/* ==========================================================================
   Danil Karaimchuk — portfolio
   Big quiet type, black background, rounded image cards. Tokens first.
   ========================================================================== */

:root {
  --bg: #000;
  --card: #141414;
  --card-2: #1c1c1c;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #fff;
  --text-2: rgba(255, 255, 255, 0.86);
  --muted: rgba(255, 255, 255, 0.56);
  --faint: rgba(255, 255, 255, 0.34);
  --ok: #7fd18b;

  --pad: clamp(16px, 4.2vw, 60px);   /* page side padding */
  --max: 1440px;
  --r: 20px;
  --r-sm: 14px;

  --font: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", monospace;
  --serif: "Instrument Serif", Georgia, serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring-bounce: linear(0, 0.0336, 0.1191, 0.236, 0.3677, 0.5017, 0.6286, 0.7426, 0.84, 0.9194, 0.9811, 1.0261, 1.0564, 1.0744, 1.0825, 1.083, 1.078, 1.0695, 1.0591, 1.0479, 1.0369, 1.0267, 1.0177, 1.0103, 1.0043, 0.9998, 0.9966, 0.9945, 0.9934, 0.993, 0.9932, 0.9938, 0.9946, 0.9955, 0.9964, 0.9973, 1);
  --spring: linear(0, 0.0217, 0.0773, 0.1546, 0.2441, 0.3386, 0.4327, 0.5227, 0.6061, 0.6814, 0.7478, 0.8052, 0.8539, 0.8944, 0.9275, 0.9538, 0.9744, 0.9901, 1.0016, 1.0097, 1.015, 1.0181, 1.0196, 1.0199, 1.0193, 1.018, 1.0164, 1.0146, 1.0127, 1.0108, 1.0091, 1.0074, 1.006, 1.0047, 1.0036, 1.0027, 1);
  --glass: blur(24px) saturate(180%);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-optical-sizing: auto;
  font-size: 20px; line-height: 1.4; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: #fff; color: #000; }
:focus-visible { outline: 2px solid #0a84ff; outline-offset: 3px; border-radius: 8px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }
.stage { background: var(--bg); min-height: 100vh; }
.dim { color: var(--muted); }
.serif { font-family: var(--serif); font-style: italic; }
.todo { box-shadow: inset 0 -1px 0 rgba(255, 196, 0, 0.6); background: rgba(255, 196, 0, 0.07); }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.avail { display: inline-flex; align-items: center; gap: 8px; }
.avail::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(127, 209, 139, 0.16); }

/* ---------- type scale ---------- */
.display { margin: 0; font-size: clamp(46px, 7vw, 100px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 400; }
.giant { margin: 0; font-size: clamp(96px, 23vw, 340px); line-height: 0.9; letter-spacing: -0.06em; font-weight: 400; }
.h2 { margin: 0; font-size: clamp(26px, 2.3vw, 32px); line-height: 1.3; letter-spacing: -0.02em; font-weight: 400; }
.h3 { margin: 0; font-size: clamp(24px, 2.1vw, 30px); line-height: 1.3; letter-spacing: -0.03em; font-weight: 400; }
.body { color: var(--text-2); }
.body p { margin: 0 0 18px; }
.body p:last-child { margin-bottom: 0; }
.body strong { color: var(--text); font-weight: 500; }
.small { font-size: 15px; line-height: 1.45; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--text-2);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
}
.more { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--muted); transition: color .2s; }
.more:hover { color: var(--text); }
.more span { transition: transform .45s var(--spring-bounce); }
.more:hover span { transform: translateX(3px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong);
  font-size: 14px; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s, transform .5s var(--spring-bounce);
}
.btn:hover { background: #fff; color: #000; border-color: #fff; }
.btn:active { transform: scale(0.95); }

/* ---------- top bar: name + links; on scroll it folds into a glass circle ---------- */
.topbar { position: fixed; z-index: 60; top: 0; left: 0; right: 0; pointer-events: none; }
.topbar__in { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.topbar__name, .nav { pointer-events: auto; transition: opacity .35s var(--ease), transform .5s var(--spring); }
.topbar__name { font-size: 16px; color: var(--text-2); }
.topbar__name:hover { color: var(--text); }
.nav { display: flex; gap: 22px; font-size: 14px; }
.nav a { color: var(--muted); transition: color .2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.topbar.is-folded .topbar__name, .topbar.is-folded .nav { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.menu-btn {
  position: fixed; z-index: 61; top: 18px; right: var(--pad); width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; pointer-events: auto;
  background: rgba(40, 40, 42, 0.55); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0; scale: 0.6; pointer-events: none;
  transition: opacity .3s var(--ease), scale .6s var(--spring-bounce);
}
.topbar.is-folded ~ .menu-btn, body.menu-open .menu-btn { opacity: 1; scale: 1; pointer-events: auto; }
.menu-btn:active { scale: 0.9; }

/* menu: a glass sheet from the right */
.sheet-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.5); opacity: 0; pointer-events: none; transition: opacity .45s var(--ease); }
body.menu-open .sheet-scrim { opacity: 1; pointer-events: auto; }
.menu {
  position: fixed; z-index: 95; top: 10px; right: 10px; bottom: 10px; width: min(360px, calc(100vw - 20px));
  display: flex; flex-direction: column; padding: 14px;
  border-radius: 26px; background: rgba(28, 28, 30, 0.74);
  backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  transform: translateX(calc(100% + 30px)); visibility: hidden;
  transition: transform .7s var(--spring), visibility 0s linear .7s;
}
body.menu-open .menu { transform: none; visibility: visible; transition: transform .7s var(--spring), visibility 0s; }
.menu__head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 18px 10px; font-size: 15px; color: var(--muted); }
.menu-close { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.08); font-size: 13px; transition: background .2s, transform .45s var(--spring-bounce); }
.menu-close:hover { background: rgba(255, 255, 255, 0.16); }
.menu-close:active { transform: scale(0.9); }
.menu nav a {
  display: block; padding: 6px 10px; font-size: 34px; line-height: 1.2; letter-spacing: -0.03em; color: var(--muted);
  opacity: 0; transform: translateX(16px); transition: color .2s, opacity .3s var(--ease), transform .6s var(--spring);
}
body.menu-open .menu nav a { opacity: 1; transform: none; transition-delay: 0s, calc(var(--i) * 30ms + 100ms), calc(var(--i) * 30ms + 100ms); }
.menu nav a:hover, .menu nav a[aria-current="page"] { color: var(--text); }
.menu__links { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; }
.menu__foot { display: flex; justify-content: space-between; padding: 12px 10px 4px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 10px; }
.clock { font-variant-numeric: tabular-nums; }

