/* ============================================================
   Anomity base — design tokens + shared chrome.
   Loaded FIRST on every page (before nav.css and any page CSS).
   Implements the warm-editorial design system (see DESIGN.md and
   mockups/full-page-elevated.html). Tokens live here ONLY.
   ============================================================ */

:root {
  /* ---- surfaces ---- */
  --paper: #f4f3ee;
  --paper-2: #fbfaf7;
  --paper-3: #efece4;
  --card: #ffffff;

  /* ---- ink & text ---- */
  --ink: #181b21;
  --ink-2: #3c4350;
  --muted: #5f6775;
  --faint: #6b7280;

  /* ---- hairlines ---- */
  --rule: #e4e2da;
  --rule-2: #eeece5;
  --hair: #dcd9cf;

  /* ---- accent (signal teal) ---- */
  --accent: #0c7d6f;
  --accent-soft: #e6f2f0;
  --accent-deep: #0a5d53;
  --accent-glow: rgba(12, 125, 111, .32);
  --teal-bright: #5eead4;

  /* ---- status signals ---- */
  --warn: #b45309;
  --danger: #b91c1c;
  --info: #4f46e5;

  /* ---- type ---- */
  --display: 'Sentient', Georgia, serif;
  --body: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* ---- shape & layout ---- */
  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1180px;

  /* ---- transitional aliases (old token names -> new) ----
     Lets nav.css / site.css / blog.css / legal.css resolve while they
     migrate to the canonical names above. Safe to remove once unused. */
  --teal: var(--accent);
  --teal-dark: var(--accent-deep);
  --teal-tint: var(--accent-soft);
  --teal-glow: var(--accent-glow);
  --ink-muted: var(--ink-2);
  --surface-light: var(--paper-2);
  --surface-page: var(--paper);
  --bg-card: var(--card);
  --border: var(--rule);
  --success: var(--accent);
  --font-sans: var(--body);
  --font-mono: var(--mono);
  --text: var(--ink);
  --text-secondary: var(--muted);
  --text-muted: var(--faint);
  --meta: var(--faint);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
::selection { background: var(--accent-soft); color: var(--accent-deep); }
body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
}
a { color: inherit; }
code { font-family: var(--mono); }

/* paper grain over everything */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.75rem;
  position: relative;
}
section { padding: 6rem 0; position: relative; z-index: 2; }

/* ---- signal motif (pulsing pip) ---- */
.pip {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 0 var(--accent-glow); animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 8px rgba(12, 125, 111, 0); }
  100% { box-shadow: 0 0 0 0 rgba(12, 125, 111, 0); }
}

/* ---- editorial section header ---- */
.sec-head { position: relative; margin-bottom: 3rem; max-width: var(--maxw); }
.sec-index {
  display: flex; align-items: center; gap: 1rem;
  font-family: var(--mono); font-size: .7rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1.6rem;
}
.sec-index .ln { flex: 1; height: 1px; background: linear-gradient(90deg, var(--hair), transparent); }
/* default h2 (prose / page-body subheadings) — moderate, full width */
h2 {
  font-family: var(--display); font-weight: 500; font-size: 1.6rem;
  line-height: 1.25; letter-spacing: -.01em; color: var(--ink);
}
h2 em { font-style: italic; color: var(--accent); }
/* big editorial section headline */
.sec-head h2 {
  font-weight: 400; font-size: clamp(1.75rem, 3.6vw, 2.6rem);
  line-height: 1.1; letter-spacing: -.015em; max-width: 28ch;
}
.sec-sub { font-size: 1.12rem; color: var(--ink-2); max-width: 40rem; margin-top: 1.1rem; line-height: 1.6; }
.ghost {
  position: absolute; right: 0; top: -2.4rem; font-family: var(--display); font-weight: 500;
  font-size: 8rem; line-height: 1; color: var(--accent); opacity: .06; pointer-events: none;
  user-select: none; letter-spacing: -.04em;
}
@media (max-width: 680px) { .ghost { font-size: 5rem; top: -1rem; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem; font-family: var(--mono);
  font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.6rem;
}
.eyebrow::before, .eyebrow::after { content: ''; width: 26px; height: 1px; background: var(--hair); }

/* ---- buttons ---- */
.btn { font-family: var(--body); font-weight: 700; font-size: .97rem; text-decoration: none; transition: all .2s; cursor: pointer; border: 0; }
.btn-primary {
  background: var(--accent); color: #fff; padding: .92rem 1.9rem; border-radius: 999px;
  box-shadow: 0 14px 34px -12px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-2px); box-shadow: 0 18px 42px -12px var(--accent-glow); }
.btn-text { color: var(--ink); display: inline-flex; align-items: center; gap: .45rem; background: none; }
.btn-text .ar { transition: transform .2s; }
.btn-text:hover .ar { transform: translateX(5px); }

:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 2px; border-radius: 4px; }

