/* DTSLIB Brand Tokens — single source for landing, HQ map, repo pages */
:root {
  --bg: #030303;
  --bg-elevated: #0a0a0a;
  --bg-card: #0f0e0c;
  --bg-card-hover: #141210;
  --gold: #C9A84C;
  --gold-light: #E2C76E;
  --gold-pale: #F0DFA0;
  --gold-deep: #8A7030;
  --gold-dim: rgba(201, 168, 76, 0.08);
  --gold-glow: rgba(201, 168, 76, 0.14);
  --text: #EDEBE6;
  --text-secondary: rgba(237, 235, 230, 0.68);
  --text-muted: rgba(237, 235, 230, 0.42);
  --text-dim: rgba(237, 235, 230, 0.22);
  --border: rgba(237, 235, 230, 0.07);
  --border-gold: rgba(201, 168, 76, 0.18);
  --border-strong: rgba(201, 168, 76, 0.32);
  --t1: #C9A84C;
  --t2: #D4B96A;
  --t3: #7FB07F;
  --t4: #9B8AC8;
  --t5: #7FA0B0;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 100px;
  --shadow-card: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(201, 168, 76, 0.06);
  --max-narrow: 520px;
  --max-read: 640px;
  --max-wide: 960px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-display: 'Cinzel', 'Times New Roman', serif;
}

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

html {
  height: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-height: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

/* Film grain — subtle, editorial */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.022;
  pointer-events: none;
  z-index: 9998;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }

/* Focus ring for a11y */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* Shared utilities */
.u-serif { font-family: var(--font-serif); }
.u-display { font-family: var(--font-display); }
.u-gold { color: var(--gold); }

.section-kicker {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(26px, 5.5vw, 40px);
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--text);
}

.section-title strong,
.section-title em {
  color: var(--gold);
  font-weight: 500;
  font-style: italic;
}

.section-sub {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 42em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), background 0.25s, border-color 0.25s, color 0.25s;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: #0a0906;
  box-shadow: 0 8px 28px rgba(201, 168, 76, 0.22);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(201, 168, 76, 0.32);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-gold);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Topbar shared */
.site-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + var(--safe-top)) 20px 10px;
  background: rgba(3, 3, 3, 0.72);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}

.site-topbar.scrolled {
  border-bottom-color: var(--border);
  background: rgba(3, 3, 3, 0.88);
}

.site-logo {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: var(--gold);
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 8px 10px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.site-nav a:hover {
  color: var(--gold);
  background: var(--gold-dim);
}

@media (max-width: 420px) {
  .site-nav a.nav-hide-sm { display: none; }
}

/* Footer shared */
.site-footer {
  text-align: center;
  padding: 32px 24px calc(48px + var(--safe-bottom));
  border-top: 1px solid var(--border);
}

.site-footer p {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.site-footer .footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 14px;
}

.site-footer .footer-links a {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

.site-footer .footer-links a:hover { color: var(--gold); }

/* Discord dock */
.discord-dock {
  position: fixed;
  right: 14px;
  bottom: calc(14px + var(--safe-bottom));
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.discord-dock a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: rgba(10, 8, 6, 0.92);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  color: var(--gold-pale);
  font-size: 11.5px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s, transform 0.2s;
}

.discord-dock a:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.discord-dock a.chat {
  border-color: rgba(88, 101, 242, 0.45);
  color: #a8b4ff;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-gold);
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gold);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--ease-out);
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
