/* =================================================================
   Ali Aslam — portfolio
   css/style.css

   Design system is locked by the brief: cream paper, deep green,
   one terracotta accent, Cormorant Garamond display over Inter body
   with JetBrains Mono for technical labels. Arch forms, hairline
   rules, asymmetric grid, no cards with shadows, no gradients.

   Contrast (measured, WCAG):
     ink        #1A1A1A on #F3EFE6  15.17
     muted      #6B6B63 on #F3EFE6   4.68  (AA body)
     green      #0F2E24 on #F3EFE6  12.74
     accent     #C9742C on #F3EFE6   3.04  -> large type / rules only
     accent-ink #9C5518 on #F3EFE6   4.91  -> small accent text
     paper 66%  #A5ADA4 on #0F2E24   6.34  -> dark-section small text
   ================================================================= */

/* ------------------------------------------------------------ 1. tokens */
:root {
  --paper:      #F3EFE6;
  --paper-2:    #E7E0D2;
  --paper-3:    #DCD4C4;
  --green:      #0F2E24;
  --green-2:    #164134;
  --ink:        #1A1A1A;
  --muted:      #6B6B63;
  --accent:     #C9742C;
  --accent-ink: #9C5518;
  --on-dark:    #F3EFE6;
  --on-dark-mute: #A5ADA4;
  --warn:       #E0A472;   /* 6.77 on green */
  --ok:         #8FBFA4;   /* 7.07 on green */

  --line:       rgba(15, 46, 36, .17);
  --line-soft:  rgba(15, 46, 36, .09);
  --line-dark:  rgba(243, 239, 230, .18);

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans:  "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --pad: clamp(18px, 5.5vw, 100px);
  --sec: clamp(100px, 13vh, 190px);

  --out3: cubic-bezier(.215, .61, .355, 1);
  --inout4: cubic-bezier(.645, .045, .355, 1);
}

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

html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
/* Lenis injects .lenis.lenis-stopped{overflow:hidden}, which removes the
   viewport scrollbar and re-centres every pinned section by ~15px the moment
   an overlay opens. Keeping the gutter reserved makes the lock invisible. */
html.lenis { overflow-y: scroll !important; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(.98rem, .3vw + .9rem, 1.08rem);
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--green); color: var(--paper); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--green); color: var(--paper); padding: .8rem 1.4rem;
}
.skip:focus { left: 1rem; }

/* ------------------------------------------------------- 2. typography */
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }

.mono {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
}
.mono--label {
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: .68rem;
  color: var(--accent-ink);
  margin: 0 0 1.6rem;
}
.mono--labelDark { color: var(--accent); }
.mono--num { color: var(--muted); }

.display {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 6rem);
  line-height: .98;
  letter-spacing: -.03em;
}

/* line-mask reveal primitive (3.3, 3.7, 3.9). The padding/margin pair
   gives descenders room inside the overflow:hidden mask without
   adding space to the layout. */
.ln { display: block; overflow: hidden; padding-bottom: .16em; margin-bottom: -.16em; }
.ln__i { display: block; }

/* --------------------------------------------------------- 3. primitives */
.wrap { width: 100%; padding-inline: var(--pad); }

.arch {
  border-radius: 999px 999px 0 0;
  overflow: hidden;
  background: var(--paper-2);
  position: relative;
}
.hair { height: 1px; background: var(--line); border: 0; margin: 0; }

/* device frame — hero + system + work share this */
.phone { position: relative; }
.phone__frame {
  position: relative;
  display: block;                 /* spans inside cards need block layout
                                      or aspect-ratio is ignored */
  border-radius: 34px;
  padding: 5px;                   /* was 11px — a thick black bezel made the
                                      screen read as a small window inside a
                                      black slab instead of a phone */
  background: #101312;
  box-shadow: inset 0 0 0 1px rgba(243,239,230,.09);
  aspect-ratio: 9 / 19;
  overflow: hidden;
}
.phone__frame::after {           /* side button */
  content: ""; position: absolute; right: -2px; top: 22%;
  width: 2px; height: 15%; border-radius: 2px; background: #232826;
}
.phone__screen {
  position: relative; display: block; height: 100%; border-radius: 30px; overflow: hidden;
  background: var(--paper-2);
}
.phone__screen > img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
}

/* desktop app window — for products whose UI is not a phone (Vendlora) */
.win {
  position: relative; display: block; background: var(--paper);
  border: 1px solid var(--line); border-radius: 7px 7px 4px 4px; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(243,239,230,.06), 0 34px 60px -40px rgba(15,46,36,.6);
}
.win__bar { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.win__bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); opacity: .28; }
.win__label { margin-left: 9px; font-size: .54rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win__screen { display: block; position: relative; aspect-ratio: 16 / 10; background: var(--paper-2); overflow: hidden; }
.win__screen > img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }

