/* ===================================================================
   Natali Bozhkova — Portfolio
   Design tokens (from Figma variables)
=================================================================== */
:root {
  --black-100: #2d2d2d;
  --pink-100:  #f6c2c4;
  --pink-200:  #d18381;
  --tan-100:   #fffaf2;
  --olive-100: #b5b150;
  --olive-200: #8a7000;
  --grey-100:  #acacac;
  --white:     #ffffff;
  --surface:   #fbf9f6;   /* #ece3d2 + 80% white */

  --page-w: 1440px;
  --gutter: 80px;
  --content-w: 1280px;

  --font-head: "Exo", system-ui, sans-serif;
  --font-body: "Alegreya Sans", system-ui, sans-serif;

  /* body/UI text: 20px on desktop, 16px on mobile (see mobile media query) */
  --fs-16: 20px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--black-100);
  font-family: var(--font-body);
  font-size: var(--fs-16);
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
  transition: background-color .6s ease;
  overflow-x: clip; /* clip (not hidden) so it doesn't break position: sticky */
}

img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }

/* Entrance animations: hide above-the-fold elements until GSAP reveals them.
   If JS/GSAP can't run, the `.js` flag is removed and everything shows. */
.js .marquee,
.js .case-back,
.js .hero__sub,
.js .case-tldr { opacity: 0; }

/* ===================================================================
   Grainy film-grain texture + parallax
   Applied ONLY to the cream (--surface) content section.
   `background-attachment: fixed` anchors the texture to the viewport,
   so it stays put while the section scrolls (parallax), but it is
   painted only inside the .content box — other coloured sections
   (hero, nav, marquee, footer) stay grain-free.
=================================================================== */
.grain-surface { position: relative; isolation: isolate; }
.grain-surface::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1; /* behind the section's content, above its cream bg,
                  so opaque cards & the CTA box stay grain-free */
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22300%22%20height%3D%22300%22%3E%3Cfilter%20id%3D%22g%22%20x%3D%220%22%20y%3D%220%22%20width%3D%22100%25%22%20height%3D%22100%25%22%3E%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%220.80%22%20numOctaves%3D%222%22%20stitchTiles%3D%22stitch%22%2F%3E%3CfeColorMatrix%20type%3D%22saturate%22%20values%3D%220%22%2F%3E%3CfeComponentTransfer%3E%3CfeFuncA%20type%3D%22linear%22%20slope%3D%223.0%22%20intercept%3D%22-1.05%22%2F%3E%3C%2FfeComponentTransfer%3E%3C%2Ffilter%3E%3Crect%20width%3D%22100%25%22%20height%3D%22100%25%22%20filter%3D%22url(%23g)%22%2F%3E%3C%2Fsvg%3E");
  background-size: 300px 300px;
  background-attachment: fixed; /* fixed to viewport -> parallax */
  opacity: 0.30;
  mix-blend-mode: multiply;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain-surface::after { background-attachment: scroll; }
}

/* ===================================================================
   Shared layout helpers
=================================================================== */
.section-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 36px;
  line-height: 1;
  margin: 0;
  color: var(--black-100);
}

/* Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  font-family: var(--font-body);
  font-size: var(--fs-16);
  line-height: 1;
  border: 1px solid var(--black-100);
  white-space: nowrap;
  transition: transform .15s ease, opacity .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--dark  { background: var(--black-100); color: var(--tan-100); }
.btn--light { background: var(--tan-100);  color: var(--black-100); }

/* ===================================================================
   Navbar
=================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--pink-100);
  border-bottom: 1px solid var(--black-100);
  /* Default visible (also the no-JS / case-page state). On the home page the
     `at-top` flag (set inline in <head> before first paint, so no flash) hides
     the bar at the top; script.js removes it the moment the user scrolls,
     sliding the bar in — after which it stays. */
  transform: translateY(0);
  transition: transform .35s cubic-bezier(.22,.61,.36,1);
  will-change: transform;
}
html.at-top .navbar { transform: translateY(-100%); }
/* The bar is fixed (out of flow). On case-study pages it stays visible, so
   offset the page by its height to keep the hero out from under it. The home
   page needs no offset: its hero runs full-height beneath the bar, which is
   hidden until the first scroll. */
