/* Sitefirst Studio: tokens, type, primitives, nav, cursor, preloader, footer, legal */
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #0a0a0b;
  --bg-2: #121214;
  --bg-3: #1a1a1d;
  --fg: #f2efe8;
  --fg-2: #c9c5bc;
  --muted: #86837d;
  --line: rgba(242, 239, 232, .09);
  --line-2: rgba(242, 239, 232, .16);
  --accent: #ff5a1f;
  --accent-soft: rgba(255, 90, 31, .14);
  --blue: #7aa2ff;
  --good: #5fd08a;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --radius: 22px;
  --gutter: clamp(20px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 17px/1.6 var(--sans); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip;
}
::selection { background: var(--accent); color: #0a0a0b; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1320px; margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Grain overlay */
.grain { position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .06;
  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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite; }
@keyframes grain { 0%,100% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); } 40% { transform: translate(2%,-3%); } 60% { transform: translate(-2%,-1%); } 80% { transform: translate(3%,3%); } }

/* Type */
h1, h2, h3 { margin: 0; font-weight: 400; }
.display { font-family: var(--serif); font-weight: 400; line-height: .92; letter-spacing: -.025em; }
.display em, .it { font-style: italic; color: var(--accent); }
.h-xl { font-size: clamp(3.4rem, 9.2vw, 9.5rem); }
.h-lg { font-size: clamp(2.8rem, 6.4vw, 6.4rem); }
.h-md { font-size: clamp(2.2rem, 4.4vw, 4rem); }
.label { font: 500 .74rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: .6rem; }
.label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.lede { font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--fg-2); max-width: 36rem; line-height: 1.55; }
.line-mask { overflow: hidden; display: block; padding-bottom: .08em; margin-bottom: -.08em; }

/* Buttons */
.btn { position: relative; display: inline-flex; align-items: center; gap: .75rem; height: 56px; padding: 0 1.6rem; border-radius: 999px;
  font: 500 .98rem/1 var(--sans); border: 1px solid transparent; cursor: pointer; overflow: hidden; isolation: isolate; white-space: nowrap;
  transition: border-color .4s var(--ease-out), color .4s var(--ease-out); }
.btn .roll { display: grid; overflow: hidden; height: 1.1em; }
.btn .roll span { grid-area: 1/1; transition: transform .55s var(--ease-out); }
.btn .roll span + span { transform: translateY(110%); }
.btn:hover .roll span:first-child { transform: translateY(-110%); }
.btn:hover .roll span + span { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #0a0a0b; }
.btn-primary::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--fg); transform: translateY(101%); border-radius: inherit; transition: transform .55s var(--ease-out); }
.btn-primary:hover::before { transform: translateY(0); }
.btn-ghost { border-color: var(--line-2); color: var(--fg); }
.btn-ghost:hover { border-color: var(--fg); }
.btn .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #0a0a0b; color: var(--fg); margin-right: -.9rem; transition: transform .55s var(--ease-out); }
.btn:hover .dot { transform: rotate(-45deg); }
.btn-ghost .dot { background: var(--fg); color: #0a0a0b; }

/* Nav */
.nav { position: fixed; inset: 0 0 auto; z-index: 80; transition: transform .6s var(--ease-out); }
.nav.hide { transform: translateY(-110%); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 84px; }
.nav.solid .nav-bg { opacity: 1; }
.nav-bg { position: absolute; inset: 0; z-index: -1; opacity: 0; background: rgba(10,10,11,.72); backdrop-filter: blur(16px) saturate(1.3); border-bottom: 1px solid var(--line); transition: opacity .4s; }
.logo { display: inline-flex; align-items: center; gap: .7rem; font: 600 1.08rem/1 var(--sans); letter-spacing: -.03em; }
.logo-mark { width: 30px; height: 30px; position: relative; }
.logo-mark i { position: absolute; left: 0; right: 0; height: 30%; border-radius: 3px; background: var(--fg); transition: transform .6s var(--ease-out); }
.logo-mark i:nth-child(1) { top: 0; background: var(--accent); }
.logo-mark i:nth-child(2) { top: 35%; right: 30%; }
.logo-mark i:nth-child(3) { top: 70%; right: 55%; }
.logo:hover .logo-mark i:nth-child(2) { transform: translateX(30%); }
.logo:hover .logo-mark i:nth-child(3) { transform: translateX(55%); }
.nav-links { display: flex; gap: 2.2rem; font-size: .93rem; color: var(--fg-2); }
.nav-links a { position: relative; display: grid; overflow: hidden; height: 1.3em; }
.nav-links a span { grid-area: 1/1; transition: transform .5s var(--ease-out); }
.nav-links a span + span { transform: translateY(100%); color: var(--fg); }
.nav-links a:hover span:first-child { transform: translateY(-100%); }
.nav-links a:hover span + span { transform: translateY(0); }
.nav .btn { height: 46px; padding: 0 1.2rem; font-size: .9rem; }
@media (max-width: 900px) { .nav-links { display: none; } }
@media (max-width: 460px) { .nav .btn .dot { display: none; } .nav .btn { padding: 0 1rem; } }

/* Cursor */
.cursor, .cursor-dot { position: fixed; top: 0; left: 0; z-index: 100; pointer-events: none; border-radius: 50%; opacity: 0; }
.cursor { width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 1px solid rgba(242,239,232,.45); display: grid; place-items: center;
  font: 500 .62rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #0a0a0b;
  transition: width .45s var(--ease-out), height .45s var(--ease-out), margin .45s var(--ease-out), background .3s, border-color .3s; }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent); }
