/* =============================================================================
   Homepage — light, clinical, image-led.
   Deliberately standalone: site.css still drives the case studies and the CV in
   the dark treatment, so nothing here can break them. If this direction sticks,
   this file becomes the site's.
   ========================================================================== */

/* --- 1. Reset ------------------------------------------------------------- */
*,*::before,*::after{box-sizing:border-box}
*{margin:0}
html{-webkit-text-size-adjust:100%}
img,svg{display:block;max-width:100%}
/* The width/height attributes are presentational hints, so without this the
   used height is the attribute value and any CSS aspect-ratio is ignored. */
img{height:auto}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
h1,h2,h3,h4{font-weight:inherit;text-wrap:balance}
p{text-wrap:pretty}

/* --- 2. Tokens ------------------------------------------------------------
   Apple's actual values: #FBFBFD page, #F5F5F7 for the recessed band, #1D1D1F
   ink. Secondary ink is #6E6E73 rather than the lighter #86868B, which only
   clears 3.5:1 — fine for Apple's huge type, not for ours. -------------------*/
:root{
  --white:#FFFFFF;
  --ground:#FBFBFD;
  --grey:#F5F5F7;
  --ink:#1D1D1F;
  --ink-2:#6E6E73;
  --line:#D2D2D7;
  --line-soft:#E8E8ED;
  /* Graphite: the accent carries no hue, so hierarchy comes from weight,
     size and underline rather than colour. */
  --accent:#1D1D1F;
  --accent-hover:#3A3A3C;

  /* SF Pro where it exists — this is a Mac-first audience — then the site's
     own face, then the usual grotesk fallbacks. */
  --sans:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text",
         "Schibsted Grotesk","Helvetica Neue",Helvetica,Arial,sans-serif;

  --t-hero:clamp(2.9rem,6.6vw,5rem);
  --t-h2:clamp(2.1rem,4.4vw,3.4rem);
  --t-h3:clamp(1.35rem,2.1vw,1.85rem);
  --t-lead:clamp(1.15rem,1.7vw,1.5rem);
  --t-body:1.0625rem;
  --t-sm:.9375rem;
  --t-xs:.8125rem;

  --r-lg:28px;
  --r-md:18px;
  --r-sm:12px;

  --maxw:1120px;
  --pad:clamp(1.25rem,4vw,2.5rem);
  --sec:clamp(4.5rem,10vw,8.5rem);

  --ease:cubic-bezier(.28,.72,.32,1);
  color-scheme:light;
}