/* graceful fallback: CSS-drawn fake app UI when the image is missing.
   Section 6 of the spec — the site must never look broken. */
.fake { position: absolute; inset: 0; padding: 34px 12px 14px; display: flex; flex-direction: column; gap: 9px; background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%); }
.fake__bar { height: 9px; width: 46%; border-radius: 6px; background: var(--green); opacity: .82; }
.fake__bar--thin { height: 6px; width: 62%; background: var(--muted); opacity: .35; }
.fake__hero { height: 30%; border-radius: 16px 16px 10px 10px; background: var(--green-2); opacity: .9; margin-top: 4px; }
.fake__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fake__cell { height: 34px; border-radius: 9px; background: var(--paper-3); }
.fake__row { height: 15px; border-radius: 8px; background: var(--paper-3); }
.fake__cta { margin-top: auto; height: 34px; border-radius: 10px; background: var(--accent); opacity: .9; }
.fake__dots { display: flex; gap: 6px; }
.fake__dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); opacity: .3; }

/* ---------------------------------------------------------- 4. cursor */
.cur { position: fixed; top: 0; left: 0; z-index: 120; pointer-events: none; display: none; }
/* `translate` is used instead of `transform` here and below the sys
   stage: GSAP writes `transform` on these nodes, and the individual
   property composes with it instead of being overwritten. */
.cur__dot, .cur__ring {
  position: absolute; top: 0; left: 0; border-radius: 50%;
  translate: -50% -50%;
}
.cur__dot { width: 6px; height: 6px; background: var(--green); }
.cur__ring {
  width: 40px; height: 40px; border: 1px solid var(--green);
  display: grid; place-items: center;
  transition: background .4s var(--out3), border-color .4s var(--out3), width .5s var(--out3), height .5s var(--out3);
}
.cur__text {
  font-family: var(--mono); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--paper); opacity: 0; transition: opacity .3s var(--out3);
}
.cur.is-active .cur__ring { width: 92px; height: 92px; background: var(--green); border-color: var(--green); }
.cur.is-active .cur__text { opacity: 1; }
.cur.is-link .cur__ring { width: 58px; height: 58px; background: rgba(15,46,36,.08); }
.cur.is-dark .cur__ring { border-color: var(--paper); }
.cur.is-dark .cur__dot { background: var(--paper); }
.cur.is-dark.is-active .cur__ring { background: var(--paper); }
.cur.is-dark.is-active .cur__text { color: var(--green); }

@media (hover: hover) and (pointer: fine) {
  .cur { display: block; }
  body, a, button { cursor: none; }
}

/* ------------------------------------------------------- 5. preloader */
.pl {
  position: fixed; inset: 0; z-index: 100;
  background: var(--green); color: var(--paper);
  display: grid; place-items: center;
}
.pl__inner { text-align: center; overflow: hidden; }
.pl__eyebrow {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .34em; text-transform: uppercase;
  color: var(--on-dark-mute); margin-bottom: 1.4rem;
}
.pl__name { margin: 0; font-family: var(--serif); }
.pl__nameMask { display: block; overflow: hidden; }
.pl__nameRise { display: block; font-size: clamp(2.6rem, 9vw, 7.5rem); line-height: 1; letter-spacing: -.03em; font-weight: 300; }
.pl__count {
  position: absolute; right: clamp(18px, 5vw, 60px); bottom: clamp(18px, 5vw, 48px);
  font-family: var(--mono); font-size: clamp(1.4rem, 4vw, 2.6rem); color: var(--accent);
  font-variant-numeric: tabular-nums;
}
html.no-pl .pl { display: none; }
html.preloading { overflow: hidden; }

/* -------------------------------------------------------------- 6. nav */
.nav {
  position: fixed; top: clamp(14px, 2.4vh, 30px); left: 0; right: 0; z-index: 90;
  display: flex; justify-content: center;
  padding-inline: var(--pad);
}
.nav__pill {
  display: flex; align-items: center; gap: .3rem;
  padding: .42rem .5rem .42rem 1.15rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(243, 239, 230, .74);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.nav__link {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink); padding: .5rem .8rem; border-radius: 999px;
  transition: color .3s var(--out3);
}
.nav__link:hover { color: var(--accent-ink); }
.nav__sep { width: 1px; height: 12px; background: var(--line); }
.nav__cta {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  background: var(--green); color: var(--paper);
  padding: .62rem 1.1rem; border-radius: 999px; margin-left: .5rem;
  transition: background .35s var(--out3);
}
.nav__cta:hover { background: var(--accent); }

