/* Basstion Forge — Forge Cinema base system */
@view-transition { navigation: auto; }

:root {
  --ink: #080a10;
  --night: #0f1826;
  --plate: #121c2b;
  --plate-2: #18243a;
  --line: rgba(236, 230, 216, .12);
  --line-2: rgba(236, 230, 216, .22);
  --paper: #ece6d8;
  --dim: #a9a397;
  --mute: #6f6a62;
  --brass: #c9a15b;
  --brass-hi: #ecd29a;
  --brass-lo: #8a6a33;
  --ivory: #f4efe4;
  --accent: var(--brass);
  --accent-hi: var(--brass-hi);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --serif: "Instrument Serif", "Times New Roman", serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --radius: 18px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html[data-calm] { scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: var(--brass); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--brass); color: var(--ink); padding: 8px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { left: 8px; }

.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); display: inline-flex; gap: 10px; align-items: center; }
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; opacity: .7; }
.serif { font-family: var(--serif); font-weight: 400; }
h1, h2, h3 { font-weight: 400; margin: 0; letter-spacing: -.02em; }
.display { font-family: var(--serif); font-size: clamp(48px, 9vw, 132px); line-height: .92; letter-spacing: -.035em; }
.h2 { font-family: var(--serif); font-size: clamp(36px, 5.6vw, 76px); line-height: 1; letter-spacing: -.03em; }
.h3 { font-family: var(--sans); font-size: clamp(20px, 2vw, 24px); font-weight: 500; letter-spacing: -.01em; }
.lede { font-size: clamp(18px, 1.7vw, 22px); color: var(--dim); max-width: 60ch; line-height: 1.5; }
em, .it { font-style: italic; color: var(--accent-hi); }
p { margin: 0 0 1em; }
.dim { color: var(--dim); }

/* ---------- Header ---------- */
.site-head {
  position: fixed; inset: 14px var(--gutter) auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  pointer-events: none;
}
.site-head > * { pointer-events: auto; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 10px;
  border-radius: 999px; background: rgba(8, 10, 16, .55); border: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  view-transition-name: brand;
}
.brand svg { width: 24px; height: 24px; }
.nav {
  display: flex; align-items: center; gap: 2px; padding: 5px;
  border-radius: 999px; background: rgba(8, 10, 16, .55); border: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  view-transition-name: nav;
}
.nav a, .nav button.navbtn {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--dim);
  background: none; border: 0; cursor: pointer; transition: color .2s, background .2s;
}
.nav a:hover, .nav button.navbtn:hover { color: var(--paper); background: rgba(236, 230, 216, .06); }
.nav a[aria-current="page"] { color: var(--paper); background: rgba(236, 230, 216, .08); }
.nav .cta { color: var(--ink); background: linear-gradient(180deg, var(--brass-hi), var(--brass)); font-weight: 500; }
.nav .cta:hover { color: var(--ink); background: linear-gradient(180deg, #f6e2b4, var(--brass-hi)); }
.calm-toggle {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 8px 12px; border-radius: 999px; border: 0; background: none; color: var(--dim); font-size: 13px;
}
.calm-toggle .pip { width: 28px; height: 16px; border-radius: 99px; background: rgba(236, 230, 216, .14); position: relative; transition: background .3s; }
.calm-toggle .pip::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); transition: transform .35s var(--ease-out); }
html[data-calm] .calm-toggle .pip { background: var(--brass); }
html[data-calm] .calm-toggle .pip::after { transform: translateX(12px); background: var(--ink); }
.menu-btn { display: none; }

@media (max-width: 860px) {
  .nav { display: none; position: fixed; inset: 70px var(--gutter) auto; flex-direction: column; align-items: stretch; border-radius: 22px; padding: 10px; background: rgba(8, 10, 16, .92); }
  .nav.open { display: flex; }
  .nav a, .nav .calm-toggle { padding: 14px 16px; font-size: 17px; }
  .menu-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; cursor: pointer;
    background: rgba(8, 10, 16, .6); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  }
}

