/* ==========================================================================
   Pandaren (PANDAREN TRADING LIMITED) — pandarentrading.com
   Design system: ink & bamboo. Dark canvas, jade light, cinnabar seal.
   No external assets, no trackers, no web fonts fetched from third parties.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Palette */
  --ink-900: #060d0c;
  --ink-800: #08120f;
  --ink-700: #0c1a17;
  --ink-600: #12241f;
  --ink-500: #1a322b;

  --paper: #f3eee2;
  --paper-dim: rgba(243, 238, 226, 0.66);
  --paper-faint: rgba(243, 238, 226, 0.42);

  --jade: #3fbf8f;
  --jade-bright: #6fe4b6;
  --jade-deep: #165843;
  --cinnabar: #e0533f;
  --gold: #d8b36a;

  --line: rgba(243, 238, 226, 0.12);
  --line-strong: rgba(243, 238, 226, 0.22);

  /* Type */
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    "Songti SC", Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* Scale */
  --step--1: clamp(0.78rem, 0.76rem + 0.1vw, 0.85rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3: clamp(2rem, 1.6rem + 2vw, 3.1rem);
  --step-4: clamp(2.6rem, 1.8rem + 4vw, 5.4rem);

  /* Layout */
  --shell: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --radius: 18px;
  --radius-lg: 28px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1.1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

::selection { background: var(--jade); color: var(--ink-900); }

:focus-visible {
  outline: 2px solid var(--jade-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 999;
  padding: 0.7rem 1.1rem;
  background: var(--jade);
  color: var(--ink-900);
  font-weight: 600;
  border-radius: 10px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* --------------------------------------------------------------------------
   3. Atmosphere — grain, aurora, bamboo rules
   -------------------------------------------------------------------------- */
body::before { /* paper grain */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: drift 26s var(--ease) infinite alternate;
}
.aurora span:nth-child(1) {
  width: 46vw; height: 46vw; top: -14vw; left: -8vw;
  background: radial-gradient(circle, rgba(63, 191, 143, 0.5), transparent 68%);
}
.aurora span:nth-child(2) {
  width: 38vw; height: 38vw; top: 34vh; right: -12vw;
  background: radial-gradient(circle, rgba(216, 179, 106, 0.28), transparent 68%);
  animation-duration: 34s; animation-direction: alternate-reverse;
}
.aurora span:nth-child(3) {
  width: 42vw; height: 42vw; bottom: -18vw; left: 22vw;
  background: radial-gradient(circle, rgba(224, 83, 63, 0.22), transparent 70%);
  animation-duration: 40s;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4vw, -6vh, 0) scale(1.18); }
}

/* --------------------------------------------------------------------------
   4. Layout primitives
   -------------------------------------------------------------------------- */
.shell {
  width: min(100% - var(--gutter) * 2, var(--shell));
  margin-inline: auto;
}

main, header, footer { position: relative; z-index: 2; }

section { padding-block: clamp(4.5rem, 10vw, 8.5rem); }

.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head h2 { font-size: var(--step-3); margin-bottom: 1rem; }
.section-head p { color: var(--paper-dim); font-size: var(--step-1); line-height: 1.5; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--jade);
  margin-bottom: 1.2rem;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--line-strong) 20%, var(--line-strong) 80%, transparent);
  margin: 0;
}

/* --------------------------------------------------------------------------
   5. Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  background: linear-gradient(180deg, rgba(6, 13, 12, 0.86), rgba(6, 13, 12, 0.45));
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header[data-stuck="true"] {
  border-bottom-color: var(--line);
  background: rgba(6, 13, 12, 0.92);
}
.site-header .shell {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex: 0 0 auto;
}
.brand img { width: 36px; height: 36px; }
.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-name strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.06rem;
  letter-spacing: 0.02em;
}
.brand-name span {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--paper-faint);
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2rem);
}
.nav a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--paper-dim);
  transition: color 0.2s var(--ease);
  position: relative;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 1px;
  background: var(--jade);
  transition: width 0.28s var(--ease);
}
.nav a:hover { color: var(--paper); }
.nav a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--paper);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    inset: 76px 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 var(--gutter) 1.5rem;
    background: rgba(6, 13, 12, 0.98);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: 0.9rem 0; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .nav .btn { margin-top: 1rem; justify-content: center; border-bottom: 0; }
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--jade);
  --btn-fg: var(--ink-900);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
  will-change: transform;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -14px rgba(63, 191, 143, 0.7);
}
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--paper);
  border-color: var(--line-strong);
}
.btn--ghost:hover {
  border-color: var(--jade);
  box-shadow: none;
  background: rgba(63, 191, 143, 0.08);
}
.btn svg { width: 16px; height: 16px; }

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */
.hero {
  padding-block: clamp(3.5rem, 9vw, 7rem) clamp(3rem, 7vw, 5rem);
}
.hero .shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 900px) {
  .hero .shell { grid-template-columns: 1fr; }
}