/* ---- announce bar ---- */
.announce {
  text-align: center; font-family: var(--mono); font-size: .72rem; letter-spacing: .07em;
  color: var(--muted); padding: .6rem 1rem; border-bottom: 1px solid var(--rule);
  background: var(--paper-2); position: relative; z-index: 20;
}
.announce a { color: var(--accent); text-decoration: none; font-weight: 500; }
.announce .pip { margin-right: .5rem; vertical-align: middle; }

/* ---- AI summary widget ---- */
.ai-summary { background: var(--paper-2); border-top: 1px solid var(--rule); padding: 2rem 0; }
.ais-inner { display: flex; flex-direction: column; align-items: center; gap: .55rem; text-align: center; }
.ais-label { font-family: var(--body); font-weight: 600; font-size: .98rem; color: var(--ink); display: inline-flex; align-items: center; gap: .5rem; }
.ais-label::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.ais-sub { font-family: var(--mono); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: -.3rem; }
.ais-icons { display: flex; gap: .85rem; flex-wrap: wrap; justify-content: center; margin-top: .35rem; }
.ais-btn {
  width: 46px; height: 46px; border-radius: 50%; background: var(--card); border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.ais-btn:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 8px 18px -8px var(--accent-glow); }
.ais-btn img { width: 22px; height: 22px; object-fit: contain; }

/* ---- footer ---- */
footer { background: var(--paper-2); color: var(--ink-2); padding: 4rem 0 2rem; position: relative; z-index: 2; border-top: 1px solid var(--rule); }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 3rem; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
.foot-brand .word { font-family: var(--display); font-weight: 500; font-size: 1.4rem; color: var(--ink); }
.foot-brand .tag { font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; color: var(--accent); text-transform: uppercase; margin-top: 5px; display: block; }
.foot-brand p { font-size: .88rem; color: var(--ink-2); margin: 1.1rem 0 0; max-width: 19rem; line-height: 1.55; }
.foot-col h4 { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 1.1rem; font-weight: 500; }
.foot-col a { display: block; font-size: .9rem; color: var(--ink-2); text-decoration: none; margin-bottom: .65rem; transition: color .2s; }
.foot-col a:hover { color: var(--accent-deep); }
.foot-bot { border-top: 1px solid var(--rule); padding-top: 1.5rem; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 1rem; }
.foot-badges { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; justify-content: center; }
.badge { font-family: var(--mono); font-size: .62rem; letter-spacing: .06em; color: var(--accent-deep); border: 1px solid var(--rule); background: var(--accent-soft); padding: .3rem .6rem; border-radius: 6px; }
.vbadge { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid var(--rule); background: var(--card); padding: .42rem .68rem; border-radius: 10px; text-decoration: none; transition: border-color .2s, box-shadow .2s; }
a.vbadge:hover { border-color: var(--accent); box-shadow: 0 6px 16px -8px var(--accent-glow); }
.vbadge img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.vbadge svg { width: 20px; height: 20px; flex-shrink: 0; }
.vbadge .vb-t { display: flex; flex-direction: column; line-height: 1.15; }
.vbadge .vb-t b { font-size: .72rem; font-weight: 700; color: var(--ink); }
.vbadge .vb-t span { font-family: var(--mono); font-size: .54rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.foot-copy { font-size: .78rem; color: var(--muted); }
.foot-legal { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-top: 1.25rem; }
.foot-legal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; }
.foot-legal-nav a { font-size: .78rem; color: var(--muted); text-decoration: none; transition: color .2s; }
.foot-legal-nav a:hover { color: var(--accent-deep); }
.foot-social { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; margin-top: 1.1rem; border: 1px solid var(--rule); border-radius: 50%; color: var(--ink-2); transition: color .2s, border-color .2s, background .2s; }
.foot-social:hover { color: #fff; border-color: var(--accent); background: var(--accent); }

/* ---- scroll reveal ---- */
/* Initial hidden state is gated behind .js so no-JS users still see content
   (the <html class="js"> flag is set by an inline script in <head>). */
.js .rev { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); }
.rev.in { opacity: 1; transform: translateY(0); }
.js .stagger > * { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.stagger.in > * { opacity: 1; transform: translateY(0); }
.stagger.in > *:nth-child(1) { transition-delay: 0s; }
.stagger.in > *:nth-child(2) { transition-delay: .06s; }
.stagger.in > *:nth-child(3) { transition-delay: .12s; }
.stagger.in > *:nth-child(4) { transition-delay: .18s; }
.stagger.in > *:nth-child(5) { transition-delay: .24s; }
.stagger.in > *:nth-child(6) { transition-delay: .3s; }
.stagger.in > *:nth-child(7) { transition-delay: .36s; }
.stagger.in > *:nth-child(8) { transition-delay: .42s; }

@media (prefers-reduced-motion: reduce) {
  .rev, .stagger > * { transition: none !important; opacity: 1 !important; transform: none !important; }
  .pip { animation: none; }
  html { scroll-behavior: auto; }
}
