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

/* ── Tokens ────────────────────────────────────────── */
:root {
  --bg: #0c0b0f;
  --surface: #14131a;
  --text: #c8c4d4;
  --text-dim: #6e6a7a;
  --accent: #d4a574;
  --accent-dim: #a07850;
  --glow: rgba(212, 165, 116, 0.06);
}

/* ── Base ──────────────────────────────────────────── */
body {
  font-family: 'Cormorant Garamond', Georgia, serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 4rem 2rem;
  position: relative;
  overflow-x: hidden;
}

body.home {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: hidden;
}

/* Ambient glow */
body::before {
  content: '';
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(ellipse, var(--glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body.home::before { top: 50%; }

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

/* ── Layout ────────────────────────────────────────── */
.container {
  position: relative;
  z-index: 1;
  max-width: 500px;
  margin: 0 auto;
}

body.home .container {
  max-width: 420px;
  width: 100%;
  margin: 0;
}

body.terms .container { max-width: 600px; }

/* ── Shared components ─────────────────────────────── */
.back {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-decoration: none;
  letter-spacing: 0.03em;
  display: inline-block;
  margin-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.3s ease;
}

.back:hover { border-color: rgba(255, 255, 255, 0.2); }

.divider {
  width: 40px;
  height: 1px;
  background: var(--accent-dim);
  opacity: 0.5;
}

/* ── Home ──────────────────────────────────────────── */
.mark {
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
  line-height: 1.1;
}

.tagline {
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
  letter-spacing: 0.02em;
}

.subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  margin-bottom: 2.5rem;
}

body.home .divider { margin-bottom: 2.5rem; }

.links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 3rem;
}

.links a {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.links a.primary {
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  font-size: 1.1rem;
}

.links a.primary:hover {
  border-color: rgba(212, 165, 116, 0.2);
  background: rgba(212, 165, 116, 0.04);
}

.links a .label { flex: 1; }

.links a .label small {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
  letter-spacing: 0.02em;
}

.links a .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.5;
}

.links a .arrow,
.client .arrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent-dim);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateX(-4px);
}

.links a:hover .arrow,
.client:hover .arrow {
  opacity: 1;
  transform: translateX(0);
}

.sponsor {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
  letter-spacing: 0.02em;
}

.sponsor a {
  color: var(--accent-dim);
  text-decoration: none;
  border-bottom: 1px solid rgba(160, 120, 80, 0.3);
  transition: border-color 0.3s ease, color 0.3s ease;
}

.sponsor a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.contact {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.contact span {
  color: var(--accent-dim);
  user-select: all;
}

.kofi {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  margin-top: 0.4rem;
}

.kofi a {
  color: var(--accent-dim);
  text-decoration: none;
  border-bottom: 1px solid rgba(160, 120, 80, 0.3);
  transition: border-color 0.3s ease, color 0.3s ease;
}

.kofi a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.legal {
  margin-top: 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
}

.legal a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.3s ease;
}

.legal a:hover { border-color: rgba(255, 255, 255, 0.2); }

/* ── Content page prose ────────────────────────────── */
body:not(.home) p,
body:not(.home) li,
.intro,
.notice {
  font-family: 'Source Sans 3', sans-serif;
}

/* ── Clients ───────────────────────────────────────── */
h1 {
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.03em;
  line-height: 1.2;
  margin-bottom: 0.6rem;
}

.intro {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 3rem;
}

.intro a {
  color: var(--accent-dim);
  text-decoration: none;
  border-bottom: 1px solid rgba(160, 120, 80, 0.3);
  transition: border-color 0.3s ease;
}

.intro a:hover { border-color: var(--accent); }

.platform { margin-bottom: 2rem; }

.platform-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}

.client {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.3s ease, background 0.3s ease;
  margin-bottom: 0.5rem;
}

.client:hover {
  border-color: rgba(212, 165, 116, 0.2);
  background: rgba(212, 165, 116, 0.04);
}

.client-info { flex: 1; }

.client-name {
  font-size: 1.05rem;
  font-weight: 600;
}

.client-note {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
  letter-spacing: 0.02em;
}

.badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(212, 165, 116, 0.25);
  border-radius: 3px;
  padding: 0.15rem 0.4rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

body.clients .divider { margin: 2.5rem 0; }

.notice {
  background: var(--surface);
  border: 1px solid rgba(212, 165, 116, 0.2);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.7;
}

.notice strong {
  color: var(--accent);
  font-weight: 600;
}

.notice code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  color: var(--accent);
  background: rgba(212, 165, 116, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

/* ── Primer ────────────────────────────────────────── */
body.primer .container { max-width: 600px; }

body.primer h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--accent-dim);
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
  letter-spacing: 0.02em;
}

body.primer p {
  font-size: 1.1rem;
  line-height: 1.75;
  margin-bottom: 1rem;
}

body.primer p a {
  color: var(--accent-dim);
  text-decoration: none;
  border-bottom: 1px solid rgba(160, 120, 80, 0.3);
  transition: border-color 0.3s ease;
}

body.primer p a:hover { border-color: var(--accent); }

body.primer p strong { color: var(--text); }

body.primer code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  color: var(--accent);
  background: rgba(212, 165, 116, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

/* ── Terms ─────────────────────────────────────────── */
body.terms h1 { margin-bottom: 0.4rem; }

.updated {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  margin-bottom: 3rem;
}

body.terms h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--accent-dim);
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
  letter-spacing: 0.02em;
}

body.terms p {
  font-size: 1.1rem;
  line-height: 1.75;
  margin-bottom: 1rem;
}

body.terms ul {
  margin: 0.5rem 0 1rem 1.5rem;
  font-size: 1.1rem;
  line-height: 1.75;
}

body.terms li { margin-bottom: 0.3rem; }

body.terms p a,
body.terms li a { color: var(--accent-dim); }

body.terms .divider { margin: 3rem 0; }

body.terms footer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  margin-top: 3rem;
}

body.terms footer a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Animations ────────────────────────────────────── */
.container > * {
  opacity: 0;
  transform: translateY(6px);
  animation: enter 0.5s ease forwards;
}

.container > *:nth-child(1) { animation-delay: 0.05s; }
.container > *:nth-child(2) { animation-delay: 0.1s; }
.container > *:nth-child(3) { animation-delay: 0.15s; }
.container > *:nth-child(n+4) { animation-delay: 0.2s; }

body.home .container > * {
  transform: translateY(8px);
  animation-duration: 0.6s;
}

body.home .mark     { animation-delay: 0.1s; }
body.home .tagline  { animation-delay: 0.2s; }
body.home .subtitle { animation-delay: 0.25s; }
body.home .divider  { animation-delay: 0.35s; }
body.home .links    { animation-delay: 0.45s; }
body.home .sponsor  { animation-delay: 0.6s; }
body.home .contact  { animation-delay: 0.65s; }
body.home .kofi     { animation-delay: 0.7s; }
body.home .legal    { animation-delay: 0.8s; }

@keyframes enter {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 600px) {
  body::before {
    width: 400px;
    height: 400px;
  }

  .mark { font-size: 2rem; }
  h1 { font-size: 1.6rem; }
}