.case-page { padding-top: 69px; }
.navbar__inner {
  max-width: var(--page-w);
  margin: 0 auto;
  height: 68px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--fs-16);
  line-height: 1;
}
.navbar__brand { letter-spacing: -.04em; font-weight: 700; }
/* Right-hand group: the text links and the Contact CTA button together. */
.navbar__end { display: flex; align-items: center; gap: 48px; }
.navbar__links { display: flex; gap: 40px; }
/* The Contact button replaces the [contact] link on desktop, so hide the link
   there; it stays in the mobile burger menu, where the button is hidden. */
.nav-contact { display: none; }
/* Compact solid button at the end of the nav. */
.navbar__cta {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 1;
  background: var(--black-100);
  color: var(--tan-100);
  border: 1px solid var(--black-100);
  transition: transform .15s ease, opacity .15s ease;
}
.navbar__cta:hover { transform: translateY(-1px); }
/* Hand-drawn underline: script.js wraps each link's text in .nav-label and
   draws a random SVG stroke into .nav-label__line on hover / keyboard focus. */
.nav-label { position: relative; display: inline-block; }
.nav-label__line {
  position: absolute;
  left: -3px;
  right: -3px;
  top: calc(100% + 2px);  /* clears the brackets' descenders */
  height: .55em;
  pointer-events: none;
  color: var(--pink-200);
}
.nav-label__line svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.nav-label__line path {
  fill: none;
  stroke: currentColor;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1 2;    /* path is normalised to length 1 (pathLength) */
  stroke-dashoffset: 1.05;  /* hidden until the draw animation runs */
}
.navbar__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 26px;
  height: 20px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}
.navbar__toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--black-100);
  transition: transform .25s ease, opacity .25s ease;
}

/* ===================================================================
   Hero — full-height tile grid
=================================================================== */
:root {
  --tile-base: #FFFAF2;   /* cream tile */
  --tile-line: #ffffff;   /* white grid line (shows through the 2px gap) */
}
.topband { display: flex; flex-direction: column; }
.hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  background: var(--tile-line);
}

/* Tile grid: JS (setupHeroGrid) sets the column/row counts and fills this with
   .tile elements. gap:1px over the line-coloured background draws the grid. */
.hero__grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  gap: 2px;
  background: var(--tile-line);
}
.hero__tile {
  background: var(--tile-base);
  /* Bold tiles hop by re-colouring cells; a soft fade on each hop, kept well
     shorter than the hop interval so colours still land solid and hold. */
  transition: background-color .5s ease;
}

/* Centred name + role, above the grid. */
.hero__center {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 var(--gutter);
  pointer-events: none;
}
.hero__name {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(38px, 7.5vw, 100px);
  line-height: 1;
  letter-spacing: -.01em;
  margin: 0;
  color: var(--black-100);
}
.hero__role {
  margin: 20px 0 0;
  font-family: var(--font-body);  /* Alegreya Sans */
  font-weight: 400;               /* regular */
  font-size: clamp(18px, 2.2vw, 28px);
  letter-spacing: .02em;
  color: var(--black-100);
  /* Fade + rise in on load, purely in CSS (not tied to scroll). */
  opacity: 0;
  animation: hero-role-in 1s ease-out .45s forwards;
}
@keyframes hero-role-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero__role { animation: none; opacity: 1; }
}