.nav__burger { display: none; position: fixed; top: clamp(14px,2.4vh,30px); right: var(--pad); z-index: 95;
  width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(243,239,230,.8); backdrop-filter: blur(10px);
  flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.nav__burgerBar { display: block; width: 17px; height: 1px; background: var(--green); transition: transform .4s var(--out3), opacity .3s; }
.nav__burger[aria-expanded="true"] .nav__burgerBar:first-child { transform: translateY(3px) rotate(45deg); }
.nav__burger[aria-expanded="true"] .nav__burgerBar:last-child  { transform: translateY(-3px) rotate(-45deg); }

.mob {
  position: fixed; inset: 0; z-index: 92; background: var(--green); color: var(--paper);
  display: flex; flex-direction: column; justify-content: center; padding: 90px var(--pad) 40px;
  clip-path: inset(0 0 100% 0); visibility: hidden;
}
.mob.is-open { visibility: visible; }
.mob__nav { display: flex; flex-direction: column; gap: .2rem; }
.mob__link { font-family: var(--serif); font-size: clamp(2.4rem, 13vw, 4.6rem); line-height: 1.06; letter-spacing: -.02em; overflow: hidden; }
.mob__link > span { display: block; }
.mob__close { position: absolute; top: clamp(14px,2.4vh,30px); right: var(--pad); width: 46px; height: 46px; font-size: 1.6rem; line-height: 1; color: var(--paper); }
.mob__foot { margin-top: 3rem; font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; color: var(--on-dark-mute); }

/* -------------------------------------------------------------- 7. hero */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding: 120px var(--pad) 90px; }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(0, .78fr);
  align-items: center; gap: clamp(24px, 5vw, 80px); width: 100%;
}
/* sized so each DATA line stays on exactly one line at 1440px */
.hero__title {
  font-size: clamp(2.9rem, 8.2vw, 10rem);
  line-height: .95; letter-spacing: -.035em; font-weight: 300;
  margin: 0 0 1.8rem;
}
.hero__title em { font-style: italic; font-weight: 400; }
.hero__title .ln:nth-child(2) { text-indent: .06em; }
.hero__title .ln:nth-child(3) { margin-left: clamp(0px, 6vw, 120px); }
.hero__sub { max-width: 34ch; color: var(--muted); font-size: 1.02rem; }
.hero__sub b { color: var(--ink); font-weight: 500; }

.hero__stage { position: relative; display: grid; place-items: center; }
.hero__arch {
  position: absolute; width: 86%; aspect-ratio: 3 / 4.4;
  border-radius: 999px 999px 0 0; background: var(--paper-2);
  bottom: -4%; z-index: 0;
}
.hero__rule { position: absolute; width: 1px; height: 130%; background: var(--accent); opacity: .5; right: 12%; z-index: 0; }
.phone--hero { position: relative; z-index: 1; width: clamp(190px, 21vw, 300px); transform-style: preserve-3d; will-change: transform; }

.hero__cue { position: absolute; left: var(--pad); bottom: 30px; display: flex; align-items: center; gap: 12px; }
.hero__cue .mono { text-transform: uppercase; letter-spacing: .3em; font-size: .62rem; color: var(--muted); }
.hero__cueLine { display: block; width: 1px; height: 54px; background: var(--line); position: relative; overflow: hidden; }
.hero__cueLine::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: translateY(-100%); animation: cue 2.4s var(--inout4) infinite; }
@keyframes cue { 0% { transform: translateY(-100%); } 60% { transform: translateY(100%); } 100% { transform: translateY(100%); } }

/* ----------------------------------------------------------- 8. marquee */
.mq { overflow: hidden; border-block: 1px solid var(--line); padding: clamp(14px,2.4vw,26px) 0; }
.mq__track { display: flex; width: max-content; will-change: transform; }
.mq__item {
  font-family: var(--serif); font-size: clamp(1.5rem, 3.4vw, 3rem); line-height: 1;
  letter-spacing: -.01em; padding-inline: clamp(14px, 2vw, 30px); white-space: nowrap; color: var(--ink);
  display: inline-flex; align-items: center; gap: clamp(14px, 2vw, 30px);
}
.mq__item::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.mq__item--alt { font-style: italic; color: var(--muted); }

/* ---------------------------------------------------------- 9. the system */
.sys { padding-top: var(--sec); background: var(--paper); }
.sys__head { padding-inline: var(--pad); max-width: 1100px; }
.sys__title { font-size: clamp(2.6rem, 7vw, 6.4rem); line-height: .96; letter-spacing: -.03em; font-weight: 300; }
.sys__title .ln:nth-child(2) { color: var(--green); font-style: italic; }

