:root {
  --bg: #f7f3ec;
  --bg-alt: #efe8dc;
  --surface: #ffffff;
  --ink: #1d2b3a;
  --ink-soft: #4b5b6b;
  --muted: #7a8794;
  --line: rgba(29, 43, 58, 0.12);
  --accent: #d9822b;
  --accent-ink: #ffffff;
  --accent-soft: rgba(217, 130, 43, 0.14);
  --sky-top: #fbe6c8;
  --sky-bottom: #f7f3ec;
  --ridge-1: #c9b9a3;
  --ridge-2: #9c8c7a;
  --ridge-3: #f7f3ec;
  --sun: #f0a64a;
  --shadow: 0 18px 40px -22px rgba(29, 43, 58, 0.35);
  --radius: 18px;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1722;
    --bg-alt: #142030;
    --surface: #182637;
    --ink: #eef2f6;
    --ink-soft: #b4c0cc;
    --muted: #8796a6;
    --line: rgba(238, 242, 246, 0.12);
    --accent: #f0a64a;
    --accent-ink: #1d1407;
    --accent-soft: rgba(240, 166, 74, 0.16);
    --sky-top: #0b1320;
    --sky-bottom: #1a2a40;
    --ridge-1: #24364d;
    --ridge-2: #1a2a3d;
    --ridge-3: #0f1722;
    --sun: #d9e2ec;
    --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.7);
  }
}

:root[data-theme="dark"] {
  --bg: #0f1722;
  --bg-alt: #142030;
  --surface: #182637;
  --ink: #eef2f6;
  --ink-soft: #b4c0cc;
  --muted: #8796a6;
  --line: rgba(238, 242, 246, 0.12);
  --accent: #f0a64a;
  --accent-ink: #1d1407;
  --accent-soft: rgba(240, 166, 74, 0.16);
  --sky-top: #0b1320;
  --sky-bottom: #1a2a40;
  --ridge-1: #24364d;
  --ridge-2: #1a2a3d;
  --ridge-3: #0f1722;
  --sun: #f3d7a4;
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.7);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .3s ease, color .3s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.5rem, 6.5vw, 5rem); font-weight: 700; }
h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 600; }
h3 { font-size: 1.3rem; font-weight: 600; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; position: relative; }

.eyebrow {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

/* Nav */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px max(16px, calc((100% - 1120px) / 2));
  transition: background-color .3s ease, box-shadow .3s ease, backdrop-filter .3s;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.nav nav { display: flex; gap: 26px; margin-left: auto; }
.nav nav a { text-decoration: none; font-size: .95rem; font-weight: 500; color: var(--ink-soft); }
.nav nav a:hover { color: var(--ink); }

.theme-toggle {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom));
  padding: 120px 16px 160px;
}
.hero-sky { position: absolute; inset: 0; will-change: transform; }
.sun {
  position: absolute;
  width: clamp(110px, 15vw, 210px);
  aspect-ratio: 1;
  border-radius: 50%;
  right: 7%; top: 13%;
  background: radial-gradient(circle at 40% 40%, var(--sun), color-mix(in srgb, var(--sun) 40%, transparent) 70%);
  opacity: .9;
}
.dot { position: absolute; left: var(--x); top: var(--y); width: 4px; height: 4px; border-radius: 50%; background: var(--sun); opacity: .7; }
.ridge { position: absolute; left: 0; width: 100%; height: 42%; bottom: 0; will-change: transform; }
.ridge-1 { bottom: 10%; fill: var(--ridge-1); }
.ridge-2 { bottom: 2%; fill: var(--ridge-2); }
.ridge-3 { bottom: -1px; fill: var(--ridge-3); height: 26%; }

.hero-copy { position: relative; z-index: 2; text-align: center; max-width: 820px; will-change: transform; }
.hero-copy .lede { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--ink-soft); max-width: 620px; margin: 22px auto 34px; }
.cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600; font-size: .98rem;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.btn-ghost { border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 60%, transparent); }

