/* Heritage AI — Website tokens & base */

:root {
  /* Color tokens — from brief 15.1 */
  --bg-primary: #0B0F14;
  --bg-secondary: #11171F;
  --bg-tertiary: #1A2230;
  --bg-elevated: #222C3C;
  --border-subtle: #1F2937;
  --border-strong: #2D3A4E;
  --text-primary: #F5F7FA;
  --text-secondary: #9AA6B6;
  --text-tertiary: #6B7888;
  --accent: #C9A961;
  --accent-hover: #D9BC78;
  --accent-soft: rgba(201, 169, 97, 0.12);
  --accent-line: rgba(201, 169, 97, 0.32);
  --heritage-blue: #2C3E6B;
  --heritage-blue-soft: rgba(44, 62, 107, 0.1);
  --heritage-blue-line: rgba(44, 62, 107, 0.24);
  --accent-secondary: #5B8FB9;
  --protected: #3FA776;
  --warning: #D4A045;
  --critical: #C25450;

  /* Typography */
  --font-display: "Fraunces", "Cormorant Garamond", "Libre Caslon Text", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Layout */
  --max-content: 1200px;
  --section-py: 70px;
  --section-py-mobile: 44px;
  --radius-card: 20px;
  --radius-btn: 12px;
  --radius-pill: 999px;

  /* Motion */
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* Hairline / divider helpers */
.hairline {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle) 20%, var(--border-subtle) 80%, transparent);
}
.hairline-gold {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line) 20%, var(--accent-line) 80%, transparent);
}

/* Containers */
.container {
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 720px) { .container { padding: 0 22px; } }

/* Section frames */
section {
  padding: var(--section-py) 0;
  position: relative;
}
@media (max-width: 900px) { section { padding: var(--section-py-mobile) 0; } }

/* Type scale */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  font-variation-settings: "SOFT" 30, "WONK" 0, "opsz" 144;
}
.display em {
  font-style: italic;
  color: var(--accent);
  font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 144;
}

h1, h2, h3 { margin: 0; font-weight: 500; }

.h-section {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.4vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.018em;
  font-weight: 400;
  max-width: 18ch;
  font-variation-settings: "SOFT" 30, "WONK" 0, "opsz" 144;
}
.h-section em {
  font-style: italic;
  color: var(--accent);
  font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 144;
}

.h-card {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 400;
}

.body-lg {
  font-size: 19px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 60ch;
}
.body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.caption {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-tertiary);
}
.mono-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.mk-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}
.mk-dot-gold { background: var(--accent); }
.mk-dot-protected { background: var(--protected); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 180ms var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(180deg, var(--accent-hover), var(--accent));
  color: #1A130A;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 8px 24px -8px rgba(201,169,97,0.45);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #E5C887, var(--accent-hover));
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.22) inset, 0 12px 30px -8px rgba(201,169,97,0.5);
}
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-tertiary);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  height: 40px;
  padding: 0 14px;
  font-size: 14px;
}
.btn-ghost:hover { color: var(--text-primary); }

/* Cards */
.card {
  background: linear-gradient(180deg, var(--bg-secondary), var(--bg-secondary));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 32px;
  position: relative;
  transition: border-color 220ms var(--ease), transform 220ms var(--ease);
}
.card-elevated {
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(201,169,97,0.04), transparent 60%),
    linear-gradient(180deg, var(--bg-tertiary), var(--bg-secondary));
  border: 1px solid var(--border-subtle);
}
.card-hover:hover {
  border-color: var(--border-strong);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.badge-gold {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-line);
}
.badge-protected {
  background: rgba(63, 167, 118, 0.1);
  color: var(--protected);
  border: 1px solid rgba(63, 167, 118, 0.25);
}
.badge-muted {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Reveal animation — only hides once JS confirms IO is available */
.reveal { transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
html.reveal-ready .reveal:not(.is-visible) {
  opacity: 0;
  transform: translateY(14px);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html.reveal-ready .reveal:not(.is-visible) { opacity: 1; transform: none; }
  .reveal { transition: none; }
}

/* Scrollbar */
::selection { background: var(--accent-soft); color: var(--text-primary); }

/* Gold seal background filter */
.bg-grain::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScyMDAnIGhlaWdodD0nMjAwJz48ZmlsdGVyIGlkPSduJz48ZmVUdXJidWxlbmNlIHR5cGU9J2ZyYWN0YWxOb2lzZScgYmFzZUZyZXF1ZW5jeT0nMC45JyBudW1PY3RhdmVzPScyJy8+PGZlQ29sb3JNYXRyaXggdmFsdWVzPScwIDAgMCAwIDAuOSAgMCAwIDAgMCAwLjg1ICAwIDAgMCAwIDAuNyAgMCAwIDAgMCAwLjA2IDAnLz48L2ZpbHRlcj48cmVjdCB3aWR0aD0nMTAwJScgaGVpZ2h0PScxMDAlJyBmaWx0ZXI9J3VybCglMjNuKScvPjwvc3ZnPg==");
  opacity: 0.5;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