.sys__viewport {
  position: relative; height: min(100svh, 880px); margin-top: clamp(30px, 6vh, 70px);
  padding-inline: var(--pad);
}
.sys__stage { position: relative; width: 100%; height: 100%; }
.sys__wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sys__wire { fill: none; stroke: var(--green); stroke-width: 1.4; }
.sys__node { fill: var(--accent); opacity: 0; }

.sys__phone, .sys__dash, .sys__code { position: absolute; top: 50%; translate: 0 -50%; }
/* three columns with deliberate gaps: the wires need room to be seen */
.sys__phone { left: 3%; width: clamp(150px, 14vw, 200px); }
.sys__dash  { left: 27%; width: clamp(300px, 31vw, 430px); }
.sys__code  { left: 69%; width: clamp(240px, 25vw, 330px); }
.sys__cap { margin-top: 1rem; font-size: .62rem; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.sys__ring {
  position: absolute; left: 50%; bottom: 13%; width: 62px; height: 62px; margin: -31px 0 0 -31px;
  border-radius: 50%; border: 1px solid var(--accent);
  box-shadow: 0 0 0 6px rgba(201,116,44,.14); opacity: 0; z-index: 4;
}
.sys__note {
  position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%);
  font-family: var(--mono); font-size: .6rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
}

