/* ───────────── Tokens ───────────── */
:root {
  --bg: #070707;
  --bg-2: #111112;
  --fg: #ece8e1;
  --muted: #8a8780;
  --line: rgba(236, 232, 225, 0.12);
  --accent: #ff5b2e;
  --accent-2: #ffb36b;

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter Tight", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --pad: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { -webkit-font-smoothing: antialiased; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }

a { color: inherit; text-decoration: none; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; }
::selection { background: var(--accent); color: var(--bg); }

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* split text helpers */
.split-line { display: inline-block; white-space: nowrap; overflow: hidden; vertical-align: top; padding-bottom: 0.06em; }
.char, .word { display: inline-block; will-change: transform; }

/* ───────────── Preloader ───────────── */
.loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg-2); clip-path: inset(0 0 0% 0);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--pad);
}
.loader__inner { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.loader__name { font-family: var(--serif); font-style: italic; font-size: clamp(28px, 4vw, 48px); }
.loader__count {
  font-size: clamp(80px, 18vw, 240px); font-weight: 700; line-height: 0.8;
  letter-spacing: -0.05em; font-variant-numeric: tabular-nums;
}
.loader__bar { margin-top: 24px; height: 1px; background: var(--line); }
.loader__bar span { display: block; height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }

/* ───────────── Cursor ───────────── */
.cursor, .cursor-dot {
  position: fixed; top: 0; left: 0; z-index: 90; pointer-events: none;
  border-radius: 50%;
}
.cursor {
  width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border: 1px solid rgba(236, 232, 225, 0.45);
  display: grid; place-items: center;
  transition: width .35s var(--ease), height .35s var(--ease), margin .35s var(--ease), background .35s, border-color .35s;
}
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent); }
.cursor__label {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--bg); opacity: 0; transition: opacity .2s;
}
.cursor.is-active {
  width: 88px; height: 88px; margin: -44px 0 0 -44px;
  background: var(--accent); border-color: var(--accent);
}
.cursor.is-active .cursor__label { opacity: 1; }
.cursor.is-link { width: 64px; height: 64px; margin: -32px 0 0 -32px; border-color: var(--accent); }
@media (hover: none), (pointer: coarse) { .cursor, .cursor-dot { display: none; } }

/* ───────────── Page transition ───────────── */
.transition {
  position: fixed; inset: 0; z-index: 110; pointer-events: none;
  background: var(--accent); color: var(--bg);
  display: grid; place-items: center; padding: var(--pad);
  clip-path: inset(100% 0 0 0);
}
.is-entering .transition { clip-path: inset(0% 0 0 0); }
.is-entering .loader { display: none; }
.transition__label {
  font-family: var(--serif); font-style: italic; text-align: center;
  font-size: clamp(48px, 9vw, 140px); line-height: 1; letter-spacing: -0.02em;
}

/* Back/Forward: the browser animates between pages (Chrome, Edge, Safari 18+).
   Old page eases back; the new page (which starts under the orange overlay) rises over it. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .7s cubic-bezier(.76, 0, .24, 1) both; }
::view-transition-new(root) { animation: vt-in .7s cubic-bezier(.76, 0, .24, 1) both; }
::view-transition-group(root) { background: var(--bg); }
@keyframes vt-out { to { transform: translateY(-4%) scale(.96); opacity: .35; } }
@keyframes vt-in { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ───────────── Misc chrome ───────────── */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 80;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
}
.grain {
  position: fixed; inset: -50%; z-index: 70; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5%, 3%); }
  40% { transform: translate(4%, -6%); }
  60% { transform: translate(-3%, 8%); }
  80% { transform: translate(6%, -2%); }
}

/* ───────────── Nav ───────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 20px var(--pad);
  mix-blend-mode: difference;
}
.nav__logo { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; padding: 6px; }
.nav__links { display: flex; gap: 28px; }
.nav__links a { font-size: 14px; position: relative; padding: 4px 0; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.nav__status i { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 0 rgba(61,220,132,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(61,220,132,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); } }

.nav__menu { display: none; background: none; border: 0; width: 36px; height: 36px; position: relative; cursor: pointer; }
.nav__menu span { position: absolute; left: 6px; right: 6px; height: 1.5px; background: var(--fg); transition: transform .4s var(--ease); }
.nav__menu span:first-child { top: 14px; }
.nav__menu span:last-child { top: 21px; }
.nav__menu[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav__menu[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0; z-index: 55; background: var(--bg-2);
  display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: var(--pad);
  clip-path: inset(0 0 100% 0); visibility: hidden;
}
.mobile-menu a { font-size: clamp(40px, 12vw, 72px); font-weight: 600; letter-spacing: -0.04em; line-height: 1.1; }

@media (max-width: 860px) {
  .nav__links, .nav__status { display: none; }
  .nav__menu { display: block; }
}

/* ───────────── Hero ───────────── */
.hero {
  position: relative; min-height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 110px var(--pad) 40px;
}
.hero__blob {
  position: absolute; width: 60vw; height: 60vw; max-width: 820px; max-height: 820px;
  top: 10%; left: 45%; border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle at 30% 30%, var(--accent), transparent 60%);
  filter: blur(80px); opacity: .45;
}
.hero__blob--2 {
  top: 40%; left: 5%; width: 40vw; height: 40vw;
  background: radial-gradient(circle, var(--accent-2), transparent 60%); opacity: .2;
}
.hero__sphere {
  position: absolute; z-index: 0; pointer-events: none;
  width: min(70vw, 760px); height: min(70vw, 760px);
  top: 50%; right: -4vw; margin-top: calc(min(70vw, 760px) * -0.55);
}
.hero__sphere canvas { width: 100%; height: 100%; display: block; }
@media (max-width: 860px) { .hero__sphere { width: 110vw; height: 110vw; right: -30vw; top: 38%; margin-top: -60vw; opacity: .7; } }
.hero > *:not(.hero__blob):not(.hero__sphere) { position: relative; z-index: 1; }
.hero__meta { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.hero__title {
  font-weight: 700; letter-spacing: -0.055em; line-height: 0.86;
  font-size: clamp(72px, 17vw, 280px);
  margin: 6vh 0;
}
.hero__line { display: block; }
.hero__line--indent { padding-left: 12vw; }
.hero__line em { font-weight: 400; letter-spacing: -0.03em; color: var(--accent); }

.hero__bottom {
  display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 32px; align-items: end;
  border-top: 1px solid var(--line); padding-top: 24px;
}
/* "I build" + rotating word: both sit in identical 1.3em line boxes so their baselines line up.
   The serif runs small next to Inter Tight, so it's bumped up and nudged to share the baseline. */
.hero__roles { font-size: clamp(22px, 2.6vw, 36px); letter-spacing: -0.02em; display: flex; align-items: flex-start; gap: .3em; flex-wrap: wrap; line-height: 1.3; }
.hero__roles-lead { display: block; height: 1.3em; line-height: 1.3em; }
.roles { display: block; height: 1.3em; overflow: hidden; }
.roles__track { display: flex; flex-direction: column; }
.roles__track span {
  --scale: 1.12;
  display: block; white-space: nowrap;
  font-family: var(--serif); font-style: italic; font-size: calc(var(--scale) * 1em); color: var(--accent-2);
  height: calc(1.3em / var(--scale)); line-height: calc(1.3em / var(--scale)); /* = the parent's 1.3em */
}
.hero__intro { color: var(--muted); max-width: 42ch; }
.hero__scroll {
  width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center;
}
@media (max-width: 860px) {
  .hero__bottom { grid-template-columns: 1fr; }
  .hero__scroll { display: none; }
  .hero__line--indent { padding-left: 0; }
}

/* ───────────── Marquee ───────────── */
.marquee {
  border-block: 1px solid var(--line); overflow: hidden; padding: 22px 0;
  background: var(--bg-2);
}
.marquee__track { display: flex; width: max-content; }
.marquee__item {
  display: inline-flex; align-items: center; gap: 40px; padding-right: 40px;
  font-size: clamp(28px, 4vw, 56px); font-weight: 600; letter-spacing: -0.03em; white-space: nowrap;
}
.marquee__item:nth-child(even) { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--muted); }
.marquee__item::after { content: "✦"; font-size: .4em; color: var(--accent); font-style: normal; }