/* dynamic-island message */
.island {
  position: fixed; z-index: 130; top: 12px; left: 50%; translate: -50% 0;
  height: 38px; padding: 0 18px; border-radius: 999px; display: flex; align-items: center;
  background: #000; border: 1px solid rgba(255, 255, 255, 0.14); color: #fff; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); opacity: 0; scale: 0.5; pointer-events: none;
  transition: opacity .25s, scale .35s var(--ease);
}
.island.is-on { opacity: 1; scale: 1; transition: opacity .2s, scale .7s var(--spring-bounce); }

/* ---------- media ---------- */
.cover { position: absolute; inset: 0; overflow: hidden; background: var(--cover-bg, var(--card)); }
.cover.only-mob { display: none; }
.cover__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover--contain { display: grid; grid-template: minmax(0, 100%) / minmax(0, 100%); place-items: center; padding: var(--cpad, 6%); }
.cover--contain .cover__img { position: static; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7); }
.ph { position: absolute; inset: 0; background: radial-gradient(90% 70% at 50% 110%, color-mix(in oklab, var(--cover-accent) 26%, transparent), transparent 70%); }
.ph-device { position: absolute; left: 50%; translate: -50% 0; bottom: -2%; }
.ph-phone { width: clamp(90px, 22%, 170px); aspect-ratio: 9 / 19.5; border-radius: 22px; background: #0c0c0c; border: 1px solid rgba(255, 255, 255, 0.12); padding: 18px 9px 9px; display: flex; flex-direction: column; gap: 6px; }
.ph-browser { width: 74%; aspect-ratio: 16 / 10; border-radius: 10px 10px 0 0; background: #0c0c0c; border: 1px solid rgba(255, 255, 255, 0.12); border-bottom: 0; padding: 22px 10px 10px; display: grid; grid-template-columns: 1fr 2.4fr; gap: 8px; }
.ph-bar { height: 7px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); }
.ph-bar.w40 { width: 40%; } .ph-bar.w60 { width: 60%; } .ph-bar.w80 { width: 80%; }
.ph-block { flex: 1; border-radius: 6px; background: rgba(255, 255, 255, 0.05); }
.ph-block.accent { background: color-mix(in oklab, var(--cover-accent) 32%, #141414); }
.ph-col { display: flex; flex-direction: column; gap: 6px; }
.ph-label { position: absolute; top: 16px; right: 16px; z-index: 2; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 196, 0, 0.8); }
.frame { position: relative; overflow: hidden; border-radius: var(--r); background: var(--card); }

/* ---------- home: hero ---------- */
.hero { padding-top: clamp(120px, 17vh, 170px); padding-bottom: clamp(36px, 5vh, 56px); }

/* project cards (a horizontal strip when there is more than one) */
.strip { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-inline: var(--pad); scroll-padding-inline: var(--pad); }
.strip::-webkit-scrollbar { display: none; }
.strip--wrap { max-width: var(--max); margin-inline: auto; }
.pcard {
  position: relative; flex: none; width: min(1200px, 86%); aspect-ratio: 2 / 1; scroll-snap-align: start;
  border-radius: var(--r); overflow: hidden; background: var(--card); isolation: isolate;
  transition: transform .5s var(--spring-bounce);
}
.strip > .pcard:only-child { width: 100%; }
.pcard:active { transform: scale(0.99); }
.pcard__art { position: absolute; inset: 0; z-index: -1; background: radial-gradient(70% 90% at 70% 110%, color-mix(in oklab, var(--cover-accent) 45%, transparent), transparent 70%), var(--card); }
.pcard__art .cover { background: transparent; }
.pcard__shots { position: absolute; top: 9%; right: 6%; width: 52%; display: flex; gap: 4%; justify-content: flex-end; }
.pcard__shots > img { width: 30%; border-radius: 12px; box-shadow: 0 30px 60px -16px rgba(0, 0, 0, 0.8); transition: transform .8s var(--spring-bounce); }
.pcard__shots > img:nth-child(2) { transform: translateY(-5%); }
.pcard:hover .pcard__shots > img:nth-child(1) { transform: translateY(-3%) rotate(-2deg); }
.pcard:hover .pcard__shots > img:nth-child(2) { transform: translateY(-9%); }
.pcard:hover .pcard__shots > img:nth-child(3) { transform: translateY(-3%) rotate(2deg); }
.pcard::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0) 55%); }
.pcard__info { position: absolute; left: clamp(18px, 2.4vw, 32px); bottom: clamp(18px, 2.4vw, 32px); right: 40%; }
.pcard__title { font-size: clamp(24px, 2.1vw, 30px); letter-spacing: -0.03em; line-height: 1.2; }
.pcard__line { margin: 4px 0 14px; font-size: 17px; color: var(--muted); }
.pcard__quote {
  position: absolute; right: clamp(18px, 2.4vw, 32px); bottom: clamp(18px, 2.4vw, 32px); width: min(380px, 34%);
  padding: 18px 20px; border-radius: 16px; font-size: 15px; line-height: 1.45; color: var(--text-2);
  background: rgba(40, 40, 42, 0.45); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); border: 1px solid rgba(255, 255, 255, 0.12);
}
.pcard__quote cite { display: block; margin-top: 12px; font-style: normal; font-size: 13px; color: var(--muted); }