/* fake dashboard — this IS the dashboard, animated in step 3 */
.dash { border: 1px solid var(--line); border-radius: 3px; background: var(--paper); overflow: hidden; box-shadow: 0 30px 60px -50px rgba(15,46,36,.5); }
.dash__bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--paper-2); }
.dash__bar i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); opacity: .35; }
.dash__bar span { margin-left: 12px; font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.dash__body { padding: 16px 16px 18px; }
.dash__charts { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: end; }
.dash__bars { display: flex; align-items: flex-end; gap: 7px; height: 74px; }
.dash__bars i { flex: 1; height: 100%; background: var(--green); transform-origin: bottom center; transform: scaleY(.12); border-radius: 1px; }
.dash__bars i:nth-child(2n) { background: var(--green-2); }
.dash__bars i:nth-child(4) { background: var(--accent); }
.dash__chartLabel { display: block; margin-top: 8px; font-size: .56rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.dash__kpis { display: flex; flex-direction: column; gap: 10px; }
.dash__kpi b { display: block; font-family: var(--serif); font-size: clamp(1.5rem, 2.4vw, 2.4rem); font-weight: 400; letter-spacing: -.02em; line-height: 1; }
.dash__kpi span { display: block; font-size: .56rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.dash__kpi--sm { display: flex; align-items: center; gap: 8px; }
.dash__kpi--sm > span { margin: 0; }
.dash__pill { font-family: var(--mono); font-size: .56rem; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--paper-3); color: var(--ink); white-space: nowrap; }
.dash__pill--live { background: var(--accent); color: var(--paper); }
.dash__table { margin-top: 16px; border-top: 1px solid var(--line); }
.dash__row { display: grid; grid-template-columns: 42px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: .78rem; }
.dash__row span { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash__row--head span { font-size: .56rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.dash__row--new { background: rgba(201,116,44,.07); }

.code { border: 1px solid var(--line); border-radius: 3px; background: var(--green); overflow: hidden; }
.code__file { padding: 9px 13px; border-bottom: 1px solid var(--line-dark); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.code__body { margin: 0; padding: 13px; font-size: clamp(.55rem, .72vw, .68rem); line-height: 1.75; color: var(--on-dark); overflow: hidden; }
.code__body .ln { display: block; overflow: visible; padding: 0; }
.code__body .ln__i { display: block; white-space: pre; }

/* --------------------------------------------------------------- 10. work */
.work { padding-top: var(--sec); }
.work__head { padding-inline: var(--pad); display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.work__headmain { min-width: 0; }
.work__title { font-size: clamp(2.4rem, 6vw, 5.6rem); line-height: .98; letter-spacing: -.03em; font-weight: 300; }
.work__hint { color: var(--muted); letter-spacing: .24em; text-transform: uppercase; font-size: .62rem; }
/* the pinned rail is a full viewport tall so cards sit centred, not top-aligned */
.work__viewport { margin-top: clamp(30px, 5vh, 60px); overflow: hidden; height: 100svh; display: flex; align-items: center; }
.work__track { display: flex; gap: clamp(20px, 3.4vw, 60px); width: max-content; padding-inline: var(--pad); will-change: transform; }

.card {
  position: relative; flex: none;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 44px);
  align-items: start;                 /* plate tops align on every card */
  width: clamp(300px, 70vw, 900px);
  background: none; text-align: left;
}
.card__text { display: block; min-width: 0; padding-top: clamp(6px, 4vh, 46px); }
.card__idx, .card__name, .card__short, .card__role { display: block; }
.card__idx { font-family: var(--mono); font-size: .62rem; letter-spacing: .22em; color: var(--accent-ink); margin-bottom: 1.1rem; }
.card__name { font-family: var(--serif); font-size: clamp(2rem, 4.4vw, 4.2rem); line-height: 1; letter-spacing: -.03em; font-weight: 400; }
.card__short { color: var(--muted); margin-top: 1rem; max-width: 30ch; font-size: .94rem; }
.card__role { font-family: var(--mono); font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); margin-top: 1.2rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.card__tags { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 1rem; }
.card__tag { font-family: var(--mono); font-size: .58rem; letter-spacing: .06em; color: var(--muted); }
.card__tag + .card__tag::before { content: "·"; margin-right: 10px; color: var(--accent); }
.card__more { display: inline-block; margin-top: 1.4rem; font-family: var(--mono); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; border-bottom: 1px solid var(--accent); padding-bottom: 3px; color: var(--ink); }
/* One designed plate on every card — same size, same position, same
   treatment. Only the screen inside the device changes, so the rail reads
   as a system instead of nine differently-framed screenshots. */
.card__visual {
  position: relative; flex: none;
  display: grid; place-items: center;      /* grid centring, not CSS translate:
                                              GSAP absorbs the translate property
                                              and yPercent then drops the -50% */
  width: clamp(260px, 34vw, 470px);
  height: clamp(400px, 56vh, 540px);
  transition: transform 1.1s var(--out3);
}
.card:hover .card__visual, .card:focus-visible .card__visual { transform: scale(1.02); }
.card__plate {
  position: absolute; inset: 0; z-index: 1; overflow: hidden;
  border-radius: 999px 999px 6px 6px;
  background: linear-gradient(180deg, #174536 0%, var(--green) 60%, #0C241C 100%);
  box-shadow: inset 0 0 0 1px rgba(243,239,230,.10);
}
.card__plate::before {          /* hairline arc echoing the arch */
  content: ""; position: absolute; left: 13%; right: 13%; top: 14%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,116,44,.5) 28%, rgba(201,116,44,.5) 72%, transparent);
}
.card__plate::after {           /* a base, so the plate is not a flat shape */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 36%;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.3));
}
.card__phone, .card__win { z-index: 2; }
.card__visual > .card__phone, .card__visual > .card__win { position: relative; }
.card__visual > .card__phone { width: clamp(150px, 15.5vw, 215px); }
.card__visual > .card__win { width: clamp(280px, 30vw, 430px); }
.card__phone .phone__frame, .card__win { box-shadow: inset 0 0 0 1px rgba(243,239,230,.14), 0 40px 70px -40px rgba(0,0,0,.8); }

/* ------------------------------------------------------------- 11. overlay */
.ov { position: fixed; inset: 0; z-index: 110; visibility: hidden; }
.ov.is-open { visibility: visible; }
/* keep the panel unclipped while open: GSAP clears its inline clip-path
   when the reveal finishes, and without this the CSS base state would
   snap the panel back to hidden. */
.ov.is-open .ov__panel { clip-path: inset(0 0 0 0); }
.ov__panel {
  position: absolute; inset: 0; background: var(--paper); overflow-y: auto; overscroll-behavior: contain;
  clip-path: inset(0 0 100% 0); padding: clamp(60px, 9vh, 110px) var(--pad) clamp(60px, 9vh, 110px);
}
.ov__close {
  position: fixed; top: clamp(14px, 2.4vh, 30px); right: var(--pad); z-index: 2;
  width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(243,239,230,.8); backdrop-filter: blur(10px);
  font-size: 1.4rem; line-height: 1; display: grid; place-items: center;
}
.ov__inner { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(30px, 5vw, 80px); align-items: start; }
.ov__main { min-width: 0; }
.ov__kicker { font-family: var(--mono); font-size: .62rem; letter-spacing: .24em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 1.4rem; }
.ov__title { font-family: var(--serif); font-size: clamp(2.6rem, 7vw, 6rem); line-height: .95; letter-spacing: -.035em; font-weight: 300; }
.ov__role { font-family: var(--mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 1.4rem; }
.ov__long p { margin-top: 1.6rem; max-width: 58ch; }
.ov__bullets { margin-top: 2.4rem; border-top: 1px solid var(--line); }
.ov__b { display: grid; grid-template-columns: 130px 1fr; gap: 20px; padding: 1.3rem 0; border-bottom: 1px solid var(--line); }
.ov__b dt { font-family: var(--mono); font-size: .58rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); padding-top: .3rem; }
.ov__b dd { margin: 0; font-size: .95rem; }
.ov__stack { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 2rem; }
.ov__stack li { font-family: var(--mono); font-size: .62rem; letter-spacing: .08em; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; list-style: none; }
.ov__links { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 2.2rem; }
.ov__link { font-family: var(--mono); font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; border-bottom: 1px solid var(--accent); padding-bottom: 4px; }
.ov__none { font-family: var(--mono); font-size: .62rem; color: var(--muted); letter-spacing: .1em; margin-top: 2.2rem; }
.ov__side { position: sticky; top: clamp(20px, 7vh, 70px); align-self: start; display: grid; place-items: center; padding-top: 10px; }
/* extra screens a project ships with (data.js → project.screens).
   Stays in the article column: full width would run under the sticky phone. */
.ov__strip { grid-column: 1; margin-top: clamp(40px, 6vh, 72px); padding-top: 1.5rem; border-top: 1px solid var(--line); }
.ov__stripLabel { font-size: .58rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.3rem; }
.ov__stripRow { display: flex; gap: clamp(10px, 1.7vw, 22px); flex-wrap: wrap; }
/* sized so four phones fit one row inside the article column, instead of 3+1 */
.ov__shot { width: clamp(78px, 8.6vw, 122px); }
/* desktop projects: two windows per row, big enough to read a line of the UI */
.ov__stripRow--wide { gap: clamp(12px, 1.8vw, 22px); }
.ov__stripRow--wide .ov__shot { width: calc(50% - 11px); }
.ov__win { width: clamp(250px, 25vw, 360px); }
.ov__side .card__phone { width: clamp(150px, 16vw, 220px); }

/* -------------------------------------------------------------- 12. about */
.about { padding-top: var(--sec); }
.about__grid { display: grid; grid-template-columns: minmax(0, .42fr) minmax(0, .58fr); gap: clamp(30px, 6vw, 100px); padding-inline: var(--pad); align-items: start; }
.about__photo { position: relative; }
.about__photo .arch { width: 100%; aspect-ratio: 4 / 5; }
.about__photo .arch img { width: 100%; height: 100%; object-fit: cover; object-position: top center; will-change: transform; }
/* The portrait is graded into the file (see assets/projects/README.txt), so no CSS
   filter here — that would double-apply to any photo you drop in later.
   The bottom fade is a frame effect, so it stays in CSS. */
.about__photo .arch::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(243,239,230,0) 54%, rgba(243,239,230,.20) 84%, rgba(243,239,230,.46) 100%);
}
.about__title { font-size: clamp(1.9rem, 3.6vw, 3.4rem); line-height: 1.04; letter-spacing: -.025em; font-weight: 400; }
.about__text p { margin-top: 1.6rem; max-width: 52ch; color: var(--muted); }
.stats { display: flex; flex-wrap: wrap; gap: clamp(24px, 4vw, 70px); margin-top: 2.6rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.stat__n { font-family: var(--serif); font-size: clamp(2.4rem, 4.6vw, 4rem); line-height: 1; font-weight: 400; letter-spacing: -.02em; }
.stat__l { display: block; font-family: var(--mono); font-size: .56rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: .5rem; max-width: 22ch; }

.services { padding: clamp(50px, 8vh, 100px) var(--pad) 0; }
.services__label { margin-bottom: 1.4rem; }

/* rows with sliding green fill (services + experience) */
.rows { border-top: 1px solid var(--line); }
.row { position: relative; display: grid; align-items: center; gap: 20px; padding: clamp(1.1rem, 2.4vh, 1.8rem) clamp(.6rem, 1.4vw, 1.2rem); border-bottom: 1px solid var(--line); overflow: hidden; }
.row__fill { position: absolute; inset: 0; background: var(--green); transform: scaleX(0); transform-origin: left center; transition: transform .55s var(--out3); z-index: 0; pointer-events: none; }
.row > *:not(.row__fill) { position: relative; z-index: 1; }
.row__n { font-family: var(--mono); font-size: .62rem; letter-spacing: .1em; color: var(--accent-ink); }
.row__t { font-family: var(--serif); font-size: clamp(1.5rem, 2.6vw, 2.4rem); line-height: 1.05; letter-spacing: -.02em; }
.row__l { color: var(--muted); font-size: .9rem; max-width: 54ch; }
.row:hover .row__fill, .row:focus-visible .row__fill { transform: scaleX(1); }
.row:hover .row__t, .row:hover .row__l, .row:hover .row__n, .row:focus-visible .row__t { color: var(--paper); }
.row:hover .row__n, .row:focus-visible .row__n { color: var(--accent); }
.row:hover .row__l, .row:focus-visible .row__l { color: var(--on-dark-mute); }

.row--service { grid-template-columns: 60px minmax(0, .38fr) minmax(0, .62fr); }
.row--exp { grid-template-columns: 130px minmax(0, .3fr) minmax(0, .26fr) minmax(0, 1fr); }
.row--exp .row__t { font-size: clamp(1.1rem, 1.6vw, 1.5rem); }
.row__co { font-family: var(--mono); font-size: .66rem; letter-spacing: .08em; color: var(--ink); }

/* --------------------------------------------------------- 13. experience */
.exp { padding: var(--sec) var(--pad) 0; }

/* ------------------------------------------------------------- 14. contact */
.ct { margin-top: var(--sec); background: var(--green); color: var(--paper); padding: clamp(80px, 12vh, 150px) var(--pad) 34px; }
.ct__title { font-size: clamp(2.8rem, 10vw, 9.5rem); line-height: .94; letter-spacing: -.035em; font-weight: 300; margin-bottom: clamp(30px, 5vh, 60px); }
.ct__title .ln:nth-child(2) { font-style: italic; margin-left: clamp(0px, 5vw, 100px); }
.ct__mail { position: relative; display: inline-block; font-family: var(--serif); font-size: clamp(1.5rem, 4vw, 3.4rem); letter-spacing: -.02em; line-height: 1.1; padding-bottom: 6px; }
.ct__mail::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left center; transition: transform .6s var(--out3); }
.ct__mail:hover::after, .ct__mail:focus-visible::after { transform: scaleX(1); }
.ct__note { max-width: 54ch; color: var(--on-dark-mute); margin-top: clamp(26px, 4vh, 46px); font-size: .95rem; }

