/* ==========================================================================
   LUMEN — base.css
   Fonts · Design tokens · Reset · Typography · Layout utilities · Buttons
   ========================================================================== */

/* ---------- Fonts (self-hosted, no external requests) -------------------- */
@font-face {
  font-family: "Manrope VF";
  src: url("../fonts/manrope-latin.woff2") format("woff2-variations"),
       url("../fonts/manrope-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ------------------------------------------------------- */
:root {
  color-scheme: dark;

  --ink-950: #05060a;
  --ink-900: #080a11;
  --ink-850: #0b0e17;
  --ink-800: #10141f;

  --ivory: #f2ede4;
  --ivory-2: #e9e2d6;
  --ivory-3: #d9d0bf;

  --gold: #d9bd92;
  --gold-soft: #f2dfc0;
  --gold-deep: #a9855a;
  --violet: #7b6bff;
  --teal: #3fd3c1;
  --rose: #ff8fa3;

  --bg: var(--ink-900);
  --text: #efece6;
  --text-dim: #a8aeba;
  --text-mute: #767d8a;
  --line: rgba(255, 255, 255, 0.1);
  --line-soft: rgba(255, 255, 255, 0.055);
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(12, 15, 24, 0.66);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0.05, 0.36, 1);
  --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);

  --font-sans: "Manrope VF", "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB",
    "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-serif: "Instrument Serif", "Songti SC", "Noto Serif SC", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(20px, 4.6vw, 64px);
  --max: 1440px;
  --radius: 22px;
  --radius-lg: 30px;
  --nav-h: 76px;
  --section-y: clamp(88px, 12vw, 168px);
}

/* Ivory sections flip the whole local palette. */
[data-theme="ivory"] {
  color-scheme: light;
  --bg: var(--ivory);
  --text: #16140f;
  --text-dim: #5d594f;
  --text-mute: #8a8478;
  --line: rgba(22, 20, 15, 0.14);
  --line-soft: rgba(22, 20, 15, 0.08);
  --glass: rgba(22, 20, 15, 0.04);
  --glass-strong: rgba(242, 237, 228, 0.72);
}

/* ---------- Reset -------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

html.is-locked { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink-900);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  font-variant-ligatures: common-ligatures;
}

h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd { margin: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }

img, svg, video, canvas { display: block; max-width: 100%; }

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: var(--gold);
  color: #0a0b10;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Lenis */
html.lenis,
html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-scrolling iframe { pointer-events: none; }

/* ---------- Typography --------------------------------------------------- */
h1, h2, h3 {
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

strong { font-weight: 600; }

.serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.005em;
}

.accent {
  background: linear-gradient(100deg, #a1743c 0%, #d1a468 46%, #946d36 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mono {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  line-height: 1;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  flex: none;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--gold);
  line-height: 1;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(20px, 4vw, 56px);
  margin-bottom: clamp(40px, 6vw, 76px);
}

.section-head__title {
  font-size: clamp(1.9rem, 4.2vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.section-head__title .serif {
  color: var(--gold);
  font-size: 1.04em;
}

.section-head__note {
  max-width: 34ch;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.75;
}

.lead {
  font-size: clamp(1rem, 1.25vw, 1.125rem);
  line-height: 1.8;
  color: var(--text-dim);
}

/* ---------- Layout ------------------------------------------------------- */
.wrap {
  width: min(var(--max), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

.section {
  position: relative;
  padding-block: var(--section-y);
  background: var(--bg);
  color: var(--text);
}

.section--tight { padding-block: clamp(56px, 7vw, 96px); }
.section--flush-top { padding-top: 0; }

.hairline {
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--line-soft);
}

/* ---------- Buttons ------------------------------------------------------ */
.btn {
  --btn-h: 54px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  height: var(--btn-h);
  padding-inline: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  isolation: isolate;
  overflow: hidden;
  transition:
    color 0.45s var(--ease),
    border-color 0.45s var(--ease),
    background-color 0.45s var(--ease),
    transform 0.5s var(--ease);
  will-change: transform;
}

.btn__label {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
}

.btn__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.btn__arrow {
  position: relative;
  z-index: 2;
  width: 16px;
  height: 16px;
  flex: none;
  transition: transform 0.5s var(--ease);
}

.btn:hover .btn__arrow { transform: translate(2px, -2px); }

.btn--primary {
  background: var(--ivory);
  border-color: transparent;
  color: #0a0b10;
}

.btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(120deg, var(--gold-soft), var(--gold) 42%, var(--gold-deep));
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

.btn--primary:hover::before { opacity: 1; }

.btn--ghost {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn--ghost:hover {
  border-color: rgba(217, 189, 146, 0.5);
  background: rgba(255, 255, 255, 0.07);
}

.btn--sm {
  --btn-h: 44px;
  padding-inline: 20px;
  font-size: 13px;
}

.btn--lg {
  --btn-h: 64px;
  padding-inline: 34px;
  font-size: 15.5px;
}

.btn--gold {
  background: linear-gradient(120deg, #f6e7c9, var(--gold) 45%, #b48f61);
  border-color: transparent;
  color: #16130d;
}

.btn--gold::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.55) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.9s var(--ease);
}

.btn--gold:hover::after { transform: translateX(120%); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  position: relative;
  padding-bottom: 3px;
}

.link-arrow::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.6s var(--ease);
  opacity: 0.5;
}

.link-arrow:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.link-arrow svg {
  width: 14px;
  height: 14px;
  transition: transform 0.5s var(--ease);
}

.link-arrow:hover svg { transform: translate(3px, -3px); }

/* ---------- Reveal system ------------------------------------------------ */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition:
    opacity 1s var(--ease),
    transform 1.1s var(--ease);
  transition-delay: var(--d, 0s);
}

[data-reveal="fade"] { transform: none; }
[data-reveal="scale"] { transform: scale(0.965); }

[data-reveal].is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* Masked line reveal used for headlines */
.line-mask {
  display: block;
  overflow: hidden;
  padding-block: 0.04em;
  margin-block: -0.04em;
}

.line-mask > span {
  display: block;
  will-change: transform;
  transform: translate3d(0, 115%, 0) rotate(2.4deg);
  transition: transform 1.25s var(--ease);
  transition-delay: var(--d, 0s);
}

.is-ready .hero .line-mask > span,
.line-mask.is-in > span {
  transform: translate3d(0, 0, 0) rotate(0deg);
}

/* ---------- Texture & decorative layers ---------------------------------- */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 90;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  animation: grain-shift 7s steps(6) infinite;
}

@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 1%); }
  100% { transform: translate(0, 0); }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ivory);
  color: #0a0b10;
  font-size: 13px;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.4s var(--ease);
}

.skip-link:focus-visible { transform: translateY(0); }

/* ---------- Reduced motion ----------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }

  [data-reveal],
  .line-mask > span {
    opacity: 1 !important;
    transform: none !important;
  }

  .grain { animation: none !important; opacity: 0.022; }

  .studio__statement .w { opacity: 1 !important; }
}