/* sections */
.sec { padding-top: clamp(96px, 14vh, 160px); }
.sec__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 36px; }
.grid12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
.col-l { grid-column: span 4; }
.col-r { grid-column: 5 / -1; }

/* intro: photo + statement */
.intro__photo { grid-column: span 3; aspect-ratio: 4 / 5; border-radius: var(--r-sm); overflow: hidden; background: var(--card); align-self: start; }
.intro__photo img { width: 100%; height: 100%; object-fit: cover; }
.intro__text { grid-column: 5 / -1; }
.intro__text .h2 { margin-bottom: 22px; }
.intro__text .more { margin-top: 26px; }

/* numbered rows (approach, decisions, findings) */
.steps { list-style: none; margin: 0; padding: 0; }
.step { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; padding: 30px 0; border-bottom: 1px solid var(--line); transition: color .6s var(--ease); }
.step:first-child { border-top: 1px solid var(--line); }
.step__n { grid-column: span 1; color: var(--faint); }
.step__t { grid-column: span 3; }
.step__d { grid-column: 5 / -1; color: var(--text-2); }
.steps--scroll .step { color: var(--faint); }
.steps--scroll .step .step__d { color: var(--faint); transition: color .6s var(--ease); }
.steps--scroll .step.is-lit { color: var(--text); }
.steps--scroll .step.is-lit .step__d { color: var(--text-2); }