/* contact form — hairline inputs on the dark section, no boxes.
   Measured on #0F2E24: paper 12.74, mute 6.34, warn 6.77, ok 7.07. */
.ct__form { margin-top: clamp(40px, 7vh, 76px); max-width: 640px; }
.ct__formLabel { color: var(--on-dark-mute); letter-spacing: .2em; text-transform: uppercase; font-size: .58rem; margin-bottom: 1.5rem; }
.ct__row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 3vw, 30px); }
.ct__field { display: block; margin-bottom: 1.5rem; }
.ct__field label { display: block; color: var(--on-dark-mute); font-size: .58rem; letter-spacing: .18em; text-transform: uppercase; margin-bottom: .55rem; }
.ct__field input, .ct__field textarea {
  display: block; width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line-dark);
  border-radius: 0; color: var(--on-dark); font-family: var(--sans); font-size: 1rem; line-height: 1.5;
  padding: .55rem 0; transition: border-color .35s var(--out3);
}
.ct__field textarea { resize: vertical; min-height: 96px; }
.ct__field input::placeholder, .ct__field textarea::placeholder { color: rgba(165, 173, 164, .8); }
.ct__field input:focus, .ct__field textarea:focus { border-bottom-color: var(--accent); }
.ct__field.is-bad input, .ct__field.is-bad textarea { border-bottom-color: var(--warn); }
.ct__err { display: block; min-height: 1.1em; margin-top: .5rem; font-size: .6rem; letter-spacing: .08em; color: var(--warn); }
.ct__honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ct__foot { display: flex; align-items: center; gap: 18px 24px; flex-wrap: wrap; }
.ct__submit {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--mono); font-size: .66rem; letter-spacing: .2em; text-transform: uppercase;
  background: var(--paper); color: var(--green); border-radius: 999px; padding: .95rem 1.6rem;
  transition: background .35s var(--out3), color .35s var(--out3);
}
.ct__submit:hover, .ct__submit:focus-visible { background: var(--warn); color: var(--green); }
.ct__submit[disabled] { opacity: .5; }
.ct__submit i { font-style: normal; }
.ct__status { font-size: .62rem; letter-spacing: .1em; color: var(--ok); }
.ct__status.is-bad { color: var(--warn); }
.ct__links { display: flex; flex-wrap: wrap; gap: 12px 30px; margin-top: clamp(40px, 7vh, 80px); padding-top: 1.4rem; border-top: 1px solid var(--line-dark); }
.ct__link { font-family: var(--mono); font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--on-dark-mute); transition: color .35s var(--out3); }
.ct__link:hover { color: var(--accent); }
.ct__foot { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: clamp(50px, 9vh, 110px); padding-top: 1.2rem; border-top: 1px solid var(--line-dark); font-family: var(--mono); font-size: .58rem; letter-spacing: .16em; text-transform: uppercase; color: var(--on-dark-mute); }