/* ===================================================================
   Logo marquee
=================================================================== */
.marquee {
  background: var(--olive-200);
  border-top: 1px solid var(--black-100);
  border-bottom: 1px solid var(--black-100);
  overflow: hidden;
  padding: 20px 0;
  flex: 0 0 auto;      /* natural height, sits at the bottom of the band */
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 40s linear infinite;
}
.marquee__half {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.marquee__group {
  display: flex;
  align-items: center;
  gap: 80px;
  padding-right: 80px;
  flex-shrink: 0;
}
.marquee__logo { width: auto; }
/* Two identical halves; shifting by exactly one half (-50%) loops seamlessly
   with no empty space, because each half is wider than the viewport. */
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee:hover .marquee__track { animation-play-state: paused; }

/* ===================================================================
   Main content
=================================================================== */
.content {
  padding: 40px var(--gutter) 80px;  /* 40px gap from the tools banner to "Selected Work" */
  background: var(--surface);
}
.content__stack {
  position: relative;
  max-width: var(--content-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 104px;
  align-items: center;
}

/* Selected Work --------------------------------------------------- */
/* On desktop the section pins (freezes) while JS scrubs the card-stacking
   timeline; each card slides up to full size over the last one, which scales
   back and recedes into the deck. Then the section unpins and scrolls on. */
.work {
  position: relative;
  width: 100%;
}
.section-head {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
}
.section-sub {
  margin: 0;
  max-width: 648px;
  font-family: var(--font-body);
  font-size: var(--fs-16);
  line-height: 1.4;
}

/* Project cards.
   Default (no-JS, reduced motion, mobile): a plain vertical list with a 32px
   gap. On desktop with JS, script.js upgrades this into a pinned stage — the
   section freezes and the cards pile up as you scroll (see the
   .card-stack--pinned rules below and the GSAP timeline in script.js). */
.card-stack {
  position: relative;
  width: 100%;
  margin-top: 64px;        /* Figma: 64px gap from the header to the cards */
}
.card-sticky { margin-bottom: 32px; }   /* resting gap between cards */
.card-sticky:last-child { margin-bottom: 0; }

/* --- Pinned stacking stage (desktop, JS only) --- */
@media (min-width: 901px) {
  /* The section becomes a tall scroll track: one screen plus 90vh of scrolling
     per card that stacks (--deck-steps, set by script.js). Inside it the stage
     — header + deck — is a full-height frame that sticks to the top of the
     viewport while the track scrolls past. The freeze is native CSS sticky,
     so it can never fall out of sync with the scroll position; GSAP only
     scrubs the cards inside the stage. */
  .work.is-pinned {
    height: calc(100vh + var(--deck-steps, 2) * 90vh);
  }
  .work.is-pinned .work__stage {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 40px;
    /* Breathing room above the title: clears the fixed navbar (~69px) and adds
       air, so the frozen stage isn't crammed against the top of the screen. */
    padding-top: 112px;
  }
  .work.is-pinned .section-head { margin: 0 auto; }

  /* The deck's own frame: one card tall plus the room the finished deck
     needs (--deck-peek, set by script.js). The whole animation stays inside
     it, so its top edge keeps a constant 40px distance to the header. */
  .card-stack--pinned {
    height: calc(400px + var(--deck-peek, 40px));
    margin-top: 0;
    overflow: visible;
  }
  .card-stack--pinned .card-sticky {
    position: absolute;
    top: 0;                /* anchored to the frame's top; GSAP drives y / scale */
    left: 0;
    right: 0;
    margin: 0 auto;
    transform-origin: 50% 0;   /* covered cards shrink without lifting their top edge */
    width: 100%;
    will-change: transform;
    backface-visibility: hidden;
  }
}
.card-link { display: block; }
.card-link:focus-visible { outline: 2px solid var(--black-100); outline-offset: 4px; }
.card-face {
  position: relative;
  /* Full-width cards; info / photo split 385:497. Uniform fixed height so each
     card fully covers the one it stacks over. */
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 385fr) minmax(0, 497fr);
  height: 400px;
  background: #fffaf2;
  border: 1px solid var(--black-100);
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 18px 15px 0 rgba(0, 0, 0, 0.15);
}
.card-info {
  display: flex;
  flex-direction: column;
  justify-content: center;   /* Figma vertically centres the info block */
  align-items: flex-start;
  gap: 30px;                 /* tightened from Figma's 38px so the larger text fits */
  min-width: 0;
  padding: 40px;
}
.card-meta {
  margin-top: 12px;          /* Figma: 12px between title and category */
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.card-title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 36px;
  line-height: 1;          /* Figma: leading-none */
  letter-spacing: 0;
  color: var(--black-100);
}
.card-desc {
  margin: 0 0 10px;
  max-width: 44ch;              /* wider info column on the full-width card */
  font-size: var(--fs-16);      /* design-system regular body size (20px desktop) */
  line-height: 1.3;
}
/* Figma chips: a small colour square + label, spaced out (not outlined pills).
   The square colour cycles pink / olive / light-pink across the row. */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--fs-16);   /* match the card paragraph (20px desktop) */
  line-height: 1;
  color: var(--black-100);
}
.chip:first-child { padding-left: 0; }   /* flush with the title / description */
.chip::before {
  content: "";
  width: 10px;
  height: 10px;
  flex: none;
  background: var(--pink-200);
}
.chip:nth-child(3n+2)::before { background: var(--olive-100); }
.chip:nth-child(3n)::before   { background: var(--pink-100); }
.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  align-self: flex-start;
  background: var(--black-100);
  color: var(--tan-100);
  font-family: var(--font-body);   /* Figma: Alegreya Sans regular */
  font-weight: 400;
  font-size: 16px;
  line-height: 1;
  padding: 12px 20px;              /* Figma button padding */
  border: 1px solid var(--black-100);
  border-radius: 0;                /* Figma: square button */
  transition: background-color .25s ease;
}
.card-arrow { display: inline-block; transition: transform .25s ease; }
.card-link:hover .card-cta { background: #141413; }
.card-link:hover .card-arrow { transform: translateX(6px); }
.card-shot {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #e9e6da;
}
.card-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;   /* focal point: centre of the photo, as in Figma */
  transition: transform .6s ease;
}
.card-link:hover .card-shot img { transform: scale(1.03); }
.hr {
  height: 1px;
  width: 100%;
  background: var(--black-100);
  opacity: .5;
}

