/* Mahdi Saiah · portfolio
   One stylesheet for every page. Same family as getconnectapp.github.io:
   Playfair Display for voice, Geist for reading, Geist Mono for labels.
   Monochrome, light by default, follows the OS into dark. */

:root {
  --ground: #F3F3F2;
  --card: #FFFFFF;
  --ink: #111111;
  --ink-2: #2E2E2E;
  --muted: #6B6B6B;
  --faint: #A3A3A3;
  --line: rgba(17, 17, 17, .18);
  --line-soft: rgba(17, 17, 17, .08);
  --fill: #E8E8E7;
  --inverse: #111111;
  --on-inverse: #FAFAFA;
  --glass: rgba(255, 255, 255, .72);
  --glass-edge: rgba(255, 255, 255, .8);
  --ok: #1F9D55;
  --shadow: 0 1px 5px rgba(0,0,0,.08), 0 8px 22px rgba(0,0,0,.07), 0 20px 46px rgba(0,0,0,.05);
  --phone-shadow: 0 2px 6px rgba(0,0,0,.10), 0 30px 60px -10px rgba(0,0,0,.26), 0 60px 120px -30px rgba(0,0,0,.22);

  --f-display: "Playfair Display", "Didot", "Bodoni 72", Georgia, serif;
  --f-body: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --t-hero: clamp(2.8rem, 5.5vw, 5.3rem);
  --t-h2: clamp(2.3rem, 4.6vw, 4.1rem);
  --t-h3: clamp(1.8rem, 3vw, 2.6rem);
  --gut: clamp(16px, 4vw, 40px);
  --r: 24px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
/* Dark: follows the phone unless the visitor picked a side with the switch. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0A0A0A; --card: #161616; --ink: #F1F1F1; --ink-2: #D6D6D6;
    --muted: #9A9A9A; --faint: #5E5E5E;
    --line: rgba(255,255,255,.17); --line-soft: rgba(255,255,255,.07); --fill: #222222;
    --inverse: #F1F1F1; --on-inverse: #111111;
    --glass: rgba(28,28,28,.66); --glass-edge: rgba(255,255,255,.10);
    --ok: #3CCB7F;
    --shadow: 0 1px 5px rgba(0,0,0,.5), 0 8px 22px rgba(0,0,0,.35), 0 20px 46px rgba(0,0,0,.25);
    --phone-shadow: 0 2px 6px rgba(0,0,0,.5), 0 30px 60px -10px rgba(0,0,0,.7), 0 0 80px -20px rgba(255,255,255,.06);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0A0A0A; --card: #161616; --ink: #F1F1F1; --ink-2: #D6D6D6;
  --muted: #9A9A9A; --faint: #5E5E5E;
  --line: rgba(255,255,255,.17); --line-soft: rgba(255,255,255,.07); --fill: #222222;
  --inverse: #F1F1F1; --on-inverse: #111111;
  --glass: rgba(28,28,28,.66); --glass-edge: rgba(255,255,255,.10);
  --ok: #3CCB7F;
  --shadow: 0 1px 5px rgba(0,0,0,.5), 0 8px 22px rgba(0,0,0,.35), 0 20px 46px rgba(0,0,0,.25);
  --phone-shadow: 0 2px 6px rgba(0,0,0,.5), 0 30px 60px -10px rgba(0,0,0,.7), 0 0 80px -20px rgba(255,255,255,.06);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  transition: background-color .5s var(--ease), color .5s var(--ease);
  font-family: var(--f-body); font-size: 1.0625rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; font-weight: 700; }
p { text-wrap: pretty; }
a { color: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--ink); color: var(--ground); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 12px; }
section { scroll-margin-top: 90px; }

.i { width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: middle; fill: currentColor; }
.i--ne { transform: rotate(-45deg); }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--gut); }
.label { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.display { font-family: var(--f-display); font-weight: 700; letter-spacing: -.022em; line-height: 1.02; }
.display em, .em { font-style: italic; }
.lead { font-size: 1.18rem; line-height: 1.55; color: var(--ink-2); }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.js [data-reveal] { transform: translateY(28px); transition: transform 1.1s var(--ease); }
.js [data-reveal].is-in { transform: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px; padding: 0 22px; border-radius: 999px;
  font-size: .98rem; font-weight: 500; text-decoration: none; white-space: nowrap;
  border: 1.2px solid var(--line); transition: background .25s, color .25s, border-color .25s, transform .5s var(--ease);
}
.btn:hover { border-color: var(--ink); }
.btn .i { width: 18px; height: 18px; }
.btn--ink { background: var(--inverse); color: var(--on-inverse); border-color: var(--inverse); }
.btn--ink:hover { background: color-mix(in srgb, var(--inverse) 86%, var(--ground)); }
.btn--sm { height: 40px; padding: 0 16px; font-size: .9rem; }
.badge { display: inline-flex; border-radius: 12px; }
.badge img { height: 50px; width: auto; }
.link { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; text-decoration: none; border-bottom: 1.2px solid var(--line); padding-bottom: 2px; transition: border-color .2s; }
.link:hover { border-color: var(--ink); }
.link .i { width: 15px; height: 15px; }

/* ---------- nav ---------- */
.nav { position: fixed; z-index: 50; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + 14px); padding-inline: 12px; pointer-events: none; transition: transform .5s var(--ease); }
.nav.is-hidden { transform: translateY(calc(-100% - 70px)); }
.nav__bar {
  pointer-events: auto; max-width: 1120px; margin-inline: auto; height: 56px; border-radius: 28px;
  display: flex; align-items: center; gap: 6px; padding: 0 8px 0 18px;
  background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--glass-edge); box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; font-weight: 600; font-size: .98rem; letter-spacing: -.01em; }