/* ───────────── Sections ───────────── */
.section { padding: clamp(96px, 14vw, 180px) var(--pad); }
.section__head {
  display: flex; align-items: baseline; gap: 12px 20px; flex-wrap: wrap;
  margin-bottom: clamp(40px, 6vw, 80px);
}
.section__index { color: var(--accent); white-space: nowrap; }
.section__title { font-size: clamp(40px, 8vw, 120px); font-weight: 600; letter-spacing: -0.05em; line-height: .95; }

/* About */
.about__text {
  font-size: clamp(22px, 2.8vw, 40px); line-height: 1.22; letter-spacing: -0.025em; font-weight: 500;
  max-width: 24ch; max-width: 1200px;
}
.about__text .word { opacity: .14; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(64px, 10vw, 140px); border-top: 1px solid var(--line);
}
.stat { padding: 32px 24px 0 0; }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--line); }
.stat__num { font-size: clamp(48px, 7vw, 104px); font-weight: 700; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__num sup { font-size: .4em; color: var(--accent); vertical-align: top; }
.stat__label { margin-top: 12px; display: block; }
@media (max-width: 700px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
}

.skills { margin-top: clamp(64px, 10vw, 140px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.skills__group h3 { margin-bottom: 18px; }
.skills__list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 14px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  transition: background .3s, color .3s, border-color .3s;
}
.chip:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
@media (max-width: 960px) { .skills { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .skills { grid-template-columns: 1fr; } }

/* Experience */
.exp { border-top: 1px solid var(--line); }
.exp__item { border-bottom: 1px solid var(--line); position: relative; }
.exp__item::before {
  content: ""; position: absolute; inset: 0; background: var(--bg-2);
  transform: scaleY(0); transform-origin: bottom; transition: transform .6s var(--ease); z-index: -1;
}
.exp__item:hover::before, .exp__item.is-open::before { transform: scaleY(1); }
.exp__head {
  width: 100%; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
  display: grid; grid-template-columns: 60px 1.4fr 1fr 180px 40px; align-items: center; gap: 24px;
  padding: 32px 12px;
}
.exp__company { font-size: clamp(22px, 2.8vw, 40px); font-weight: 600; letter-spacing: -0.01em; transition: transform .5s var(--ease); }
.exp__item:hover .exp__company { transform: translateX(10px); }
.exp__role { font-family: var(--serif); font-style: italic; font-size: clamp(18px, 1.8vw, 24px); color: var(--muted); }
.exp__icon { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); position: relative; }
.exp__icon::before, .exp__icon::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 12px; height: 1.5px; background: var(--fg);
  transform: translate(-50%, -50%); transition: transform .4s var(--ease);
}
.exp__icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.exp__item.is-open .exp__icon::after { transform: translate(-50%, -50%) rotate(0); }
.exp__body { height: 0; overflow: hidden; }
.exp__body-inner {
  display: grid; grid-template-columns: 60px 1.4fr 1fr; gap: 24px;
  padding: 0 12px 40px;
}
.exp__points { grid-column: 2; list-style: none; display: grid; gap: 14px; }
.exp__points li { padding-left: 24px; position: relative; color: #c9c5bd; max-width: 60ch; }
.exp__points li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }
.exp__aside { display: flex; flex-direction: column; gap: 16px; }
.exp__tags { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 860px) {
  .exp__head { grid-template-columns: 1fr 40px; gap: 8px 16px; }
  .exp__head > .mono:first-child { display: none; }
  .exp__company { grid-column: 1; }
  .exp__role { grid-column: 1; grid-row: 2; }
  .exp__period { grid-column: 1; grid-row: 3; }
  .exp__icon { grid-column: 2; grid-row: 1 / span 3; }
  .exp__body-inner { grid-template-columns: 1fr; }
  .exp__points { grid-column: 1; }
}

/* Work (horizontal) */
.work { position: relative; }
.work__pin { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 88px 0 32px; overflow: hidden; }
.work__head { padding: 0 var(--pad); margin-bottom: 32px; }
.work__counter { margin-left: auto; font-variant-numeric: tabular-nums; }
.work__track { display: flex; gap: 32px; padding: 0 var(--pad); width: max-content; }
.card {
  --card-w: min(476px, 78vw);
  width: var(--card-w); flex-shrink: 0; display: block;
  perspective: 1000px;
}
.card__inner { transform-style: preserve-3d; will-change: transform; }
.card__cover {
  /* 4:3, but shorter on short screens so the title, description and tags still fit the pinned view */
  height: max(220px, min(calc(var(--card-w) * 3 / 4), calc(100svh - 480px)));
  border-radius: 14px; overflow: hidden; position: relative; clip-path: inset(0 0 0 0%);
  background:
    radial-gradient(circle at 75% 25%, hsl(var(--h) 90% 62% / .9), transparent 55%),
    radial-gradient(circle at 20% 90%, hsl(calc(var(--h) + 40) 80% 50% / .7), transparent 55%),
    hsl(var(--h) 25% 12%);
}
.card__cover::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px; mask-image: linear-gradient(to bottom, #000, transparent);
}
.card__cover img { width: 100%; height: 100%; object-fit: cover; }
.card__num {
  position: absolute; left: 24px; bottom: 8px; z-index: 1;
  font-size: clamp(80px, 12vw, 160px); font-weight: 700; letter-spacing: -0.06em; line-height: 1;
  color: rgba(255,255,255,.9); mix-blend-mode: overlay;
}
.card__year { position: absolute; top: 20px; right: 20px; z-index: 1; color: rgba(255,255,255,.8); }
.card__body { padding: 22px 4px 0; display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; }
.card__title { font-size: clamp(24px, 2.4vw, 34px); font-weight: 600; letter-spacing: -0.03em; }
.card__arrow {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center;
  transition: background .3s, color .3s, transform .5s var(--ease);
}
.card:hover .card__arrow { background: var(--accent); border-color: var(--accent); color: var(--bg); transform: rotate(-45deg); }
.card__desc { color: var(--muted); grid-column: 1 / -1; max-width: 48ch; }
.card__tags { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.card__tags .chip { font-size: 12px; padding: 5px 12px; }

@media (max-width: 860px) {
  .work__pin { min-height: 0; padding: clamp(96px, 14vw, 180px) 0; }
  .work__track { flex-direction: column; width: auto; gap: 56px; }
  .card { width: 100%; }
  .card__cover { height: auto; aspect-ratio: 4 / 3; }   /* stacked cards scroll normally, so no height limit */
  .work__counter { display: none; }
}

/* Education */
.edu { border-top: 1px solid var(--line); margin-bottom: 56px; }
.edu__row {
  display: grid; grid-template-columns: 1.4fr 1fr 180px; gap: 24px; align-items: baseline;
  padding: 36px 0; border-bottom: 1px solid var(--line); position: relative; overflow: hidden;
}
.edu__school { font-size: clamp(24px, 3.4vw, 48px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; }
.edu__degree { font-family: var(--serif); font-style: italic; font-size: clamp(18px, 1.8vw, 24px); }
.edu__note { color: var(--muted); display: block; font-size: 14px; margin-top: 6px; font-family: var(--sans); font-style: normal; }
.edu__period { text-align: right; }
@media (max-width: 760px) {
  .edu__row { grid-template-columns: 1fr; gap: 8px; }
  .edu__period { text-align: left; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 18px 28px; border-radius: 999px; background: var(--fg); color: var(--bg);
  font-weight: 600; position: relative; overflow: hidden; isolation: isolate; cursor: pointer;
}
.btn::before {
  content: ""; position: absolute; inset: 0; background: var(--accent); z-index: -1;
  border-radius: 50%; transform: translateY(101%); transition: transform .6s var(--ease), border-radius .6s;
}
.btn:hover::before { transform: translateY(0) scale(1.4); border-radius: 0; }

/* Contact */
.contact {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  padding: 120px var(--pad) 80px; border-top: 1px solid var(--line);
}
.contact__title {
  font-size: clamp(56px, 11vw, 190px); font-weight: 700; letter-spacing: -0.055em; line-height: .9;
  margin: 32px 0 56px;
}
.contact__line { display: block; }
.contact__line em { color: var(--accent); font-weight: 400; letter-spacing: -0.03em; }
.contact__email {
  align-self: flex-start;
  font-size: clamp(20px, 3vw, 40px); letter-spacing: -0.02em;
  border-bottom: 1px solid var(--line); padding-bottom: 8px; transition: border-color .3s, color .3s;
  word-break: break-all;
}
.contact__email:hover { color: var(--accent); border-color: var(--accent); }
.contact__socials { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 48px; }
.contact__socials a {
  padding: 12px 22px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px;
  transition: background .3s, color .3s;
}
.contact__socials a:hover { background: var(--fg); color: var(--bg); }

.footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 28px var(--pad); border-top: 1px solid var(--line);
}
.footer__top:hover { color: var(--fg); }

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .about__text .word { opacity: 1; }
}

/* ───────────── Project page ───────────── */
.btn--ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn--ghost:hover { color: var(--bg); }

.phero { padding: 130px var(--pad) clamp(48px, 7vw, 96px); }
.phero__top { display: flex; justify-content: space-between; margin-bottom: clamp(32px, 6vw, 72px); }
.phero__back { color: var(--fg); transition: color .3s; }
.phero__back:hover { color: var(--accent); }
.phero__title {
  font-size: clamp(64px, 14vw, 230px); font-weight: 700; letter-spacing: -0.055em; line-height: .88;
}
.phero__lede {
  margin-top: clamp(24px, 4vw, 48px); max-width: 32ch;
  font-family: var(--serif); font-style: italic; font-size: clamp(24px, 3vw, 42px); line-height: 1.15; color: var(--accent-2);
}
.phero__meta {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  margin-top: clamp(40px, 6vw, 80px); padding-top: 24px; border-top: 1px solid var(--line);
}
.phero__meta dd { margin-top: 8px; font-size: 17px; }
@media (max-width: 760px) { .phero__meta { grid-template-columns: 1fr 1fr; } }

.pcover {
  width: 100%; height: 100%; position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 75% 25%, hsl(var(--h) 90% 62% / .9), transparent 55%),
    radial-gradient(circle at 20% 90%, hsl(calc(var(--h) + 40) 80% 50% / .7), transparent 55%),
    hsl(var(--h) 25% 12%);
}
.pcover::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: linear-gradient(to bottom, #000, transparent);
}
.pcover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcover-wrap { height: clamp(320px, 80vh, 900px); overflow: hidden; margin: 0 var(--pad); border-radius: 20px; }
.pcover--hero { clip-path: inset(0% 0% 0 0% round 0px); }

.pcontent { padding: clamp(80px, 12vw, 160px) var(--pad) 0; }
.pblock {
  display: grid; grid-template-columns: 1fr 3fr; gap: 32px;
  padding: clamp(40px, 6vw, 72px) 0; border-top: 1px solid var(--line);
}
.pblock__label { color: var(--accent); }
.pblock__body > p { font-size: clamp(18px, 1.6vw, 22px); color: #c9c5bd; max-width: 60ch; }
.pblock__body > p.pblock__lead { font-size: clamp(24px, 3vw, 42px); line-height: 1.2; letter-spacing: -0.025em; color: var(--fg); font-weight: 500; max-width: none; }
.psteps { list-style: none; display: grid; }
.psteps li { display: grid; grid-template-columns: 56px 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.psteps li:first-child { padding-top: 0; }
.psteps li .mono { color: var(--accent); padding-top: 6px; }
.psteps p { font-size: clamp(18px, 1.6vw, 22px); }
.presults { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 32px; }
.presult__num { font-size: clamp(48px, 6vw, 88px); font-weight: 700; letter-spacing: -0.05em; line-height: 1; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.presult__prefix { font-size: .5em; color: var(--muted); margin-right: 2px; letter-spacing: -0.02em; }
.presult__num sup { font-size: .35em; color: var(--accent); vertical-align: top; margin-left: 4px; letter-spacing: -0.02em; }
@media (max-width: 760px) { .pblock { grid-template-columns: 1fr; gap: 20px; } }

.pgallery { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: clamp(40px, 6vw, 80px) var(--pad); }
.pgallery { row-gap: 48px; }
.pgallery__item { margin: 0; }
.pgallery__item.is-wide { grid-column: 1 / -1; }
.pgallery__media {
  aspect-ratio: 4 / 3; overflow: hidden; border-radius: 16px; clip-path: inset(0% 0 0 0 round 16px);
  position: relative;
}
.pgallery__item.is-wide:not(.is-image):not(.is-chart) .pgallery__media { aspect-ratio: 16 / 8; }
.pgallery__media > .pcover, .pgallery__media > img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Screenshots keep their own proportions */
.pgallery__item.is-image .pgallery__media { aspect-ratio: auto; border: 1px solid var(--line); }
.pgallery__item.is-image img { height: auto; }
.pgallery__item figcaption { margin-top: 16px; color: var(--muted); font-size: 15px; max-width: 64ch; }
@media (max-width: 760px) { .pgallery { grid-template-columns: 1fr; } .pgallery__item.is-wide:not(.is-image):not(.is-chart) .pgallery__media { aspect-ratio: 4 / 3; } }

/* Charts */
.pgallery__item.is-chart .pgallery__media { aspect-ratio: auto; background: var(--bg-2); border: 1px solid var(--line); }
.pchart { position: relative; padding: 20px 20px 8px; }
.pchart svg { width: 100%; height: auto; display: block; overflow: visible; }
.pchart__head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pchart__title { font-weight: 600; font-size: 18px; letter-spacing: -0.02em; }
.pchart__legend { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.pchart__legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-left: 8px; }
.pchart__legend i.is-under, .pchart__dot.is-under { background: #3ddc84; fill: #3ddc84; }
.pchart__legend i.is-over, .pchart__dot.is-over { background: var(--accent); fill: var(--accent); }
.pchart__grid { stroke: var(--line); stroke-width: 1; }
.pchart__tick { font-family: var(--mono); font-size: 14px; fill: var(--muted); }
.pchart__axis { font-family: var(--mono); font-size: 13px; fill: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pchart__note { font-family: var(--mono); font-size: 13px; fill: var(--muted); }
.pchart__note.is-key { fill: var(--accent); font-size: 16px; font-weight: 500; }
.pchart__ideal { stroke: var(--accent-2); stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .8; fill: none; }
.pchart__line { stroke: var(--accent); stroke-width: 2.5; fill: none; stroke-dasharray: 1; stroke-dashoffset: 1; stroke-linejoin: round; }
.pchart__dot { fill: rgba(236, 232, 225, .38); transition: fill .2s; }
.pchart__dot.is-active { fill: var(--fg); stroke: var(--bg); stroke-width: 2; r: 7; }
.pchart__pt { fill: var(--bg-2); stroke: var(--accent); stroke-width: 2; }
.pchart__pt.is-key { fill: var(--accent); }
.pchart__tip {
  position: absolute; z-index: 3; pointer-events: none; min-width: 180px;
  display: grid; gap: 4px; padding: 12px 14px; border-radius: 10px;
  background: rgba(7, 7, 7, .92); border: 1px solid var(--line); font-size: 13px;
  opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s;
}
.pchart__tip.is-on { opacity: 1; transform: none; }
.pchart__tip b { font-weight: 600; }
.pchart__tip .is-under { color: #3ddc84; }
.pchart__tip .is-over { color: var(--accent); }
.pchart__error { padding: 40px; text-align: center; }

/* Typographic cover */
.pcover, .card__cover { container-type: inline-size; }
.tcover {
  position: absolute; inset: 0; z-index: 1; padding: clamp(20px, 4vw, 56px);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.tcover__kicker { position: absolute; top: clamp(20px, 4vw, 56px); left: clamp(20px, 4vw, 56px); color: rgba(255,255,255,.75); }
.tcover__stat {
  font-size: min(30cqw, 340px); font-weight: 700; letter-spacing: -0.06em; line-height: .82;
  color: #fff; font-variant-numeric: tabular-nums;
}
.tcover__label { margin-top: 16px; color: rgba(255,255,255,.8); }
.card__cover .tcover { padding: 20px 24px; }
.card__cover .tcover__kicker { display: none; }
.card__cover .tcover__stat { font-size: min(24cqw, 120px); }
.card__cover .tcover__label { margin-top: 8px; font-size: 11px; }
.pnext__cover .tcover__stat { font-size: 26cqw; }
.pnext__cover .tcover__kicker, .pnext__cover .tcover__label { display: none; }

.plinks { display: flex; gap: 12px; flex-wrap: wrap; padding: 0 var(--pad) clamp(80px, 10vw, 140px); }

.pnext {
  display: block; position: relative; overflow: hidden;
  padding: clamp(80px, 12vw, 160px) var(--pad); border-top: 1px solid var(--line);
}
.pnext__title {
  display: flex; align-items: center; gap: .3em; margin-top: 16px; position: relative; z-index: 2;
  font-size: clamp(56px, 11vw, 180px); font-weight: 700; letter-spacing: -0.055em; line-height: .9;
  transition: color .4s;
}
.pnext__arrow { display: inline-grid; transition: transform .6s var(--ease); }
.pnext__arrow svg { width: .5em; height: .5em; }
.pnext:hover .pnext__title { color: var(--accent); }
.pnext:hover .pnext__arrow { transform: translateX(20px); }
.pnext__cover {
  position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;
  width: 340px; height: 240px; margin: -120px 0 0 -170px; border-radius: 14px; overflow: hidden;
  opacity: 0; scale: 0; transition: scale .5s var(--ease), opacity .3s;
}
.pnext:hover .pnext__cover { scale: 1; opacity: 1; }
@media (hover: none) { .pnext__cover { display: none; } }

/* ───────────── Live embed (browser window) ───────────── */
.pembed { padding: clamp(80px, 12vw, 160px) var(--pad) 0; perspective: 1600px; }
.pembed__head { display: grid; grid-template-columns: 1fr 3fr; gap: 32px; margin-bottom: 32px; }
.pembed__head p { color: #c9c5bd; font-size: clamp(18px, 1.6vw, 22px); max-width: 52ch; }
@media (max-width: 760px) { .pembed__head { grid-template-columns: 1fr; gap: 12px; } }

.browser {
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--bg-2);
  box-shadow: 0 40px 120px -40px rgba(255, 91, 46, .25), 0 0 0 1px rgba(0,0,0,.6);
  transform-origin: 50% 0%;
}
.browser__bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  height: 44px; padding: 0 12px; border-bottom: 1px solid var(--line); background: #161618;
}
.browser__dots { display: flex; gap: 7px; }
.browser__dots i { width: 11px; height: 11px; border-radius: 50%; background: #3a3a3d; }
.browser:hover .browser__dots i:nth-child(1) { background: #ff5f57; }
.browser:hover .browser__dots i:nth-child(2) { background: #febc2e; }
.browser:hover .browser__dots i:nth-child(3) { background: #28c840; }
.browser__url {
  display: inline-flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0;
  padding: 6px 16px; border-radius: 8px; background: rgba(255,255,255,.05); color: #b8b4ad;
  min-width: min(360px, 40vw); justify-content: center; white-space: nowrap; overflow: hidden;
}
.browser__url svg { flex-shrink: 0; }
.browser__host { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.browser__actions { display: flex; justify-content: flex-end; gap: 4px; }
.browser__btn {
  width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--muted);
  display: grid; place-items: center; cursor: pointer; transition: background .2s, color .2s;
}
.browser__btn:hover:not(:disabled) { background: rgba(255,255,255,.08); color: var(--fg); }
.browser__btn:disabled { opacity: .35; cursor: default; }

.browser__viewport { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #fff; }
.browser__stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.browser__stage iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

.browser__cover {
  position: absolute; inset: 0; z-index: 2; border: 0; cursor: pointer; color: var(--fg); font: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background:
    radial-gradient(circle at 70% 20%, hsl(var(--h) 90% 60% / .55), transparent 55%),
    radial-gradient(circle at 15% 85%, hsl(calc(var(--h) + 40) 80% 50% / .4), transparent 55%),
    #0d0d0e;
}
.browser__cover::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(circle at center, #000, transparent 75%);
}
.browser__cover-title {
  position: relative; font-family: var(--serif); font-style: italic;
  font-size: clamp(32px, 5vw, 72px); line-height: 1; letter-spacing: -0.02em;
  display: inline-flex; align-items: center; gap: .3em;
}
.browser__cover-title::before {
  content: ""; width: .7em; height: .7em; background: var(--fg);
  clip-path: polygon(35% 25%, 75% 50%, 35% 75%);
}
.browser__cover .mono { position: relative; }

.browser__loading {
  position: absolute; inset: 0; z-index: 1; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: #0d0d0e; text-align: center; padding: 24px;
}
.browser__loading a { color: var(--accent); text-decoration: underline; }
.browser.is-loading .browser__loading { display: flex; }
.browser__spinner {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.browser.is-full {
  position: fixed; inset: 16px; z-index: 95; display: flex; flex-direction: column;
  transform: none !important;
}
.browser.is-full .browser__viewport { aspect-ratio: auto; flex: 1; }
.has-full-embed .pembed { perspective: none; }
.embed-shade { position: fixed; inset: 0; z-index: 94; background: rgba(0,0,0,.75); opacity: 0; visibility: hidden; pointer-events: none; }
.has-full-embed .embed-shade { opacity: 1; visibility: visible; pointer-events: auto; }

.cursor-off .cursor, .cursor-off .cursor-dot { opacity: 0; }
.cursor, .cursor-dot { transition-property: width, height, margin, background, border-color, opacity; }

@media (max-width: 640px) {
  .browser__viewport { aspect-ratio: 9 / 14; }
  .browser__bar { grid-template-columns: minmax(0, 1fr) auto; }
  .browser__dots { display: none; }
  .browser__url { min-width: 0; justify-content: flex-start; }
}

/* ───────────── iPhone device ───────────── */
.pdevice {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center;
  padding: clamp(80px, 12vw, 160px) var(--pad) 0;
}
.pdevice__copy { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; max-width: 46ch; }
.pdevice__lead { color: #c9c5bd; font-size: clamp(18px, 1.6vw, 22px); }
.pdevice__platforms { color: var(--muted); }

.pdevice__stage {
  position: relative; display: grid; place-items: center;
  perspective: 1800px; padding: 40px 0 72px;
}
.phone__float { transform-style: preserve-3d; will-change: transform; }

/* Resting tilt lives in CSS so it works with or without GSAP; going live straightens it */
.phone {
  --rx: 10deg; --ry: -24deg; --rz: 4deg;
  width: clamp(240px, 24vw, 330px); container-type: inline-size;
  transform: rotateX(var(--rx)) rotateY(var(--ry)) rotateZ(var(--rz));
  /* flat: the phone is one plane. preserve-3d here makes taps land on the body
     instead of the app inside the screen. */
  transform-style: flat;
  transition: transform 1s var(--ease), width 1s var(--ease);
}
.pdevice.has-live .phone { cursor: pointer; }
/* Straightens to face the visitor while in use. */
.pdevice.is-live .phone { transform: none; width: clamp(280px, 26vw, 360px); cursor: auto; }

.phone__body {
  position: relative; aspect-ratio: 71.6 / 146.6; border-radius: 16cqw; padding: 3.4cqw;
  background: linear-gradient(145deg, #3a3a3e 0%, #18181a 40%, #2b2b2f 100%);
  box-shadow:
    inset 0 0 0 .6cqw #4a4a4f,
    inset 0 0 0 1.1cqw #0b0b0c,
    0 60px 120px -30px rgba(0, 0, 0, .9),
    0 30px 80px -40px rgba(255, 91, 46, .35);
}
/* Side keys */
.phone__key { position: absolute; width: 1.2cqw; border-radius: 1cqw; background: linear-gradient(90deg, #2a2a2e, #4a4a50); }
.phone__key--action   { left: -.9cqw; top: 19%; height: 7cqw; }
.phone__key--vol-up   { left: -.9cqw; top: 27%; height: 13cqw; }
.phone__key--vol-down { left: -.9cqw; top: 37%; height: 13cqw; }
.phone__key--power    { right: -.9cqw; top: 29%; height: 20cqw; background: linear-gradient(270deg, #2a2a2e, #4a4a50); }

.phone__screen {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  border-radius: 12.6cqw; background: #000; isolation: isolate;
}
.phone__idle, .phone__live { position: absolute; inset: 0; }
.phone__media { width: 100%; height: 100%; object-fit: cover; display: block; }

.phone__island {
  position: absolute; z-index: 5; top: 3cqw; left: 50%; transform: translateX(-50%);
  width: 31cqw; height: 9cqw; border-radius: 9cqw; background: #000; pointer-events: none;
}
.phone__glare {
  position: absolute; inset: 0; z-index: 6; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,.04) 28%, transparent 42%);
  transition: opacity .6s;
}
.pdevice.is-live .phone__glare { opacity: 0; }

.phone__shadow {
  position: absolute; bottom: 24px; left: 50%; width: 60%; height: 40px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(0,0,0,.75), transparent); filter: blur(6px);
  pointer-events: none;
}

/* Placeholder splash (until there's a recording) */
.phone__splash {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4cqw;
  background:
    radial-gradient(circle at 70% 15%, hsl(var(--h) 90% 60% / .55), transparent 55%),
    radial-gradient(circle at 20% 90%, hsl(calc(var(--h) + 40) 80% 50% / .45), transparent 55%),
    #0b0b0d;
}
.phone__status {
  position: absolute; top: 4.6cqw; left: 9cqw; right: 8cqw; display: flex; justify-content: space-between; align-items: center;
  font-size: 4.2cqw; color: #fff; text-transform: none; letter-spacing: 0; font-weight: 500;
}
.phone__status-icons { display: inline-flex; gap: 1.4cqw; align-items: flex-end; }
.phone__status-icons i { display: block; width: 1.2cqw; background: #fff; border-radius: .4cqw; }
.phone__status-icons i:nth-child(1) { height: 1.8cqw; }
.phone__status-icons i:nth-child(2) { height: 2.6cqw; }
.phone__status-icons i:nth-child(3) { height: 3.4cqw; width: 6cqw; border-radius: 1cqw; }
.phone__appicon {
  width: 22cqw; height: 22cqw; border-radius: 5.4cqw; display: grid; place-items: center;
  background: linear-gradient(145deg, hsl(var(--h) 85% 60%), hsl(calc(var(--h) + 40) 75% 42%));
  color: #fff; font-weight: 700; font-size: 11cqw; letter-spacing: -0.04em;
  box-shadow: 0 3cqw 8cqw -2cqw hsl(var(--h) 80% 40% / .7);
}
.phone__appname { font-size: 7cqw; font-weight: 600; letter-spacing: -0.03em; color: #fff; }
.phone__apptag { position: absolute; bottom: 9cqw; font-size: 3.2cqw; color: rgba(255,255,255,.6); }

/* Live iframe, rendered at iPhone width (393pt) then scaled to the screen */
.phone__live { z-index: 4; opacity: 0; visibility: hidden; transition: opacity .5s, visibility .5s; background: #000; }
.pdevice.is-live .phone__live { opacity: 1; visibility: visible; }
.phone__live-stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.phone__live-stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.phone__loading {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4cqw;
  background: #000; transition: opacity .4s;
}
.phone__loading .mono { font-size: 3.2cqw; }
.pdevice.is-ready .phone__loading { opacity: 0; pointer-events: none; }

.pdevice__close {
  position: absolute; top: 0; right: 0; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--fg); cursor: pointer;
  opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s, background .2s;
}
.pdevice__close:hover { background: var(--fg); color: var(--bg); }
.pdevice.is-live .pdevice__close { opacity: 1; visibility: visible; }
.pdevice.is-live .js-device-launch { opacity: .4; pointer-events: none; }

@media (max-width: 860px) {
  .pdevice { grid-template-columns: 1fr; }
  .phone { width: min(68vw, 300px); --ry: -18deg; }
  .pdevice.is-live .phone { width: min(82vw, 340px); }
}
@media (prefers-reduced-motion: reduce) {
  .phone { transition: none; }
}

/* ───────────── Scroll story (stories.js) ───────────── */
.pstory { position: relative; }
.pstory__pin {
  min-height: 100svh; display: grid; grid-template-columns: 1.4fr minmax(240px, 1fr); align-items: center;
  gap: clamp(32px, 6vw, 96px); padding: 88px var(--pad) 40px; overflow: hidden;
}
.pstory__copy .pblock__label { margin-bottom: 28px; }
.pstory__steps { list-style: none; display: grid; gap: 22px; }
.pstory__steps li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; opacity: .3; transition: opacity .5s var(--ease); }
.pstory__steps li.is-on { opacity: 1; }
.pstory__steps li > .mono { color: var(--accent); padding-top: 6px; }
.pstory__steps b { display: block; font-size: clamp(22px, 2.4vw, 32px); font-weight: 600; letter-spacing: -0.02em; }
.pstory__steps p { color: var(--muted); margin-top: 4px; max-width: 32ch; }

.pstory__stage { position: relative; display: grid; place-items: center; perspective: 1800px; }
.ipad {
  --w: min(400px, 78vw, calc((100svh - 160px) * 0.72));
  position: relative; width: var(--w); aspect-ratio: 0.72; transform-style: preserve-3d;
}
.ipad__body { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.ipad__face {
  position: absolute; inset: 0; border-radius: calc(var(--w) * 0.075); padding: calc(var(--w) * 0.035);
  background: linear-gradient(145deg, #2a2a2d, #141416); border: 1px solid #3a3a3e;
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.8), inset 0 0 0 2px #0b0b0c;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.ipad__back { transform: rotateY(180deg); }
.ipad__screen { position: relative; width: 100%; height: 100%; border-radius: calc(var(--w) * 0.045); overflow: hidden; }
.ipad__screen--paper { background: #F5F5F0; }
.ipad__bar {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; color: #0D0D0D; font-weight: 700; letter-spacing: -0.02em; border-bottom: 2px solid #0D0D0D;
}
.ipad__cube { width: 26px; height: 26px; background: #06C270; border: 2px solid #0D0D0D; box-shadow: 3px 3px 0 #0D0D0D; }
.sketch { position: absolute; inset: 18% 8% 10%; width: 84%; height: 72%; }

.ipad__screen--viewer { background: radial-gradient(circle at 50% 40%, #1f2a24, #0b0d0c 75%); }
.mv { position: absolute; inset: 8% 0 4%; }
.mv model-viewer { width: 100%; height: 100%; background: transparent; --poster-color: transparent; }
.gen {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(6,194,112,.0) 30%, rgba(6,194,112,.35) 50%, rgba(6,194,112,0) 70%, transparent 100%);
  background-size: 100% 300%;
}
.ar { position: absolute; inset: 0; opacity: 0; background: linear-gradient(180deg, #6f6559 0%, #a39582 46%, #8a7a66 47%, #c9b9a2 100%); }
.ar::before { content: ""; position: absolute; inset: 0; backdrop-filter: blur(2px); background: radial-gradient(circle at 70% 20%, rgba(255,240,210,.35), transparent 50%); }
.ar__floor {
  position: absolute; left: -40%; right: -40%; bottom: -10%; height: 56%;
  background-image: linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px);
  background-size: 40px 40px; transform: perspective(400px) rotateX(62deg); transform-origin: 50% 100%;
  mask-image: linear-gradient(to top, #000 30%, transparent);
}
.ar__reticle {   /* sits under the model and moves with it */
  position: absolute; left: 50%; bottom: 15%; width: 44%; aspect-ratio: 3 / 1; translate: -50% 0; opacity: 0;
  border: 2px solid rgba(255,255,255,.85); border-radius: 50%;
}
.ipad__tag {
  position: absolute; top: 14px; left: 50%; translate: -50% 0; z-index: 3;
  padding: 5px 12px; border-radius: 999px; background: rgba(0,0,0,.45); color: #fff; font-size: 11px; backdrop-filter: blur(8px);
}
.pencil { position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; filter: drop-shadow(-10px 14px 12px rgba(0,0,0,.45)); }

/* no motion: the finished model, turning on its own */
.pstory.is-static .ipad__body { transform: rotateY(180deg); }
.pstory.is-static .pencil { display: none; }
.pstory.is-static .pstory__steps li { opacity: 1; }

@media (max-width: 860px) {
  .pstory__pin { grid-template-columns: 1fr; align-content: center; gap: 24px; padding-top: 80px; }
  .pstory__copy { order: -1; }
  .pstory__steps { grid-template-columns: repeat(4, auto); gap: 8px; }
  .pstory__steps li { display: block; }
  .pstory__steps li > .mono { display: none; }
  .pstory__steps b { font-size: 16px; }
  .pstory__steps p { display: none; }
  .ipad { --w: min(320px, 70vw, calc((100svh - 260px) * 0.72)); }
}

/* ───────────── Viberrr story: two phones jam, merge, play ───────────── */
.pstory--viberrr .pstory__stage { min-height: min(78svh, 680px); }
.vduo {
  --ph: min(210px, 34vw, calc((100svh - 220px) * 0.47));
  --gap: clamp(36px, 6vw, 96px);
  position: relative; display: flex; justify-content: center; align-items: center; gap: var(--gap);
  width: 100%; transform-style: preserve-3d;
}
.vphone {
  position: relative; width: var(--ph); aspect-ratio: 0.47; border-radius: calc(var(--ph) * 0.16);
  padding: calc(var(--ph) * 0.035); background: linear-gradient(145deg, #2b2b2e, #121214);
  box-shadow: 0 30px 80px -24px rgba(0,0,0,.8), inset 0 0 0 1.5px #3a3a3e; transform-style: preserve-3d;
}
.vphone::before {   /* the dynamic island */
  content: ""; position: absolute; top: calc(var(--ph) * 0.055); left: 50%; translate: -50% 0; z-index: 2;
  width: 30%; height: calc(var(--ph) * 0.05); border-radius: 99px; background: #0a0a0b;
}
.vphone--m { position: absolute; left: 50%; top: 50%; margin: calc(var(--ph) / -0.94) 0 0 calc(var(--ph) / -2); visibility: hidden; }
.vphone__screen {
  height: 100%; border-radius: calc(var(--ph) * 0.13); overflow: hidden;
  background: linear-gradient(180deg, #DAD9D4, #C9C8C2); padding: calc(var(--ph) * 0.17) calc(var(--ph) * 0.06) 0;
  display: flex; flex-direction: column; gap: calc(var(--ph) * 0.045); font-size: calc(var(--ph) * 0.05); color: #1a1a1a;
}
.vphone__plate {
  position: relative; display: flex; align-items: center; gap: 6px; padding: 8% 6%; border-radius: 6px;
  background: #E6E5E0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.vphone__plate b { font-weight: 500; letter-spacing: .02em; font-size: 1.5em; }
.vphone__led { width: .55em; height: .55em; border-radius: 50%; background: #F05A2A; box-shadow: 0 0 6px #F05A2A; }
.vphone__grille {
  margin-left: auto; width: 34%; align-self: stretch; border-radius: 3px;
  background-image: radial-gradient(#3a3a3a 34%, transparent 36%); background-size: 6px 6px; opacity: .8;
}
.vphone__display {
  position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; padding: 7% 6%;
  border-radius: 6px; background: #0E0E10; color: #e9e9e9; min-height: 3.4em;
}
.vphone__status { display: inline-flex; align-items: center; gap: 5px; font-size: .85em; letter-spacing: .06em; }
.vphone__status i { width: .5em; height: .5em; border-radius: 50%; background: #F5B23D; }
.is-matched .vphone__status i, .vphone--m .vphone__status i { background: #43D17A; }
.vphone__sub { grid-column: 1; font-size: .72em; letter-spacing: .08em; color: #8b8b8b; }
.vphone__bpm { grid-row: 1 / span 2; grid-column: 2; font: 600 1.9em/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .04em; color: #f2f2f2; }
.vphone__steps { grid-column: 1; display: grid; grid-template-columns: repeat(16, 1fr); gap: 2px; }
.vphone__steps i { height: .5em; border-radius: 1px; background: #2c2c30; }
.vphone__steps i.is-on { background: #F5B23D; box-shadow: 0 0 6px #F5B23D; }
.vphone__keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7% 6%; }
.vkey {
  position: relative; aspect-ratio: 1.1; border-radius: 4px; background: #1F1F22; color: #ededed;
  box-shadow: 0 3px 0 #0b0b0c; transition: transform .12s, background .12s, box-shadow .12s;
}
.vkey--white { background: #EFEFEC; color: #333; box-shadow: 0 3px 0 #a9a8a3; }
.vkey em { position: absolute; top: 6%; left: 9%; font: 400 .82em/1 "Inter", system-ui, sans-serif; font-style: normal; }
.vphone__cta {
  margin-top: auto; margin-bottom: calc(var(--ph) * 0.09); padding: 7% 0; border-radius: 6px; text-align: center;
  background: linear-gradient(180deg, #F47A45, #E2572A); color: #fff; font-size: .8em; letter-spacing: .08em; box-shadow: 0 3px 0 #a8401d;
}
.vkey__led { position: absolute; left: 50%; bottom: -26%; translate: -50% 0; width: .38em; height: .38em; border-radius: 50%; background: #555; transition: background .15s, box-shadow .15s; }
.vkey.is-a .vkey__led { background: #FF6B2C; box-shadow: 0 0 6px #FF6B2C; }
.vkey.is-b .vkey__led { background: #3BA9FF; box-shadow: 0 0 6px #3BA9FF; }
.vkey.is-pressed { transform: translateY(3px); box-shadow: 0 0 0 #000; }
.vphone--a .vkey.is-pressed { background: #FF6B2C; }
.vphone--b .vkey.is-pressed { background: #3BA9FF; }
.vkey.is-hit { animation: vhit .22s ease-out; }
@keyframes vhit { 0% { transform: translateY(3px); filter: brightness(1.6); box-shadow: 0 0 0 #000; } 100% { transform: none; filter: none; } }
.vlink { position: absolute; left: 50%; top: 50%; width: var(--gap); height: 10px; translate: -50% -50%; transform-origin: center; }
.vlink svg { width: 100%; height: 100%; overflow: visible; }
.vlink line { stroke: rgba(255,255,255,.35); stroke-width: 2; stroke-dasharray: 4 5; vector-effect: non-scaling-stroke; }
.vlink__dot {
  position: absolute; top: 50%; left: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; opacity: 0;
  background: #FF6B2C; box-shadow: 0 0 12px #FF6B2C;
}
.vlink__dot[data-who="b"] { background: #3BA9FF; box-shadow: 0 0 12px #3BA9FF; }
.vsound {
  position: absolute; left: 50%; bottom: 0; translate: -50% 0; padding: 8px 16px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--fg); font-size: 11px;
}
.vsound:hover { background: rgba(255,255,255,.12); }
.pstory--viberrr.is-static .vphone--a, .pstory--viberrr.is-static .vphone--b { visibility: visible; }
@media (max-width: 860px) {
  .vduo { --ph: min(150px, 38vw, calc((100svh - 300px) * 0.47)); --gap: 22px; }
}

/* ───────────── Junxion outro: the train ───────────── */
.poutro { padding: clamp(40px, 6vw, 80px) var(--pad); }
.ptrain { position: relative; min-height: clamp(460px, 66svh, 660px); display: grid; place-items: center; }
.ptrain__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ptrain__copy { position: relative; z-index: 1; text-align: center; max-width: 760px; padding: 72px 24px 88px; }
.ptrain__title { font-size: clamp(32px, 4.4vw, 60px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.02; margin-top: 14px; }
.ptrain__lead { color: var(--muted); margin: 16px auto 0; max-width: 42ch; }
.ptrain__ctas { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; margin-top: 30px; }
.ptrain__soon { flex-basis: 100%; margin-top: 6px; font-size: 13px; color: var(--muted); }
.btn--ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