/* About ----------------------------------------------------------- */
.about {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
  width: 100%;
}
.about__body {
  margin: 0;
  max-width: 860px;       /* measure sized to the type */
  text-align: center;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 28px;        /* between body copy and .section-title */
  line-height: 1.3;
  text-wrap: pretty;
  display: flex;          /* paragraphs stack with an even gap */
  flex-direction: column;
  gap: 24px;
}
.about__para { margin: 0; }
.about__lead  { color: var(--black-100); }
.about__muted { color: var(--grey-100); }

/* Arrow icon button ----------------------------------------------- */
.icon-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black-100);
  transition: transform .15s ease;
}
.icon-btn:hover { transform: translate(2px, -2px); }
.icon-btn img {
  width: 26px;
  height: 26px;
  transform: rotate(180deg);
}

/* Let's Talk CTA -------------------------------------------------- */
.cta { width: 100%; }
.cta__frame { border: 7px solid; }
.cta__frame--outer { border-color: var(--olive-200); }
.cta__frame--mid   { border-color: var(--olive-100); }
.cta__frame--inner {
  border-color: var(--pink-100);
  background: var(--tan-100);
  padding: 56px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cta__content {
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: center;
  max-width: 552px;
  text-align: center;
}
.cta__text { display: flex; flex-direction: column; gap: 20px; }
.cta__title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 36px;
  line-height: 1;
}
.cta__body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.2;
}
.cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
/* Let's Talk block on case-study pages: sits below the Next-project link. */
.case-cta { margin-top: 96px; }

/* ===================================================================
   Footer
=================================================================== */
.footer {
  background: var(--black-100);
  border-top: 1px solid var(--black-100);
}
.footer__inner {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 56px var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 32px;
  font-family: var(--font-head);
  color: var(--tan-100);
}
.footer__row {
  display: flex;
  justify-content: space-between;
  gap: 40px;
}
.footer__contact { display: flex; flex-direction: column; gap: 20px; }
.footer__contact-top { display: flex; flex-direction: column; gap: 20px; }
.footer__email {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 16px;
  text-decoration: underline;
}
.footer__phone,
.footer__loc { font-size: 16px; }
.footer__phone { color: inherit; text-decoration: none; }
.footer__phone:hover { opacity: .7; }
.footer__social { display: flex; gap: 100px; align-items: flex-start; }
.footer__link {
  padding: 10px;
  font-size: 16px;
  text-decoration: underline;
}
.footer__sep {
  height: 1px;
  width: 100%;
  background: var(--tan-100);
  opacity: .5;
}
.footer__copy { margin: 0; font-size: 16px; }

