/* Reset-ish */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f5f5f5;
  color: #222;
}

a {
  color: inherit;
  text-decoration: none;
}

.layout {
  min-height: 100vh;
  display: flex;
  min-width: 0;
}

/* NAV – default: sidebar (desktop) */
.nav {
  padding: 1.5rem 1rem;
  border-right: 1px solid #ddd;
  min-width: 220px;
}

.nav-title {
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.nav-links {
  list-style: none;
}

.nav-links li + li {
  margin-top: 0.75rem;
}

.nav-links a {
  font-size: 0.95rem;
  opacity: 0.8;
}

.nav-links a:hover {
  opacity: 1;
}

.nav-links a.active {
  font-weight: 600;
  opacity: 1;
}

/* MAIN CONTENT */
.content {
  flex: 1;
  padding: 2rem;
  max-width: 900px;
  margin: 0 auto;
  min-width: 0;
}

section + section {
  margin-top: 3rem;
}

h1 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* Cards for calculators / portfolio items */
.card {
  background: #fff;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  border: 1px solid #e0e0e0;
  min-width: 0;
}

/* Calculator layout */
.calc-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calc-row input {
  width: 110px;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.calc-row button {
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #eee;
  cursor: pointer;
}

.calc-row button:active {
  background: #ddd;
}

.calc-row output {
  min-width: 60px;
  text-align: center;
  padding: 0.4rem 0.6rem;
  background: #fafafa;
  border-radius: 4px;
  border: 1px solid #ccc;
}

/* --- RESPONSIVE: on small screens, nav goes on top --- */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 100%;
    border-right: none;
    border-bottom: 1px solid #ddd;
    padding: 0.8rem 1rem;
  }

  .nav-links {
    display: flex;
    gap: 1rem;
  }

  .nav-links li + li {
    margin-top: 0;
  }

  .content {
    padding: 1.5rem 1rem 2rem;
    min-width: 0;
    margin: 0;
  }

  .calc-row {
    flex-wrap: wrap;
  }
  .content--full {
    padding: 0; /* override .content padding for this page */
  }

  .content--full h1,
  .content--full p {
    padding: 1rem 1rem 0.5rem; /* keep a bit of space for the text */
  }

  .content--full .tool-frame {
    height: auto; /* JS will set the height */
  }
}

/* Full-width content pages (big tools etc.) */
.content--full {
  max-width: none; /* remove 900px cap */
  width: 100%; /* stretch to full width of the flex area */
  margin: 0; /* no auto-centering margins */
}

/* Tool iframe: fill almost the whole viewport */
.content--full .tool-frame {
  width: 100%;
  border: none;
  display: block;
  height: auto; /* JS will set the height */
}

/* Portfolio grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem auto 2rem;
}

/* Make cards clickable, full-height */
.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none; /* remove underline */
  color: inherit; /* keep normal text colour */
}

/* Project images */
.project-card img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  object-fit: cover;
  aspect-ratio: 16 / 9; /* nice consistent shape */
}

/* Slight hover feedback */
.project-card:hover {
  border-color: #ccc;
  transform: translateY(-2px);
  transition: transform 0.1s ease, border-color 0.1s ease;
}

.screenshot-strip-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto; /* scrollbar lives here */
}

.screenshot-strip {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem 0;
  min-width: 0;
  max-width: 100%;
}

.screenshot-strip img {
  flex: 0 0 auto;
  height: 600px; /* tweak this */
  border-radius: 6px;
  border: 1px solid #ddd;
}

.content2 {
  flex: 1;
  padding: 2rem;
  max-width: 900px;
  margin: 0;
  min-width: 0;
}

.app-link {
  /*font-weight: 600;*/
  text-decoration: underline;
  /*text-decoration-thickness: 2px;
    text-underline-offset: 3px;*/
}
.app-link:hover {
  text-decoration-thickness: 3px;
}
.app-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.video {
  margin-top: 1rem;
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: 900px;
}
.video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
}

.wrap {
  display: flex;
  gap: 16px; /* spacing between image + text */
  /*align-items: flex-start;*/
  align-items: center;
  margin: 20px 0;
}

.wrap--reverse {
  display: flex;
  gap: 16px;
  align-items: center;
  margin: 20px 0;
  flex-direction: row-reverse;
}

.wrap p {
  flex: 1; /* fill remaining width */
  margin: 0;
  min-width: 0; /* important so long text can wrap instead of overflow */
}

.wrap img {
  border-radius: 6px;
  /*margin-bottom: 1rem;*/
}

.wrap--reverse img {
  border-radius: 6px;
  /*margin-bottom: 1rem;*/
}

@media (max-width: 460px) {
  .wrap,
  .wrap--reverse {
    flex-direction: column;
  }
}

.project-video {
  width: 100%;
  max-width: 360px;
  height: auto;
  display: block;
  margin: 0 auto 1rem;
  border-radius: 6px;
}

.two-col {
  display: flex;
  gap: 24px; /* space between columns */
  align-items: flex-start;
  margin: 1rem;
}

.col {
  flex: 1; /* both columns share width equally */
  min-width: 0; /* prevents overflow issues */
}

.list > div {
  margin: 6px 0;
}

/* Work projects */

.project-card {
  background: #fff;
  position: relative;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 16px;
  overflow: hidden; /* keeps badge nicely clipped if it touches edges */
}

.card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.project-title {
  margin: 0;
}

/* Main image styling example */
.project-main-image {
  object-fit: contain;
  width: 100%;
  border-radius: 10px;
  margin-bottom: 12px;
  object-fit: contain;
}

.project-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}

.company-badge.corner {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 120px;
  display: block;
  background: transparent;
  border: none;
  object-fit: contain;
}
