/* ── Gerege AI — Mongolian dawn palette ───────────────────────── */
:root {
  --ink: #0b0806;        /* warm near-black page ground */
  --ink-2: #151009;      /* raised surfaces */
  --line: rgba(242, 234, 224, 0.1);
  --ember: #ff7a3d;      /* dawn accent */
  --gold: #d9a441;       /* gerege gold */
  --bone: #f2eae0;       /* primary text */
  --dust: #a6968a;       /* muted text */
  --display: "Bricolage Grotesque", "Avenir Next", sans-serif;
  --body: "Instrument Sans", "Helvetica Neue", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--mono); color: var(--gold); font-size: 0.9em; }
::selection { background: var(--ember); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 2px; }

/* ── Nav ──────────────────────────────────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(11, 8, 6, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: var(--line);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 1.1rem 2rem;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
}
.nav-brand { font-family: var(--display); font-weight: 600; letter-spacing: 0.14em; font-size: 0.95rem; }
.nav-brand sup { font-size: 0.5em; color: var(--dust); }
.nav-links { display: flex; gap: 2rem; }
.nav-links a { font-size: 0.86rem; color: var(--dust); transition: color 0.25s; }
.nav-links a:hover { color: var(--bone); }
.nav-actions { display: flex; align-items: center; gap: 1.2rem; }
.nav-login { font-size: 0.86rem; color: var(--dust); transition: color 0.25s; }
.nav-login:hover { color: var(--bone); }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; font-weight: 500; }
.btn-ghost-pill {
  border: 1px solid var(--line); border-radius: 999px; padding: 0.5rem 1.2rem;
  font-size: 0.86rem; transition: border-color 0.25s, background 0.25s;
}
.btn-ghost-pill:hover { border-color: var(--ember); background: rgba(255, 122, 61, 0.08); }
.btn-solid {
  background: var(--bone); color: var(--ink); border-radius: 999px;
  padding: 0.85rem 1.8rem; transition: transform 0.25s, box-shadow 0.25s;
}
.btn-solid:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(255, 122, 61, 0.28); }
.btn-text { color: var(--bone); padding: 0.85rem 0.4rem; }
.btn-text .arrow { transition: transform 0.25s; display: inline-block; }
.btn-text:hover .arrow { transform: translateX(5px); }

/* ── Hero — the dawn gate ─────────────────────────────────────── */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
}
.hero-bg { position: absolute; inset: 0; overflow: hidden; }
.hero-img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 40%;
  animation: heroZoom 9s ease-out forwards;
}
@keyframes heroZoom { from { transform: scale(1.09); } to { transform: scale(1); } }
.hero-beam {
  position: absolute; inset: 0; mix-blend-mode: screen; pointer-events: none;
  background:
    radial-gradient(10% 14% at 63% 26%, rgba(255, 214, 140, 0.85), transparent 70%),
    radial-gradient(40% 60% at 60% 40%, rgba(255, 138, 66, 0.38), rgba(255, 96, 40, 0.1) 45%, transparent 70%);
  animation: beamPulse 7s ease-in-out infinite;
}
@keyframes beamPulse {
  0%, 100% { opacity: 0.55; transform: scaleY(1); }
  50%      { opacity: 1;    transform: scaleY(1.06); }
}
.hero-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(11,8,6,0.55), transparent 26%, transparent 62%, rgba(11,8,6,0.92)),
    linear-gradient(100deg, rgba(11,8,6,0.72) 0%, transparent 55%);
}
.hero-grain {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.05'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero-content {
  position: relative; z-index: 2; max-width: 1280px; width: 100%;
  margin: 0 auto; padding: 8rem 2rem 0;
}
.hero-title {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(3rem, 7vw, 5.6rem); letter-spacing: -0.02em; line-height: 1.02;
}
.hero-sub {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.3rem, 2.6vw, 2rem); color: var(--dust); margin-top: 0.6rem;
}
.hero-desc { max-width: 30rem; margin-top: 1.4rem; color: rgba(242, 234, 224, 0.82); font-size: 0.98rem; }
.hero-cta { display: flex; align-items: center; gap: 1.4rem; margin-top: 2.2rem; flex-wrap: wrap; }
.hero-strip {
  position: relative; z-index: 2; margin-top: auto;
  max-width: 1280px; width: 100%; margin-inline: auto;
  padding: 2.5rem 2rem 1.8rem;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
}
.strip-label { font-size: 0.78rem; color: var(--dust); }
.strip-marks { display: flex; gap: 2.4rem; flex-wrap: wrap; }
.strip-marks span {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.16em;
  color: rgba(242, 234, 224, 0.55);
}

/* ── Sections ─────────────────────────────────────────────────── */
.section { max-width: 1280px; margin: 0 auto; padding: 8rem 2rem; }
.eyebrow {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.2em;
  color: var(--gold); margin-bottom: 1.6rem;
}
.section-title, .story-text h2, .api-text h2, .outro h2 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 3rem); letter-spacing: -0.015em; line-height: 1.12;
}