.hero h1 {
  font-size: var(--step-4);
  margin-bottom: 1.5rem;
}
.hero h1 em {
  font-style: italic;
  color: var(--jade-bright);
}
.hero-lede {
  font-size: var(--step-1);
  color: var(--paper-dim);
  line-height: 1.55;
  max-width: 34rem;
  margin-bottom: 2rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.hero-meta {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--paper-faint);
  letter-spacing: 0.06em;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 0.5rem; }
.hero-meta span::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--jade);
}

/* Seal artwork */
.seal {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  isolation: isolate;
}
.seal::before { /* rotating ring of dashes */
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  border: 1px dashed rgba(216, 179, 106, 0.35);
  animation: spin 60s linear infinite;
}
.seal::after { /* jade halo */
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(63, 191, 143, 0.28), transparent 62%);
  filter: blur(18px);
}
.seal-disc {
  position: relative;
  width: 74%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 25%, rgba(63, 191, 143, 0.16), transparent 60%),
    linear-gradient(160deg, var(--ink-600), var(--ink-800));
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(243, 238, 226, 0.08), 0 40px 90px -40px rgba(0, 0, 0, 0.9);
}
.seal-disc img { width: 58%; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   8. Marquee
   -------------------------------------------------------------------------- */
.marquee {
  border-block: 1px solid var(--line);
  padding-block: 1.1rem;
  overflow: hidden;
  background: rgba(8, 18, 15, 0.6);
}
.marquee-track {
  display: flex;
  width: max-content;
  gap: 3rem;
  animation: slide 42s linear infinite;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper-faint);
  white-space: nowrap;
}
.marquee-track span { display: inline-flex; align-items: center; gap: 3rem; }
.marquee-track span::after {
  content: "✦";
  color: var(--jade);
  font-size: 0.7em;
}
@keyframes slide { to { transform: translateX(-50%); } }
.marquee:hover .marquee-track { animation-play-state: paused; }

/* --------------------------------------------------------------------------
   9. Cards & grids
   -------------------------------------------------------------------------- */
.grid { display: grid; gap: clamp(1rem, 2vw, 1.5rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 28rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }

.card {
  position: relative;
  padding: clamp(1.5rem, 3vw, 2.2rem);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(18, 36, 31, 0.7), rgba(8, 18, 15, 0.55));
  overflow: hidden;
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease);
}
.card::after { /* light sweep */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(63, 191, 143, 0.12), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.card:hover::after { opacity: 1; }

.card h3 { font-size: var(--step-2); margin-bottom: 0.75rem; }
.card p { color: var(--paper-dim); }

.card-index {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--gold);
  letter-spacing: 0.2em;
  display: block;
  margin-bottom: 1.2rem;
}

.tick-list { list-style: none; margin: 1.4rem 0 0; padding: 0; display: grid; gap: 0.7rem; }
.tick-list li {
  position: relative;
  padding-left: 1.35rem;
  color: var(--paper-dim);
  font-size: 0.96rem;
  line-height: 1.5;
}
.tick-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px; height: 7px;
  border-radius: 2px;
  background: var(--jade);
  transform: rotate(45deg);
}

/* Craft — the two disciplines */
.craft { display: grid; gap: clamp(1rem, 2vw, 1.5rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); }
.craft .card { padding-bottom: clamp(2rem, 4vw, 3rem); }

.craft-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--paper-dim);
  margin: 0 0.4rem 0.5rem 0;
}