/* work mosaic: a strip of images that runs off the edge */
.mosaic { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding-inline: var(--pad); }
.mosaic::-webkit-scrollbar { display: none; }
.mosaic a { position: relative; flex: none; height: clamp(300px, 34vw, 480px); border-radius: var(--r); overflow: hidden; background: var(--card); scroll-snap-align: start; transition: transform .5s var(--spring-bounce); }
.mosaic a:active { transform: scale(0.98); }
.mosaic img { height: 100%; width: auto; transition: transform 1s var(--ease); }
.mosaic a:hover img { transform: scale(1.03); }

/* contact: a little mail composer */
.contact { padding-top: clamp(110px, 16vh, 180px); text-align: center; }
.contact .display { font-size: clamp(42px, 5.4vw, 76px); max-width: 13ch; margin-inline: auto; }
.contact .display .dim { color: var(--text); }
.mailer {
  max-width: 560px; margin: 40px auto 0; padding: 8px 20px 20px; text-align: left;
  border-radius: 24px; background: var(--card); border: 1px solid var(--line);
}
.mailer label, .mailer .to { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--line); font-size: 15px; }
.mailer .k { color: var(--muted); }
.mailer input, .mailer textarea { width: 100%; background: none; border: 0; outline: none; padding: 14px 0; font-size: 15px; }
.mailer input::placeholder, .mailer textarea::placeholder { color: var(--faint); }
.mailer .msg { align-items: start; border-bottom: 0; }
.mailer .msg .k { padding-top: 14px; }
.mailer textarea { min-height: 120px; resize: vertical; }
.mailer__copy { font-size: 13px; color: var(--muted); }
.mailer__copy:hover { color: var(--text); }
.mailer .btn { margin-top: 10px; }

/* footer */
.footer { padding: clamp(100px, 14vh, 160px) 0 28px; }
.footer__in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; color: var(--muted); }
.footer__icons { display: flex; gap: 16px; }
.footer__icons a { display: grid; place-items: center; width: 28px; height: 28px; color: var(--muted); transition: color .2s, transform .45s var(--spring-bounce); }
.footer__icons a:hover { color: var(--text); transform: translateY(-2px); }
.footer__links { justify-self: end; display: flex; gap: 16px; }
.footer__links a:hover { color: var(--text); }

/* ---------- work page ---------- */
.page-head { padding-top: clamp(120px, 17vh, 170px); }
.page-intro { margin: 18px 0 0; max-width: 34ch; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 36px 0 24px; }
.filters button {
  height: 32px; padding: 0 14px; border-radius: 999px; font-size: 13px; color: var(--text-2);
  background: rgba(255, 255, 255, 0.08); transition: background .2s, color .2s, transform .45s var(--spring-bounce);
}
.filters button:hover { background: rgba(255, 255, 255, 0.14); }
.filters button[aria-pressed="true"] { background: #fff; color: #000; }
.filters button:active { transform: scale(0.94); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; border-radius: var(--r); background: var(--card); overflow: hidden; transition: transform .5s var(--spring-bounce), background .3s; }
.card:hover { background: var(--card-2); }
.card:active { transform: scale(0.985); }
.card .frame { aspect-ratio: 1 / 0.86; border-radius: 0; background: transparent; }
.card--big { grid-column: span 2; }
.card--big .frame { aspect-ratio: 2 / 0.86; }
.card--big .card__shots { inset: 10% 22% auto; }
@media (max-width: 720px) { .card--big { grid-column: auto; } .card--big .frame { aspect-ratio: 1 / 0.86; } .card--big .card__shots { inset: 12% 8% auto; } }
.card .frame .cover { background: transparent; transition: transform 1s var(--ease); }
.card:hover .frame .cover { transform: scale(1.03); }
.card .cover--contain { --cpad: 9%; }
.card__shots { position: absolute; inset: 12% 8% auto; display: flex; justify-content: center; gap: 4%; }
.card__shots > img { width: 29%; border-radius: 8px; box-shadow: 0 24px 40px -14px rgba(0, 0, 0, 0.8); }
.card__shots > img:nth-child(2) { transform: translateY(-5%); }
.card .frame { background: radial-gradient(70% 70% at 50% 100%, color-mix(in oklab, var(--cover-accent) 30%, transparent), transparent 70%); }
.card__cap { padding: 4px 22px 22px; }
.card__title { font-size: 18px; }
.card__line { margin-top: 4px; font-size: 14px; color: var(--muted); }
.card.is-hidden { display: none; }

/* ---------- case page ---------- */
.case-head { padding-top: clamp(110px, 15vh, 150px); }
.case-head .giant { margin-left: -0.04em; }
.case-info { margin-top: clamp(40px, 6vh, 72px); }
.case-info .body { grid-column: span 6; }
.case-meta { grid-column: 8 / -1; margin: 0; }
.case-meta > div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: baseline; padding: 10px 0; }
.case-meta dt { color: var(--faint); }
.case-meta dd { margin: 0; font-size: 16px; }
.case-cover { margin-top: clamp(48px, 7vh, 80px); aspect-ratio: 21 / 9; }
.case-cover .cover { background: radial-gradient(70% 90% at 50% 120%, color-mix(in oklab, var(--cover-accent) 26%, transparent), transparent 70%), var(--card); }
.case-cover .cover--contain { --cpad: 4.5% 4%; }

