/* Ali Parchekani — portfolio. Depth system: a pinned portrait stage, paper and
   field sheets that slide over one another, raised plates for evidence, and a
   dark floor revealed at the end. BoardUI's free radius token is kept. */
@import url('assets/boardui-tokens.css');
@font-face{font-family:Manrope;src:url('assets/manrope.woff2') format('woff2');font-weight:200 800;font-display:swap}

:root{
  --ink:#222622; --muted:#5d625b; --paper:#f5f2ed; --raised:#fcfaf6; --well:#ebe6dc;
  --line:#d6d3c9; --accent:#ded7c8; --sand:#e4cfb5; --night:#1b1e1b;
  --field:#1d2420; --field-raised:#242c28; --field-line:#3a443e;
  --field-text:#eef1e8; --field-body:#dfe5dc; --field-muted:#b4bdac;
  --studio-a:#8f847b; --studio-b:#a3988f; --studio-c:#8c827a;
  --hero-ink:#080a09; --hero-white:#f9f6f0; --focus:#526c26;
  --gutter:clamp(24px,5vw,80px); --sheet-r:clamp(26px,3.2vw,44px);
  --ease:cubic-bezier(.22,1,.36,1);
  --shadow-plate:0 1px 2px rgb(44 34 24 / .06),0 10px 24px -12px rgb(44 34 24 / .18);
  --shadow-card:0 -12px 32px -22px rgb(44 34 24 / .28),0 30px 60px -34px rgb(44 34 24 / .38);
  --shadow-sheet:0 -26px 70px -26px rgb(18 13 8 / .6);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:96px;background:#978c83;scrollbar-color:#8b867d var(--paper)}
body{margin:0;background:var(--night);color:var(--ink);font-family:Manrope,Arial,sans-serif;font-size:16px;line-height:1.65;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit}
h1,h2,h3,h4,p,figure,ul,ol,dl,dd{margin:0}
ul,ol{padding:0;list-style:none}
h2,h3{font-weight:450;line-height:1.09;letter-spacing:-.04em;text-wrap:balance}
p{text-wrap:pretty}
img{max-width:100%}
strong{font-weight:700}
::selection{background:var(--sand);color:var(--ink)}
a:focus-visible,button:focus-visible{outline:3px solid var(--focus);outline-offset:6px;border-radius:3px}
[hidden]{display:none!important}
.sprite{position:absolute;width:0;height:0;overflow:hidden}
.icon{display:inline-block;width:1em;height:1em;flex-shrink:0;vertical-align:-.12em;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.skip{position:fixed;top:12px;left:16px;z-index:100;background:var(--ink);color:#fff;padding:12px 16px;border-radius:8px;transform:translateY(-200%)}
.skip:focus{transform:none}
.shell{max-width:1600px;margin-inline:auto;padding-inline:var(--gutter)}
.text-link{display:inline-flex;gap:28px;align-items:center;border-bottom:1px solid currentColor;padding-bottom:8px;font-size:13px}
.text-link .icon{transition:transform .35s var(--ease)}
.text-link:hover .icon{transform:translate(3px,-3px)}

/* ───────── Hero: backdrop → name → figure, pinned while the page slides over it */
.hero{--hh:clamp(650px,100svh,1200px);--px:0;--py:0;--cover:0;--dim:0;position:relative;z-index:0;height:var(--hh);overflow:hidden;isolation:isolate;background:var(--studio-b);color:var(--hero-white)}
@media(min-height:650px){.hero{position:sticky;top:0}}
.hero.is-covered{visibility:hidden}
.hero-bar{position:absolute;inset:0 0 auto;z-index:6;display:flex;justify-content:space-between;align-items:center;gap:24px;padding:30px var(--gutter);color:var(--hero-ink)}
.wordmark{font-size:14px;font-weight:650;letter-spacing:-.025em}
.hero-bar nav{display:flex;gap:28px;font-size:13px}
.hero-bar nav a{position:relative;padding:12px 0}
.hero-bar nav a::after{content:'';position:absolute;bottom:6px;left:0;width:100%;height:1px;background:currentColor;transform:scaleX(0);transform-origin:left;transition:transform .35s var(--ease)}
.hero-bar nav a:hover::after{transform:scaleX(1)}
.hero a:focus-visible,.hero button:focus-visible{outline-color:#fff}

.stage{position:absolute;inset:0;z-index:0}
.stage-light{position:absolute;inset:-4%;z-index:0;translate:calc(var(--px) * -18px) calc(var(--py) * -10px);
  background:
    linear-gradient(transparent 46%,rgb(24 22 20 / .42)),
    radial-gradient(58% 62% at 50% 34%,rgb(255 240 222 / .34),transparent 72%),
    linear-gradient(110deg,var(--studio-a),var(--studio-b) 55%,var(--studio-c))}
.name-window{position:absolute;left:50%;width:100vw;margin-left:-50vw;top:calc(var(--hh) * .89 - 15.855vw);overflow:hidden;pointer-events:none}
.name-track{display:flex;width:max-content;font-size:15.1vw;font-weight:400;line-height:1.05;letter-spacing:-.04em;animation:name-travel 34s linear infinite paused}
.name-track span{display:block;width:100vw;padding:0 3.6vw;white-space:nowrap}
.name-back{z-index:1;translate:calc(var(--px) * -10px) calc(var(--py) * -5px + var(--cover) * -120px)}
.figure-box{position:absolute;z-index:2;top:0;left:50%;height:calc(var(--hh) * 1.25);aspect-ratio:1086/1448;translate:-50% 0}
.figure{display:block;width:100%;height:100%;filter:drop-shadow(22px 28px 36px rgb(28 20 14 / .42))}
/* The same name, outlined, clipped to the figure's own alpha so it shows only where he covers it. */
.figure-ghost{position:absolute;inset:0;-webkit-mask:url('assets/ali-cutout.webp') center/100% 100% no-repeat;mask:url('assets/ali-cutout.webp') center/100% 100% no-repeat}
/* The figure never moves; the outlined name tracks the name behind him exactly. */
.name-front{translate:calc(var(--px) * -10px) calc(var(--py) * -5px + var(--cover) * -120px)}
.name-front .name-track{color:transparent;-webkit-text-stroke:1.5px rgb(249 246 240 / .5)}
.stage-shade{position:absolute;inset:0;z-index:5;background:#120f0c;opacity:calc(var(--dim) * .6);pointer-events:none}
.motion-on:not(.name-idle) .name-track{animation-play-state:running}
@keyframes name-travel{to{transform:translateX(-50%)}}

.hero-location,.hero-role,.hero-bottom{z-index:6;opacity:calc(1 - var(--dim) * 1.6)}
.hero-location{position:absolute;left:var(--gutter);top:42%;font-size:14px;line-height:1.6;color:var(--hero-ink)}
.hero-role{position:absolute;right:var(--gutter);top:40%;font-size:clamp(21px,2.1vw,34px);line-height:1.35;letter-spacing:-.025em;color:var(--hero-ink)}
.hero-bottom{position:absolute;left:var(--gutter);right:var(--gutter);bottom:34px;display:flex;justify-content:space-between;align-items:center;font-size:13px}
.hero-bottom a{display:inline-flex;align-items:center;gap:20px;padding:8px 0;border-bottom:1px solid rgb(249 246 240 / .42)}
.hero-bottom .icon{width:20px;height:20px;transition:transform .3s var(--ease)}
.hero-bottom a:hover .icon{transform:translateY(4px)}
#motion-toggle{padding:8px 0;border:0;border-bottom:1px solid rgb(249 246 240 / .42);background:none;font-size:12px;cursor:pointer}

/* ───────── Floating section navigation */
.dock{position:fixed;z-index:50;top:16px;left:50%;display:flex;align-items:center;gap:2px;padding:5px;border-radius:999px;background:rgb(250 248 244 / .8);-webkit-backdrop-filter:blur(16px) saturate(1.5);backdrop-filter:blur(16px) saturate(1.5);border:1px solid rgb(34 38 34 / .09);box-shadow:0 1px 2px rgb(30 24 18 / .08),0 14px 34px -14px rgb(30 24 18 / .4);font-size:13px;transform:translate(-50%,-140%);visibility:hidden;transition:transform .55s var(--ease),visibility 0s .55s}
.past-hero .dock{transform:translate(-50%,0);visibility:visible;transition:transform .55s var(--ease),visibility 0s}
.dock a{padding:8px 15px;border-radius:999px;line-height:1.3;transition:background .25s,color .25s}
.dock a:hover{background:rgb(34 38 34 / .07)}
.dock a.is-active{background:var(--ink);color:var(--paper)}
.dock-home{font-weight:700;letter-spacing:-.03em}
.dock a:focus-visible{outline-offset:2px;border-radius:999px}

/* ───────── Sheets */
.opening{position:relative;z-index:1}
.sheet{position:relative;z-index:1}
.sheet>section{position:relative}
.section-head{display:grid;grid-template-columns:1.25fr 1fr;gap:8%;align-items:end;margin-bottom:clamp(40px,5vw,72px)}
.section-head h2{font-size:clamp(38px,4.4vw,68px)}
.section-head p{font-size:15px;line-height:1.8;color:var(--muted);max-width:46ch}
.section-head .text-link{margin-top:22px}

.about{background:var(--paper);border-radius:var(--sheet-r) var(--sheet-r) 0 0;box-shadow:var(--shadow-sheet);padding-top:clamp(64px,8vw,120px);padding-bottom:clamp(56px,7vw,104px);display:grid;grid-template-columns:1fr 1.15fr;gap:8%;align-items:start}
.about h2{font-size:clamp(34px,3.9vw,60px)}
.about-photo{position:relative;width:min(100%,330px);margin-top:clamp(36px,4vw,60px)}
.about-photo::before{content:'';position:absolute;inset:0;translate:18px 18px;border-radius:16px;background:var(--accent)}
.about-photo img{position:relative;display:block;width:100%;height:auto;border-radius:16px;box-shadow:0 2px 4px rgb(44 34 24 / .1),0 28px 50px -24px rgb(44 34 24 / .5)}
.about-body p{font-size:16px;line-height:1.8;color:var(--muted);max-width:60ch}
.about-body p+p{margin-top:18px}
.about-body .lede{font-size:clamp(22px,2.1vw,30px);line-height:1.35;letter-spacing:-.03em;color:var(--ink);max-width:26ch;margin-bottom:26px}
.facts{margin-top:44px;border-top:1px solid var(--ink)}
.facts>div{display:grid;grid-template-columns:132px 1fr;gap:20px;padding:16px 0;border-bottom:1px solid var(--line)}
.facts dt{font-size:13px;color:var(--muted);padding-top:2px}
.facts dd{font-size:15px;line-height:1.6}

/* ───────── Work: stacking case plates */
.work{background:var(--paper);padding-top:clamp(30px,4vw,60px);padding-bottom:calc(clamp(64px,8vw,120px) + var(--sheet-r))}
.cases{display:grid;gap:26px}
.case{position:sticky;top:var(--stick,auto);display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);gap:clamp(28px,4.2vw,68px);align-items:stretch;padding:clamp(22px,3.2vw,50px);background:var(--raised);border:1px solid rgb(34 38 34 / .08);border-radius:clamp(20px,2.2vw,30px);box-shadow:var(--shadow-card)}
.case-copy{display:flex;flex-direction:column;min-width:0}
.case h3{font-size:clamp(28px,3vw,46px)}
.case-meta{font-size:13px;color:var(--muted);margin-top:14px}
.case-lead{font-size:clamp(16px,1.3vw,19px);line-height:1.6;letter-spacing:-.012em;margin-top:22px;max-width:44ch}
.case-facts{margin-top:26px;border-top:1px solid var(--line)}
.case-facts>div{display:grid;grid-template-columns:118px 1fr;gap:18px;padding:14px 0;border-bottom:1px solid var(--line)}
.case-facts dt{font-size:13px;font-weight:650;padding-top:1px}
.case-facts dd{font-size:14px;line-height:1.7;color:var(--muted)}
.tech{font-size:12px;color:var(--muted);margin-top:auto;padding-top:22px;line-height:1.8}
.case-figure{display:flex;flex-direction:column;justify-content:center;gap:22px;min-width:0;padding:clamp(18px,2.4vw,36px);background:var(--well);border-radius:clamp(14px,1.6vw,20px);box-shadow:inset 0 1px 3px rgb(44 34 24 / .14)}
.case-figure figcaption{font-size:13px;line-height:1.65;color:var(--muted)}
.case-figure figcaption strong{color:var(--ink)}

.screens{position:relative;aspect-ratio:1.18}
.screen{position:absolute;display:block;border-radius:10px;overflow:hidden;cursor:zoom-in;background:var(--night);box-shadow:0 2px 4px rgb(30 22 14 / .16),0 26px 44px -20px rgb(30 22 14 / .55);transition:transform .5s var(--ease),box-shadow .5s var(--ease)}
.screen img{display:block;width:100%;height:auto}
.screen-back{top:0;left:0;width:84%}
.screen-front{right:0;bottom:0;width:64%}
.screen:hover{transform:translateY(-6px);box-shadow:0 4px 8px rgb(30 22 14 / .16),0 36px 56px -22px rgb(30 22 14 / .6)}
.screen:focus-visible{outline-offset:3px}

.fig-title{font-size:16px!important;font-weight:650;letter-spacing:-.015em;color:var(--ink)!important}
.fig-title span{display:block;font-size:13px;font-weight:400;letter-spacing:0;color:var(--muted)}
.bars{display:grid;gap:16px}
.bars li{display:grid;grid-template-columns:1fr 2.4em;gap:6px 12px;align-items:center;font-size:14px}
.bar-label{grid-column:1/-1;color:var(--muted)}
.bar-track{display:block}
.bar{display:block;height:16px;width:calc(var(--v) / 34 * 100%);border-radius:3px;background:#b5ab9b}
.bar-value{font-weight:700;font-variant-numeric:tabular-nums;text-align:right}
.is-lead .bar{background:var(--ink)}
.is-lead .bar-label{color:var(--ink);font-weight:650}
.planted{display:grid;grid-template-columns:auto 1fr;gap:18px;align-items:center;padding-top:22px;border-top:1px solid #d3ccbd}
.planted p{font-size:14px;line-height:1.6;color:var(--muted)}
.planted strong{color:var(--ink)}
.dots{display:grid;grid-template-columns:repeat(5,13px);gap:5px}
.dots i{width:13px;height:13px;border-radius:50%;background:var(--ink)}
.dots i.off{background:none;box-shadow:inset 0 0 0 1.5px #a59b8a}

.diagram{display:grid;justify-items:stretch;max-width:420px;width:100%;margin-inline:auto}
.node{padding:13px 18px;border-radius:var(--radius-2lg,10px);background:var(--raised);border:1px solid #d9d2c3;box-shadow:var(--shadow-plate);font-size:15px;font-weight:650;letter-spacing:-.015em;line-height:1.35}
.node small{display:block;font-size:12px;font-weight:400;letter-spacing:0;color:var(--muted);margin-top:2px}
.node.is-gate{background:var(--sand);border-color:#d2bb9f}
.node.is-gate small{color:#5a4d3c}
.node.is-box{background:var(--night);border-color:var(--night);color:var(--field-text);padding:18px;box-shadow:0 2px 4px rgb(20 16 12 / .2),0 22px 40px -18px rgb(20 16 12 / .6)}
.node.is-box small{color:var(--field-muted)}
.node.is-aside{background:none;border:1.5px dashed #a59b8a;box-shadow:none;color:var(--muted)}
.link{display:block;width:24px;height:34px;margin:3px auto;fill:none;stroke:#8b8272;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.desk{grid-template-columns:1fr auto;column-gap:18px;max-width:470px}
.desk>*{grid-column:1}
.desk .is-aside{grid-column:2;grid-row:1/4;align-self:center;max-width:132px}
.mini-windows{display:flex;gap:8px;margin-top:14px}
.mini-windows span{flex:1;height:34px;border-radius:5px;background:#2c322d;border-top:7px solid #3d453e}
.steps{display:grid;gap:6px;margin-top:14px;counter-reset:step}
.steps li{counter-increment:step;display:flex;gap:12px;align-items:baseline;padding:8px 12px;border-radius:7px;background:#2a2f2a;font-size:14px;font-weight:500}
.steps li::before{content:counter(step);font-size:12px;font-variant-numeric:tabular-nums;color:var(--sand)}

/* ───────── Ledger: everything else, in the open */
.ledger{margin-top:clamp(70px,8vw,120px);display:grid;gap:clamp(56px,6vw,90px)}
.ledger-group{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,3fr);column-gap:6%;align-items:start}
.ledger-group>h3{font-size:clamp(24px,2.3vw,34px);grid-column:1}
.ledger-note{grid-column:1;font-size:13px;color:var(--muted);margin-top:10px}
.ledger-group>ul{grid-column:2;grid-row:1/4;border-top:1px solid var(--ink)}
.ledger li{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2.1fr);gap:6px 5%;padding:22px 0;border-bottom:1px solid var(--line)}
.ledger h4{font-size:18px;font-weight:600;letter-spacing:-.02em;line-height:1.35;grid-row:1/3}
.ledger li p{font-size:14.5px;line-height:1.7;color:var(--muted);max-width:66ch}
.ledger h4 a{display:inline-flex;align-items:baseline;gap:8px;background:linear-gradient(currentColor,currentColor) 0 100%/0 1px no-repeat;transition:background-size .4s var(--ease)}
.ledger h4 a:hover{background-size:100% 1px}
.ledger h4 .icon{width:.8em;height:.8em;color:var(--muted);transition:transform .35s var(--ease)}
.ledger h4 a:hover .icon{transform:translate(2px,-2px)}
.ledger-note .text-link{margin-top:16px;gap:18px}
.scope{grid-column:2;font-size:12px;color:var(--ink);display:flex;align-items:baseline;gap:9px}
.scope::before{content:'';width:14px;height:1px;background:currentColor;flex-shrink:0;translate:0 -4px}

/* ───────── Research field */
.research{background:var(--field);color:var(--field-text);margin-top:calc(var(--sheet-r) * -1);border-radius:var(--sheet-r) var(--sheet-r) 0 0;box-shadow:0 -24px 60px -30px rgb(18 13 8 / .55);padding-top:clamp(70px,8vw,120px);padding-bottom:calc(clamp(60px,7vw,100px) + var(--sheet-r))}
.research a:focus-visible{outline-color:var(--sand)}
.research ::selection{background:var(--sand);color:var(--night)}
.on-dark p{color:var(--field-muted)}
.thesis{display:grid;grid-template-columns:1fr 1.25fr;gap:7%;align-items:start;padding:clamp(24px,3vw,44px);border-radius:clamp(18px,2vw,26px);background:var(--field-raised);border:1px solid rgb(255 255 255 / .06);box-shadow:0 1px 0 rgb(255 255 255 / .05) inset,0 40px 70px -40px rgb(0 0 0 / .8)}
.thesis h3{font-size:clamp(22px,2.2vw,32px);line-height:1.2;letter-spacing:-.03em}
.thesis p{font-size:15px;line-height:1.8;color:var(--field-body)}
.studies{display:grid;gap:clamp(64px,8vw,120px);margin-top:clamp(64px,8vw,120px)}
.study{display:grid;grid-template-columns:1.25fr 1fr;gap:6%;align-items:center}
.study.is-flipped figure{order:2}
.study figure img{display:block;width:100%;height:auto;border-radius:clamp(14px,1.6vw,22px);border:1px solid rgb(255 255 255 / .07);box-shadow:0 2px 6px rgb(0 0 0 / .3),0 50px 80px -44px rgb(0 0 0 / .9)}
.study figcaption{font-size:12px;color:var(--field-muted);margin-top:14px}
.study h3{font-size:clamp(28px,3vw,44px);line-height:1.15}
.study-copy>p{font-size:16px;line-height:1.8;color:var(--field-body);margin-top:22px}
.study-facts{margin-top:26px;border-top:1px solid var(--field-line)}
.study-facts>div{display:grid;grid-template-columns:92px 1fr;gap:18px;padding:14px 0;border-bottom:1px solid var(--field-line)}
.study-facts dt{font-size:13px;color:var(--sand);padding-top:1px}
.study-facts dd{font-size:14px;line-height:1.7;color:var(--field-muted)}
.study-facts strong{color:var(--field-text);font-size:1.12em}
@supports (animation-timeline:view()){
  .motion-on .study figure{animation:plate-rise linear both;animation-timeline:view();animation-range:entry 0% cover 42%}
  @keyframes plate-rise{from{transform:translateY(56px) scale(.972)}to{transform:none}}
}

.pubs{margin-top:clamp(70px,8vw,120px)}
.pubs-head{display:flex;justify-content:space-between;align-items:end;gap:24px;margin-bottom:8px}
.pubs-head h3{font-size:clamp(28px,3vw,44px)}
.pubs h4{font-size:13px;font-weight:650;color:var(--sand);margin:40px 0 12px}
.papers li{display:grid;grid-template-columns:64px minmax(0,1fr) auto;gap:24px;align-items:baseline;padding:20px 0;border-top:1px solid var(--field-line)}
.papers li:last-child{border-bottom:1px solid var(--field-line)}
.year{font-size:13px;color:var(--field-muted);font-variant-numeric:tabular-nums}
.paper-title{font-size:17px;font-weight:450;line-height:1.45;letter-spacing:-.02em;max-width:68ch}
.paper-title a{background:linear-gradient(currentColor,currentColor) 0 100%/0 1px no-repeat;transition:background-size .4s var(--ease),color .25s}
.paper-title a:hover{background-size:100% 1px;color:var(--sand)}
.paper-by{font-size:13px;color:var(--field-muted);margin-top:7px}
.status{font-size:12px;color:var(--field-muted);white-space:nowrap;display:inline-flex;gap:8px;align-items:center}
.service{font-size:14px;color:var(--field-muted);margin-top:34px}

/* ───────── Experience sheet */
.experience{background:var(--paper);margin-top:calc(var(--sheet-r) * -1);border-radius:var(--sheet-r) var(--sheet-r) 0 0;box-shadow:0 -24px 60px -24px rgb(0 0 0 / .7);padding-top:clamp(70px,8vw,120px);padding-bottom:clamp(64px,7vw,110px)}
.timeline{border-top:1px solid var(--ink)}
.timeline>li{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2.6fr);gap:6%;padding:38px 0 42px;border-bottom:1px solid var(--line)}
.when{display:grid;gap:4px;align-content:start;font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums}
.when span:first-child{color:var(--ink);font-weight:600}
.what h3{font-size:clamp(25px,2.4vw,36px)}
.role{font-size:14px;margin:10px 0 18px}
.what ul{display:grid;gap:9px;max-width:70ch}
.what ul li{position:relative;padding-left:24px;font-size:15px;line-height:1.7;color:var(--muted)}
.what ul li::before{content:'';position:absolute;left:0;top:.82em;width:12px;height:1px;background:var(--ink)}
.what small{display:block;font-size:12px;color:var(--muted);margin-top:14px}
.record{display:grid;grid-template-columns:1fr 1fr;gap:clamp(48px,5vw,76px) 8%;margin-top:clamp(64px,7vw,104px)}
.record-block>h3{font-size:clamp(24px,2.3vw,34px);padding-bottom:20px;border-bottom:1px solid var(--ink)}
.degrees li{padding:20px 0;border-bottom:1px solid var(--line)}
.degrees h4{font-size:17px;font-weight:600;letter-spacing:-.02em;line-height:1.4}
.where{font-size:13px;color:var(--muted);margin-top:3px}
.degrees li p:last-child{font-size:14.5px;line-height:1.7;color:var(--muted);margin-top:10px;max-width:62ch}
.tools>div{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,3fr);gap:6%;padding:16px 0;border-bottom:1px solid var(--line)}
.tools dt{font-size:15px;font-weight:600}
.tools dd{font-size:14.5px;line-height:1.7;color:var(--muted)}
.anchor-end{position:absolute;bottom:0;height:1px;width:1px}
/* The sheet's lower corners are drawn in the floor's colour, so the floor seems to sit beneath it. */
.experience::after{content:'';position:absolute;inset:auto 0 0;height:var(--sheet-r);pointer-events:none;background:
  radial-gradient(circle at 100% 0,transparent calc(var(--sheet-r) - .7px),var(--night) var(--sheet-r)) left bottom/var(--sheet-r) var(--sheet-r) no-repeat,
  radial-gradient(circle at 0 0,transparent calc(var(--sheet-r) - .7px),var(--night) var(--sheet-r)) right bottom/var(--sheet-r) var(--sheet-r) no-repeat}

/* ───────── Floor: contact, revealed from underneath */
.floor{position:relative;z-index:0;background:var(--night);color:var(--field-text)}
@media(min-height:700px){.floor{position:sticky;bottom:0}}
.floor a:focus-visible,.floor button:focus-visible{outline-color:var(--sand)}
.floor ::selection{background:var(--sand);color:var(--night)}
.floor-inner{padding-top:clamp(64px,8vw,120px);padding-bottom:26px}
.floor-lede{font-size:15px;line-height:1.7;color:var(--field-muted)}
.floor-title{display:flex;align-items:center;justify-content:space-between;gap:40px;margin:26px 0 30px}
.floor-title h2{font-size:clamp(60px,9vw,150px);line-height:1;letter-spacing:-.045em}
.floor-title .icon{width:clamp(54px,7vw,116px);height:clamp(54px,7vw,116px);stroke-width:1;transition:transform .6s var(--ease)}
.floor-title:hover .icon{transform:translate(12px,-12px)}
.floor-actions{display:flex;gap:20px;align-items:center;flex-wrap:wrap}
.email{font-size:clamp(18px,2vw,28px);letter-spacing:-.03em;border-bottom:1px solid var(--field-line);padding-bottom:4px;transition:border-color .25s}
.email:hover{border-color:var(--sand)}
#copy-email{border:0;background:none;border-bottom:1px solid var(--field-line);color:var(--field-muted);padding:8px 0;cursor:pointer;font-size:12px}
#copy-status{font-size:12px;color:var(--field-muted)}
.floor-links{display:flex;justify-content:space-between;align-items:center;gap:32px;margin-top:clamp(44px,5vw,72px)}
.pill-link{display:inline-flex;align-items:center;gap:40px;border:1px solid var(--field-line);border-radius:40px;padding:16px 24px;font-size:13px;transition:background .3s,color .3s,border-color .3s}
.pill-link:hover{background:var(--sand);border-color:var(--sand);color:var(--night)}
.socials{display:flex;gap:30px;font-size:13px}
.socials a{display:inline-flex;gap:8px;align-items:center;padding:8px 0}
.socials .icon{transition:transform .35s var(--ease)}
.socials a:hover .icon{transform:translate(3px,-3px)}
.floor-base{display:flex;justify-content:space-between;gap:20px;margin-top:clamp(40px,5vw,64px);padding-top:22px;border-top:1px solid var(--field-line);font-size:12px;color:var(--field-muted)}
.floor-base a{display:inline-flex;gap:8px;align-items:center}

/* ───────── Tablet */
@media(max-width:1100px){
  .name-window{top:calc(var(--hh) * .87 - 15.855vw)}
  .figure-box{height:calc(var(--hh) * 1.15)}
  .hero-location{top:34%;font-size:12px}
  .hero-role{top:34%;font-size:23px}
  .case{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .case-facts>div{grid-template-columns:1fr;gap:4px}
  .ledger-group{grid-template-columns:1fr}
  .ledger-group>ul{grid-column:1;grid-row:auto;margin-top:26px}
}
@media(max-width:900px){
  .case{grid-template-columns:1fr;position:static}
  .study,.thesis{grid-template-columns:1fr;gap:28px}
  .study.is-flipped figure{order:0}
  .record{grid-template-columns:1fr}
  .section-head{grid-template-columns:1fr;gap:22px;align-items:start}
}

/* ───────── Phone: the name moves in front, where the figure fills the frame */
@media(max-width:700px){
  html{scroll-padding-top:76px}
  .hero{--hh:clamp(700px,100svh,950px)}
  .hero-bar{padding-top:20px;padding-bottom:14px;gap:10px;flex-wrap:wrap;color:var(--hero-white)}
  .hero-bar nav{font-size:12px;gap:20px;width:100%;justify-content:space-between}
  .hero-bar nav a{padding:10px 0}
  .stage::before{content:'';position:absolute;inset:0 0 auto;height:230px;z-index:3;background:linear-gradient(rgb(24 22 20 / .5),rgb(24 22 20 / .25) 170px,transparent);pointer-events:none}
  .stage::after{content:'';position:absolute;inset:42% 0 0;z-index:3;background:linear-gradient(transparent,rgb(20 17 14 / .72));pointer-events:none}
  .figure-box{top:70px;height:calc(var(--hh) * .98)}
  .figure{filter:none}
  .figure-ghost{display:none}
  .name-window{top:calc(var(--hh) - 130px - 14.91vw)}
  .name-back{z-index:4;translate:0 calc(var(--cover) * -70px)}
  .name-track{font-size:14.2vw}
  .name-track span{padding:0 var(--gutter)}
  .hero-location{top:118px;font-size:12px;line-height:1.5;color:var(--hero-white)}
  .hero-role{top:auto;right:auto;left:var(--gutter);bottom:235px;font-size:22px;line-height:1.4;color:#fff}
  .hero-bottom{display:grid;grid-template-columns:1fr auto;gap:8px 20px;bottom:20px;font-size:12px}
  .hero-bottom a{gap:12px}
  #motion-toggle{grid-column:1/-1;grid-row:2;justify-self:center;padding:3px 0}
  .dock{top:10px;font-size:12px;padding:4px}
  .dock a{padding:8px 10px}
  .about{grid-template-columns:1fr;gap:36px}
  .about-photo{width:min(72%,280px)}
  .facts>div{grid-template-columns:92px 1fr;gap:14px}
  .case{padding:16px 16px 24px;border-radius:20px}
  .case-copy{padding:0 6px}
  .ledger li{grid-template-columns:1fr;gap:8px}
  .ledger h4{grid-row:auto}
  .scope{grid-column:1}
  .study-facts>div{grid-template-columns:1fr;gap:4px}
  .papers li{grid-template-columns:44px minmax(0,1fr);gap:8px 14px}
  .status{grid-column:2}
  .paper-title{font-size:16px}
  .timeline>li{grid-template-columns:1fr;gap:18px;padding:30px 0 34px}
  .when{grid-auto-flow:column;justify-content:space-between}
  .tools>div{grid-template-columns:1fr;gap:4px}
  .floor-links{flex-direction:column;align-items:flex-start;gap:28px}
  .socials{gap:24px}
  .floor-base{flex-wrap:wrap}
  .floor-base span:nth-child(2){display:none}
  .desk{grid-template-columns:1fr}
  .desk .is-aside{grid-column:1;grid-row:auto;max-width:none;margin-top:14px}
}

@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation:none!important;transition:none!important}
}
@media print{
  .dock,.stage,.hero-bottom,.hero-bar nav,.hero-location{display:none}
  body{background:#fff}
  .hero{position:static;height:auto;background:none;color:#222;padding:20px var(--gutter)}
  .hero .sr-only{position:static;width:auto;height:auto;margin:0;clip-path:none;font-size:32pt}
  .hero-role,.hero-bar{position:static;color:#222;padding:0}
  .case,.floor{position:static;box-shadow:none}
  .research,.floor{background:#fff;color:#222}
  .research *,.floor *{color:#222!important}
  .about,.research,.experience{box-shadow:none;border-radius:0;margin-top:0}
  .case,.timeline>li,.papers li{break-inside:avoid}
}

/* ───────── Research diagrams (inline SVG; numbered pins are HTML so they stay legible at any size) */
.figure-dg{position:relative;border-radius:clamp(14px,1.6vw,22px);background:var(--field-raised);border:1px solid rgb(255 255 255 / .07);box-shadow:0 2px 6px rgb(0 0 0 / .3),0 50px 80px -44px rgb(0 0 0 / .9);overflow:hidden}
.dg{display:block;width:100%;height:auto}
.dg .plate{fill:#2c3731;stroke:rgb(255 255 255 / .09)}
.dg .el{fill:#4a5f54}
.dg .el0{fill:var(--sand)}.dg .el1{fill:#aebfae}.dg .el2{fill:#6f8a7b}.dg .el3{fill:#3f5148}
.dg .space path{fill:rgb(255 255 255 / .025);stroke:#8fa598;stroke-width:1.4}
.dg .space .grid{fill:none;stroke:#55675d;stroke-width:1.1;stroke-dasharray:4 5}
.dg .cube path{fill:var(--sand);stroke:none}
.dg .cube .cube-side{fill:#b79f82}
.dg .sphere circle{fill:#aebfae}
.dg .sphere .shine{fill:none;stroke:#eef1e8;stroke-width:2.2;stroke-linecap:round}
.dg .antenna path{fill:none;stroke:#dfe5dc;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.dg .antenna circle{fill:#dfe5dc}
.dg .antenna .waves{stroke:#8fa598;stroke-width:1.5}
.dg .flow{fill:none;stroke:var(--sand);stroke-width:2.6;stroke-linecap:round;stroke-dasharray:9 9}
.dg .nuis{fill:none;stroke:#7f9388;stroke-width:1.5;stroke-linecap:round;stroke-dasharray:3 7}
.dg .nuis.solid{stroke-dasharray:none}
.dg .snap{fill:#3c4a42}
.dg .snap:nth-child(-n+4){fill:var(--sand)}
.dg .road{fill:#20272300;stroke:none}
.dg-control .road,.dg-receiver .road{fill:#212823}
.dg .lane{fill:none;stroke:#3b4741;stroke-width:2;stroke-dasharray:22 20}
.dg .car rect{fill:#2d3832;stroke:#9fb3a6;stroke-width:1.6}
.dg .car .cabin{fill:none;stroke:#6f8478;stroke-width:1.3}
.dg .car.ego rect{fill:#dfe5dc;stroke:#dfe5dc}
.dg .car.ego .cabin{stroke:#6c7a71}
.dg .car.target rect{stroke:var(--sand);stroke-width:2}
.dg .car.target .cabin{stroke:#b79f82}
.dg .car.intf rect{fill:none;stroke:#7f9388;stroke-dasharray:5 5}
.dg .car.adv rect{stroke:#dfe5dc}
.dg .rx{fill:var(--field);stroke:none}
.dg .mount{stroke:#8fa598;stroke-width:1.6;fill:none}
.dg .load{fill:#2c3731;stroke:var(--sand);stroke-width:1.6}
.dg .dot{fill:var(--sand)}
.dg .couple{fill:none;stroke:var(--sand);stroke-width:1.5;stroke-linecap:round;opacity:.75}
.dg .feed{stroke:#8fa598;stroke-width:1.4;fill:none}
.dg .lobe{fill:rgb(228 207 181 / .16);stroke:rgb(228 207 181 / .5);stroke-width:1.2}
.dg .lobe-side{fill:rgb(228 207 181 / .06);stroke:rgb(228 207 181 / .25)}
.dg .sector{fill:rgb(174 191 174 / .09);stroke:rgb(174 191 174 / .3);stroke-width:1.2}
.dg .sweep path{fill:rgb(238 241 232 / .16)}
.dg .ring{fill:none;stroke:var(--sand);stroke-width:1.5;stroke-dasharray:2 7;stroke-linecap:round}
.dg .radar{fill:var(--sand)}
.dg .panel rect{fill:var(--sand);stroke:none}
.dg .panel path{fill:none;stroke:#2c3731;stroke-width:1.2}
.dg .ghost rect,.dg .ghost path{fill:none;stroke:var(--sand);stroke-width:1.8;stroke-dasharray:6 5}
.dg .ghost .vel{stroke-dasharray:none;stroke-width:2}
.pin{position:absolute;display:grid;place-items:center;width:24px;height:24px;margin:-12px 0 0 -12px;border-radius:50%;background:var(--field-text);color:var(--field);font-size:12px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums;box-shadow:0 2px 6px rgb(0 0 0 / .45)}
.legend{display:grid;grid-template-columns:1fr 1fr;gap:9px 26px;margin-top:18px;counter-reset:pin}
.legend li{counter-increment:pin;display:grid;grid-template-columns:22px 1fr;gap:10px;align-items:start;font-size:13px;line-height:1.55;color:var(--field-muted)}
.legend li::before{content:counter(pin);display:grid;place-items:center;width:20px;height:20px;border-radius:50%;border:1px solid var(--field-line);font-size:11px;font-weight:700;color:var(--field-text);font-variant-numeric:tabular-nums}
.motion-on .dg .flow{animation:dg-flow 1.4s linear infinite}
.motion-on .dg .el{animation:dg-state 8s steps(1) infinite}
.motion-on .dg .el1{animation-delay:-2s}.motion-on .dg .el2{animation-delay:-4s}.motion-on .dg .el3{animation-delay:-6s}
.motion-on .dg .snap{animation:dg-snap 20s steps(1) infinite;animation-delay:calc(var(--k) * 2s - 20s)}
.motion-on .dg .couple{animation:dg-couple 2.4s ease-in-out infinite;animation-delay:calc(var(--k) * -.4s)}
.motion-on .dg .sweep{animation:dg-sweep 7s ease-in-out infinite alternate}
.motion-on .dg .ghost{animation:dg-ghost 3.5s ease-in-out infinite}
@keyframes dg-flow{to{stroke-dashoffset:-18}}
@keyframes dg-state{0%{fill:var(--sand)}25%{fill:#aebfae}50%{fill:#6f8a7b}75%{fill:#3f5148}}
@keyframes dg-snap{0%{fill:var(--sand)}10%{fill:#e9dcc8}20%,100%{fill:#3c4a42}}
@keyframes dg-couple{0%,100%{opacity:.25}50%{opacity:1}}
@keyframes dg-sweep{from{transform:rotate(-52deg)}to{transform:rotate(52deg)}}
@keyframes dg-ghost{0%,100%{opacity:.55}50%{opacity:1}}

/* Unit strips: one mark per counted thing */
.units{display:flex;flex-wrap:wrap;gap:3px;margin-top:14px}
.units i{width:7px;height:16px;border-radius:2px;background:var(--sand)}
.units i.off{background:none;box-shadow:inset 0 0 0 1.2px var(--field-muted)}
.units.waffle{display:grid;grid-template-columns:repeat(20,9px);gap:3px}
.units.waffle i{width:9px;height:9px}
.unit-note{font-size:13px;line-height:1.6;color:var(--field-muted);margin-top:12px;max-width:52ch}
@media(max-width:700px){.legend{grid-template-columns:1fr}.pin{width:20px;height:20px;margin:-10px 0 0 -10px;font-size:11px}}

/* ───────── Second pass: plain-voice copy, teaching, research summary */
.about h2{font-size:clamp(38px,4.4vw,68px)}
.about-body .lede{max-width:30ch}
.study figure.figure-dg{margin:0}
.study h3{font-size:clamp(26px,2.7vw,40px)}
.study-copy>p{margin-top:20px}
.study-copy .study-result{font-size:15px;color:var(--field-text);padding:14px 0;border-top:1px solid var(--field-line);border-bottom:1px solid var(--field-line)}
.study-copy .text-link{margin-top:22px}
.section-head.on-dark .text-link{margin-top:22px}
.pubs-brief{display:flex;justify-content:space-between;align-items:center;gap:32px;flex-wrap:wrap;margin-top:clamp(64px,8vw,110px);padding-top:26px;border-top:1px solid var(--field-line)}
.pubs-brief p{font-size:15px;line-height:1.7;color:var(--field-body);max-width:58ch}
.pubs-links{display:flex;gap:34px;flex-wrap:wrap}
.teaching{margin-top:clamp(64px,7vw,104px)}
.teaching-head{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2.6fr);gap:6%;padding-bottom:30px;border-bottom:1px solid var(--ink)}
.teaching-head h3{font-size:clamp(28px,3vw,44px)}
.teaching-head p{font-size:16px;line-height:1.8;color:var(--muted);max-width:70ch}
.courses li{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2.6fr);gap:6px 6%;padding:30px 0 34px;border-bottom:1px solid var(--line)}
.courses h4{font-size:clamp(20px,1.9vw,26px);font-weight:500;letter-spacing:-.025em;line-height:1.25;grid-column:1}
.courses .where{grid-column:1;margin-top:2px}
.courses li>p:not(.where){grid-column:2;font-size:15px;line-height:1.75;color:var(--muted);max-width:70ch}
.courses li>p:nth-of-type(2){grid-row:1/3}
.courses li>p:nth-of-type(3){margin-top:12px}
@media(max-width:700px){
  .teaching-head,.courses li{grid-template-columns:1fr;gap:10px}
  .courses li>p:not(.where),.courses h4,.courses .where{grid-column:1}
  .courses li>p:nth-of-type(2){grid-row:auto;margin-top:8px}
  .hero-bar nav{gap:14px}
  .dock a{padding:8px 8px}
}

/* ───────── Research page */
.page-research{background:var(--night)}
.topbar{position:absolute;inset:0 0 auto;z-index:6;display:flex;justify-content:space-between;align-items:center;gap:24px;padding:30px var(--gutter);color:var(--field-text)}
.topbar nav{display:flex;gap:28px;font-size:13px;align-items:center}
.topbar a:focus-visible,.topbar button:focus-visible{outline-color:var(--sand)}
.topbar #motion-toggle{border-bottom:1px solid var(--field-line);color:var(--field-muted)}
.paper-sheet{background:var(--field);color:var(--field-text);border-radius:0 0 var(--sheet-r) var(--sheet-r);box-shadow:0 34px 70px -24px rgb(0 0 0 / .8)}
.paper-sheet a:focus-visible{outline-color:var(--sand)}
.paper-sheet ::selection{background:var(--sand);color:var(--night)}
.sub-head{padding-top:clamp(130px,15vw,210px);padding-bottom:clamp(50px,6vw,90px);display:grid;grid-template-columns:1.1fr 1fr;gap:8%;align-items:end}
.sub-head h1{font-size:clamp(52px,8vw,128px);font-weight:400;line-height:1;letter-spacing:-.045em;margin:0}
.sub-head p{font-size:16px;line-height:1.8;color:var(--field-body);max-width:56ch}
.sub-head p+p{margin-top:16px;color:var(--field-muted)}
.sub-head .back{display:inline-flex;gap:10px;align-items:center;font-size:13px;color:var(--field-muted);margin-bottom:26px}
.sub-head .back .icon{transform:rotate(180deg)}
.thesis-line{padding:26px 0;border-top:1px solid var(--field-line);border-bottom:1px solid var(--field-line);display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2.6fr);gap:6%}
.thesis-line dt{font-size:13px;color:var(--sand)}
.thesis-line dd{font-size:clamp(18px,1.7vw,24px);line-height:1.45;letter-spacing:-.02em}
.thesis-line dd small{display:block;font-size:14px;letter-spacing:0;color:var(--field-muted);margin-top:10px;line-height:1.7}
.study-full{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:6%;align-items:start;padding:clamp(60px,8vw,120px) 0;border-bottom:1px solid var(--field-line)}
.study-full>figure{margin:0}
@media(min-width:901px) and (min-height:820px){.study-full>figure{position:sticky;top:96px}}
.study-full h2{font-size:clamp(30px,3.4vw,52px);margin-bottom:8px}
.study-full h3{font-size:13px;font-weight:650;letter-spacing:0;line-height:1.5;color:var(--sand);margin:30px 0 8px}
.study-full .study-text p{font-size:16px;line-height:1.8;color:var(--field-body);max-width:60ch}
.study-full .study-text p+p{margin-top:14px}
.study-full .refs{font-size:14px;line-height:1.75;color:var(--field-muted)}
.study-full .refs a{color:var(--field-text);border-bottom:1px solid var(--field-line);transition:border-color .25s}
.study-full .refs a:hover{border-color:var(--sand)}
.page-research .pubs{padding-bottom:clamp(64px,8vw,110px)}
@media(max-width:900px){
  .sub-head,.study-full,.thesis-line{grid-template-columns:1fr;gap:26px}
  .study-full>figure{position:static}
}
@media(max-width:700px){
  .topbar{padding-top:20px}
  .topbar nav{gap:18px;font-size:12px}
  .units.waffle{grid-template-columns:repeat(20,minmax(0,9px))}
}
@media print{.topbar nav{display:none}.paper-sheet{background:#fff;color:#222;box-shadow:none}.paper-sheet *{color:#222!important}}

.paper-sheet #motion-toggle{padding:6px 0;border:0;border-bottom:1px solid var(--field-line);background:none;color:var(--field-muted);font-size:12px;cursor:pointer}
.sub-head .motion-line{margin-top:20px}

.study-full>h2{grid-column:2;grid-row:1;align-self:end}
.study-full>figure{grid-column:1;grid-row:1/3}
.study-full>.study-text{grid-column:2;grid-row:2}
.study-full .study-text>h3:first-child{margin-top:14px}
.dock{max-width:calc(100vw - 16px);overflow-x:auto;scrollbar-width:none}
.dock::-webkit-scrollbar{display:none}
.dock a{white-space:nowrap}
@media(max-width:900px){
  .study-full>h2,.study-full>figure,.study-full>.study-text{grid-column:1;grid-row:auto}
}

/* ───────── Third pass: video case, percentage bars, headline stat */
.case-text{font-size:15px;line-height:1.75;color:var(--muted);margin-top:16px;max-width:54ch}
.case-link{align-self:flex-start;margin-top:22px}
.fig-video{padding:clamp(12px,1.6vw,22px)}
.fig-video video{display:block;width:100%;height:auto;border-radius:10px;background:#161a17;box-shadow:0 2px 4px rgb(30 22 14 / .16),0 26px 44px -20px rgb(30 22 14 / .5)}
.fig-video video:focus-visible{outline:3px solid var(--focus);outline-offset:4px}
.bars-pct .bar{width:calc(var(--v) * 1%)}
.bars-pct li{grid-template-columns:1fr 3em}
.stat{display:grid;grid-template-columns:auto 1fr;gap:18px;align-items:start;padding-top:22px;border-top:1px solid #d3ccbd}
.stat-big{font-size:clamp(40px,4vw,56px);line-height:.9;letter-spacing:-.05em;font-weight:500;color:var(--ink)}
.stat p:not(.stat-big){font-size:14px;line-height:1.6;color:var(--muted)}
@media(max-width:900px){.case-video .case-figure{order:0}}

/* ───────── Diagrams (diagram-design skill, profile ali-portfolio): readable width held, scroll locally on phones */
.diagram-container{width:100%;max-width:100%;min-width:0;overflow-x:auto;-webkit-overflow-scrolling:touch}
.dg-svg{display:block;width:100%;min-width:480px;max-width:640px;height:auto;margin:0 auto}
.fig-diagram{padding:clamp(8px,1.2vw,16px)}
.figure-dg{padding:0}
@media print{.diagram-container{overflow-x:visible}.dg-svg{min-width:0}}
/* A grid item would otherwise grow to the diagram's 480px minimum and push the page sideways on phones. */
.study-full>*,.study>*,.case>*{min-width:0}
@media(max-width:900px){.study-full,.study,.thesis-line,.sub-head{grid-template-columns:minmax(0,1fr)}}
/* Short laptop windows: keep each project card shorter than the window so the cards still stack. */
@media(min-width:901px) and (max-height:900px){
  .case{padding:clamp(20px,2.2vw,32px);gap:clamp(24px,3vw,44px)}
  .case h3{font-size:clamp(26px,2.4vw,36px)}
  .case-meta{margin-top:8px}
  .case-lead{margin-top:14px;font-size:16px;line-height:1.5}
  .case-facts{margin-top:16px}
  .case-facts>div{padding:8px 0}
  .case-facts dd{font-size:13.5px;line-height:1.55}
  .case-text{margin-top:10px;font-size:14px;line-height:1.6}
  .tech{padding-top:12px}
  .case-figure{padding:clamp(14px,1.6vw,24px);gap:14px}
}