/* CRT panel for the retro games card */
.crt {
  position: relative;
  margin-top: 1.8rem;
  border-radius: 14px;
  padding: 1.6rem 1.2rem;
  display: grid;
  place-items: center;
  gap: 0.9rem;
  background: radial-gradient(ellipse at 50% 40%, #1d4438, #081a15 80%);
  border: 1px solid rgba(63, 191, 143, 0.28);
  box-shadow: inset 0 0 40px rgba(63, 191, 143, 0.12);
  overflow: hidden;
}
.crt::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.28) 0 1px,
    transparent 1px 3px
  );
  pointer-events: none;
}
.crt img {
  width: clamp(72px, 16vw, 104px);
  image-rendering: pixelated;
  filter: drop-shadow(0 0 12px rgba(63, 191, 143, 0.45));
  animation: bob 3.4s var(--ease) infinite alternate;
}
.crt-caption {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--jade-bright);
  text-align: center;
}
.crt-caption b { font-weight: 400; color: var(--paper-faint); display: block; margin-top: 0.4rem; letter-spacing: 0.14em; }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-8px); } }

/* --------------------------------------------------------------------------
   10. Work / showcase
   -------------------------------------------------------------------------- */
.work-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: center;
  padding: clamp(1.4rem, 3vw, 2rem) 0;
  border-top: 1px solid var(--line);
}
.work-item:last-child { border-bottom: 1px solid var(--line); }
.work-num {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--gold);
  letter-spacing: 0.16em;
}
.work-body h3 { font-size: var(--step-2); margin-bottom: 0.35rem; }
.work-body p { color: var(--paper-dim); font-size: 0.98rem; max-width: 44rem; }
.status {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid currentColor;
}
.status--dev { color: var(--gold); }
.status--soon { color: var(--jade); }
@media (max-width: 700px) {
  .work-item { grid-template-columns: auto 1fr; }
  .work-item .status { grid-column: 2; justify-self: start; }
}

/* --------------------------------------------------------------------------
   11. Process
   -------------------------------------------------------------------------- */
.step {
  padding-top: 1.6rem;
  border-top: 1px solid var(--line-strong);
}
.step b {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.2em;
  color: var(--jade);
  margin-bottom: 0.9rem;
  font-weight: 400;
}
.step h3 { font-size: var(--step-1); margin-bottom: 0.6rem; }
.step p { color: var(--paper-dim); font-size: 0.95rem; }

/* --------------------------------------------------------------------------
   12. Compliance & company
   -------------------------------------------------------------------------- */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(150deg, rgba(18, 36, 31, 0.85), rgba(6, 13, 12, 0.7));
  padding: clamp(1.6rem, 4vw, 3rem);
}

.company {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.company dl { margin: 0; display: grid; gap: 1.1rem; }
.company dt {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper-faint);
  margin-bottom: 0.3rem;
}
.company dd { margin: 0; font-size: 0.98rem; line-height: 1.55; }
.company dd a { color: var(--jade-bright); text-underline-offset: 3px; }

/* --------------------------------------------------------------------------
   13. Contact
   -------------------------------------------------------------------------- */
.contact { text-align: center; }
.contact h2 { font-size: var(--step-4); margin-bottom: 1.2rem; }
.contact p { color: var(--paper-dim); font-size: var(--step-1); max-width: 40rem; margin-inline: auto; }
.mail-link {
  display: inline-block;
  margin-top: 2rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2.6rem);
  color: var(--jade-bright);
  text-decoration: none;
  border-bottom: 1px solid rgba(111, 228, 182, 0.35);
  padding-bottom: 0.15em;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
  word-break: break-word;
}
.mail-link:hover { border-color: var(--jade-bright); color: var(--paper); }

/* --------------------------------------------------------------------------
   14. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(2.5rem, 6vw, 4rem) 2.5rem;
  background: rgba(6, 13, 12, 0.7);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 2.2rem;
  margin-bottom: 2.5rem;
}
.footer-grid h4 {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper-faint);
  margin-bottom: 1rem;
  font-weight: 400;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.footer-grid li { color: var(--paper-dim); font-size: 0.94rem; }
.footer-grid a { color: var(--paper-dim); text-decoration: none; font-size: 0.94rem; transition: color 0.2s var(--ease); }
.footer-grid a:hover { color: var(--jade-bright); }
.footer-grid address { font-style: normal; color: var(--paper-dim); font-size: 0.94rem; line-height: 1.6; }

.footer-base {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-faint);
}

/* --------------------------------------------------------------------------
   14b. Utilities
   (Kept as classes rather than inline styles so the site can ship a strict
   Content-Security-Policy without 'unsafe-inline'.)
   -------------------------------------------------------------------------- */