/* ===================================================================
   Responsive — Laptop (≈1440-wide screens)
=================================================================== */
/* ===================================================================
   Responsive — Tablet
=================================================================== */
/* Stack the portrait below the hero text early enough that the wider 80px
   two-row title never collides with it. */
@media (max-width: 1220px) {
  .hero__inner { display: flex; flex-direction: column; }
  /* keep the wrapper positioned (not static) so its absolute circles stay
     inside it; just move it into normal flow below the text */
  .hero__portrait { position: relative; top: auto; right: auto; margin-top: 48px; }
}

@media (max-width: 1100px) {
  :root { --gutter: 40px; }
}

/* Project cards collapse to a single column (image on top) on tablet/phone */
@media (max-width: 900px) {
  .card-stack { padding-bottom: 0; }
  .card-stack__tail { display: none; }
  .card-sticky { position: static; margin-bottom: 32px; }
  .card-face {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    border-radius: 0;
  }
  .card-shot {
    order: -1;
    aspect-ratio: 16 / 10;
    border-left: 0;
    border-bottom: 1.5px solid var(--black-100);
  }
  .card-info { gap: 20px; }
}

/* ===================================================================
   Responsive — Tablet & Mobile (burger menu)
=================================================================== */
@media (max-width: 1024px) {
  .navbar__links { display: none; }
  .navbar__cta { display: none; }   /* burger covers nav actions on mobile */
  .nav-contact { display: block; }  /* ...so keep [contact] in the mobile menu */
  .navbar__toggle { display: flex; }

  /* Menu open state */
  .navbar.is-open .navbar__links {
    display: flex;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--pink-100);
    border-bottom: 1px solid var(--black-100);
  }
  .navbar.is-open .navbar__links a {
    padding: 18px var(--gutter);
    border-top: 1px solid rgba(45,45,45,.15);
  }
  .navbar.is-open .navbar__toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .navbar.is-open .navbar__toggle span:nth-child(2) { opacity: 0; }
  .navbar.is-open .navbar__toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

/* ===================================================================
   Responsive — Mobile
=================================================================== */
@media (max-width: 720px) {
  :root { --gutter: 20px; --fs-16: 16px; }

  .hero__inner { padding: 78px 40px; }
  /* scale down so "Building designs" still fits on one line at phone widths */
  .hero__title { font-size: clamp(26px, 8.5vw, 44px); }
  .hero__portrait { display: none; }

  .content { padding: 56px 20px; }
  .content__stack { gap: 72px; }
  .section-head { gap: 20px; }
  .section-title { font-size: 28px; }
  .section-sub { max-width: 100%; }

  .about { gap: 20px; }
  .about__body { font-size: 20px; text-align: left; gap: 18px; }

  .icon-btn { align-self: flex-start; }

  .cta__frame--inner { padding: 40px 20px; }
  .cta__content { gap: 28px; }
  .cta__title { font-size: 28px; }

  .footer__inner { padding: 40px 20px; }
  .footer__row { flex-direction: column; gap: 32px; }
  .footer__social { gap: 60px; }
}

/* ===================================================================
   Case study pages (work/*.html)
   Reuses: .navbar, .hero, .hero__title, .section-title,
   .cta__frame (triple border), .hr, .icon-btn, .footer.
   New pieces only cover long-form layout: TL;DR rows, two-column
   sections, lists, table, figures and the next-project link.
=================================================================== */

/* Hero band ------------------------------------------------------- */
/* The case-study hero keeps the original green split layout. These base text
   rules are now used only here (the home hero uses .hero__center / .hero__name
   / .hero__role), so they live with the case styles. */