/* Why */
.statement {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(1.6rem, 3.4vw, 2.7rem); line-height: 1.25; letter-spacing: -0.01em;
  max-width: 60rem;
}
.statement em { font-style: normal; color: var(--ember); }
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
  margin-top: 5rem; border-top: 1px solid var(--line); padding-top: 3rem;
}
.stat-num {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.6rem, 5vw, 4rem); color: var(--bone); display: block; line-height: 1;
}
.stat-label { display: block; margin-top: 0.9rem; font-size: 0.86rem; color: var(--dust); max-width: 18rem; }

/* Story */
.story-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: center; }
.story-text p { color: var(--dust); margin-bottom: 1.2rem; max-width: 32rem; }
.story-text h2 { margin-bottom: 1.6rem; }
.story-figure { position: relative; }
.story-figure img {
  border-radius: 14px; border: 1px solid var(--line);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55);
}
.story-figure::after {
  content: ""; position: absolute; inset: -12%; z-index: -1;
  background: radial-gradient(50% 50% at 50% 50%, rgba(217, 164, 65, 0.14), transparent 70%);
}

/* Capabilities */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; margin-top: 3.5rem; }
.card {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 2rem 1.6rem; transition: transform 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}
.card:hover { transform: translateY(-6px); border-color: rgba(255, 122, 61, 0.45); background: #1a130b; }
.card h3 { font-family: var(--display); font-weight: 600; font-size: 1.1rem; margin-bottom: 0.8rem; }
.card p { font-size: 0.88rem; color: var(--dust); }

/* API */
.api-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 5rem; align-items: center; }
.api-text p { color: var(--dust); margin: 1.4rem 0 2rem; max-width: 30rem; }
.terminal {
  background: #0d0a07; border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; box-shadow: 0 40px 90px rgba(0, 0, 0, 0.5);
}
.terminal-bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--line);
}
.terminal-bar span { width: 10px; height: 10px; border-radius: 50%; background: rgba(242, 234, 224, 0.16); }
.terminal-bar em { margin-left: auto; font-family: var(--mono); font-style: normal; font-size: 0.7rem; color: var(--dust); }
.terminal-body {
  padding: 1.4rem 1.3rem; font-family: var(--mono); font-size: 0.8rem;
  line-height: 1.7; color: var(--bone); min-height: 15.5em;
  white-space: pre-wrap; overflow-x: auto;
}
.terminal-body code { color: inherit; font-size: 1em; }
.caret { display: inline-block; width: 8px; height: 1.1em; background: var(--ember); vertical-align: -0.2em; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Outro */
.outro { text-align: center; padding-bottom: 10rem; }
.outro-inner { position: relative; }
.outro-inner::before {
  content: ""; position: absolute; inset: -60% -20%; z-index: -1; pointer-events: none;
  background: radial-gradient(45% 55% at 50% 60%, rgba(255, 122, 61, 0.13), transparent 70%);
}
.outro p { color: var(--dust); margin: 1.2rem auto 2.4rem; max-width: 28rem; }
.outro .hero-cta { justify-content: center; margin-top: 0; }

/* Footer */
.footer { border-top: 1px solid var(--line); }
.footer-inner {
  max-width: 1280px; margin: 0 auto; padding: 2rem;
  display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  font-size: 0.8rem; color: var(--dust);
}
.footer-inner a { color: var(--bone); }
.footer-inner sup { font-size: 0.6em; }

/* ── Motion: load + scroll reveals ────────────────────────────── */
.reveal-load { opacity: 0; transform: translateY(26px); filter: blur(6px); animation: rise 1s cubic-bezier(0.2, 0.65, 0.25, 1) forwards; }
.hero-title.reveal-load { animation-delay: 0.15s; }
.hero-sub.reveal-load { animation-delay: 0.3s; }
.hero-desc.reveal-load { animation-delay: 0.45s; }
.hero-cta.reveal-load { animation-delay: 0.6s; }
.hero-strip.reveal-load { animation-delay: 0.9s; }
@keyframes rise { to { opacity: 1; transform: none; filter: none; } }

.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.9s cubic-bezier(0.2, 0.65, 0.25, 1), transform 0.9s cubic-bezier(0.2, 0.65, 0.25, 1); }
.reveal.in { opacity: 1; transform: none; }
.cards .card:nth-child(2) { transition-delay: 0.1s; }
.cards .card:nth-child(3) { transition-delay: 0.2s; }
.cards .card:nth-child(4) { transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .reveal-load { opacity: 1; transform: none; filter: none; }
  html { scroll-behavior: auto; }
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 960px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .story-grid, .api-grid { grid-template-columns: 1fr; gap: 3rem; }
  .stats { grid-template-columns: 1fr; gap: 2.6rem; }
  .nav-links { display: none; }
  .section { padding: 5.5rem 1.4rem; }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .hero-content { padding: 7rem 1.4rem 0; }
  .hero-strip { padding: 2rem 1.4rem 1.4rem; }
  .nav-inner { padding: 1rem 1.4rem; }
  .nav-login { display: none; }
}
