
/* ============================================================
   Adam Galante — Portfolio V2 — PROJECT PAGES

   Rebuilt from two Figma case-study frames: the full-bleed
   image-into-dark-title-band "opening" from the "Five Guys Case
   Study" frame, and the numbered, alternating light/dark section
   rhythm ("01 — THE CHALLENGE", hairlines, two-column problem /
   response, a closing "next project" link) from the
   "Five Guys — Portfolio Case Study / Desktop" frame. Typography
   and color stay on the homepage's own tokens (--ink/--white/
   --footer-base, Roboto Condensed) rather than the Figma file's,
   so these read as part of the same site instead of a pasted-in
   template. Reserves the homepage's italic wordmark treatment for
   the homepage alone — these use the same bold condensed upright
   style the rest of the site already uses for work-title/work-year.
   ============================================================ */

/* canvas, colors, type, motion and layers live in tokens.css */

html{
  scroll-behavior:smooth;
  /* clip, not hidden — hidden would make <html> a scroll container.
     A safety net against any full-bleed element (the hero image, the
     title band) running a fraction past the viewport edge, the same
     way the homepage guards against it. */
  overflow-x:clip;
  /* the page background is white, but every project page opens on a
     dark hero and closes on the dark footer — rubber-band overscroll
     past either edge would flash that white straight against them,
     so bounce is disabled outright, same as the homepage. */
  overscroll-behavior-y:none;
}
body{
  margin:0;
  background:var(--white);
  color:var(--ink);
  font-family:var(--font-sans);
  font-weight:var(--fw-regular);
  -webkit-font-smoothing:antialiased;
  overscroll-behavior-y:none;
  overflow-x:clip;
}

/* ============================================================
   NAV — same fixed nav as the homepage. A frosted backdrop keeps
   it legible over the full-bleed opening image, whatever's in it,
   without needing to invert per-page.
   ============================================================ */
/* no backdrop anymore — mix-blend-mode:difference inverts the nav
   against whatever's actually behind it (light or dark sections
   alike), so it stays legible without a frosted white bar sitting
   on top of every page's hero image. White is the base color on
   purpose: differenced against a white section that reads black,
   against a dark section that reads white, against a color it
   reads as that color's inverse. */
.site-nav{
  position:fixed;
  top:0;left:0;right:0;
  z-index:var(--z-nav);
  display:flex;
  justify-content:flex-end;
  padding:calc(33 * var(--u)) max(var(--gutter), calc(50vw - var(--canvas) / 2 + var(--gutter))) calc(22 * var(--u));
  mix-blend-mode:difference;
}
.site-nav ul{
  display:flex;
  gap:calc(38 * var(--u));
  list-style:none;
  margin:0;padding:0;
}
.site-nav a{
  display:block;
  font-size:var(--fs-nav);
  font-weight:var(--fw-medium);
  line-height:1;
  text-transform:uppercase;
  color:var(--white);
  padding-bottom:calc(6 * var(--u));
  border-bottom:1px solid currentColor;
  transition:opacity .2s ease;
}
.site-nav a:hover{opacity:.65;}

/* ============================================================
   OPENING — full-bleed hero image straight into a dark title +
   facts band, no gutter, no gap between them. Borrowed from the
   "Five Guys Case Study" frame's opening treatment.
   ============================================================ */
.project-open-media{
  position:relative;
  width:100%;
  aspect-ratio:1604 / 902;
  overflow:hidden;
  background:var(--color-surface-placeholder);
}
.project-open-media img{width:100%;height:100%;object-fit:cover;}

.project-open-band{
  width:100%;
  background:var(--footer-base);
  color:var(--white);
  padding:calc(56 * var(--u)) var(--gutter) calc(48 * var(--u));
}
.project-open-inner{
  max-width:var(--content);
  margin:0 auto;
}
.project-title{
  margin:0 0 calc(40 * var(--u));
  font-size:var(--fs-title-xl);
  font-weight:var(--fw-medium);
  text-transform:uppercase;
  letter-spacing:-.02em;
  line-height:1.02;
}
.project-facts{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:calc(24 * var(--u)) calc(32 * var(--u));
  padding-top:calc(28 * var(--u));
  border-top:1px solid var(--color-line-strong);
}
.project-fact h3{
  margin:0 0 calc(8 * var(--u));
  font-size:var(--fs-label);
  font-weight:var(--fw-medium);
  text-transform:uppercase;
  letter-spacing:.06em;
  opacity:.55;
}
.project-fact p{
  margin:0;
  font-size:calc(17 * var(--u));
  font-weight:var(--fw-regular);
  line-height:1.4;
}