.hero--case {
  display: block;
  min-height: 0;                 /* not the full-height home hero */
  place-items: initial;
  background: var(--olive-100);  /* green, as it was */
}
.hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 48px var(--gutter);
}
.hero__content {
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: flex-start;
  max-width: 568px;
}
.hero__text { display: flex; flex-direction: column; gap: 20px; }
.hero__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 80px;
  line-height: 1;
  margin: 0;
  color: var(--black-100);
  white-space: nowrap;
}
.hero--case .hero__inner { padding: 56px var(--gutter) 176px; }
.hero--case .hero__content { max-width: 900px; gap: 48px; }
.hero--case .hero__text { gap: 24px; }
.hero--case .hero__title { white-space: normal; }
.hero__sub {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.2;
}
.case-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: opacity .15s ease;
}
.case-back:hover { opacity: .6; }
.case-back span { transition: transform .2s ease; }
.case-back:hover span { transform: translateX(-4px); }

/* Main column ------------------------------------------------------ */
.case {
  max-width: var(--content-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* Small uppercase label used by TL;DR, table head, next-project */
.case-label {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* TL;DR: the CTA triple-border frame, pulled up over the olive band */
.case-tldr { margin-top: -148px; margin-bottom: 40px; }
.case-tldr .cta__frame--inner { display: block; padding: 40px 32px; }
.case-tldr__title { margin: 0 0 8px; font-weight: 700; }
.case-tldr__list { margin: 0; }
.case-tldr__row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid rgba(45, 45, 45, .2);
}
.case-tldr__row dt { padding-top: 3px; }
.case-tldr__row dd {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-16);
  line-height: 1.4;
}

/* Two-column sections --------------------------------------------- */
.case-section {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 40px;
  padding: 72px 0;
}
.case-section .section-title { font-size: 28px; line-height: 1.15; }
.case-section__body {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-family: var(--font-body);
  font-size: var(--fs-16);
  line-height: 1.45;
}
.case-section__body p { margin: 0; }
.case-section__body strong { font-weight: 700; }
.case-section__body a { text-decoration: underline; text-underline-offset: 3px; }
.case-section__body a:hover { opacity: .6; }

/* Content links: plain black with an underline. The top nav, the card
   links and the back link keep their own styling. */
.case-tldr__row dd a,
.case-section__body a,
.footer__link,
.footer__email {
  color: var(--black-100);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer__link,
.footer__email { color: var(--tan-100); }
.footer__link:hover,
.footer__email:hover { opacity: .7; }

.case-pull {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 28px !important;
  line-height: 1.15 !important;
}

.case-quote {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-left: 24px;
  border-left: 3px solid var(--pink-200);
}
.case-quote__mark {
  display: block;
  height: 57px;
  overflow: hidden;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 128px;
  line-height: 1;
  color: var(--pink-200);
}
.case-quote__text {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-style: italic;
  font-size: 32px;
  line-height: 1.2;
  color: var(--black-100);
}
.case-quote__cite {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.2;
  color: #7c7c7c;
}
@media (max-width: 680px) {
  .case-quote__mark { font-size: 96px; height: 44px; }
  .case-quote__text { font-size: 24px; }
  .case-quote__cite { font-size: 18px; }
}

/* Placeholder copy still to be written — easy to spot, remove when done */
.todo {
  background: var(--pink-100);
  color: var(--black-100);
  padding: 0 4px;
}

/* Lists: olive squares */
.case-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.case-list li { position: relative; padding-left: 24px; }
.case-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .6em;
  width: 8px;
  height: 8px;
  background: var(--olive-200);
}

/* Table */
.case-table {
  width: 100%;
  border-collapse: collapse;
}
.case-table th,
.case-table td {
  text-align: left;
  vertical-align: top;
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid rgba(45, 45, 45, .2);
}
.case-table thead th { border-bottom: 1px solid var(--black-100); padding-top: 0; }
.case-table td:first-child { width: 40%; font-weight: 700; }

/* Figures */
.case-figure { margin: 12px 0 0; display: flex; flex-direction: column; gap: 12px; }
.case-figure__media {
  border: 1px solid var(--black-100);
  background: var(--tan-100);
  overflow: hidden;
}
.case-figure__media img { width: 100%; height: auto; }
.case-figure__media--empty {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.case-figure__media--empty::after {
  content: "Add image";
  font-family: var(--font-head);
  font-size: 14px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--grey-100);
}
.case-figure__media--code { aspect-ratio: auto; min-height: 140px; }
/* Several images side by side inside one figure, all the same height.
   Give each image its aspect ratio (width / height) as --ar, e.g.
   style="--ar: 0.75". Widths are shared out in proportion to it, so every
   image in the row ends up exactly as tall as the others. */
.case-figure__rows { display: flex; flex-direction: column; gap: 12px; }
.case-figure__row { display: flex; gap: 12px; align-items: flex-start; }
.case-figure__row > .case-figure__media { flex: var(--ar, 1) 1 0; min-width: 0; }
/* Tall, low-resolution images: centred, and capped near their real width
   so they aren't blown up and blurry */
.case-figure--center figcaption { text-align: center; }
.case-figure__media--narrow { width: 100%; max-width: 520px; margin-inline: auto; }
.case-figure__media--code::after { content: "Add code snippet"; }

/* Code block ------------------------------------------------------- */
.code-block {
  background: var(--black-100);
  border: 1px solid var(--black-100);
  border-radius: 8px;
  overflow: hidden;
}
.code-block__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  background: rgba(255, 250, 242, .05);
  border-bottom: 1px solid rgba(255, 250, 242, .12);
}
.code-block__dots { display: inline-flex; gap: 7px; }
.code-block__dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.code-block__dots i:nth-child(1) { background: var(--pink-200); }
.code-block__dots i:nth-child(2) { background: var(--olive-100); }
.code-block__dots i:nth-child(3) { background: var(--grey-100); }
.code-block__name {
  font-family: var(--font-head);
  font-size: 13px;
  letter-spacing: .06em;
  color: rgba(255, 250, 242, .65);
}
.code-block__pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  color: var(--tan-100);
  font-family: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.75;
  tab-size: 2;
}
.code-block__pre code { font-family: inherit; white-space: pre; }
.code-block .c-com { color: var(--grey-100); font-style: italic; }
.code-block .c-str { color: var(--pink-200); }
.code-block .c-key { color: var(--olive-100); }
@media (max-width: 640px) {
  .code-block__pre { font-size: 12px; padding: 14px 14px; }
}
.case-figure figcaption { font-size: 16px; line-height: 1.3; color: rgba(45, 45, 45, .7); }