.blk { padding-top: clamp(80px, 12vh, 140px); }
.blk--tight { padding-top: 12px; }
.blk--tight .blk__wide:first-child { margin-top: 0; }
.blk__label { grid-column: span 4; }
.blk__main { grid-column: 5 / -1; min-width: 0; }
.blk__lead { margin: 0 0 18px; font-size: clamp(22px, 1.9vw, 26px); line-height: 1.35; letter-spacing: -0.02em; }
.blk__wide { margin-top: 40px; }
.panel { border-radius: var(--r); background: var(--card); padding: clamp(16px, 3.6vw, 48px); }
.fig { margin: 0; }
.fig figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 22px); }
.gallery .frame, .compare .frame { aspect-ratio: var(--ratio, 9 / 16); border-radius: 10px; background: var(--card-2); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 3vw, 40px); max-width: 640px; margin: 0 auto; }
.compare figcaption b { display: block; color: var(--text); font-weight: 400; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.metric { padding: 22px; border-radius: 16px; background: var(--card); }
.metric__value { font-size: clamp(34px, 3.6vw, 48px); line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.metric__label { margin-top: 10px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.story { margin: 0; }
.story > div { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.story dt { color: var(--faint); font-size: 15px; padding-top: 3px; }
.story dd { margin: 0; color: var(--text-2); }
.pullquote { margin: 0; text-align: center; }
.pullquote p { margin: 0 auto; max-width: 22ch; font-size: clamp(32px, 3.6vw, 52px); line-height: 1.15; letter-spacing: -0.03em; }
.pullquote cite { display: block; margin-top: 18px; font-style: normal; font-size: 15px; color: var(--muted); }

.tbl-wrap { overflow: hidden; border-radius: var(--r); background: var(--card); padding: 8px clamp(16px, 2.4vw, 32px); }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.tbl th { padding: 18px 18px 14px 0; text-align: left; vertical-align: bottom; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 400; color: var(--faint); border-bottom: 1px solid var(--line); }
.tbl td { padding: 16px 18px 16px 0; vertical-align: top; color: var(--text-2); border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child { color: var(--text); width: 20%; }
.tbl td:nth-child(3) { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text); }
.tbl td:last-child { width: 30%; }

.next { display: block; padding-top: clamp(110px, 16vh, 180px); }
.next .mono { color: var(--muted); }
.next__t { display: flex; align-items: center; gap: 0.25em; margin-top: 10px; font-size: clamp(56px, 10vw, 150px); line-height: 1; letter-spacing: -0.05em; transition: gap .5s var(--spring-bounce); }
.next:hover .next__t { gap: 0.4em; }

/* ---------- about ---------- */
.about-photo { grid-column: span 4; aspect-ratio: 4 / 5; border-radius: var(--r-sm); overflow: hidden; background: var(--card); align-self: start; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-text { grid-column: 6 / -1; }
.about-text .h2 { margin-bottom: 22px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.list li:first-child { border-top: 1px solid var(--line); }
.list small { display: block; margin-top: 2px; font-size: 15px; color: var(--muted); }
.list .r { color: var(--muted); font-size: 15px; text-align: right; }
.list a.li-link { display: contents; }

/* ---------- stack ---------- */
.app-icon {
  --s: 40px; --c: #3a3a3c; position: relative; flex: none; width: var(--s); height: var(--s); border-radius: calc(var(--s) * 0.2237);
  display: grid; place-items: center; overflow: hidden; color: #fff; font-weight: 600; font-size: calc(var(--s) * 0.36); letter-spacing: -0.04em; line-height: 1;
  background: linear-gradient(165deg, color-mix(in oklab, var(--c) 78%, #fff) 0%, var(--c) 48%, color-mix(in oklab, var(--c) 78%, #000) 100%);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.2);
}
.app-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.st-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.st-row { display: grid; grid-template-columns: minmax(200px, 3fr) minmax(0, 6fr) 120px 20px; gap: 24px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); transition: background .2s; }
a.st-row:hover { background: rgba(255, 255, 255, 0.03); }
.st-name { display: flex; align-items: center; gap: 14px; }
.st-name .app-icon { transition: transform .55s var(--spring-bounce); }
a.st-row:hover .app-icon { transform: scale(1.08) rotate(-4deg); }
.st-desc { color: var(--muted); font-size: 16px; }
.st-go { color: var(--faint); font-size: 15px; transition: color .2s, transform .45s var(--spring-bounce); }
a.st-row:hover .st-go { color: var(--text); transform: translate(2px, -2px); }
.st-row.is-hidden { display: none; }

/* ---------- motion ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
[data-split] .w { display: inline-block; }
[data-split]:not(.is-in) .w { opacity: 0; }
[data-split].is-in .w { animation: word-in 1.1s var(--spring) both; animation-delay: calc(var(--i) * 40ms + var(--delay, 0ms)); }
@keyframes word-in { from { opacity: 0; filter: blur(8px); transform: translateY(0.35em); } to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes word-in-lite { from { opacity: 0; transform: translateY(0.25em); } to { opacity: 1; transform: none; } }
.giant[data-split].is-in .w { animation-name: word-in-lite; animation-duration: .9s; }
[data-parallax] .cover__img { will-change: transform; }
.zoom-ghost { position: fixed !important; z-index: 120; margin: 0 !important; pointer-events: none; overflow: hidden; clip-path: none !important; aspect-ratio: auto !important; transform-origin: 50% 50%; will-change: transform, opacity; }
.zoom-ghost .phone { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), inset 0 0 0 4px #1d1d1f; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pcard { aspect-ratio: 16 / 11; }
  .pcard__info { right: 45%; }
  .st-row { grid-template-columns: minmax(170px, 3fr) minmax(0, 5fr) 100px 16px; }
}
@media (max-width: 720px) {
  body { font-size: 17px; }
  .nav { display: none; }
  .menu-btn { top: 14px; opacity: 1; scale: 1; pointer-events: auto; }
  .topbar__in { height: 68px; }
  .cover.only-desk { display: none; }
  .cover.only-mob { display: grid; }
  .grid12 { grid-template-columns: 1fr; gap: 20px; }
  .grid12 > * { grid-column: 1 / -1 !important; }
  .pcard { width: 88%; aspect-ratio: 4 / 5.4; }
  .pcard__shots { top: 6%; left: 8%; right: 8%; width: auto; justify-content: center; }
  .pcard__info { right: 18px; }
  .pcard__quote { display: none; }
  .intro__photo { max-width: 260px; }
  .step { grid-template-columns: 28px 1fr; gap: 6px 12px; padding: 22px 0; }
  .step__n { grid-column: 1; }
  .step__t, .step__d { grid-column: 2 !important; }
  .mosaic a { height: 300px; }
  .mailer { padding: 4px 14px 14px; }
  .mailer label, .mailer .to { grid-template-columns: 64px 1fr auto; }
  .footer__in { grid-template-columns: 1fr; justify-items: start; }
  .footer__links { justify-self: start; }
  .cards { grid-template-columns: 1fr; }
  .case-meta > div { grid-template-columns: 96px 1fr; }
  .case-cover { aspect-ratio: 4 / 3; }
  .case-cover .cover--contain { --cpad: 6%; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story > div { grid-template-columns: 1fr; gap: 4px; }
  .about-photo { max-width: 300px; }
  .st-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: start; }
  .st-desc { grid-column: 1 / -1; padding-left: 54px; font-size: 15px; }
  .st-row .chip { grid-row: 1; grid-column: 2; margin-top: 8px; }
  .st-go { display: none; }
  .tbl-wrap { padding: 4px 16px; }
  .tbl thead { display: none; }
  .tbl tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .tbl tr:last-child { border-bottom: 0; }
  .tbl td { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; width: auto !important; padding: 3px 0; border: 0; white-space: normal !important; }
  .tbl td::before { content: attr(data-label); font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding-top: 3px; }
  .tbl td:first-child { display: block; font-size: 17px; margin-bottom: 4px; }
  .tbl td:first-child::before { display: none; }
}

/* ==========================================================================
   Real screens in an iPhone frame + the blocks of a big case
   ========================================================================== */

/* iPhone frame. Screenshots are 1320×2868; the island and the bezel are CSS, so nothing is cropped. */
.phone {
  position: relative; width: 100%; padding: 2.6%;
  border-radius: 15.4% / 7.3%; background: #0a0a0b;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), inset 0 0 0 4px #1d1d1f, 0 24px 40px -24px rgba(0, 0, 0, 0.9);
}
.phone__screen { position: relative; overflow: hidden; aspect-ratio: 1320 / 2868; border-radius: 13.4% / 6.17%; background: #000; }
.phone__screen img { width: 100%; height: 100%; object-fit: cover; }
.phone__island { position: absolute; left: 50%; top: 1.15%; width: 28.6%; aspect-ratio: 126 / 37; translate: -50% 0; border-radius: 999px; background: #000; }

/* project cards: phones instead of bare screenshots */
/* each phone gets its own GPU layer, so the hover lift/tilt is a cheap move, not a repaint of shadows */
.pcard__shots .phone, .card__shots .phone { flex: none; width: 30%; transition: transform .7s var(--spring); will-change: transform; backface-visibility: hidden; }
.card__shots .phone { width: 29%; }
.pcard__shots .phone:nth-child(2), .card__shots .phone:nth-child(2) { transform: translateY(-5%); }
.pcard:hover .pcard__shots .phone:nth-child(1) { transform: translateY(-3%) rotate(-2deg); }
.pcard:hover .pcard__shots .phone:nth-child(2) { transform: translateY(-9%); }
.pcard:hover .pcard__shots .phone:nth-child(3) { transform: translateY(-3%) rotate(2deg); }

/* case cover: three whole phones, the middle one larger */
.cover--phones {
  display: grid; place-items: center;
  background: radial-gradient(60% 80% at 50% 115%, color-mix(in oklab, var(--cover-accent) 34%, transparent), transparent 70%),
              radial-gradient(40% 50% at 50% 40%, rgba(255, 255, 255, 0.04), transparent 70%), var(--card);
}
.phones-hero { display: flex; align-items: center; justify-content: center; gap: 4.5%; width: 100%; height: 100%; padding: 4% 0; }
.phones-hero .phone { width: auto; height: 84%; aspect-ratio: 1376 / 2944; padding: 1.6%; }
.phones-hero .phone:nth-child(2) { height: 94%; }
.phones-hero .phone__screen { height: 100%; width: 100%; aspect-ratio: auto; }

/* a dark stage with 2–4 phones in a row */
.pstage { border-radius: var(--r); background: var(--card); padding: clamp(28px, 5vw, 72px) clamp(16px, 4vw, 64px) clamp(24px, 4vw, 56px); }
.phones {
  display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: clamp(14px, 3vw, 44px); align-items: start;
  max-width: calc(var(--n, 3) * 290px + (var(--n, 3) - 1) * 44px); margin-inline: auto;
}
.phone-fig figcaption { margin-top: 16px; text-align: center; font-size: 14px; line-height: 1.4; color: var(--muted); }

/* cards: research findings, the pivot */
.icards { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 12px; }
.icard { padding: clamp(20px, 2.2vw, 28px); border-radius: var(--r); background: var(--card); display: flex; flex-direction: column; gap: 10px; }
.icard__eye { color: var(--faint); }
.icard__t { margin: 0; font-size: clamp(19px, 1.5vw, 22px); line-height: 1.3; letter-spacing: -0.02em; font-weight: 400; }
.icard__d { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.icard__list { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 15px; line-height: 1.45; color: var(--text-2); }
.icard__list li { padding-left: 16px; position: relative; }
.icard__list li::before { content: ""; position: absolute; left: 0; top: .62em; width: 6px; height: 1px; background: var(--faint); }
.icard--warn { background: #2a1412; }
.icard--warn .icard__eye { color: #ff8a7a; }
.icard--new .icard__eye { color: #7fd18b; }

/* a board of early wireframes, straight from Figma — whole frames, never cropped */
.wboard { border-radius: var(--r); background: #2b2b2b; padding: clamp(20px, 3.6vw, 48px); }
.wboard__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-bottom: clamp(18px, 2.4vw, 32px); color: rgba(255, 255, 255, 0.7); }
.wboard__note { font-size: 14px; color: rgba(255, 255, 255, 0.45); }
.wboard__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px) clamp(10px, 1.6vw, 22px); }
.wf img { width: 100%; aspect-ratio: 402 / 874; border-radius: 10% / 4.6%; background: #fff; }
.wf figcaption { margin-top: 10px; font-size: 13px; line-height: 1.35; color: rgba(255, 255, 255, 0.62); }
.wf figcaption .mono { font-size: 10px; color: rgba(255, 255, 255, 0.4); margin-right: 4px; }

/* recreated iOS elements: the UI audit before / after */
.kit { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", var(--font); }
.kit__side { padding: clamp(22px, 3vw, 40px); border-radius: var(--r); background: var(--card); min-width: 0; }
.kit__eye--before { color: #ff8a7a; }
.kit__eye--after { color: #7fd18b; }
.kit h4 { margin: 30px 0 14px; font-size: 17px; font-weight: 500; letter-spacing: -0.01em; }
.kit h4:first-of-type { margin-top: 22px; }
.kit figure { margin: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.kit figcaption { color: var(--faint); font-size: 10px; }
.kit-row { display: flex; gap: 22px; flex-wrap: wrap; }
.kit-c {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff;
  background: rgba(118, 118, 128, 0.32); box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.25);
}
.kit-c--alt { background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); }
.kit-c svg { width: var(--s); height: var(--s); fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.kit-c svg circle { fill: currentColor; stroke: none; }
.kit-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; align-items: end; }
.kit-btns figure { flex-direction: row; align-items: center; gap: 10px; }
.kit-btns--after { grid-template-columns: 1fr; }
.kit-btn {
  flex: 1; min-width: 0; height: var(--h); border-radius: 999px; background: #fff; color: #000;
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap;
}
.kit-btns--after .kit-btn { flex: none; width: min(260px, 70%); }
.kit-btns figcaption { min-width: 22px; }
.kit-sheets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kit-sheet {
  position: relative; height: 58px; border-radius: 16px; background: #222224; display: grid; place-items: center;
  font-size: 15px;
}
.kit-sheet b { font-weight: 600; }
.kit-sheet__l, .kit-sheet__r { position: absolute; top: 50%; translate: 0 -50%; display: flex; }
.kit-sheet__l { left: 8px; } .kit-sheet__r { right: 8px; }
.kit-sheet .kit-c { width: 38px; height: 38px; }
.kit-link { font-style: normal; color: #0a84ff; padding: 0 8px; }
.kit-rules { display: grid; gap: 10px; }
.kit-rules > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: center; }
.kit-rules p { margin: 0; font-size: 14px; line-height: 1.4; color: var(--muted); }

/* recreated element: Letterboxd stars → Lowo's ten */
.rmap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rmap > div { padding: 22px 24px; border-radius: var(--r); background: var(--card); display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rmap__stars { color: #00e054; font-size: 18px; letter-spacing: 0.06em; white-space: nowrap; }
.rmap__to { color: var(--faint); font-size: 15px; }
.rmap__n { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", var(--font); font-size: 34px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.rmap__n small { font-size: 15px; font-weight: 400; color: var(--muted); margin-left: 2px; }

@media (max-width: 1024px) {
  .kit { grid-template-columns: 1fr; }
  .rmap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .icards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .case-cover:has(.cover--phones) { aspect-ratio: 5 / 4; }
  .phones-hero { gap: 3%; }
  .pstage { padding: 24px 0 20px; }
  .phones { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 14px; padding-inline: 24px; max-width: none; }
  .phones::-webkit-scrollbar { display: none; }
  .phones > .phone-fig { flex: none; width: 62%; scroll-snap-align: center; }
  .icards { grid-template-columns: 1fr; }
  .wboard { padding: 20px 0; }
  .wboard__head { padding-inline: 20px; }
  .wboard__grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 12px; padding-inline: 20px; }
  .wboard__grid::-webkit-scrollbar { display: none; }
  .wboard__grid > .wf { flex: none; width: 46%; scroll-snap-align: start; }
  .kit-btns { grid-template-columns: 1fr; }
  .kit-sheets { grid-template-columns: 1fr; }
  .kit-rules > div { grid-template-columns: 1fr; gap: 6px; }
  .rmap { grid-template-columns: 1fr 1fr; }
  .rmap > div { padding: 16px; flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
  [data-split] .w { opacity: 1 !important; }
}