/* ---------- Buttons ---------- */
.btn {
  --bx: 50%; --by: 50%;
  position: relative; display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  min-height: 52px; padding: 0 24px; border-radius: 999px; cursor: pointer; border: 0;
  font-size: 16px; font-weight: 500; letter-spacing: -.005em; isolation: isolate; overflow: hidden;
  transform: translate3d(var(--mx, 0), var(--my, 0), 0) scale(var(--s, 1));
  transition: box-shadow .4s var(--ease-out), color .3s;
  will-change: transform;
}
.btn .arr { transition: transform .45s var(--ease-out); }
.btn:hover .arr { transform: translateX(4px); }
.btn-key {
  color: #1a1206;
  background: linear-gradient(180deg, #f3dca5 0%, var(--brass) 55%, #a9813f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -2px 0 rgba(0, 0, 0, .18), 0 10px 30px -10px rgba(201, 161, 91, .65);
}
.btn-key::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(120px 80px at var(--bx) var(--by), rgba(255, 255, 255, .55), transparent 70%);
  opacity: 0; transition: opacity .3s;
}
.btn-key:hover::after { opacity: 1; }
.btn-glass {
  color: var(--paper); background: rgba(236, 230, 216, .06);
  border: 1px solid var(--line-2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn-glass::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(140px 90px at var(--bx) var(--by), rgba(236, 210, 154, .22), transparent 70%);
  opacity: 0; transition: opacity .3s;
}
.btn-glass:hover::after { opacity: 1; }
.btn-ghost { color: var(--dim); background: none; padding: 0 6px; min-height: 44px; }
.btn-ghost:hover { color: var(--paper); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Sections ---------- */
section { position: relative; }
.pad { padding-block: clamp(80px, 12vw, 160px); }
.pad-s { padding-block: clamp(56px, 8vw, 100px); }
.rule { height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); border: 0; margin: 0; }
.grid { display: grid; gap: clamp(14px, 2vw, 22px); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

.card {
  --cx: 50%; --cy: 50%;
  position: relative; border-radius: var(--radius); padding: clamp(20px, 2.4vw, 30px);
  background: linear-gradient(180deg, rgba(236, 230, 216, .045), rgba(236, 230, 216, .015));
  border: 1px solid var(--line); overflow: hidden; isolation: isolate;
}
.card::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit;
  background: radial-gradient(360px 240px at var(--cx) var(--cy), color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
  opacity: 0; transition: opacity .4s;
}
.card:hover::before { opacity: 1; }
.card .num { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: .14em; }
.card h3 { margin: 10px 0 8px; }
.card p { color: var(--dim); margin: 0; font-size: 16px; }
.feat-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-hi); margin-bottom: 14px; }
.feat-ico svg { width: 22px; height: 22px; }

.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; color: var(--dim); background: rgba(236, 230, 216, .03); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Reveal ---------- */
.rv { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: var(--d, 0s); }
.rv.in { opacity: 1; transform: none; }
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.split .w > span { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--i) * 45ms + var(--d, 0s)); }
.split.in .w > span { transform: none; }
html[data-calm] .rv, html[data-calm] .split .w > span { opacity: 1 !important; transform: none !important; transition: none !important; }

/* ---------- App hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: grid; align-items: end; overflow: hidden;
  padding-bottom: clamp(40px, 7vw, 90px); padding-top: 120px;
}
.hero-media { position: absolute; inset: 0; z-index: -2; view-transition-name: var(--vt, none); }
.hero-media img, .hero-media video { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); }
.hero-media video { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s; }
.hero-media video.on { opacity: 1; }
html[data-calm] .hero-media video { display: none; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 10, 16, .55) 0%, rgba(8, 10, 16, 0) 30%, rgba(8, 10, 16, .1) 55%, var(--ink) 100%),
    linear-gradient(90deg, rgba(8, 10, 16, .7) 0%, rgba(8, 10, 16, 0) 60%);
}
.hero .app-mark { width: 72px; height: 72px; border-radius: 20px; overflow: hidden; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .8), 0 0 0 1px var(--line-2); margin-bottom: 22px; }
.hero .app-mark img, .hero .app-mark svg { width: 100%; height: 100%; object-fit: cover; }
.hero h1 { margin: 14px 0 18px; }
.hero .lede { color: rgba(236, 230, 216, .82); }
.hero .chips { margin-top: 24px; }
.scroll-cue { position: absolute; right: var(--gutter); bottom: clamp(40px, 7vw, 90px); writing-mode: vertical-rl; font-family: var(--mono); font-size: 11px; letter-spacing: .3em; color: var(--dim); display: flex; gap: 12px; align-items: center; }
.scroll-cue::after { content: ""; width: 1px; height: 60px; background: linear-gradient(var(--accent), transparent); animation: cue 2.4s var(--ease-io) infinite; }
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
html[data-calm] .scroll-cue::after { animation: none; }
@media (max-width: 720px) { .scroll-cue { display: none; } }

/* ---------- Section heads ---------- */
.shead { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 60px); align-items: end; margin-bottom: clamp(36px, 5vw, 64px); }
.shead .lede { margin: 0; }
@media (max-width: 820px) { .shead { grid-template-columns: 1fr; } }