/* --- 3. Base -------------------------------------------------------------- */
body{
  background:var(--ground);
  color:var(--ink);
  font-family:var(--sans);
  font-size:var(--t-body);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overflow-x:clip;
}
::selection{background:var(--accent);color:#fff}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:4px}

.wrap{max-width:var(--maxw);margin-inline:auto;padding-inline:var(--pad)}
.section{padding-block:var(--sec)}
.section--grey{background:var(--grey)}
.section--white{background:var(--white)}

/* --- 4. Type -------------------------------------------------------------- */
/* Apple sets headlines heavy and very tight, then lets the size do the work. */
.eyebrow{
  font-size:var(--t-sm);font-weight:600;letter-spacing:-.008em;
  color:var(--accent);
}
h1{font-size:var(--t-hero);font-weight:700;letter-spacing:-.028em;line-height:1.05}
h2{font-size:var(--t-h2);font-weight:700;letter-spacing:-.024em;line-height:1.08}
h3{font-size:var(--t-h3);font-weight:600;letter-spacing:-.018em;line-height:1.15}
.lead{font-size:var(--t-lead);line-height:1.42;letter-spacing:-.012em;color:var(--ink-2)}
.sub{color:var(--ink-2)}
.cap{font-size:var(--t-sm);color:var(--ink-2);letter-spacing:-.004em}

.link{
  color:var(--accent);font-weight:500;
  display:inline-flex;align-items:center;gap:.28em;
  text-decoration:underline;text-decoration-thickness:1px;
  text-underline-offset:.3em;text-decoration-color:rgba(29,29,31,.3);
  transition:text-decoration-color .25s var(--ease);
}
.link:hover{text-decoration-color:currentColor}
.link svg{width:.72em;height:.72em;flex:none;transition:transform .3s var(--ease)}
.link:hover svg{transform:translateX(2px)}

/* --- 5. Nav ---------------------------------------------------------------
   44px, translucent, hairline. It sits over the hero, so the blur matters. */
.nav{
  position:sticky;top:0;z-index:80;height:48px;
  background:rgba(251,251,253,.72);
  -webkit-backdrop-filter:saturate(180%) blur(20px);
  backdrop-filter:saturate(180%) blur(20px);
  border-bottom:1px solid transparent;
  transition:border-color .3s var(--ease);
}
.nav[data-stuck="true"]{border-bottom-color:var(--line-soft)}
.nav__in{
  max-width:var(--maxw);margin-inline:auto;padding-inline:var(--pad);
  height:100%;display:flex;align-items:center;justify-content:space-between;gap:var(--pad);
}
.nav__logo{display:flex;align-items:center;color:var(--ink);text-decoration:none}
.nav__logo svg{height:17px;width:auto}
.nav__links{display:flex;align-items:center;gap:clamp(1rem,2.4vw,2rem);list-style:none;padding:0}
.nav__links a{
  font-size:var(--t-xs);color:var(--ink);text-decoration:none;opacity:.82;
  transition:opacity .2s var(--ease);
}
.nav__links a:hover{opacity:1}

/* --- 6. Hero --------------------------------------------------------------
   Centred, like every Apple product page: eyebrow, headline, one line, then
   the thing itself. */
.hero{padding-block:clamp(3.5rem,8vw,6.5rem) 0;text-align:center}
/* ch resolves against the element's own font-size, so the measure has to sit
   on the headline itself — on the wrapper it was computing at body size. */
.hero__in{max-width:none}
.hero h1{max-width:17ch;margin-inline:auto}
.hero h1{margin-top:.75rem}
.hero .lead{max-width:56ch;margin:clamp(1.25rem,2.4vw,1.75rem) auto 0}
.hero__cta{display:flex;flex-wrap:wrap;gap:1.5rem;justify-content:center;
  margin-top:clamp(1.5rem,2.6vw,2.25rem);font-size:var(--t-lead)}

/* The device row. Screens overlap slightly and the outer two sit back, so the
   eye lands on the middle one. */
.stage{
  margin-top:clamp(2.5rem,5vw,4.5rem);
  background:linear-gradient(180deg,#F5F5F7 0%,#EDEDF0 100%);
  border-radius:var(--r-lg);
  padding:clamp(2rem,4.5vw,3.5rem) var(--pad) 0;
  overflow:hidden;
}
.devices{
  display:flex;align-items:flex-end;justify-content:center;
  gap:clamp(.5rem,1.6vw,1.5rem);
  max-width:760px;margin-inline:auto;
}
.devices img{
  width:32%;height:auto;border-radius:14px;
  border:1px solid rgba(0,0,0,.08);
  box-shadow:0 18px 40px -18px rgba(0,0,0,.28);
  background:#fff;
}
.devices img:nth-child(odd){width:29%;margin-bottom:clamp(1rem,2.4vw,2rem);opacity:.94}

/* --- 7. Section heads ----------------------------------------------------- */
.head{max-width:none}
.head h2{max-width:18ch}
.head .lead{margin-top:1rem;max-width:46ch}
.head--center{text-align:center}
.head--center h2,
.head--center .lead{margin-inline:auto}

/* --- 8. Tiles -------------------------------------------------------------
   The Apple product grid: a rounded panel, text at the top, the image bleeding
   off the bottom edge. Two up on desktop, stacked on mobile. */
.tiles{display:grid;gap:clamp(1rem,1.6vw,1.5rem);margin-top:clamp(2.5rem,4.5vw,4rem)}
.tiles--2{grid-template-columns:1fr}
@media(min-width:840px){ .tiles--2{grid-template-columns:1fr 1fr} }
.tiles--3{grid-template-columns:1fr}
@media(min-width:720px){ .tiles--3{grid-template-columns:repeat(3,1fr)} }

.tile{
  position:relative;display:flex;flex-direction:column;
  background:var(--white);border-radius:var(--r-lg);overflow:hidden;
  text-decoration:none;color:inherit;
  box-shadow:0 1px 2px rgba(0,0,0,.04),0 8px 24px -16px rgba(0,0,0,.18);
  transition:transform .45s var(--ease),box-shadow .45s var(--ease);
}
.tile--grey{background:var(--grey);box-shadow:none;border:1px solid var(--line-soft)}
a.tile:hover{transform:translateY(-4px);
  box-shadow:0 2px 4px rgba(0,0,0,.05),0 22px 44px -20px rgba(0,0,0,.26)}
.tile__txt{padding:clamp(1.75rem,3vw,2.75rem) clamp(1.5rem,2.6vw,2.5rem) 0;text-align:center}
.tile__txt .eyebrow{display:block;margin-bottom:.55rem}
.tile__txt p{margin-top:.75rem;color:var(--ink-2);font-size:var(--t-sm);
  max-width:42ch;margin-inline:auto}
.tile__more{margin-top:1rem;display:inline-flex}

/* The image well. A fixed ratio keeps the two tiles the same height whatever
   the source images are. */
.tile__vis{
  margin-top:clamp(1.5rem,2.6vw,2.25rem);
  flex:1;min-height:0;
  display:flex;align-items:flex-end;justify-content:center;
  padding-inline:clamp(1.25rem,2.4vw,2.25rem);
  aspect-ratio:16/10;
}
.tile__vis img{
  width:100%;height:100%;object-fit:cover;object-position:top center;
  border-radius:var(--r-md) var(--r-md) 0 0;
  border:1px solid rgba(0,0,0,.07);border-bottom:0;
  box-shadow:0 -1px 24px -8px rgba(0,0,0,.16);
}
/* Phone screens are portrait — show them whole, sitting on the floor. */
.tile__vis--phones{align-items:flex-end;gap:clamp(.4rem,1.2vw,.9rem);
  display:flex;padding-bottom:0}
.tile__vis--phones img{
  width:auto;height:92%;object-fit:contain;object-position:bottom;
  border-radius:12px 12px 0 0;border:1px solid rgba(0,0,0,.09);border-bottom:0;
  box-shadow:0 14px 34px -16px rgba(0,0,0,.3);
}
.tile__vis--phones img:nth-child(2){height:100%}

.tiles--3 .tile__vis{padding-inline:0;overflow:hidden}
.tiles--3 .tile__vis img{border-radius:0;border-inline:0;
  transform:scale(1.35);transform-origin:top center}
.tiles--3 .tile__vis--flat img{transform:none}

/* --- 9. Showcase — full-width alternating rows ---------------------------- */
.show{display:grid;gap:clamp(2rem,4vw,3.5rem);align-items:center}
@media(min-width:860px){
  .show{grid-template-columns:1fr 1.15fr}
  .show--flip .show__fig{order:-1}
}
.show + .show{margin-top:clamp(3.5rem,7vw,6rem)}
.show__txt h3{margin-bottom:.9rem}
.show__txt p{color:var(--ink-2);max-width:46ch}
.show__txt .link{margin-top:1.1rem}
.show__fig img{
  width:100%;border-radius:var(--r-md);
  border:1px solid var(--line-soft);
  box-shadow:0 16px 40px -24px rgba(0,0,0,.3);
}
.show__fig figcaption{margin-top:.85rem;font-size:var(--t-xs);color:var(--ink-2)}

/* --- 10. Craft strip ------------------------------------------------------
   A horizontal run of working artefacts. Scrolls on narrow screens rather than
   shrinking to illegibility. */
.strip{
  margin-top:clamp(2.5rem,4.5vw,3.5rem);
  display:grid;grid-auto-flow:column;
  grid-auto-columns:minmax(clamp(220px,26vw,340px),1fr);
  gap:clamp(.75rem,1.4vw,1.25rem);
  overflow-x:auto;padding-bottom:1rem;
  scroll-snap-type:x mandatory;
  scrollbar-width:thin;
}
.strip figure{scroll-snap-align:start}
.strip img{
  width:100%;aspect-ratio:3/2;object-fit:contain;
  border-radius:var(--r-sm);border:1px solid var(--line-soft);background:var(--white);
}
.strip figcaption{margin-top:.7rem;font-size:var(--t-xs);color:var(--ink-2)}

/* --- 11. Facts ------------------------------------------------------------ */
.facts{display:grid;gap:clamp(1.5rem,3vw,2.5rem);margin-top:clamp(2.5rem,4.5vw,4rem);
  grid-template-columns:1fr}
@media(min-width:640px){ .facts{grid-template-columns:1fr 1fr} }
@media(min-width:960px){ .facts{grid-template-columns:repeat(4,1fr)} }
.facts div{border-top:1px solid var(--line);padding-top:1rem}
.facts dt{font-size:var(--t-xs);color:var(--ink-2);margin-bottom:.4rem}
.facts dd{font-size:var(--t-h3);font-weight:600;letter-spacing:-.018em;line-height:1.15}
.facts small{display:block;margin-top:.5rem;font-size:var(--t-sm);
  font-weight:400;letter-spacing:0;color:var(--ink-2)}

/* --- 12. Contact ---------------------------------------------------------- */
.contact{text-align:center}
.contact .lead{max-width:44ch;margin:1.25rem auto 0}
.contact__links{display:flex;flex-wrap:wrap;gap:.75rem;justify-content:center;
  margin-top:clamp(1.75rem,3vw,2.5rem)}
.btn{
  display:inline-flex;align-items:center;gap:.5rem;text-decoration:none;
  padding:.7rem 1.35rem;border-radius:999px;font-size:var(--t-sm);font-weight:500;
  border:1px solid var(--line);color:var(--ink);background:var(--white);
  transition:background .25s var(--ease),border-color .25s var(--ease),color .25s var(--ease);
}
.btn:hover{border-color:var(--ink);}
.btn--solid{background:var(--accent);border-color:var(--accent);color:#fff}
.btn--solid:hover{background:#0077ED;border-color:#0077ED;color:#fff}

/* --- 13. Foot ------------------------------------------------------------- */
.foot{border-top:1px solid var(--line-soft);padding-block:2rem;background:var(--ground)}
.foot__in{display:flex;flex-wrap:wrap;gap:.75rem 1.5rem;align-items:center;
  justify-content:space-between;font-size:var(--t-xs);color:var(--ink-2)}
.foot a{color:var(--ink-2);text-decoration:none}
.foot a:hover{color:var(--ink)}

/* --- 14. Motion -----------------------------------------------------------
   One gesture, used everywhere: rise and fade. Apple's is short and soft. */
.js [data-reveal]{opacity:0;transform:translateY(24px)}
.js [data-reveal].is-in{
  opacity:1;transform:none;
  transition:opacity .8s var(--ease),transform .9s var(--ease);
  transition-delay:var(--d,0ms);
}
@media(prefers-reduced-motion:reduce){
  .js [data-reveal],.js [data-reveal].is-in{opacity:1;transform:none;transition:none}
  .tile,a.tile:hover{transition:none;transform:none}
  html{scroll-behavior:auto}
}
html{scroll-behavior:smooth}

/* --- 15. Artwork bands -----------------------------------------------------
   Slots for imagery that is not a screenshot — process, people, print. The
   band runs full width; the pair sits two-up. Both are placeholders for now. */
.band{padding-block:var(--sec);background:var(--white)}
.band__fig{max-width:var(--maxw);margin-inline:auto;padding-inline:var(--pad)}
.band__fig img{width:100%;border-radius:var(--r-lg);border:1px solid var(--line-soft)}
.band__fig figcaption,.duo figcaption{
  margin-top:.9rem;font-size:var(--t-sm);color:var(--ink-2)}
.band__fig figcaption{text-align:center}

.duo{display:grid;gap:clamp(1rem,2vw,1.75rem);margin-top:clamp(2.5rem,4.5vw,4rem)}
@media(min-width:760px){ .duo{grid-template-columns:1fr 1fr} }
.duo img{width:100%;border-radius:var(--r-md);border:1px solid var(--line-soft)}

/* A third case study leaves the 2-up grid with an orphan, so the last one
   spans the row and takes a wider well to suit it. */
@media(min-width:840px){
  .tile--wide{grid-column:1 / -1}
  .tile--wide .tile__vis{aspect-ratio:5/2}
  .tile--wide .tile__txt p{max-width:58ch}
}

/* Device-framed artwork on transparency — see case-light.css. */
.cutout{border:0;box-shadow:none;background:none;
  filter:drop-shadow(0 16px 28px rgba(0,0,0,.18))}
.tile__vis--phones img.cutout{border:0;box-shadow:none;border-radius:0}

/* A lone device should fill the well rather than sit at the 92% the outer
   phones in a trio use. */
.tile__vis--phones img:only-child{height:100%}

/* --- 16. Brand marks -------------------------------------------------------
   The eyebrow carries a logo instead of the client's name in type. Heights are
   set per mark rather than shared: John Lewis is a two-line lockup, so matching
   Boden's pixel height would leave its second line unreadable. Optical weight
   is what should match, not the number. */
/* .tile__txt .eyebrow (0,2,0) outranks a bare .eyebrow--logo, so this has to
   match its specificity to take effect. */
.tile__txt .eyebrow--logo{margin-bottom:20px}
/* .tile__txt .eyebrow sets display:block at higher specificity, so the flex
   centring never applied — centre the block-level image itself instead. */
.eyebrow--logo img{width:auto;display:block;margin-inline:auto}
.logo-boden{height:16px}
.logo-jl{height:30px}
@media(max-width:600px){ .logo-boden{height:14px} .logo-jl{height:26px} }

/* The other tiles let their screenshot bleed off the bottom edge; this one is
   a whole device, so it wants floor under it rather than a crop. Padding sits
   on the tile so the well keeps its ratio and the device keeps its size. */
.tile--wide{padding-bottom:40px}

/* --- 17. Card hover --------------------------------------------------------
   The card lifts and the artwork drifts toward the viewer. Small and slow —
   3% over three quarters of a second reads as depth rather than movement, and
   the artwork running slower than the card gives a little parallax.
   Only the clickable cards; the "What I do" tiles are not links. */
@media (hover:hover) and (pointer:fine){
  a.tile .tile__vis img{
    transition:transform .75s cubic-bezier(.22,.61,.36,1);
  }
  a.tile:hover .tile__vis img{ transform:scale(1.035); }

  /* Devices stand on the floor of the well rather than filling it, so they
     grow up from where they sit instead of sinking through it. */
  a.tile .tile__vis--phones img{ transform-origin:bottom center; }
  a.tile:hover .tile__vis--phones img{ transform:scale(1.05); }
}
@media (prefers-reduced-motion:reduce){
  a.tile .tile__vis img,
  a.tile:hover .tile__vis img{ transition:none; transform:none; }
}

/* The reveal sets transform:none at (0,3,0) on .is-in, which outranks a plain
   a.tile:hover at (0,2,1) — so the lift never fired once a card had revealed.
   Matching the reveal's specificity puts it back. */
.js a.tile.is-in:hover{ transform:translateY(-4px); }

/* --- 18. Section seams -----------------------------------------------------
   The tonal bands used to butt against the page along a hard horizontal line.
   They now rise out of it: a large top radius turns each band into a surface
   rather than a stripe, and a faint shadow cast upward gives it somewhere to
   rise from. Feet stay square so bands stack without gaps. */
.section--grey,
.section--white{
  border-radius:clamp(24px,3.6vw,52px) clamp(24px,3.6vw,52px) 0 0;
  /* A 2% tonal step gives the curve almost nothing to describe itself with, so
     the edge is drawn: a hairline inside the top, following the radius, over a
     shadow cast upward. The line does the shape; the shadow does the lift. */
  box-shadow:
    inset 0 1px 0 rgba(0,0,0,.055),
    0 -18px 38px -30px rgba(0,0,0,.20);
}

/* The hero had no bottom padding, so the band's edge sat directly under the
   links. The shaped edge needs air above it to read as a shape. */
.hero{padding-bottom:clamp(2.5rem,5vw,4rem)}

/* --- 19. Scroll cue --------------------------------------------------------
   A hairline with a light running down it. It arrives after the hero has
   settled, and retires the moment you scroll — a hint, not furniture. */
.cue{
  width:1px;height:44px;
  margin:clamp(1.5rem,3vw,2.25rem) auto 0;
  position:relative;overflow:hidden;
  background:linear-gradient(180deg,rgba(29,29,31,.16),rgba(29,29,31,0));
  opacity:0;
  animation:cue-in .9s var(--ease) 1.1s forwards;
}
.cue span{
  position:absolute;left:0;top:-16px;
  width:1px;height:16px;background:var(--accent);
  animation:cue-run 2.9s cubic-bezier(.45,0,.25,1) 1.4s infinite;
}
@keyframes cue-in{ to{opacity:1} }
@keyframes cue-run{
  0%   {transform:translateY(0);   opacity:0}
  12%  {opacity:1}
  55%  {transform:translateY(60px);opacity:0}
  100% {transform:translateY(60px);opacity:0}   /* the pause between passes */
}
.cue[data-gone="true"]{
  opacity:0;
  transition:opacity .45s var(--ease);
  animation:none;
}
@media(prefers-reduced-motion:reduce){
  .cue{animation:none;opacity:1}
  .cue span{animation:none;opacity:0}
}

/* Three-up variant of the facts row. */
@media(min-width:760px){ .facts--three{ grid-template-columns:repeat(3,1fr); } }
