/* ==========================================================================
   Syed Fakhrul — portfolio
   Tokens → base → layout → components → pages → motion
   ========================================================================== */

:root {
  --bg: #0b0c0b;
  --bg-2: #111311;
  --surface: #161916;
  --surface-2: #1c201c;
  --line: rgba(240, 236, 226, 0.09);
  --line-2: rgba(240, 236, 226, 0.16);
  --text: #f0ece2;
  --text-2: #b9b4a8;
  --text-3: #8a867c;
  --gold: #d4a94f;
  --gold-2: #f0d08a;
  --on-gold: #1a1408;
  --ok: #6fcf97;
  --warn: #f2c94c;
  --info: #7fb2ff;

  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;

  --radius: 18px;
  --radius-sm: 10px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: dark;
}

/* Per-project accent, set on any element with data-accent */
[data-accent="ledger"] { --accent: #2f9e8a; --accent-ink: #0f5c52; }
[data-accent="mobile"] { --accent: #5cc2a8; --accent-ink: #0f5c52; }
[data-accent="maya"] { --accent: #5ec8d0; --accent-ink: #1b2a52; }
[data-accent="relay"] { --accent: #ff4d57; --accent-ink: #ec0c18; }
[data-accent="boost"] { --accent: #8b7cff; --accent-ink: #4f46e5; }
[data-accent="invites"] { --accent: #e3a0ad; --accent-ink: #7a3445; }
[data-accent="labs"] { --accent: #f2c94c; --accent-ink: #6b5310; }
[data-accent="greygorilla"] { --accent: #ff3b3b; --accent-ink: #c1121f; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--gold); color: var(--on-gold); }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--on-gold); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* grain + glow backdrop */
.backdrop { position: fixed; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.backdrop::before {
  content: ""; position: absolute; inset: -20%;
  background:
    radial-gradient(40% 35% at var(--mx, 70%) var(--my, 20%), rgba(212, 169, 79, 0.13), transparent 70%),
    radial-gradient(35% 30% at 10% 90%, rgba(47, 158, 138, 0.08), transparent 70%);
  transition: background-position 0.3s;
}
.backdrop::after {
  content: ""; position: absolute; inset: 0; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--on-gold);
  font-family: var(--font-display); font-size: 20px; font-style: italic;
}
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  text-decoration: none; color: var(--text-2); font-size: 14px; font-weight: 600;
  padding: 10px 12px; border-radius: 10px; transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links .btn { margin-left: 8px; }
@media (max-width: 760px) { .nav-links a:not(.btn) { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 0 20px; border-radius: 999px; text-decoration: none; cursor: pointer;
  font: 700 14px/1 var(--font-sans); letter-spacing: 0.01em;
  border: 1px solid var(--line-2); color: var(--text); background: transparent;
  transition: transform 0.25s var(--ease-spring), background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--text-3); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.btn-gold:hover { background: var(--gold-2); border-color: var(--gold-2); }
.btn svg { width: 16px; height: 16px; flex: none; }
.nav-links .btn { min-height: 40px; padding: 0 16px; color: var(--on-gold); }

/* ---------- typography ---------- */
.eyebrow {
  font: 500 12px/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
.display { font-family: var(--font-display); font-weight: 400; line-height: 0.98; letter-spacing: -0.01em; }
.display em { font-style: italic; color: var(--gold-2); }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--text-2); max-width: 62ch; }
.muted { color: var(--text-3); }
.mono { font-family: var(--font-mono); }

/* ---------- hero ---------- */
.hero { padding: clamp(56px, 10vw, 120px) 0 clamp(48px, 7vw, 88px); position: relative; }
.hero h1 { font-size: clamp(48px, 9.5vw, 132px); margin: 22px 0 24px; }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero h1 .line > span { display: inline-block; }
.hero-role {
  font-size: clamp(18px, 2vw, 22px); color: var(--text-2); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline;
}
.typer { color: var(--text); font-weight: 700; border-right: 2px solid var(--gold); padding-right: 4px; white-space: nowrap; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 28px; font-size: 14px; color: var(--text-3); }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta svg { width: 15px; height: 15px; }
.avail { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(111, 207, 151, 0.6); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(111, 207, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(111, 207, 151, 0); } }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: clamp(48px, 7vw, 80px); }
.stat { padding: 22px 22px 20px; border-right: 1px solid var(--line); background: color-mix(in oklab, var(--surface) 55%, transparent); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-family: var(--font-display); font-size: clamp(36px, 4.6vw, 56px); font-weight: 400; line-height: 1; color: var(--text); }
.stat span { display: block; margin-top: 8px; font-size: 13px; color: var(--text-3); line-height: 1.4; }
@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
}

/* marquee */
.marquee { border-block: 1px solid var(--line); overflow: hidden; padding: 18px 0; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 44px; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font: 500 14px/1 var(--font-mono); color: var(--text-3); white-space: nowrap; display: inline-flex; align-items: center; gap: 44px; }
.marquee-track span::after { content: "✦"; color: var(--gold); font-size: 10px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 { font-size: clamp(38px, 6vw, 72px); margin-top: 16px; }
.section-head p { margin: 14px 0 0; }
@media (max-width: 760px) { .section-head { grid-template-columns: 1fr; } }

.split-label {
  display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); font: 600 12px/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2);
}
.split-label i { width: 8px; height: 8px; border-radius: 2px; background: var(--gold); display: inline-block; }

/* ---------- project cards ---------- */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.card {
  --accent: var(--gold);
  grid-column: span 6; position: relative; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); overflow: hidden;
  text-decoration: none; color: inherit; display: flex; flex-direction: column;
  transition: transform 0.5s var(--ease-out), border-color 0.3s, box-shadow 0.5s var(--ease-out);
  isolation: isolate;
}
.card.wide { grid-column: span 12; }
.card.third { grid-column: span 4; }
.card::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(420px circle at var(--cx, 50%) var(--cy, 50%), color-mix(in oklab, var(--accent) 22%, transparent), transparent 60%);
}
.card:hover { transform: translateY(-6px); border-color: color-mix(in oklab, var(--accent) 45%, transparent); box-shadow: 0 30px 60px -30px color-mix(in oklab, var(--accent) 45%, transparent); }
.card:hover::before { opacity: 1; }
@media (max-width: 960px) { .card, .card.third { grid-column: span 12; } }

.card-media {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in oklab, var(--accent) 26%, var(--surface-2)), var(--bg-2) 70%);
  display: grid; place-items: center; padding: 26px 26px 0;
}
.card.wide .card-media { aspect-ratio: 21 / 9; }
@media (max-width: 960px) { .card.wide .card-media { aspect-ratio: 16 / 10; } }

/* browser frame with scrolling full-page screenshot */
.browser {
  width: 100%; height: 100%; border-radius: 12px 12px 0 0; overflow: hidden; background: #fff;
  box-shadow: 0 -10px 40px -10px rgba(0, 0, 0, 0.6); border: 1px solid rgba(255, 255, 255, 0.12); border-bottom: 0;
  display: flex; flex-direction: column; transform: translateY(14px); transition: transform 0.6s var(--ease-out);
}
.card:hover .browser { transform: translateY(4px); }
.browser-bar { height: 28px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 12px; background: #1d1f1d; }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: #3a3d3a; }
.browser-bar i:nth-child(1) { background: #ff5f57; } .browser-bar i:nth-child(2) { background: #febc2e; } .browser-bar i:nth-child(3) { background: #28c840; }
.browser-bar span { margin-left: 10px; font: 500 11px/1 var(--font-mono); color: #8d918d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browser-view { flex: 1; overflow: hidden; position: relative; }
.browser-view img { width: 100%; height: auto; transition: transform 4.5s cubic-bezier(0.45, 0, 0.25, 1); will-change: transform; }
.card:hover .browser-view img.scroll { transform: translateY(var(--scroll, -40%)); }

/* phone frames */
.phones { display: flex; gap: 16px; align-items: flex-end; justify-content: center; height: 100%; }
.phone {
  width: clamp(110px, 24%, 170px); aspect-ratio: 9 / 19.5; border-radius: 22px; background: #050505; padding: 5px;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.7); border: 1px solid rgba(255, 255, 255, 0.14);
  transform: translateY(24px); transition: transform 0.6s var(--ease-out);
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 17px; }
.phone:nth-child(2) { transform: translateY(6px); }
.card:hover .phone { transform: translateY(10px); }
.card:hover .phone:nth-child(2) { transform: translateY(-6px); }
.card:hover .phone:nth-child(3) { transform: translateY(2px); }

.card-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; position: relative; z-index: 3; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-logo { height: 26px; width: auto; max-width: 150px; object-fit: contain; }
.card-logo.round { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; }
.card-name { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.01em; white-space: nowrap; }
.card-top { flex-wrap: wrap; }
.card h3 { font-size: 21px; font-weight: 800; }
.card p { margin: 0; color: var(--text-2); font-size: 15px; }
.card-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; }
.more { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--text); white-space: nowrap; }
.more svg { width: 16px; height: 16px; transition: transform 0.3s var(--ease-spring); }
.card:hover .more svg { transform: translateX(5px); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font: 500 11.5px/1 var(--font-mono); padding: 6px 9px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }

.status { font: 600 11.5px/1 var(--font-mono); letter-spacing: 0.03em; padding: 6px 10px; border-radius: 999px; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; border: 1px solid var(--line-2); color: var(--text-2); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.status.live::before { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.status.test::before { background: var(--warn); }
.status.paused::before { background: #e57373; }
.status.is-client { color: var(--text); border-color: color-mix(in oklab, var(--accent) 60%, transparent); }
.status.is-client::before { background: var(--accent); }

/* real product logos sit on a light chip so dark marks stay visible */
.logo-chip { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #fbf8f1; flex: none; overflow: hidden; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); }
.logo-chip img { width: 30px; height: 30px; object-fit: contain; border-radius: 7px; }
.logo-chip.word { width: auto; padding: 0 10px; font-family: Georgia, serif; font-size: 14px; color: #7a3445; font-weight: 600; }
.p-hero .logo-chip { width: 56px; height: 56px; border-radius: 14px; }
.p-hero .logo-chip img { width: 50px; height: 50px; }
.p-hero .logo-chip.word { width: auto; height: 56px; padding: 0 16px; font-size: 22px; }
.tresura-logo { width: 200px; height: auto; background: #fbf8f1; padding: 12px 18px; border-radius: 14px; }

.icon-stage { display: flex; gap: 22px; align-items: center; justify-content: center; height: 100%; padding-bottom: 26px; }
.icon-stage img { width: 84px; height: 84px; border-radius: 20px; background: #fbf8f1; padding: 10px; object-fit: contain; filter: grayscale(0.4); box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.7); transition: transform 0.6s var(--ease-spring), filter 0.4s; }
.card:hover .icon-stage img { filter: none; transform: translateY(-6px) rotate(-4deg); }
.card:hover .icon-stage img + img { transform: translateY(-6px) rotate(4deg); }
.icon-stage.big { padding: 40px 0 60px; }
.icon-stage.big img { width: 120px; height: 120px; }
.card.slim { flex-direction: row; }
.card.slim .card-media { aspect-ratio: auto; width: 34%; padding: 22px; }
.card.slim .icon-stage { padding: 0; }
@media (max-width: 760px) { .card.slim { flex-direction: column; } .card.slim .card-media { width: 100%; aspect-ratio: 16 / 7; } }

/* client section */
.client {
  border-radius: calc(var(--radius) + 6px); border: 1px solid var(--line); overflow: hidden;
  background: radial-gradient(120% 120% at 100% 0%, rgba(193, 18, 31, 0.22), transparent 55%), var(--surface);
  display: grid; grid-template-columns: 1.05fr 1fr; text-decoration: none; color: inherit; position: relative;
  transition: transform 0.5s var(--ease-out), border-color 0.3s;
}
.client:hover { transform: translateY(-6px); border-color: rgba(255, 59, 59, 0.45); }
.client-copy { padding: clamp(28px, 4vw, 52px); display: flex; flex-direction: column; gap: 16px; }
.client-copy h3 { font-family: var(--font-display); font-weight: 400; font-size: clamp(40px, 5vw, 64px); line-height: 1; }
.client-media { position: relative; min-height: 380px; }
.client-media img { position: absolute; border-radius: 12px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8); border: 1px solid rgba(255, 255, 255, 0.1); transition: transform 0.7s var(--ease-out); }
.client-media .m1 { width: 86%; top: 40px; left: 0; }
.client-media .m2 { width: 30%; bottom: 26px; right: 26px; border-radius: 18px; }
.client:hover .m1 { transform: translate(-6px, -8px) rotate(-1deg); }
.client:hover .m2 { transform: translate(6px, -14px) rotate(2deg); }
.client-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px 0; }
.client-facts div { border-top: 1px solid var(--line-2); padding-top: 10px; }
.client-facts b { display: block; font-size: 22px; }
.client-facts span { font-size: 12.5px; color: var(--text-3); }
@media (max-width: 900px) { .client { grid-template-columns: 1fr; } .client-media { min-height: 300px; } }

/* timeline */
.timeline { position: relative; display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 200px 1fr; gap: 28px; padding: 28px 0; border-top: 1px solid var(--line); }
.tl-item:last-child { border-bottom: 1px solid var(--line); }
.tl-when { font: 500 13px/1.5 var(--font-mono); color: var(--text-3); }
.tl-what h3 { font-size: 20px; font-weight: 800; }
.tl-what .org { color: var(--gold); font-weight: 600; font-size: 15px; margin-top: 2px; }
.tl-what ul { margin: 12px 0 0; padding-left: 18px; color: var(--text-2); }
.tl-what li { margin: 6px 0; }
.tl-roles { display: grid; gap: 18px; margin-top: 14px; }
.tl-role { padding-left: 16px; border-left: 2px solid var(--line-2); }
.tl-role b { font-size: 15px; }
.tl-role .when { font: 500 12px var(--font-mono); color: var(--text-3); margin-left: 8px; }
@media (max-width: 760px) { .tl-item { grid-template-columns: 1fr; gap: 8px; } }

/* skills */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.skill { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: var(--surface); }
.skill h3 { font-size: 16px; font-weight: 800; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.skill h3 svg { width: 18px; height: 18px; color: var(--gold); }
@media (max-width: 960px) { .skills { grid-template-columns: 1fr; } }

/* edu */
.edu { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.edu div { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.edu b { display: block; font-size: 17px; }
@media (max-width: 760px) { .edu { grid-template-columns: 1fr; } }

/* contact */
.contact { text-align: center; padding: clamp(80px, 12vw, 150px) 0; }
.contact h2 { font-size: clamp(48px, 9vw, 120px); }
.contact .hero-cta { justify-content: center; }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--text-3); font-size: 13px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }

/* ==========================================================================
   Project detail pages
   ========================================================================== */
.p-hero { padding: clamp(40px, 7vw, 88px) 0 clamp(28px, 4vw, 48px); }
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 14px; min-height: 44px; }
.back:hover { color: var(--text); }
.back svg { width: 16px; height: 16px; transition: transform 0.3s var(--ease-spring); }
.back:hover svg { transform: translateX(-4px); }
.p-hero h1 { font-size: clamp(52px, 9vw, 116px); margin: 18px 0 18px; }
.p-logo { height: 44px; width: auto; }
.p-logo.round { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; }
.p-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 40px; border-top: 1px solid var(--line); }
.p-meta div { padding: 18px 18px 0 0; }
.p-meta dt { font: 500 11.5px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); }
.p-meta dd { margin: 8px 0 0; font-weight: 600; }
.p-meta a { color: var(--accent, var(--gold)); }
@media (max-width: 760px) { .p-meta { grid-template-columns: 1fr 1fr; } }

.showcase { border-radius: calc(var(--radius) + 4px); overflow: hidden; border: 1px solid var(--line);
  background: linear-gradient(160deg, color-mix(in oklab, var(--accent) 28%, var(--surface-2)), var(--bg-2) 75%); padding: clamp(18px, 4vw, 48px) clamp(18px, 4vw, 48px) 0; }
.showcase .browser { transform: none; border-radius: 12px 12px 0 0; }
.showcase .browser-view { max-height: 640px; overflow: auto; scrollbar-width: thin; }
.showcase .phones { padding-bottom: 0; }
.showcase .phone { width: clamp(120px, 22%, 230px); transform: translateY(20px); }

.p-body { display: grid; grid-template-columns: 260px 1fr; gap: clamp(28px, 5vw, 72px); padding: clamp(48px, 7vw, 88px) 0; }
.toc { position: sticky; top: 92px; align-self: start; display: grid; gap: 2px; }
.toc a { text-decoration: none; color: var(--text-3); font-size: 14px; font-weight: 600; padding: 9px 12px; border-left: 2px solid var(--line); transition: color 0.2s, border-color 0.2s; }
.toc a:hover, .toc a.active { color: var(--text); border-left-color: var(--accent, var(--gold)); }
@media (max-width: 900px) { .p-body { grid-template-columns: 1fr; } .toc { display: none; } }

.block { margin-bottom: clamp(48px, 6vw, 72px); scroll-margin-top: 90px; }
.block h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(32px, 4vw, 46px); margin-bottom: 18px; }
.block p { color: var(--text-2); margin: 0 0 14px; max-width: 70ch; }
.block p strong { color: var(--text); }

.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.feature { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px 20px; background: var(--surface); }
.feature h3 { font-size: 15.5px; font-weight: 800; margin-bottom: 8px; display: flex; gap: 10px; align-items: center; }
.feature h3::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent, var(--gold)); flex: none; }
.feature ul { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 14.5px; }
.feature li { margin: 4px 0; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }

.numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.numbers div { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; }
.numbers b { display: block; font-family: var(--font-display); font-size: 40px; font-weight: 400; line-height: 1; }
.numbers span { display: block; margin-top: 8px; font-size: 13px; color: var(--text-3); }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gallery.phones-g { grid-template-columns: repeat(4, 1fr); }
.gallery button { all: unset; cursor: zoom-in; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); display: block; position: relative; }
.gallery button:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; object-position: top; aspect-ratio: 16 / 10; transition: transform 0.6s var(--ease-out); }
.gallery.phones-g img { aspect-ratio: 9 / 19.5; }
.gallery button:hover img { transform: scale(1.04); }
.gallery figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 10px; font-size: 12.5px; font-weight: 600; background: linear-gradient(transparent, rgba(0, 0, 0, 0.78)); color: #fff; }
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr 1fr; } .gallery.phones-g { grid-template-columns: 1fr 1fr; } }