.scroll-hint { position: absolute; bottom: 28px; left: 50%; translate: -50% 0; z-index: 3; width: 26px; height: 42px; border: 2px solid var(--ink-soft); border-radius: 14px; opacity: .6; }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--ink-soft); animation: scroll 1.8s ease-in-out infinite; }
@keyframes scroll { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* Sections */
.section { position: relative; padding: clamp(80px, 12vw, 140px) 0; overflow: hidden; }
.section-head { max-width: 720px; margin-bottom: 56px; }
.section-head > p:last-child { color: var(--ink-soft); font-size: 1.1rem; margin: 18px 0 0; }

.float-shape { position: absolute; border-radius: 50%; pointer-events: none; will-change: transform; }
.shape-a { width: 420px; height: 420px; right: -140px; top: 60px; background: radial-gradient(circle, var(--accent-soft), transparent 70%); }
.shape-b { width: 260px; height: 260px; left: -100px; bottom: 80px; border: 1px solid var(--line); }
.shape-c { width: 520px; height: 520px; left: -200px; top: 40px; background: radial-gradient(circle, var(--accent-soft), transparent 70%); }

/* Philosophy */
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.principle {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: var(--shadow);
}
.principle .num { font-family: var(--font-display); font-size: 2.2rem; color: var(--accent); line-height: 1; display: block; margin-bottom: 18px; }
.principle p { color: var(--ink-soft); margin: 12px 0 0; font-size: .98rem; }

.formats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.formats span { padding: 9px 18px; border-radius: 999px; border: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent); color: var(--ink-soft); font-size: .92rem; font-weight: 500; }

/* Quote band */
.band { position: relative; padding: clamp(100px, 16vw, 200px) 0; overflow: hidden; color: #fff; text-align: center; }
.band-bg {
  position: absolute; inset: -40% 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(240, 166, 74, .35), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(240, 166, 74, .2), transparent 45%),
    repeating-linear-gradient(115deg, rgba(255,255,255,.03) 0 2px, transparent 2px 22px),
    linear-gradient(135deg, #1d2b3a, #2b3d52);
  will-change: transform;
}
.band blockquote { margin: 0 auto; max-width: 900px; }
.band p { font-family: var(--font-display); font-size: clamp(1.7rem, 4vw, 2.9rem); line-height: 1.25; margin: 0; }

/* Products */
.products { background: var(--bg-alt); }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.product {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .3s ease, box-shadow .3s ease;
}
a.product:hover { transform: translateY(-6px); }
.product-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg); }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
a.product:hover .product-media img { transform: scale(1.04); }
.product-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.product-body p { margin: 0; color: var(--ink-soft); font-size: .96rem; }
.product-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tagline { font-style: italic; color: var(--muted) !important; }
.status { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.status-live { background: rgba(46, 160, 98, .14); color: #2ea062; }
.why { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; margin-top: 4px !important; }
.why strong { display: block; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }
.tags { list-style: none; padding: 0; margin: auto 0 0; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 8px; }
.tags li { font-size: .78rem; padding: 3px 10px; border-radius: 6px; background: var(--bg); color: var(--muted); }

/* Licensing */
.license-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.license-card { padding: 28px; border-radius: var(--radius); border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.license-card p { color: var(--ink-soft); margin: 10px 0 0; font-size: .98rem; }
.license-card h3::before { content: ''; display: block; width: 32px; height: 3px; border-radius: 2px; background: var(--accent); margin-bottom: 16px; }

.terms { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 22px; }
.term { padding: 32px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line); }
.term p { color: var(--ink-soft); margin: 10px 0 18px; font-size: .98rem; }
.term a { font-weight: 600; color: var(--accent); text-decoration: none; }
.term a[aria-disabled="true"] { color: var(--muted); pointer-events: none; }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 36px 0; }
.footer-inner { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer nav { display: flex; gap: 22px; margin-left: auto; }
.footer nav a { text-decoration: none; color: var(--ink-soft); font-size: .92rem; }
.footer nav a:hover { color: var(--ink); }
.fine { width: 100%; margin: 0; color: var(--muted); font-size: .85rem; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.reveal.is-visible { opacity: 1; transform: none; }
.principles .reveal:nth-child(3n+2), .product-grid .reveal:nth-child(3n+2), .license-grid .reveal:nth-child(2) { transition-delay: .08s; }
.principles .reveal:nth-child(3n), .product-grid .reveal:nth-child(3n), .license-grid .reveal:nth-child(3) { transition-delay: .16s; }

/* Responsive */
@media (max-width: 960px) {
  .principles, .product-grid, .license-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav nav { display: none; }
  .theme-toggle { margin-left: auto; }
  .principles, .product-grid, .license-grid, .terms { grid-template-columns: 1fr; }
  .hero { padding-bottom: 140px; }
  .ridge { height: 30%; }
  .sun { right: 6%; top: 10%; width: 90px; }
  .section-head { margin-bottom: 40px; }
  .footer nav { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint span { animation: none; }
}