.cursor.is-link { width: 70px; height: 70px; margin: -35px 0 0 -35px; border-color: transparent; background: rgba(242,239,232,.1); backdrop-filter: blur(2px); }
.cursor.is-label { width: 88px; height: 88px; margin: -44px 0 0 -44px; background: var(--fg); border-color: var(--fg); }
@media (hover: none), (pointer: coarse) { .cursor, .cursor-dot { display: none; } }

/* Preloader */
.loader { position: fixed; inset: 0; z-index: 120; background: var(--bg); display: grid; align-content: end; padding: var(--gutter); }
.loader[hidden] { display: none; }
.loader-row { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.loader-count { font: 400 clamp(5rem, 16vw, 14rem)/.8 var(--serif); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.loader-count sup { font-size: .25em; vertical-align: top; color: var(--accent); }
.loader-bar { height: 1px; background: var(--line-2); margin-top: 1.4rem; overflow: hidden; }
.loader-bar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.loader-steps { font: 500 .74rem/1.9 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; text-align: right; }
.loader-steps b { color: var(--fg); font-weight: 500; }

/* Footer */
.footer { position: relative; padding-top: clamp(4rem, 8vw, 7rem); border-top: 1px solid var(--line); overflow: hidden; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer h4 { margin: 0 0 1rem; font: 500 .74rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; color: var(--fg-2); }
.footer ul a:hover { color: var(--accent); }
.footer-word { font: 400 min(40vw, 37rem)/.8 var(--serif); letter-spacing: -.05em; margin: clamp(3rem, 6vw, 5rem) 0 0; white-space: nowrap; display: flex; justify-content: center; }
.footer-word span { display: inline-block; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.4rem 0 2rem; border-top: 1px solid var(--line); font: 500 .74rem/1.4 var(--mono); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
@media (max-width: 760px) { .footer-top { grid-template-columns: 1fr 1fr; } .footer-top > :first-child { grid-column: 1 / -1; } }

/* Legal pages */
.legal { padding: 150px 0 clamp(4rem, 8vw, 7rem); }
.legal .wrap { max-width: 820px; }
.legal h1 { margin: 1.2rem 0 .6rem; }
.legal .updated { font: 500 .8rem/1 var(--mono); color: var(--muted); margin: 0 0 3rem; letter-spacing: .05em; }
.legal h2 { font: 600 1.2rem/1.3 var(--sans); margin: 2.6rem 0 .7rem; color: var(--fg); letter-spacing: -.01em; }
.legal p, .legal li { color: var(--fg-2); }
.legal a { color: var(--accent); }
.legal b { color: var(--fg); font-weight: 600; }
.legal .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.legal table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .92rem; }
.legal th, .legal td { text-align: left; padding: .85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal th { font: 500 .7rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* Motion-off */
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