.u-mt { margin-top: 1.5rem; }
.u-mb { margin-bottom: 1rem; }
.u-center { justify-content: center; }
.u-stack { margin-bottom: clamp(1rem, 2vw, 1.5rem); }
.u-muted { color: var(--paper-dim); max-width: 26rem; }
.u-plain { font-style: normal; }
.u-bare { border-top: 0; padding-top: 0; }
.footer-base a { color: inherit; text-decoration: none; }
.footer-base a:hover { color: var(--jade-bright); }

/* --------------------------------------------------------------------------
   15. Legal / document pages
   -------------------------------------------------------------------------- */
.doc-hero {
  padding-block: clamp(3.5rem, 8vw, 6rem) clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
}
.doc-hero h1 { font-size: var(--step-3); margin-bottom: 1rem; }
.doc-hero p { color: var(--paper-dim); max-width: 46rem; }
.doc-meta {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--paper-faint);
  letter-spacing: 0.12em;
  margin-top: 1.5rem;
}

.doc {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  padding-block: clamp(3rem, 6vw, 5rem);
  align-items: start;
}
@media (max-width: 900px) { .doc { grid-template-columns: 1fr; } }

.toc {
  position: sticky;
  top: 6.5rem;
  border-left: 1px solid var(--line);
  padding-left: 1.2rem;
}
@media (max-width: 900px) { .toc { position: static; } }
.toc h2 {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper-faint);
  margin-bottom: 1rem;
}
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; counter-reset: toc; }
.toc a {
  color: var(--paper-dim);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.2s var(--ease);
}
.toc a::before {
  counter-increment: toc;
  content: counter(toc, decimal-leading-zero) " ";
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gold);
  margin-right: 0.45rem;
}
.toc a:hover { color: var(--jade-bright); }

.doc-body { max-width: 46rem; }
.doc-body section { padding-block: 0 clamp(2rem, 4vw, 3rem); }
.doc-body h2 {
  font-size: var(--step-2);
  margin-bottom: 1rem;
  padding-top: 0.5rem;
}
.doc-body h3 {
  font-size: var(--step-1);
  margin: 1.8rem 0 0.7rem;
}
.doc-body p, .doc-body li { color: var(--paper-dim); }
.doc-body ul, .doc-body ol { padding-left: 1.2rem; margin: 0 0 1.1em; display: grid; gap: 0.5rem; }
.doc-body li::marker { color: var(--jade); }
.doc-body a { color: var(--jade-bright); text-underline-offset: 3px; }
.doc-body strong { color: var(--paper); font-weight: 600; }

.callout {
  border-left: 2px solid var(--jade);
  background: rgba(63, 191, 143, 0.07);
  padding: 1.1rem 1.3rem;
  border-radius: 0 12px 12px 0;
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.table-wrap { overflow-x: auto; margin: 0 0 1.5rem; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--paper-faint);
  font-weight: 400;
  background: rgba(18, 36, 31, 0.6);
}
td { color: var(--paper-dim); }
tr:last-child td { border-bottom: 0; }

/* --------------------------------------------------------------------------
   16. 404
   -------------------------------------------------------------------------- */
.notfound {
  min-height: 68vh;
  display: grid;
  place-items: center;
  text-align: center;
}
.notfound img { width: clamp(96px, 20vw, 150px); image-rendering: pixelated; margin: 0 auto 2rem; }
.notfound h1 { font-size: var(--step-3); margin-bottom: 1rem; }
.notfound p { color: var(--paper-dim); margin-bottom: 2rem; }

/* --------------------------------------------------------------------------
   17. Reveal on scroll
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   18. Print
   -------------------------------------------------------------------------- */
@media print {
  body { background: #fff; color: #111; }
  .aurora, .site-header, .toc, .site-footer nav, .btn { display: none !important; }
  body::before { display: none; }
  .doc { grid-template-columns: 1fr; }
  .doc-body p, .doc-body li, td { color: #333; }
  a { color: #111; text-decoration: underline; }
}