.brand img { width: 24px; height: 24px; object-fit: contain; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand img { filter: invert(1); } }
:root[data-theme="dark"] .brand img { filter: invert(1); }
.nav__links { display: flex; gap: 2px; }
.nav__links a { font-size: .92rem; text-decoration: none; color: var(--muted); padding: 8px 13px; border-radius: 18px; transition: color .2s, background .2s; }
.nav__links a:hover { color: var(--ink); background: var(--line-soft); }
.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--line-soft); border-radius: 999px; padding: 3px; }
.seg__pill { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n, 2)); border-radius: 999px; background: var(--inverse); transition: transform .34s var(--ease); }
.seg button { position: relative; z-index: 1; padding: 6px 12px; font-size: .8rem; font-weight: 500; color: var(--muted); transition: color .25s; border-radius: 999px; white-space: nowrap; }
.seg button[aria-pressed="true"] { color: var(--on-inverse); }

.theme { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; color: var(--ink); transition: background .2s; flex: none; }
.theme:hover { background: var(--line-soft); }
.theme .i { transition: transform .6s var(--ease); }
.theme:active .i { transform: rotate(90deg); }

/* ---------- device: real screenshot in the real iPhone 17 Pro frame ---------- */
.dev { --w: 300px; position: relative; width: var(--w); max-width: 100%; aspect-ratio: 1378 / 2794; flex: none; }
.dev::before { content: ""; position: absolute; inset: 3% 4%; border-radius: 20% / 9.8%; background: #0B0B0B; box-shadow: var(--phone-shadow); }
.dev::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: url(../media/connect/iphone-frame-orange.webp) center / 100% 100% no-repeat; }
.dev__screen { position: absolute; left: 6.24%; top: 3.08%; width: 87.52%; height: 93.84%; border-radius: 13% / 6%; overflow: hidden; background: #EDEDEC; z-index: 1; }
.dev__screen > img, .dev__screen > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dev__screen > [data-key] { opacity: 0; transition: opacity .55s var(--ease); }
.dev__screen > [data-key].on { opacity: 1; }
.dev__glare { position: absolute; z-index: 2; pointer-events: none; left: 6.24%; top: 3.08%; width: 87.52%; height: 93.84%; border-radius: 13% / 6%; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255,255,255,.26), rgba(255,255,255,0) 42%); opacity: 0; transition: opacity .4s; }
.dev.is-tilting .dev__glare { opacity: 1; }