/* ---------- Chronicle spine ---------- */
.chron { position: relative; display: grid; gap: 0; padding-left: 0; list-style: none; margin: 0; }
.chron::before { content: ""; position: absolute; left: 23px; top: 8px; bottom: 8px; width: 1px; background: var(--line-2); }
.chron::after { content: ""; position: absolute; left: 23px; top: 8px; width: 1px; height: calc((100% - 16px) * var(--p, 0)); background: linear-gradient(var(--accent-hi), var(--accent)); box-shadow: 0 0 12px var(--accent); }
.chron li { position: relative; display: grid; grid-template-columns: 48px 1fr; gap: 18px; padding: 0 0 clamp(26px, 3.4vw, 40px); }
.chron li:last-child { padding-bottom: 0; }
.chron .node { width: 47px; height: 47px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); border: 1px solid var(--line-2); font-family: var(--mono); font-size: 12px; color: var(--dim); position: relative; z-index: 1; transition: border-color .5s, color .5s, box-shadow .5s, background .5s; }
.chron li.lit .node { border-color: var(--accent); color: var(--ink); background: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 16%, transparent), 0 0 28px color-mix(in srgb, var(--accent) 45%, transparent); }
.chron li.next .node { border-style: dashed; }
.chron h3 { font-size: clamp(19px, 1.8vw, 22px); font-weight: 500; margin: 10px 0 6px; }
.chron p { color: var(--dim); margin: 0; font-size: 16px; max-width: 62ch; }
.chron .stage { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.chron li.next .stage { color: var(--mute); }

/* ---------- Two column feature ---------- */
.split2 { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 80px); align-items: center; }
@media (max-width: 900px) { .split2 { grid-template-columns: 1fr; } .split2 > [style*="sticky"] { position: static !important; } }

/* ---------- CTA band ---------- */
.cta-band { position: relative; overflow: hidden; border-radius: 28px; padding: clamp(36px, 6vw, 80px); border: 1px solid var(--line); background: radial-gradient(800px 400px at 85% 0%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 60%), linear-gradient(180deg, var(--plate), var(--ink)); }
.cta-band .h2 { max-width: 16ch; margin: 16px 0 18px; }
.cta-band .lede { margin-bottom: 30px; }

/* ---------- Next link ---------- */
.next-app { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: clamp(28px, 4vw, 48px) 0; border-top: 1px solid var(--line); }
.next-app .h2 { transition: color .3s, letter-spacing .6s var(--ease-out); }
.next-app:hover .h2 { color: var(--accent-hi); letter-spacing: -.02em; }
.next-app .arrow-c { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; transition: background .4s, transform .6s var(--ease-out); flex: none; }
.next-app:hover .arrow-c { background: var(--accent); color: var(--ink); transform: rotate(-45deg); }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding: 64px 0 40px; margin-top: 40px; color: var(--dim); font-size: 15px; }
.site-foot .cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.site-foot h4 { font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--paper); font-weight: 400; margin: 0 0 14px; }
.site-foot a { display: block; padding: 4px 0; transition: color .2s; }
.site-foot a:hover { color: var(--accent-hi); }
.site-foot .base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--mute); }
.foot-brand { display: flex; gap: 14px; align-items: center; color: var(--paper); margin-bottom: 14px; }
.foot-brand svg { width: 40px; height: 40px; }
@media (max-width: 820px) { .site-foot .cols { grid-template-columns: 1fr 1fr; } .site-foot .cols > :first-child { grid-column: 1 / -1; } }

/* ---------- Phone frame ---------- */
.phone { position: relative; width: min(300px, 70vw); aspect-ratio: 390 / 844; border-radius: 42px; padding: 10px; background: linear-gradient(160deg, #2a2f3a, #0c0e13); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9), inset 0 0 0 1px rgba(255, 255, 255, .08); }
.phone .scr { width: 100%; height: 100%; border-radius: 33px; overflow: hidden; background: #000; position: relative; }
.phone .scr img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity .7s; }
.phone .scr img.on { opacity: 1; }

/* ---------- Grain ---------- */
.grain { position: fixed; inset: -50%; z-index: 60; pointer-events: none; opacity: .05; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%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"); }

/* ---------- View transitions ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .55s; animation-timing-function: var(--ease-out); }
::view-transition-old(root) { animation-name: vt-out; }
::view-transition-new(root) { animation-name: vt-in; }
@keyframes vt-out { to { opacity: 0; filter: blur(6px); transform: scale(.985); } }
@keyframes vt-in { from { opacity: 0; filter: blur(6px); transform: scale(1.01); } }
::view-transition-group(*) { animation-duration: .7s; animation-timing-function: var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
html[data-calm] ::view-transition-group(*), html[data-calm] ::view-transition-old(*), html[data-calm] ::view-transition-new(*) { animation: none !important; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.note { font-size: 13px; color: var(--mute); }