/* ============================================================
   SECTIONS — numbered label, big headline, hairline rule,
   alternating white / dark backgrounds for the same editorial
   rhythm the site already has (dark hero, white cards, dark
   footer) rather than one flat page.
   ============================================================ */
.project-section{
  padding:calc(96 * var(--u)) var(--gutter);
}
.project-section--dark{
  background:var(--footer-base);
  color:var(--white);
}
.project-section-inner{
  max-width:var(--content);
  margin:0 auto;
}
.project-label{
  display:block;
  margin-bottom:calc(24 * var(--u));
  font-size:var(--fs-label);
  font-weight:var(--fw-medium);
  text-transform:uppercase;
  letter-spacing:.06em;
  opacity:.55;
}
.project-heading{
  margin:0 0 calc(48 * var(--u));
  font-size:var(--fs-heading);
  font-weight:var(--fw-medium);
  text-transform:uppercase;
  letter-spacing:-.01em;
  line-height:1.12;
  max-width:20ch;
}
.project-lede{
  margin:0 0 calc(48 * var(--u));
  font-size:clamp(calc(16 * var(--u)),1.3vw,calc(19 * var(--u)));
  font-weight:var(--fw-light);
  line-height:1.6;
  max-width:62ch;
}
.project-twocol{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:calc(64 * var(--u));
}
.project-twocol h3{
  margin:0 0 calc(16 * var(--u));
  font-size:clamp(calc(19 * var(--u)),1.6vw,calc(24 * var(--u)));
  font-weight:var(--fw-medium);
  letter-spacing:-.01em;
  line-height:1.25;
}
.project-twocol p{
  margin:0;
  font-size:var(--fs-body);
  font-weight:var(--fw-light);
  line-height:1.65;
}

.project-media{
  position:relative;
  aspect-ratio:1604 / 902;
  overflow:hidden;
  background:var(--color-surface-placeholder);
  margin-bottom:calc(48 * var(--u));
}
.project-media img{width:100%;height:100%;object-fit:cover;}

/* a secondary, wider supporting image inside a two-column section
   (e.g. a full UI-flow strip under the Approach copy) */
.project-media--wide{
  aspect-ratio:2777 / 894;
  margin-top:calc(48 * var(--u));
  margin-bottom:0;
}
.project-media--dark{background:var(--color-surface-plate);}

.project-back{
  display:inline-flex;
  align-items:center;
  gap:calc(8 * var(--u));
  font-size:calc(15 * var(--u));
  font-weight:var(--fw-medium);
  opacity:.6;
  transition:opacity .2s ease;
}
.project-back:hover{opacity:1;}

/* ---- next project: the other case studies, as a row of cards ---- */
.project-next{
  display:block;
  padding:calc(48 * var(--u)) var(--gutter) calc(120 * var(--u));
  background:var(--footer-base);
  color:var(--white);
  border-top:1px solid var(--color-line);
}
.project-next-inner{
  max-width:var(--content);
  margin:0 auto;
}
.project-next-eyebrow{
  margin:0 0 calc(12 * var(--u));
  font-size:var(--fs-body);
  font-weight:var(--fw-medium);
  text-transform:uppercase;
  letter-spacing:.02em;
  color:var(--color-accent-moss);
}
.project-next-label{
  margin:0 0 clamp(calc(28 * var(--u)),3vw,calc(44 * var(--u)));
  font-size:var(--fs-title-md);
  font-weight:var(--fw-medium);
  line-height:.72;
}
.project-cards{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:clamp(calc(16 * var(--u)),2vw,calc(32 * var(--u)));
}
.project-card{display:block;position:relative;color:var(--white);}
.project-card-thumb{
  position:relative;
  aspect-ratio:16/9;
  overflow:hidden;
  border-radius:calc(2 * var(--u));
  background:#1c1c1c;
}
.project-card-thumb img{
  display:block;
  width:100%;height:100%;
  object-fit:cover;
  transition:transform .6s var(--ease-site);
}
/* black gradient that supports the title once it appears on hover */
.project-card-thumb::after{
  content:"";
  position:absolute;inset:0;
  background:linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.45) 32%, rgba(0,0,0,0) 62%);
  opacity:0;
  transition:opacity .4s ease;
  pointer-events:none;
}
.project-card:hover .project-card-thumb img{transform:scale(1.04);}
.project-card:hover .project-card-thumb::after,
.project-card:focus-visible .project-card-thumb::after{opacity:1;}
/* the name lives on the image — hidden until hover, like the homepage cards */
.project-card-meta{
  position:absolute;
  left:0;right:0;bottom:0;
  padding:0 calc(20 * var(--u)) calc(18 * var(--u));
  opacity:0;
  transform:translateY(calc(8 * var(--u)));
  transition:opacity .4s ease, transform .4s ease;
  pointer-events:none;
}
.project-card:hover .project-card-meta,
.project-card:focus-visible .project-card-meta{opacity:1;transform:none;}
@media (hover:none){
  .project-card-thumb::after{opacity:1;}
  .project-card-meta{opacity:1;transform:none;}
}
.project-card-title{
  margin:0;
  font-size:clamp(calc(18 * var(--u)),1.7vw,calc(24 * var(--u)));
  font-weight:var(--fw-medium);
  line-height:1.2;
}
.project-card-title::after{content:" \2197";opacity:.7;}
@media (max-width:900px){
  .project-next{padding:calc(40 * var(--u)) var(--gutter) calc(72 * var(--u));}
  .project-cards{grid-template-columns:1fr;gap:calc(32 * var(--u));}
}