.nojs { padding: 40px var(--pad); font-family: var(--mono); font-size: .8rem; }

/* word-mask reveal (3.7 about headline) */
.w { display: inline-block; overflow: hidden; vertical-align: bottom; margin-right: .16em; padding-bottom: .16em; margin-bottom: -.16em; }
.w__i { display: inline-block; }

/* portrait plate — shown until assets/profile.jpg exists */
.faceplate { position: absolute; inset: 0; display: grid; place-items: center; gap: .4rem; align-content: center; background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%); }
.faceplate b { font-family: var(--serif); font-weight: 300; font-size: clamp(3rem, 8vw, 6rem); color: var(--green); opacity: .45; letter-spacing: -.02em; }
.faceplate span { font-family: var(--mono); font-size: .56rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }

/* --------------------------------------------------------- 15. responsive */
@media (max-width: 1200px) {
  .sys__phone { left: 2%; }
  .sys__dash  { left: 25%; }
  .sys__code  { left: 66%; }
}

@media (max-width: 1023px) {
  .nav__pill { display: none; }
  .nav__burger { display: flex; }
  .mono--label { font-size: .58rem; letter-spacing: .14em; }
  .hero { padding-top: 96px; }
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .hero__title { font-size: clamp(2.8rem, 13vw, 5rem); }
  .hero__stage { order: -1; }
  .hero__arch { width: 60%; }
  .hero__rule { display: none; }
  .phone--hero { width: clamp(160px, 40vw, 230px); }
  .card__visual > .card__phone { width: clamp(130px, 32vw, 175px); }
  .card__visual > .card__win { width: min(100%, 430px); }
  .ov__win { width: min(100%, 420px); }
  .work__hint { display: none; }

  /* the pinned stage becomes a plain vertical story */
  .sys__viewport { height: auto; padding-inline: var(--pad); }
  .sys__stage { height: auto; display: grid; gap: 40px; }
  .sys__phone, .sys__dash, .sys__code { position: static; transform: none !important; translate: none; width: 100%; opacity: 1 !important; }
  .sys__phone { justify-self: center; width: min(50vw, 190px); }
  .sys__code { max-width: 100%; }
  .sys__wires { display: none; }
  .sys__note { position: static; transform: none; display: block; margin-top: 26px; text-align: center; }

  .work__viewport { overflow: visible; height: auto; display: block; }
  .work__track { width: auto; display: grid; gap: 60px; padding-inline: var(--pad); transform: none !important; }
  .card { width: 100%; grid-template-columns: 1fr; gap: 24px; }
  .card__visual { width: 100%; height: clamp(330px, 68vw, 430px); }
  .ov__inner { grid-template-columns: 1fr; }
  .ov__side { order: -1; position: static; }
  .about__grid { grid-template-columns: 1fr; }
  .about__photo { max-width: 320px; }
  .row--service { grid-template-columns: 40px 1fr; }
  .row--service .row__l { grid-column: 2 / -1; }
  .row--exp { grid-template-columns: 1fr; gap: 6px; }
  .row--exp .row__l { font-size: .86rem; }
}