/* Next project ----------------------------------------------------- */
.case-next {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 72px 0 24px;
}
.case-next__link {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.case-next__title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 64px;
  line-height: 1;
}
.case-next__cat { font-size: var(--fs-16); flex: 1; }
.case-next__link:hover .icon-btn { transform: translate(2px, -2px); }

/* Case study — tablet / mobile */
@media (max-width: 1100px) {
  .case-section { grid-template-columns: 1fr; gap: 24px; padding: 56px 0; }
}
@media (max-width: 720px) {
  .hero--case .hero__inner { padding: 48px 20px 120px; }
  .hero--case .hero__content { gap: 32px; }
  .hero__sub { font-size: 18px; }

  .case-tldr { margin-top: -96px; margin-bottom: 16px; }
  .case-tldr .cta__frame--inner { padding: 28px 20px; }
  .case-tldr__row { grid-template-columns: 1fr; gap: 6px; }

  .case-section { padding: 40px 0; }
  .case-section .section-title,
  .case-pull { font-size: 24px !important; }
  .case-table td:first-child { width: 45%; }

  .case-next { padding-top: 48px; }
  .case-next__title { font-size: 40px; }
  .case-next__cat { flex-basis: 100%; order: 3; }
}

/* About text fill (script.js wraps each word in .fill-word) */
.about__body.is-filling .about__lead,
.about__body.is-filling .about__muted { color: var(--grey-100); }
.about__body.is-filling .fill-word {
  --fill: 0;
  color: color-mix(in srgb, var(--black-100) calc(var(--fill) * 100%), var(--grey-100));
}
.about__body.is-filled .about__muted { color: var(--black-100); }