/* ============================================================
   FOOTER — identical to the homepage's
   ============================================================ */
.footer{
  position:relative;
  overflow:hidden;
  min-height:calc(358 * var(--u));
  background:var(--footer-base);
  color:var(--white);
}
.footer::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(60% 200% at 38% 22%,
      rgba(45,55,175,.72) 0%, rgba(21,26,90,.34) 45%, rgba(0,0,0,0) 78%),
    radial-gradient(52% 170% at -5% 0%,
      rgba(52,64,196,.85) 0%, rgba(24,29,102,.40) 45%, rgba(0,0,0,0) 80%);
}
.footer-inner{
  position:relative;
  max-width:var(--canvas);
  margin:0 auto;
  padding:calc(31 * var(--u)) calc(44 * var(--u)) calc(27 * var(--u));
}
.footer h2{
  margin:0 0 calc(29 * var(--u));
  font-size:clamp(calc(28 * var(--u)),2.78vw,calc(40 * var(--u)));
  font-weight:var(--fw-medium);
  letter-spacing:-.03em;
  line-height:1.175;
}
.footer-cols{
  display:flex;
  gap:0;
  margin-bottom:calc(57 * var(--u));
}
.footer-col{width:calc(217 * var(--u));}
.footer-col:last-child{width:auto;}
.footer-col h3{
  margin:0 0 calc(10 * var(--u));
  font-size:var(--fs-subheading);
  font-weight:var(--fw-regular);
  line-height:1.19;
}
.footer-col ul{list-style:none;margin:0;padding:0;}
.footer-col li{
  font-size:var(--fs-body-lg);
  font-weight:var(--fw-light);
  line-height:calc(35 * var(--u));
}
.footer-col a{transition:opacity .2s ease;}
.footer-col a:hover{opacity:.65;}
.footer-copy{
  margin:0;
  text-align:center;
  font-size:var(--fs-body-lg);
  font-weight:var(--fw-regular);
  line-height:1.15;
}

/* calm fade-up on load for the hero image only — the dark band
   underneath it (.project-open-band) doesn't animate itself, it's
   just the static container; its title and facts use the same
   scroll-reveal .reveal system as the rest of the page instead (see
   project.js), so they're consistent with everything below them
   rather than a one-off page-load animation. */
.project-open-media{
  opacity:0;
  animation:projectIn .7s var(--ease-site) forwards;
}
@keyframes projectIn{
  from{opacity:0;transform:translateY(calc(18 * var(--u)));}
  to{opacity:1;transform:translateY(0);}
}
@media (prefers-reduced-motion:reduce){
  .project-open-media{animation:none;opacity:1;}
}

/* the title fires first, the four facts ripple in just after it —
   same --i stagger trick as the mosaic grids further down the page */
.project-facts .reveal{transition-delay:calc(var(--i,0) * 80ms);}

@media (max-width:900px){
  .site-nav{padding:calc(20 * var(--u)) calc(16 * var(--u)) calc(14 * var(--u));}
  .site-nav ul{gap:calc(20 * var(--u));}
  .site-nav a{font-size:calc(12 * var(--u));padding-bottom:calc(4 * var(--u));}
  .project-open-band{padding:calc(36 * var(--u)) calc(16 * var(--u)) calc(32 * var(--u));}
  .project-title{margin-bottom:calc(28 * var(--u));}
  .project-facts{grid-template-columns:1fr 1fr;gap:calc(22 * var(--u)) calc(20 * var(--u));}
  .project-section{padding:calc(64 * var(--u)) calc(16 * var(--u));}
  .project-twocol{grid-template-columns:1fr;gap:calc(36 * var(--u));}
  .project-next{padding:calc(40 * var(--u)) calc(16 * var(--u)) calc(72 * var(--u));}
  .footer-inner{padding:calc(28 * var(--u)) calc(20 * var(--u)) calc(24 * var(--u));}
  .footer-cols{flex-wrap:wrap;gap:calc(32 * var(--u));margin-bottom:calc(36 * var(--u));}
  .footer-col,.footer-col:last-child{width:auto;}
  .footer-col li{font-size:calc(17 * var(--u));line-height:calc(30 * var(--u));}
  .footer-copy{font-size:var(--fs-body);}
}