/* ---------- hero ---------- */
.hero { padding-top: calc(env(safe-area-inset-top, 0px) + 150px); padding-bottom: 80px; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr); gap: 40px; align-items: center; }
.hero__copy { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.hero h1 { font-size: var(--t-hero); }
.hero h1 em { display: block; }
.hero .lead { max-width: 40ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.avail { display: inline-flex; align-items: center; gap: 10px; font-size: .92rem; color: var(--ink-2); }
.avail__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); flex: none; }
.hero__stage { display: flex; justify-content: center; position: relative; }
.hero__stage .dev { --w: min(310px, 74vw); transition: transform .6s var(--ease); }
.float {
  position: absolute; z-index: 4; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 12px; border-radius: 18px; font-size: .86rem; line-height: 1.25;
  background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(1.5); backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid var(--glass-edge); box-shadow: var(--shadow);
}
.float b { display: block; font-weight: 600; }
.float small { color: var(--muted); font-size: .78rem; }
.float .i { width: 22px; height: 22px; }
.float--a { left: max(-40px, calc(50% - 250px)); bottom: 16%; }
.float--b { right: max(-40px, calc(50% - 250px)); top: 36%; }

/* ---------- facts ---------- */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1.2px solid var(--line); border-bottom: 1.2px solid var(--line); }
.fact { padding: 30px 24px 32px 0; display: flex; flex-direction: column; gap: 8px; }
.fact + .fact { padding-left: 24px; border-left: 1.2px solid var(--line-soft); }
.fact__n { font-family: var(--f-display); font-weight: 700; font-size: clamp(2rem, 2.9vw, 2.6rem); line-height: 1; letter-spacing: -.02em; white-space: nowrap; }
.fact p { font-size: .95rem; color: var(--muted); line-height: 1.45; max-width: 24ch; }

/* ---------- section heads ---------- */
.sec { padding-block: clamp(88px, 12vw, 150px); }
.head { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.head h2 { font-size: var(--t-h2); }

/* ---------- case study ---------- */
.case__top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 56px; align-items: end; }
.case__title { font-size: clamp(3rem, 7vw, 6.4rem); }
.case__title small { display: block; font-family: var(--f-body); font-size: .9rem; font-weight: 500; letter-spacing: 0; margin-bottom: 18px; color: var(--muted); }
.case__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1.2px solid var(--line); }
.case__meta div { padding: 16px 0; border-bottom: 1.2px solid var(--line-soft); }
.case__meta div:nth-child(odd) { padding-right: 16px; }
.case__meta dt { margin-bottom: 4px; }
.case__meta dd { margin: 0; font-size: .98rem; font-weight: 500; line-height: 1.4; }
.case__links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 28px; }
.case__sum { margin-top: 64px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.sum { background: var(--card); border: 1.2px solid var(--line); border-radius: var(--r); padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.sum h3 { font-family: var(--f-body); font-weight: 600; font-size: 1.05rem; letter-spacing: -.01em; }
.sum p { color: var(--muted); font-size: .97rem; line-height: 1.5; }

/* sticky story */
.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 72px; margin-top: clamp(48px, 8vw, 110px); }
.stage { position: sticky; top: 0; height: 100svh; display: grid; place-items: center; }
.stage .dev { --w: min(330px, calc((100svh - 140px) / 2.03)); }
.stage__cap { position: absolute; bottom: 26px; left: 0; right: 0; text-align: center; }
.chap { min-height: 88svh; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding-block: 8svh; max-width: 560px; }
.chap h3 { font-family: var(--f-display); font-size: var(--t-h3); line-height: 1.06; letter-spacing: -.02em; }
.chap p { color: var(--ink-2); }
.chap__dev { display: none; }
.chap .seg { align-self: flex-start; }
.chap ul.ticks { display: flex; flex-direction: column; gap: 10px; }
.ticks li { position: relative; padding-left: 26px; color: var(--ink-2); font-size: .98rem; line-height: 1.5; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 7px; height: 7px; transform: rotate(45deg); background: var(--ink); }
.rail { display: flex; flex-wrap: wrap; gap: 8px; }
.rail span { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; padding: 8px 12px; border-radius: 999px; border: 1.2px solid var(--line); color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; }
.rail span i { font-style: normal; color: var(--faint); }
.quote { border-left: 2px solid var(--ink); padding: 4px 0 4px 18px; font-family: var(--f-display); font-style: italic; font-size: 1.25rem; line-height: 1.4; color: var(--ink); }

/* shipping */
.ship { margin-top: clamp(64px, 9vw, 120px); display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 56px; align-items: start; }
.ship h3 { font-family: var(--f-display); font-size: var(--t-h3); line-height: 1.06; letter-spacing: -.02em; }
.ship__copy { display: flex; flex-direction: column; gap: 20px; }
.ship__copy p { color: var(--ink-2); }
.steps { display: flex; flex-direction: column; }
.steps li { display: grid; gap: 4px; padding: 18px 0; border-top: 1.2px solid var(--line-soft); }
.steps li:last-child { border-bottom: 1.2px solid var(--line-soft); }
.steps b { font-weight: 600; }
.steps span { color: var(--muted); font-size: .95rem; line-height: 1.45; }
.steps li.is-live b::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-left: 10px; vertical-align: middle; box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }

/* ---------- experience ---------- */
.jobs { margin-top: 56px; border-top: 1.2px solid var(--line); }
.job { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 40px; padding: 40px 0; border-bottom: 1.2px solid var(--line); }
.job__co { display: flex; flex-direction: column; gap: 8px; }
.job__co h3 { font-family: var(--f-display); font-size: clamp(1.6rem, 2.6vw, 2.2rem); letter-spacing: -.015em; line-height: 1.1; }
.job__co p { color: var(--muted); font-size: .95rem; }
.job__body { display: flex; flex-direction: column; gap: 16px; }
.job__body > p { font-size: 1.08rem; color: var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span { font-size: .8rem; padding: 6px 12px; border-radius: 999px; background: var(--line-soft); color: var(--ink-2); }

/* ---------- more work ---------- */
.works { margin-top: 56px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.work { display: flex; flex-direction: column; text-decoration: none; background: var(--card); border: 1.2px solid var(--line); border-radius: var(--r); overflow: hidden; transition: transform .6s var(--ease), box-shadow .6s var(--ease); }
.work:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.work__media { position: relative; aspect-ratio: 4 / 3; background: #111; overflow: hidden; }
.work__media img, .work__media video { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.work:hover .work__media img, .work:hover .work__media video { transform: scale(1.04); }
.work__media--paper { background: #EDEDEA; display: grid; place-items: center; }
.work__media--paper img { width: auto; height: 86%; object-fit: contain; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.work:hover .work__media--paper img { transform: translateY(-4px) rotate(-1deg); }
.work__body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.work__body h3 { font-family: var(--f-display); font-size: 1.55rem; letter-spacing: -.015em; line-height: 1.1; }
.work__body p { color: var(--muted); font-size: .95rem; line-height: 1.5; }
.work__go { margin-top: auto; padding-top: 10px; display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 500; }
.work__go .i { width: 15px; height: 15px; transition: transform .4s var(--ease); }
.work:hover .work__go .i { transform: translateX(4px); }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.portrait { border-radius: var(--r); overflow: hidden; background: #CFCFCD; aspect-ratio: 7 / 9; position: sticky; top: 100px; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.about__copy { display: flex; flex-direction: column; gap: 22px; }
.about__copy h2 { font-size: var(--t-h2); }
.about__copy > p { color: var(--ink-2); max-width: 58ch; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; margin-top: 18px; }
.block { padding: 22px 0; border-top: 1.2px solid var(--line); }
.block h4 { margin-bottom: 12px; }
.block ul { display: flex; flex-direction: column; gap: 12px; }
.block li { font-size: .97rem; line-height: 1.45; }
.block li b { display: block; font-weight: 600; }
.block li span { color: var(--muted); font-size: .9rem; }
.langs { display: flex; flex-wrap: wrap; gap: 8px; }
.langs span { padding: 7px 14px; border-radius: 999px; border: 1.2px solid var(--line); font-size: .9rem; }
.langs span b { font-weight: 600; margin-right: 6px; }

/* ---------- contact ---------- */
.contact { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.contact h2 { font-size: clamp(2.8rem, 7vw, 6rem); }
.contact h2 em { display: block; }
.contact .lead { max-width: 46ch; }
.mail { display: inline-flex; align-items: center; gap: 4px; padding: 6px 6px 6px 22px; border-radius: 999px; background: var(--card); border: 1.2px solid var(--line); font-size: clamp(.95rem, 2.4vw, 1.15rem); font-weight: 500; max-width: 100%; }
.mail a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail button { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; transition: background .2s; position: relative; }
.mail button:hover { background: var(--line-soft); }
.mail button .i { width: 18px; height: 18px; }
.mail .i--check { display: none; }
.mail.is-copied .i--copy { display: none; }
.mail.is-copied .i--check { display: inline-block; color: var(--ok); }
.contact__row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.foot { padding: 40px 0 calc(40px + env(safe-area-inset-bottom, 0px)); border-top: 1.2px solid var(--line-soft); margin-top: clamp(88px, 12vw, 150px); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; font-size: .86rem; color: var(--muted); }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }
.foot nav { display: flex; gap: 20px; }

/* ---------- project pages ---------- */
.p-hero { padding-top: calc(env(safe-area-inset-top, 0px) + 140px); padding-bottom: 56px; display: flex; flex-direction: column; gap: 24px; }
.back { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; text-decoration: none; color: var(--muted); align-self: flex-start; transition: color .2s; }
.back:hover { color: var(--ink); }
.back .i { transform: rotate(180deg); width: 15px; height: 15px; }
.p-hero h1 { font-size: clamp(2.8rem, 7vw, 6rem); }
.p-hero .lead { max-width: 52ch; }
.p-meta { display: flex; flex-wrap: wrap; gap: 0; border-top: 1.2px solid var(--line); margin-top: 12px; }
.p-meta div { padding: 16px 32px 16px 0; margin-right: 32px; }
.p-meta dd { margin: 4px 0 0; font-weight: 500; }
.p-sec { padding-block: clamp(56px, 8vw, 96px); }
.p-two { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 56px; }
.p-two h2 { font-family: var(--f-display); font-size: var(--t-h3); line-height: 1.06; letter-spacing: -.02em; }
.p-two .body { display: flex; flex-direction: column; gap: 18px; color: var(--ink-2); }
.clips { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.clip { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.clip__media { border-radius: var(--r); overflow: hidden; background: #111; aspect-ratio: 16 / 9; }
.clip__media video { width: 100%; height: 100%; object-fit: cover; }
.clip figcaption { display: flex; gap: 12px; font-size: .95rem; color: var(--muted); }
.clip figcaption b { color: var(--ink); font-weight: 600; }
.gallery { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.shot { grid-column: span 4; border-radius: 18px; overflow: hidden; background: #111; aspect-ratio: 16 / 10; cursor: zoom-in; padding: 0; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.shot:hover img { transform: scale(1.04); }
.shot--wide { grid-column: span 8; }
.shot--half { grid-column: span 6; }
.shot--full { grid-column: span 12; aspect-ratio: 21 / 9; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { font-size: .85rem; padding: 7px 14px; border-radius: 999px; border: 1.2px solid var(--line); }
.parts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.part { background: var(--card); border: 1.2px solid var(--line); border-radius: var(--r); padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.part h3 { font-family: var(--f-display); font-size: 1.45rem; line-height: 1.15; letter-spacing: -.01em; }
.part p { color: var(--muted); font-size: .97rem; line-height: 1.5; }
.next { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 36px 0; border-top: 1.2px solid var(--line); border-bottom: 1.2px solid var(--line); text-decoration: none; }
.next b { font-family: var(--f-display); font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.02em; }
.next .i { width: 28px; height: 28px; transition: transform .4s var(--ease); }
.next:hover .i { transform: translateX(6px); }

/* thesis reader: page images, read in place, nothing to download */
.reader { position: relative; height: min(82svh, 980px); overflow-y: auto; overscroll-behavior: contain; border-radius: var(--r); background: var(--fill); border: 1.2px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px; }
.reader img { flex: 0 0 auto; width: 100%; max-width: 760px; height: auto; background: #fff; box-shadow: 0 2px 14px rgba(0,0,0,.12); border-radius: 4px; }
.reader__bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(10,10,10,.6); -webkit-backdrop-filter: blur(24px) saturate(1.2); backdrop-filter: blur(24px) saturate(1.2); opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility 0s .35s; }
.lb.is-open { opacity: 1; visibility: visible; transition: opacity .35s var(--ease); }
.lb img { max-width: min(92vw, 1600px); max-height: 84svh; border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.lb__btn { position: absolute; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); transition: background .2s; }
.lb__btn:hover { background: rgba(255,255,255,.22); }
.lb__btn .i { width: 20px; height: 20px; }
.lb__x { top: 20px; right: 20px; }
.lb__prev { left: 20px; top: 50%; translate: 0 -50%; }
.lb__prev .i { transform: rotate(180deg); }
.lb__next { right: 20px; top: 50%; translate: 0 -50%; }
.lb__n { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.75); font-family: var(--f-mono); font-size: .75rem; letter-spacing: .1em; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .nav__links { display: none; }
  .story { grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: 40px; }
}
@media (max-width: 920px) {
  .hero { padding-top: calc(env(safe-area-inset-top, 0px) + 112px); }
  .hero__grid, .case__top, .ship, .job, .about, .p-two { grid-template-columns: minmax(0, 1fr); }
  .hero__grid { gap: 48px; }
  .case__sum, .works, .parts { grid-template-columns: minmax(0, 1fr); }
  .story { grid-template-columns: minmax(0, 1fr); margin-top: 48px; }
  .stage { display: none; }
  .chap { min-height: 0; padding-block: 40px; max-width: none; }
  .chap__dev { display: block; --w: min(290px, 72vw); align-self: center; margin-top: 12px; }
  .job { gap: 18px; padding: 32px 0; }
  .portrait { position: relative; top: 0; max-width: 420px; }
  .works { gap: 14px; }
  .clips { grid-template-columns: minmax(0, 1fr); }
  .shot, .shot--wide, .shot--half { grid-column: span 12; }
  .shot--full { aspect-ratio: 16 / 10; }
}
@media (max-width: 560px) {
  .nav__bar { padding-left: 14px; gap: 4px; }
  .brand span { display: none; }
  .nav .btn--sm { padding: 0 14px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .fact, .fact + .fact { padding: 22px 0; border-left: 0; }
  .fact + .fact { border-top: 1.2px solid var(--line-soft); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .case__meta { grid-template-columns: minmax(0, 1fr); }
  .case__meta div:nth-child(odd) { padding-right: 0; }
  .float--a { left: 0; bottom: 10%; }
  .float--b { right: 0; top: 34%; }
  .hero__cta .btn { flex: 1 1 auto; }
  .lb__prev, .lb__next { top: auto; bottom: 14px; translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { transform: none; transition: none; }
  * { transition-duration: .01ms !important; }
}
/* gallery rows share one height so wide and narrow tiles line up */
.gallery { grid-auto-rows: clamp(150px, 19vw, 270px); }
.shot, .shot--full { aspect-ratio: auto; height: 100%; }
.shot--full { grid-row: span 2; }
@media (max-width: 920px) {
  .gallery { grid-auto-rows: auto; }
  .shot, .shot--full { aspect-ratio: 16 / 10; grid-row: auto; }
}
.work__media--paper { display: block; }
.work__media--paper img { position: absolute; top: 7%; bottom: 7%; left: 0; right: 0; margin: auto; height: 86%; width: auto; }
.langs span span { padding: 0; border: 0; border-radius: 0; color: var(--muted); font-size: inherit; }