/* ===================================================================
   Image lightbox (case-study figures). Built by script.js.
=================================================================== */
.case-figure__media:not(.compare) img { cursor: zoom-in; }
.case-figure__media:not(.compare):has(img) { transition: transform .2s ease; }
.case-figure__media:not(.compare):has(img):hover { transform: translateY(-2px); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: rgba(45, 45, 45, .94);
  color: var(--tan-100);
  opacity: 0;
  transition: opacity .25s ease;
}
.lightbox.is-open { opacity: 1; }
.lightbox__bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px var(--gutter);
  font-family: var(--font-body);
  font-size: 16px;
}
.lightbox__caption { min-width: 0; }
.lightbox__actions { display: flex; gap: 8px; flex-shrink: 0; }
.lightbox__btn {
  height: 40px;
  min-width: 40px;
  padding: 0 14px;
  border: 1px solid var(--tan-100);
  background: transparent;
  color: var(--tan-100);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.lightbox__btn:hover { background: var(--tan-100); color: var(--black-100); }
.lightbox__btn:focus-visible { outline: 2px solid var(--pink-100); outline-offset: 2px; }
.lightbox__btn[hidden] { display: none; }
.lightbox__stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--gutter) 24px;
}
.lightbox__stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: var(--tan-100);
  cursor: zoom-out;
}
/* zoomed: natural size, pan by scrolling / dragging */
.lightbox.is-zoomed .lightbox__stage {
  overflow: auto;
  display: block;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.lightbox.is-zoomed .lightbox__stage img {
  max-width: none;
  max-height: none;
  cursor: grab;
}
.lightbox.is-dragging .lightbox__stage,
.lightbox.is-dragging .lightbox__stage img { cursor: grabbing; }
body.lightbox-open { overflow: hidden; }

@media (max-width: 720px) {
  .lightbox__bar { padding: 12px 16px; }
  .lightbox__stage { padding: 0 16px 16px; }
}

/* ===================================================================
   Before / after compare slider (case-study figures)
   Both screenshots share one frame and the same pixel size; the old one
   sits on top, clipped to the handle position (--pos).
=================================================================== */
.compare {
  position: relative;
  aspect-ratio: 1920 / 1040;
  max-width: 100%;
  touch-action: pan-y;      /* vertical swipes still scroll the page */
  user-select: none;
  -webkit-user-select: none;
  cursor: ew-resize;
}
.compare__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  pointer-events: none;
  -webkit-user-drag: none;
}
.compare__before {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.compare__tag {
  position: absolute;
  top: 12px;
  z-index: 2;
  padding: 4px 10px;
  border: 1px solid var(--black-100);
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: .1em;
  text-transform: uppercase;
  pointer-events: none;
}
.compare__tag--before { left: 12px; background: var(--black-100); color: var(--tan-100); }
.compare__tag--after  { right: 12px; background: var(--pink-100); color: var(--black-100); }
.compare__line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  z-index: 3;
  width: 2px;
  transform: translateX(-50%);
  background: var(--tan-100);
  box-shadow: 0 0 0 1px rgba(45, 45, 45, .25);
  pointer-events: none;
}
.compare__knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--black-100);
  border-radius: 50%;
  background: var(--tan-100);
  color: var(--black-100);
  box-shadow: 0 6px 20px rgba(45, 45, 45, .3);
  transition: transform .15s ease;
}
.compare__knob svg { width: 20px; height: 20px; }
.compare.is-dragging .compare__knob { transform: translate(-50%, -50%) scale(1.08); }
/* Real range input for keyboard + screen readers; pointer dragging is
   handled in script.js so it works the same on phones */
.compare__input {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  pointer-events: none;
}
.compare:has(.compare__input:focus-visible) .compare__knob {
  outline: 2px solid var(--black-100);
  outline-offset: 3px;
}
@media (max-width: 720px) {
  .compare__tag { top: 8px; font-size: 10px; padding: 3px 7px; }
  .compare__tag--before { left: 8px; }
  .compare__tag--after  { right: 8px; }
  .compare__knob { width: 36px; height: 36px; }
  .compare__knob svg { width: 16px; height: 16px; }
}