@media (max-width: 560px) {
  .hero__cue { display: none; }
  .stats { gap: 22px; }
  .dash__charts { grid-template-columns: 1fr; }
  .ct__title { font-size: clamp(2.4rem, 14vw, 4rem); }
}

/* -------------------------------------------------- 16. reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .hero__cueLine::after { display: none; }
  .cur { display: none !important; }
  body, a, button { cursor: auto !important; }
}
/* same rules driven by a class, applied by JS when motion is off or
   GSAP is unavailable, so content is always readable and everything
   sits in its final state. Pins are never created in this mode. */
html.reduced .hero__cueLine::after { display: none; }
html.reduced .cur { display: none !important; }
html.reduced body, html.reduced a, html.reduced button { cursor: auto; }
html.reduced .dash__bars i { transform: scaleY(1); }
html.reduced .sys__phone, html.reduced .sys__dash, html.reduced .sys__code { opacity: 1 !important; }
html.reduced .sys__wire { stroke-dasharray: none !important; stroke-dashoffset: 0 !important; }
/* the horizontal rail needs the pin to be reachable, so without motion
   the work section falls back to a plain vertical stack at every size */
html.reduced .work__viewport, html:not(.js) .work__viewport { overflow: visible; height: auto; display: block; }
html.reduced .work__track, html:not(.js) .work__track {
  width: auto; display: grid; gap: 56px; transform: none !important;
}
html.reduced .card, html:not(.js) .card { width: 100%; grid-template-columns: 1fr; }
html.reduced .card__visual, html:not(.js) .card__visual { width: 100%; height: clamp(400px, 56vh, 540px); }
html.reduced .mq__track { width: auto; flex-wrap: wrap; justify-content: center; }
html.reduced .mob, html:not(.js) .mob, html.reduced .ov, html:not(.js) .ov { display: none !important; }
html:not(.js) .pl { display: none; }

@media print {
  .pl, .cur, .nav, .mob, .ov { display: none !important; }
  .sys__viewport { height: auto; }
}