/* ============================================================
   SCROLL REVEAL — blur/fade/translate-up on scroll, the same
   visual language as the homepage's hero entrance and work-card
   reveal (blur(calc(18 * var(--u)))->0, opacity 0->1, a lift on the way in, the
   same cubic-bezier(.16,.84,.44,1) already used for image hovers
   on this page). Toggled by a tiny IntersectionObserver in
   project.js — .reveal is the resting (hidden) state, .is-visible
   is added once an element is ~15% into the viewport and never
   removed, so nothing replays on scroll-back.
   ============================================================ */
.reveal{
  opacity:0;
  filter:blur(calc(18 * var(--u)));
  translate:0 calc(40 * var(--u));
  transition:opacity .9s var(--ease-site),
             filter .9s var(--ease-site),
             translate .9s var(--ease-site);
  will-change:opacity,filter,translate;
}
.reveal.is-visible{opacity:1;filter:blur(0);translate:0 0;}
@media (prefers-reduced-motion:reduce){
  .reveal{opacity:1;filter:none;translate:none;transition:none;}
}

/* ============================================================
   TRUE DETECTIVE — the title sequence video itself, right where
   the CSS-built cross title card used to stand in for it. Inset to
   the same content column as every other section (left/right calc(24 * var(--u))
   gutter, calc(1392 * var(--u)) wide) rather than running full-bleed, matching the
   Figma frame's own framing.
   ============================================================ */
.td-media-inset{
  max-width:var(--content);
  margin:0 auto calc(96 * var(--u));
  padding:0 var(--gutter);
}
.td-title-video{
  position:relative;
  width:100%;
  aspect-ratio:16 / 9;
  overflow:hidden;
  background:#000;
}
.td-title-video video{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}

/* ============================================================
   MOSAIC GRID — the sketches / design board / final-designs
   tiles from the Figma frame. Real photography for these isn't
   in the repo yet (see the reply), so each tile is a clearly
   marked placeholder in the exact grid rhythm the frame uses,
   ready to swap for real images one-for-one.
   ============================================================ */
.td-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:calc(16 * var(--u));
  margin-top:calc(8 * var(--u));
}
.td-grid--3{grid-template-columns:repeat(3,1fr);}
.td-grid--2{grid-template-columns:repeat(2,1fr);margin-top:calc(32 * var(--u));max-width:calc(600 * var(--u));}
.td-tile{
  aspect-ratio:191 / 107;
  background:#f0f0f0;
  border:1px dashed rgba(0,0,0,.2);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:calc(10 * var(--u));
  text-align:center;
  font-size:calc(11 * var(--u));
  line-height:1.4;
  letter-spacing:.02em;
  color:rgba(0,0,0,.45);
}
.td-tile--dark{
  background:#1a1a1a;
  border-color:rgba(255,255,255,.22);
  color:rgba(255,255,255,.4);
}
.td-section-sub{
  margin:calc(56 * var(--u)) 0 calc(16 * var(--u));
  font-size:clamp(calc(20 * var(--u)),1.8vw,calc(32 * var(--u)));
  font-weight:var(--fw-medium);
}
.td-section-sub:first-child{margin-top:0;}

/* staggered wave: each grid tile carries its own index via --i so
   the reveal ripples across the grid instead of popping in as one
   block — set inline per tile (style="--i:3"), read here */
.td-grid .reveal{transition-delay:calc(var(--i,0) * 55ms);}

.td-deck-link{
  display:inline-flex;
  align-items:center;
  gap:calc(6 * var(--u));
  margin-top:calc(40 * var(--u));
  font-size:calc(18 * var(--u));
  font-weight:var(--fw-regular);
  text-decoration:underline;
  text-underline-offset:calc(3 * var(--u));
  opacity:.85;
  transition:opacity .2s ease;
}
.td-deck-link:hover{opacity:1;}

@media (max-width:900px){
  .td-cross{aspect-ratio:1/1;}
  .td-cross-title span{font-size:clamp(calc(16 * var(--u)),6vw,calc(32 * var(--u)));}
  .td-grid{grid-template-columns:repeat(2,1fr);}
  .td-grid--3{grid-template-columns:repeat(2,1fr);}
  .td-grid--2{grid-template-columns:repeat(2,1fr);max-width:none;}
}

