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

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

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

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

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

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;
}

.card {
  background: #fff;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  border: 1px solid #e0e0e0;
  min-width: 0;
}

.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;
}

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

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

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

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

  position: sticky;
  top: 0; /* or 1rem if you want some spacing from the top */
  align-self: flex-start; /* important if .layout is display:flex */
  height: 100vh; /* optional: make it fill the viewport */
  overflow-y: auto; /* optional: only scroll nav if it ever overflows */
}

.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;
}

.desktop-only {
  display: list-item;
  margin: 6px 0 0;
  padding-left: 14px; /* indent */
}

.desktop-only-2 {
  display: list-item;
  margin: 6px 0 0;
  padding-left: 28px; /* indent */
}

@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;

    position: static;
    height: auto;
    overflow: visible;
  }

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

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

  .desktop-only {
    display: none;
  }

  .desktop-only-2 {
    display: none;
  }

  .content {
    padding: 1.5rem 1.5rem 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 */
  }
}

.video {
  margin-top: 1rem;
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: 900px;
}

.video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
}

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

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

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

.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;
}

/* Testing project grid */

.story-grid {
  display: grid;
  gap: 20px;

  /* This makes it 1 column on small screens, and automatically becomes 2–3+ when room allows */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));

  /* optional: keep the grid centered and not too wide */
  /*max-width: 1100px;*/
  margin: 0 auto 1rem;
  padding: 0;
}

.story-card {
  overflow: hidden;
}

.story-card img {
  border-radius: 6px;
  width: 100%;
  max-height: 280px;
  display: block;
  object-fit: contain;
}

.story-text {
  padding: 12px 14px;
}

.story-text h3 {
  margin: 0 0 6px 0;
}

.story-text p {
  margin: 0;
  line-height: 1.45;
}

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

.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;
}

.ext-link {
  color: #1a5fb4;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
}
.ext-link:hover {
  text-decoration-thickness: 0.13em;
}
.ext-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 4px;
}