.notes { border-left: 3px solid var(--warn); background: color-mix(in oklab, var(--warn) 7%, var(--surface)); padding: 16px 20px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.notes p { margin: 0 0 8px; color: var(--text-2); }
.notes p:last-child { margin: 0; }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; display: grid; gap: 0; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line); color: var(--text-2); }
.steps li b { font: 500 12.5px/1.6 var(--font-mono); color: var(--text-3); }
@media (max-width: 560px) { .steps li { grid-template-columns: 1fr; gap: 2px; } }

.next { display: flex; justify-content: space-between; gap: 16px; padding: 32px 0 64px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.next a { text-decoration: none; display: grid; gap: 4px; min-height: 44px; }
.next small { color: var(--text-3); font: 500 12px var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; }
.next span { font-family: var(--font-display); font-size: clamp(26px, 3vw, 36px); }
.next a:hover span { color: var(--gold-2); }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(5, 6, 5, 0.92); display: none; place-items: center; padding: 24px; backdrop-filter: blur(8px); }
.lightbox.open { display: grid; animation: fade 0.25s var(--ease-out); }
.lightbox img { max-height: 88vh; width: auto; max-width: 100%; border-radius: 12px; box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6); animation: zoom 0.35s var(--ease-out); }
.lightbox p { color: var(--text-2); text-align: center; margin: 12px 0 0; font-size: 14px; }
.lightbox button { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); cursor: pointer; font-size: 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes zoom { from { transform: scale(0.94); opacity: 0; } }

/* ==========================================================================
   Motion
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.hero h1 .line > span { transform: translateY(105%); animation: rise 1.1s var(--ease-out) forwards; animation-delay: var(--d, 0s); }
@keyframes rise { to { transform: none; } }
.fade-up { opacity: 0; animation: fadeUp 1s var(--ease-out) forwards; animation-delay: var(--d, 0s); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal, .fade-up { opacity: 1; transform: none; }
  .hero h1 .line > span { transform: none; }
  .marquee-track { animation: none; }
}
