/* =========================================================================
   Hoài Linh — Cosmos Portfolio
   Design system: "Star Chart / Observatory"
   ========================================================================= */

:root {
  /* Space depths */
  --space-0: #05060e;
  --space-1: #0a0d1d;
  --space-2: #11152b;
  --space-3: #1a2040;

  /* Lines & text */
  --line: rgba(180, 190, 235, 0.12);
  --line-strong: rgba(180, 190, 235, 0.24);
  --ink: #e9ecfa;
  --mute: #8a90b6;
  --faint: #5c618a;

  /* Accents */
  --star: #e8c97a;     /* warm star-gold — the signature accent */
  --plasma: #5be0e6;   /* cool plasma cyan */
  --nebula: #8e7bf0;   /* nebula violet */

  /* The page background the hero fades down into (NOT re-scoped on .hero,
     so it always resolves to the active theme's real page colour). */
  --page-bg: #05060e;

  --maxw: 1140px;
  --gut: clamp(20px, 5vw, 56px);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Sora", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--space-0);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* subtle star noise behind everything */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 70% 60%, rgba(255,255,255,.35), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,.3), transparent),
    radial-gradient(1200px 600px at 70% -10%, rgba(142,123,240,.10), transparent 60%);
  z-index: -2;
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gut); }

/* ---- Mono utility labels (coordinates / catalog ids) ------------------- */
.coord {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--star);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.coord::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--star);
  opacity: 0.7;
}

/* =========================================================================
   NAV
   ========================================================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gut);
  backdrop-filter: blur(8px);
  background: linear-gradient(to bottom, rgba(5,6,14,.62) 0%, rgba(5,6,14,.18) 58%, rgba(5,6,14,0) 100%);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--line); background: rgba(5,6,14,.9); }
.nav__brand {
  font-family: var(--font-mono);
  font-size: 0.82rem; letter-spacing: 0.22em;
  color: var(--ink);
}
.nav__brand b { color: var(--star); font-weight: 700; }
.nav__links { display: flex; gap: 28px; align-items: center; }
.nav__links a {
  font-family: var(--font-mono);
  font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--mute); transition: color .2s; position: relative;
}
.nav__links a:hover { color: var(--ink); }
.nav__toggle { display: none; background: none; border: 0; color: var(--ink); cursor: pointer; }

@media (max-width: 760px) {
  .nav__links { display: none; }
  .nav__toggle { display: block; }
  .nav.open .nav__links {
    display: flex; flex-direction: column; gap: 18px;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--space-1); padding: 22px var(--gut);
    border-bottom: 1px solid var(--line);
  }
}

/* =========================================================================
   HERO
   ========================================================================= */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: center;
  background: var(--space-0); /* the hero is always "deep space" — see light-theme override */
  color: var(--ink);          /* re-resolve so inherited text (h1) uses the hero-scoped token */
}
#cosmos {
  position: absolute; inset: 0; z-index: 0;
}

/* Instant, JS-free deep-space backdrop. Painted with the very first frame so
   the hero is never a flat empty rectangle while three.js + galaxy.js are
   still being fetched and the WebGL scene is booting (both are deferred off
   the critical path). galaxy.js adds `.cosmos-live` to <html> after its first
   rendered frame, which fades this out. It is also the PERMANENT backdrop when
   the 3D scene is skipped (save-data / very low-end devices). GPU-cheap:
   only opacity + transform animate. */
.cosmos-fallback {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  overflow: hidden;
  opacity: 1; transition: opacity .9s ease;
  /* warm sun glow biased to the right (matches the real sun's world offset)
     + a faint nebula wash, over deep space */
  background:
    radial-gradient(42% 60% at 72% 46%, rgba(244,166,60,.30), rgba(244,166,60,0) 62%),
    radial-gradient(70% 80% at 74% 44%, rgba(120,92,205,.14), transparent 72%),
    var(--space-0);
}
/* twinkling starfield — a scatter of tiny dots as layered gradients */
.cosmos-fallback::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, #fff, transparent),
    radial-gradient(1px 1px at 27% 68%, #cfe0ff, transparent),
    radial-gradient(1.5px 1.5px at 38% 14%, #fff, transparent),
    radial-gradient(1px 1px at 46% 82%, #fbe6b0, transparent),
    radial-gradient(2px 2px at 58% 34%, #fff, transparent),
    radial-gradient(1px 1px at 63% 74%, #bcd0ff, transparent),
    radial-gradient(1.5px 1.5px at 8% 54%, #fff, transparent),
    radial-gradient(1px 1px at 18% 88%, #fff, transparent),
    radial-gradient(1px 1px at 33% 46%, #cfe0ff, transparent),
    radial-gradient(1.5px 1.5px at 52% 60%, #fff, transparent),
    radial-gradient(1px 1px at 70% 18%, #fbe6b0, transparent),
    radial-gradient(1.5px 1.5px at 84% 62%, #fff, transparent),
    radial-gradient(1px 1px at 90% 30%, #bcd0ff, transparent),
    radial-gradient(1px 1px at 95% 78%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 24% 34%, #fff, transparent),
    radial-gradient(1px 1px at 78% 86%, #cfe0ff, transparent);
  animation: cosmos-twinkle 4.5s ease-in-out infinite;
}
/* soft breathing corona around the sun's position */
.cosmos-fallback::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(18% 24% at 72% 46%, rgba(255,244,214,.5), rgba(255,244,214,0) 70%);
  animation: cosmos-breathe 6s ease-in-out infinite;
}
@keyframes cosmos-twinkle { 0%,100% { opacity: .55 } 50% { opacity: 1 } }
@keyframes cosmos-breathe { 0%,100% { transform: scale(1); opacity: .85 } 50% { transform: scale(1.08); opacity: 1 } }
@media (prefers-reduced-motion: reduce) {
  .cosmos-fallback::before, .cosmos-fallback::after { animation: none; }
}
/* Once the live WebGL canvas has painted, retire the fallback. */
.cosmos-live .cosmos-fallback { opacity: 0; }

.hero::after { /* vignette to seat text */
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(120% 90% at 30% 50%, rgba(5,6,14,.72) 0%, rgba(5,6,14,.25) 45%, transparent 75%);
  pointer-events: none;
}
.hero::before { /* fade the deep-space hero down into the page below */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 56px; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, transparent 0%, color-mix(in srgb, var(--page-bg) 72%, transparent) 100%);
}
.hero__inner { position: relative; z-index: 2; width: 100%; }
.hero__desig { margin-bottom: 22px; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 9vw, 6.4rem);
  line-height: 0.96;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.hero h1 .glow {
  background: linear-gradient(120deg, #fff 10%, var(--star) 55%, var(--nebula) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__role {
  font-family: var(--font-mono);
  color: var(--mute);
  letter-spacing: 0.12em; font-size: 0.9rem;
  margin: 0 0 26px;
}
.hero__role span { color: var(--plasma); }
.hero__lead { max-width: 46ch; color: var(--mute); font-size: 1.05rem; margin: 0 0 34px; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  font-family: var(--font-mono);
  font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 14px 26px; border-radius: 2px; cursor: pointer;
  border: 1px solid var(--line-strong); color: var(--ink); background: transparent;
  transition: all .25s; display: inline-flex; align-items: center; gap: 10px;
}
.btn:hover { border-color: var(--star); color: var(--star); transform: translateY(-2px); }
.btn--primary {
  background: var(--star); color: #1a1405; border-color: var(--star); font-weight: 600;
}
.btn--primary:hover { background: #f4d68a; color: #1a1405; box-shadow: 0 0 28px rgba(232,201,122,.35); }

.hero__readout {
  position: absolute; bottom: 28px; left: var(--gut); right: var(--gut); z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em;
  color: var(--faint); text-transform: uppercase;
  border-top: 1px solid var(--line); padding-top: 14px;
}
.hero__readout .blink { color: var(--plasma); animation: blink 2.4s steps(1) infinite; }
@keyframes blink { 0%,60%{opacity:1} 61%,100%{opacity:.25} }
@media (prefers-reduced-motion: reduce){ .hero__readout .blink{ animation:none } }

/* Dawn HUD — announces the landing planet, bottom-left, above the readout
   bar. galaxy.js creates the markup and drives its opacity via dawnMix, so
   there is no CSS transition here (that would fight the per-frame writes). */
.cosmos-planet {
  position: absolute; left: var(--gut); bottom: 74px; z-index: 5;
  display: flex; flex-direction: column; gap: 5px;
  font-family: var(--font-mono); opacity: 0; pointer-events: none;
  text-shadow: 0 1px 14px rgba(0,0,0,.55);
}
.cosmos-planet__label {
  font-size: 0.62rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: #f4b46a;
}
.cosmos-planet__name {
  font-size: 1.15rem; letter-spacing: 0.16em; color: #f6f0e4;
}
.cosmos-planet__epithet {
  font-size: 0.74rem; letter-spacing: 0.06em; color: rgba(246,240,228,.72);
}
@media (max-width: 640px) { .cosmos-planet { bottom: 92px; } .cosmos-planet__epithet { display: none; } }

/* =========================================================================
   SECTION SCAFFOLD
   ========================================================================= */
.section { padding: clamp(72px, 12vw, 140px) 0; position: relative; }
.section__head { margin-bottom: 56px; max-width: 60ch; }
.section__head h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.05;
  margin: 14px 0 0; letter-spacing: -0.01em;
}
.section__head p { color: var(--mute); margin: 18px 0 0; max-width: 52ch; }

/* divider with star tick */
.section + .section::before {
  content: ""; display: block; height: 1px; background: var(--line);
  max-width: var(--maxw); margin: 0 auto;
}

/* =========================================================================
   ABOUT
   ========================================================================= */
.about { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: start; }
.about__body p { color: var(--ink); }
.about__body p + p { margin-top: 18px; color: var(--mute); }
.about__facts { border: 1px solid var(--line); border-radius: 4px; background: var(--space-1); }
.about__fact {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 0.82rem;
}
.about__fact:last-child { border-bottom: 0; }
.about__fact span:first-child { color: var(--faint); letter-spacing: .08em; }
.about__fact span:last-child { color: var(--ink); text-align: right; }
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.tag {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: .08em;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--plasma);
}
@media (max-width: 820px){ .about{ grid-template-columns: 1fr; } }

/* =========================================================================
   PROJECTS
   ========================================================================= */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card {
  position: relative; border: 1px solid var(--line); border-radius: 6px;
  background: linear-gradient(180deg, var(--space-2), var(--space-1));
  padding: 26px 24px 24px; overflow: hidden;
  transition: transform .3s, border-color .3s;
}
.card::after { /* orbit arc decoration */
  content: ""; position: absolute; top: -60px; right: -60px;
  width: 140px; height: 140px; border-radius: 50%;
  border: 1px solid var(--line); opacity: .5;
}
.card:hover { transform: translateY(-4px); border-color: var(--star); }
.card__id { font-family: var(--font-mono); font-size: 0.7rem; color: var(--star); letter-spacing: .14em; }
.card__status {
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: .1em;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-strong);
  position: absolute; top: 22px; right: 22px;
}
.card__status[data-s="live"] { color: var(--plasma); border-color: rgba(91,224,230,.4); }
.card__status[data-s="wip"]  { color: var(--star); border-color: rgba(232,201,122,.4); }
.card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; margin: 16px 0 10px; }
.card p { color: var(--mute); font-size: 0.95rem; margin: 0 0 22px; }
.card__stack { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.card__stack span { font-family: var(--font-mono); font-size: 0.68rem; color: var(--faint); }
.card__links { display: flex; gap: 18px; font-family: var(--font-mono); font-size: 0.74rem; }
.card__links a { color: var(--ink); border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; transition: color .2s, border-color .2s; }
.card__links a:hover { color: var(--star); border-color: var(--star); }

/* =========================================================================
   APPS
   ========================================================================= */
.apps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.app {
  display: flex; gap: 18px; align-items: center;
  border: 1px solid var(--line); border-radius: 8px; padding: 20px;
  background: var(--space-1); transition: border-color .3s, background .3s;
}
.app:hover { border-color: var(--nebula); background: var(--space-2); }
.app__icon {
  width: 56px; height: 56px; flex: none; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.6rem;
  background: radial-gradient(circle at 30% 25%, var(--space-3), var(--space-0));
  border: 1px solid var(--line-strong);
  overflow: hidden;
}
.app__icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.app__meta { flex: 1; min-width: 0; }
.app__meta h3 { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 4px; }
.app__meta p { color: var(--mute); font-size: 0.85rem; margin: 0; }
.app__actions {
  display: flex; align-items: center; gap: 12px;
  margin-top: 10px;
}
.app__stores { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; }
.app__stores a { font-family: var(--font-mono); font-size: 0.7rem; color: var(--plasma); letter-spacing: .06em; }
.app__stores a:hover { color: var(--star); }
.app__report {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 8px;
  color: var(--plasma); background: color-mix(in srgb, var(--plasma) 7%, transparent);
  transition: color .2s, border-color .2s, background .2s;
}
.app__report::before {
  content: "!";
  width: 16px; height: 16px; display: grid; place-items: center;
  border: 1.5px solid currentColor; border-radius: 50%;
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700; line-height: 1;
}
.app__report:hover { color: var(--star); border-color: var(--star); background: color-mix(in srgb, var(--star) 9%, transparent); }

@media (max-width: 760px) {
  .apps { grid-template-columns: 1fr; }
}

/* =========================================================================
   POLICIES
   ========================================================================= */
.policies { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 16px; }
.policy-link {
  display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--line); border-left: 2px solid var(--star);
  border-radius: 4px; padding: 22px; background: var(--space-1);
  transition: transform .25s, border-color .25s;
}
.policy-link:hover { transform: translateX(4px); border-color: var(--line-strong); border-left-color: var(--plasma); }
.policy-link b { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.policy-link span { color: var(--mute); font-size: 0.85rem; }
.policy-link em { font-family: var(--font-mono); font-style: normal; font-size: 0.68rem; color: var(--faint); letter-spacing: .12em; }

/* =========================================================================
   FOOTER
   ========================================================================= */
.footer { border-top: 1px solid var(--line); padding: 56px 0 40px; }
.footer__top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 28px; }
.footer__brand { font-family: var(--font-display); font-size: 1.4rem; }
.footer__brand span { color: var(--star); }
.footer__cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer__col h4 { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 0 0 14px; }
.footer__col a { display: block; color: var(--mute); font-size: 0.9rem; padding: 4px 0; transition: color .2s; }
.footer__col a:hover { color: var(--star); }
.footer__bottom {
  margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--faint); letter-spacing: .08em;
}

/* =========================================================================
   POLICY ARTICLE PAGES
   ========================================================================= */
.legal { padding-top: 140px; }
.legal__head { max-width: 70ch; margin-bottom: 48px; }
.legal__head h1 { font-family: var(--font-display); font-size: clamp(2.2rem,5vw,3.4rem); margin: 14px 0 0; }
.legal__head p { color: var(--mute); margin-top: 16px; }
.legal__grid { display: grid; grid-template-columns: 240px 1fr; gap: 56px; align-items: start; }

/* ---- Left TOC — clearer active state ---- */
.legal__toc { position: sticky; top: 110px; display: flex; flex-direction: column; gap: 2px; }
.legal__toc a {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--mute);
  padding: 10px 14px 10px 18px; border-left: 2px solid var(--line); border-radius: 0 4px 4px 0;
  transition: all .2s;
}
.legal__toc-icon { flex: none; font-size: 0.95rem; }
.legal__toc a:hover { color: var(--ink); border-left-color: var(--line-strong); background: var(--space-1); }
.legal__toc a.is-active {
  color: var(--star); border-left-color: var(--star); background: var(--space-1);
  font-weight: 600;
}

/* ---- Body sections — larger, clearly separated blocks ---- */
.legal__body { display: flex; flex-direction: column; gap: 28px; }
.legal__section {
  border: 1px solid var(--line); border-radius: 10px; background: var(--space-1);
  padding: clamp(28px, 4vw, 44px);
}
.legal__body h2 {
  font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 20px;
  scroll-margin-top: 110px; display: flex; align-items: center; gap: 18px;
}
.legal__section-icon {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; font-size: 1.7rem; border-radius: 14px;
  background: radial-gradient(circle at 30% 25%, var(--space-3), var(--space-0));
  border: 1px solid var(--line-strong);
  box-shadow: 0 10px 24px -14px var(--star);
}
.legal__body h3 { font-size: 1.1rem; margin: 24px 0 8px; color: var(--star); }
.legal__body p, .legal__body li { color: var(--mute); }
.legal__body ul { padding-left: 20px; }
.legal__body a { color: var(--plasma); border-bottom: 1px solid var(--line-strong); }
.legal__meta { margin-top: 4px; padding: 22px; border: 1px solid var(--line); border-radius: 6px; background: var(--space-1); font-family: var(--font-mono); font-size: 0.8rem; color: var(--mute); }
@media (max-width: 820px){
  .legal__grid{ grid-template-columns: 1fr; }
  .legal__toc{ position: static; flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 4px; }
  .legal__toc a{ border-left: 0; border-bottom: 2px solid var(--line); white-space: nowrap; border-radius: 4px 4px 0 0; }
  .legal__toc a.is-active{ border-left: 0; border-bottom-color: var(--star); }
}

/* ---- Headline + image banner (đầu trang, tuỳ chọn) ---- */
.legal__hero {
  position: relative; overflow: hidden; margin-bottom: 48px;
  border: 1px solid var(--line-strong); border-radius: 14px; min-height: 220px;
  display: flex; align-items: flex-end;
  background: linear-gradient(180deg, var(--space-2), var(--space-1));
}
.legal__hero-media {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: .55;
}
.legal__hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--space-0) 5%, transparent 80%);
}
.legal__hero-headline {
  position: relative; z-index: 1; margin: 0; padding: 28px clamp(24px, 4vw, 40px);
  font-family: var(--font-display); font-weight: 600; color: var(--ink);
  font-size: clamp(1.15rem, 2.4vw, 1.6rem); max-width: 60ch;
}

/* =========================================================================
   JOURNAL
   ========================================================================= */
.journal-card {
  display: block;
  padding: 0;
}
.journal-card__thumb {
  aspect-ratio: 16 / 9;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: var(--space-2);
  overflow: hidden;
}
.journal-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.journal-card:hover .journal-card__thumb img { transform: scale(1.035); }
.journal-card__body { padding: 24px; }
.journal-card h3 {
  line-height: 1.2;
  margin: 14px 0 8px;
}

.journal-post { padding-top: 118px; }
.journal-post__wrap { max-width: 780px; }
.journal-post__head {
  max-width: 62ch;
  margin-bottom: 28px;
}
.journal-post__head h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.12;
  margin-top: 14px;
  letter-spacing: -0.01em;
}
.journal-post__head p {
  font-size: 1rem;
  line-height: 1.65;
  margin-top: 14px;
}
.journal-post__cover {
  margin: 0 0 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--space-1);
  overflow: hidden;
}
.journal-post__cover img {
  width: 100%;
  height: auto;
  display: block;
}
.journal-post__body {
  display: block;
  font-size: 0.98rem;
  line-height: 1.68;
}
.journal-post__body p {
  margin: 0 0 0.82em;
}
.journal-post__body p:last-child { margin-bottom: 0; }
.journal-post__body h2,
.journal-post__body h3 {
  line-height: 1.25;
}
.journal-post__body h2 {
  margin: 1.8em 0 .65em;
}
.journal-post__body h3 {
  margin: 1.5em 0 .5em;
}
.journal-post__body img {
  width: 100%;
  height: auto;
  margin: 1.35em 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--space-1);
}
.journal-post__body figure {
  margin: 1.35em 0;
}
.journal-post__body figure img {
  margin: 0;
}
.journal-post__body figcaption {
  margin-top: 8px;
  color: var(--faint);
  font-size: 0.86rem;
}
@media (max-width: 640px) {
  .journal-post { padding-top: 104px; }
  .journal-post__head h1 { font-size: clamp(1.85rem, 9vw, 2.55rem); }
  .journal-card__body { padding: 22px; }
}

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){ .reveal{ opacity:1; transform:none; transition:none; } }

/* focus visibility */
:focus-visible { outline: 2px solid var(--plasma); outline-offset: 3px; border-radius: 2px; }

/* =========================================================================
   CONTACT
   ========================================================================= */
.contact {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 48px; align-items: start;
}
.contact__form { display: flex; flex-direction: column; gap: 22px; }
.contact__row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--faint);
}
.field input, .field textarea, .field select {
  font-family: var(--font-body); font-size: 0.95rem; color: var(--ink);
  background: var(--space-1); border: 1px solid var(--line); border-radius: 4px;
  padding: 13px 15px; transition: border-color .2s, box-shadow .2s; width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--star); box-shadow: 0 0 0 1px var(--star);
}
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field select { appearance: none; cursor: pointer; }
.field textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
.field__err { font-family: var(--font-mono); font-size: 0.74rem; color: #ff8a8a; }
.contact__source {
  font-family: var(--font-mono); font-size: 0.76rem; color: var(--plasma);
  border: 1px solid var(--line); border-radius: 4px; background: var(--space-1);
  padding: 10px 12px; margin: -6px 0 0;
}

.contact__alert {
  font-family: var(--font-mono); font-size: 0.82rem; letter-spacing: .04em;
  padding: 13px 16px; border-radius: 4px; margin: 0;
}
.contact__alert--ok {
  color: var(--plasma); border: 1px solid var(--line-strong); background: var(--space-1);
}

/* honeypot — kept in the DOM but hidden from humans and assistive tech */
.contact__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.contact__aside {
  border: 1px solid var(--line); border-left: 2px solid var(--star);
  border-radius: 6px; background: var(--space-1); padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.contact__link {
  color: var(--ink); font-size: 0.95rem; width: fit-content;
  border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; transition: color .2s, border-color .2s;
}
.contact__link:hover { color: var(--star); border-color: var(--star); }
.contact__loc { color: var(--mute); font-size: 0.85rem; margin: 4px 0 0; }

@media (max-width: 820px) {
  .contact { grid-template-columns: 1fr; gap: 32px; }
  .contact__row { grid-template-columns: 1fr; }
}

/* =========================================================================
   HOME — SPOTLIGHT (sản phẩm nổi bật)
   ========================================================================= */
.spotlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; }
.spotlight {
  --sp: var(--plasma);
  position: relative; display: flex; flex-direction: column; gap: 18px;
  border: 1px solid var(--line); border-radius: 12px;
  background:
    radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--sp) 12%, transparent), transparent 60%),
    linear-gradient(180deg, var(--space-2), var(--space-1));
  padding: 30px 28px; overflow: hidden;
  transition: transform .3s, border-color .3s, box-shadow .3s;
}
.spotlight[data-accent="star"]   { --sp: var(--star); }
.spotlight[data-accent="plasma"] { --sp: var(--plasma); }
.spotlight[data-accent="nebula"] { --sp: var(--nebula); }
.spotlight::after {
  content: ""; position: absolute; top: -80px; right: -80px;
  width: 180px; height: 180px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--sp) 35%, transparent); opacity: .6;
}
.spotlight:hover { transform: translateY(-5px); border-color: var(--sp); box-shadow: 0 20px 50px -30px var(--sp); }
.spotlight__top { display: flex; gap: 16px; align-items: center; }
.spotlight__icon {
  width: 60px; height: 60px; flex: none; border-radius: 16px;
  display: grid; place-items: center; font-size: 1.9rem;
  background: radial-gradient(circle at 30% 25%, var(--space-3), var(--space-0));
  border: 1px solid color-mix(in srgb, var(--sp) 45%, var(--line-strong));
}
.spotlight__icon img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.spotlight__top h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; margin: 0; }
.spotlight__tag { color: var(--sp); font-size: 0.86rem; margin: 4px 0 0; }
.spotlight__sum { color: var(--mute); font-size: 0.95rem; margin: 0; flex: 1; }
.spotlight__plats { display: flex; flex-wrap: wrap; gap: 8px; }
.spotlight__plats span {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: .04em;
  color: var(--mute); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px;
}
.spotlight__go {
  font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: .08em;
  color: var(--sp); transition: letter-spacing .25s;
}
.spotlight:hover .spotlight__go { letter-spacing: .16em; }

/* =========================================================================
   PRODUCT LANDING PAGE
   ========================================================================= */
.prod { --ac: var(--plasma); }
.prod[data-accent="star"]   { --ac: var(--star); }
.prod[data-accent="plasma"] { --ac: var(--plasma); }
.prod[data-accent="nebula"] { --ac: var(--nebula); }

/* ---- Hero ---- */
.prod-hero { position: relative; padding: clamp(120px, 18vh, 200px) 0 60px; overflow: hidden; }
.prod-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(90% 60% at 78% 8%, color-mix(in srgb, var(--ac) 16%, transparent), transparent 60%);
  pointer-events: none;
}
.prod-hero__inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.prod-hero__copy h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.02; letter-spacing: -0.02em;
  margin: 20px 0 0;
}
.prod-hero__mark { display: inline-grid; place-items: center; margin-right: .18em; vertical-align: -.08em; }
.prod-hero__mark--image_url {
  width: 1.05em; height: 1.05em; border-radius: .22em; overflow: hidden;
  border: 1px solid var(--line-strong); background: var(--space-1);
}
.prod-hero__mark--image_url img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod-hero__lead { color: var(--mute); font-size: 1.1rem; max-width: 48ch; margin: 22px 0 32px; }
.prod-hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }
.prod-hero__note { margin: 24px 0 0; font-family: var(--font-mono); font-size: 0.78rem; }
.prod-hero__note a { color: var(--faint); transition: color .2s; }
.prod-hero__note a:hover { color: var(--ac); }

/* typing demo terminal */
.prod-hero__demo { justify-self: end; width: 100%; max-width: 420px; }
.prod-term {
  border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden;
  background: linear-gradient(180deg, var(--space-2), var(--space-0));
  box-shadow: 0 30px 70px -40px color-mix(in srgb, var(--ac) 60%, black);
}
.prod-term__bar { display: flex; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.prod-term__bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--space-3); }
.prod-term__bar span:first-child { background: color-mix(in srgb, var(--ac) 70%, transparent); }
.prod-term__body { padding: 26px 22px; font-family: var(--font-mono); }
.prod-term__body em { color: var(--faint); font-style: normal; font-size: 0.7rem; letter-spacing: .12em; text-transform: uppercase; }
.prod-term__body b { display: block; color: var(--ink); font-size: 1.15rem; margin: 6px 0 18px; font-weight: 500; }
.prod-term__out { color: var(--ac); font-size: 1.3rem; margin: 0; }
.prod-term__kbd { color: var(--faint); font-size: 0.72rem; letter-spacing: .1em; margin: 22px 0 0; }
.prod-showcase-image {
  margin: 0; border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden;
  background: var(--space-1); box-shadow: 0 30px 70px -40px color-mix(in srgb, var(--ac) 60%, black);
}
.prod-showcase-image img { display: block; width: 100%; height: auto; object-fit: cover; }
.prod-showcase-html {
  border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, var(--space-2), var(--space-0));
  box-shadow: 0 30px 70px -40px color-mix(in srgb, var(--ac) 60%, black);
}
.prod-showcase-html img { max-width: 100%; height: auto; display: block; }
.prod-showcase-html :is(section, article, div, figure) { max-width: 100%; }

/* ---- Highlights strip ---- */
.prod-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; margin-top: 20px;
}
.prod-stat { background: var(--space-1); padding: 26px 20px; text-align: center; }
.prod-stat b { display: block; font-family: var(--font-display); font-size: 2rem; color: var(--ac); line-height: 1; }
.prod-stat span { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: .08em; color: var(--mute); }

/* ---- Features grid ---- */
.prod-feats { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.prod-feat {
  border: 1px solid var(--line); border-radius: 10px; padding: 26px 24px;
  background: var(--space-1); transition: transform .3s, border-color .3s;
}
.prod-feat:hover { transform: translateY(-3px); border-color: var(--ac); }
.prod-feat__icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.4rem; margin-bottom: 16px;
  background: radial-gradient(circle at 30% 25%, var(--space-3), var(--space-0));
  border: 1px solid var(--line-strong);
}
.prod-feat__icon img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.prod-feat h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; margin: 0 0 8px; }
.prod-feat p { color: var(--mute); font-size: 0.92rem; margin: 0; }

/* ---- Showcase (điểm khác biệt) ---- */
.prod-show { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 48px; align-items: center; }
.prod-show__item h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; margin: 12px 0 12px; }
.prod-show__item p,
.prod-show__desc { color: var(--mute); margin: 0; }
.prod-show__desc p { margin: 0 0 0.75em; }
.prod-show__desc p:last-child { margin-bottom: 0; }
.prod-show__item code {
  font-family: var(--font-mono); font-size: 0.85em; color: var(--ac);
  background: var(--space-2); padding: 2px 7px; border-radius: 4px; border: 1px solid var(--line);
}
.prod-shot {
  aspect-ratio: 16 / 10; border-radius: 12px; display: grid; place-items: center;
  border: 1px dashed var(--line-strong);
  background:
    repeating-linear-gradient(-45deg, transparent, transparent 12px, color-mix(in srgb, var(--ac) 5%, transparent) 12px, color-mix(in srgb, var(--ac) 5%, transparent) 24px),
    var(--space-1);
}
.prod-shot span { font-family: var(--font-mono); font-size: 0.76rem; color: var(--faint); letter-spacing: .06em; }
.prod-shot--image {
  aspect-ratio: auto;
  border-style: solid; overflow: hidden; padding: 0; background: var(--space-1);
  display: block;
}
.prod-shot--image img {
  width: 100%; height: auto; max-height: none;
  object-fit: contain; display: block;
}
@media (max-width: 820px) {
  .prod-show { grid-template-columns: 1fr; gap: 16px; }
  .prod-show__media { order: 2; }
  .prod-show__media--left { order: 0; }
}

/* ---- Download cards ---- */
.prod-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.prod-dl__card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  border: 1px solid var(--line); border-radius: 12px; padding: 28px 26px;
  background: linear-gradient(180deg, var(--space-2), var(--space-1));
  transition: transform .3s, border-color .3s, box-shadow .3s;
}
.prod-dl__card:hover { transform: translateY(-4px); border-color: var(--ac); box-shadow: 0 20px 46px -30px var(--ac); }
.prod-dl__icon {
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.7rem; margin-bottom: 12px;
  background: radial-gradient(circle at 30% 25%, var(--space-3), var(--space-0)); border: 1px solid var(--line-strong);
}
.prod-dl__icon img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.prod-dl__card b { font-family: var(--font-display); font-size: 1.15rem; }
.prod-dl__ver { font-family: var(--font-mono); font-size: 0.72rem; color: var(--mute); letter-spacing: .04em; }
.prod-dl__note { font-size: 0.82rem; color: var(--faint); }
.prod-dl__go { margin-top: 12px; font-family: var(--font-mono); font-size: 0.76rem; color: var(--ac); letter-spacing: .08em; }

/* ---- FAQ ---- */
.prod-faq { display: flex; flex-direction: column; gap: 12px; max-width: 820px; }
.prod-faq__item {
  border: 1px solid var(--line); border-radius: 10px; background: var(--space-1);
  padding: 4px 22px; transition: border-color .25s;
}
.prod-faq__item[open] { border-color: color-mix(in srgb, var(--ac) 45%, var(--line)); }
.prod-faq__item summary {
  cursor: pointer; list-style: none; padding: 18px 0;
  font-family: var(--font-display); font-weight: 500; font-size: 1.05rem;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.prod-faq__item summary::-webkit-details-marker { display: none; }
.prod-faq__item summary::after { content: "+"; color: var(--ac); font-family: var(--font-mono); font-size: 1.3rem; transition: transform .25s; }
.prod-faq__item[open] summary::after { transform: rotate(45deg); }
.prod-faq__item p { color: var(--mute); margin: 0 0 20px; }

/* ---- CTA ---- */
.prod-cta-wrap { padding-bottom: clamp(90px, 14vw, 160px); }
.prod-cta {
  position: relative; overflow: hidden; text-align: center;
  border: 1px solid var(--line-strong); border-radius: 18px; padding: clamp(44px, 7vw, 80px) 24px;
  background:
    radial-gradient(80% 120% at 50% 0%, color-mix(in srgb, var(--ac) 16%, transparent), transparent 60%),
    linear-gradient(180deg, var(--space-2), var(--space-0));
}
.prod-cta h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.7rem, 4vw, 2.6rem); margin: 16px auto 28px; max-width: 24ch; }
.prod-cta__btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 860px) {
  .prod-hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .prod-hero__demo { justify-self: stretch; max-width: none; }
}

/* =========================================================================
   THEME TOGGLE (nav) + LIGHT MODE
   ========================================================================= */
.nav__right { display: flex; align-items: center; gap: 22px; }

.nav__theme {
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.95rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .2s, color .2s, background .2s;
}
.nav__theme:hover { border-color: var(--star); color: var(--star); }

@media (max-width: 760px) {
  .nav__right { gap: 12px; }
  /* dropdown menu should span the whole nav, not just the right cluster */
  .nav.open .nav__links {
    display: flex; flex-direction: column; gap: 18px;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--space-1); padding: 22px var(--gut);
    border-bottom: 1px solid var(--line);
  }
}

/* ---- Light palette -------------------------------------------------------- */
[data-theme="light"] {
  --space-0: #f5f6fb;
  --space-1: #ffffff;
  --space-2: #eef1f9;
  --space-3: #e1e6f4;

  --line: rgba(28, 38, 92, 0.12);
  --line-strong: rgba(28, 38, 92, 0.22);
  --ink: #131735;
  --mute: #4c527a;
  --faint: #878db2;

  --star: #b07d16;     /* deeper gold for contrast on light */
  --plasma: #0b8f97;
  --nebula: #6a4fd0;

  --page-bg: #f5f6fb;
}

/* In light theme the hero canvas flies down to a planet surface at dawn
   (galaxy.js toggles body.cosmos-day at the white-veil midpoint of that
   transition). Until the landing, the hero is still deep space — re-scope the
   dark tokens so its text keeps dark-mode contrast during the flight. */
[data-theme="light"] body:not(.cosmos-day) .hero {
  --space-0: #05060e;
  --space-1: #0a0d1d;
  --space-2: #11152b;
  --space-3: #1a2040;
  --line: rgba(180, 190, 235, 0.12);
  --line-strong: rgba(180, 190, 235, 0.24);
  --ink: #e9ecfa;
  --mute: #8a90b6;
  --faint: #5c618a;
  --star: #e8c97a;
  --plasma: #5be0e6;
  --nebula: #8e7bf0;
}

/* Tone down the starfield while keeping the fixed nav legible over the dark hero */
[data-theme="light"] body::before {
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(106,79,208,.08), transparent 60%);
  opacity: .8;
}
[data-theme="light"] .nav {
  background: linear-gradient(to bottom, rgba(255,255,255,.9), rgba(255,255,255,0));
}
[data-theme="light"] body.has-cosmos-hero:not(.cosmos-day) .nav:not(.scrolled) {
  background: linear-gradient(to bottom, rgba(5,6,14,.72) 0%, rgba(5,6,14,.24) 58%, rgba(5,6,14,0) 100%);
}
[data-theme="light"] body.has-cosmos-hero:not(.cosmos-day) .nav:not(.scrolled) .nav__brand,
[data-theme="light"] body.has-cosmos-hero:not(.cosmos-day) .nav:not(.scrolled) .nav__toggle,
[data-theme="light"] body.has-cosmos-hero:not(.cosmos-day) .nav:not(.scrolled) .nav__theme {
  color: #e9ecfa;
}
[data-theme="light"] body.has-cosmos-hero:not(.cosmos-day) .nav:not(.scrolled) .nav__links a {
  color: #8a90b6;
}
[data-theme="light"] body.has-cosmos-hero:not(.cosmos-day) .nav:not(.scrolled) .nav__links a:hover {
  color: #e9ecfa;
}
[data-theme="light"] body.has-cosmos-hero:not(.cosmos-day) .nav:not(.scrolled) .nav__theme {
  border-color: rgba(180, 190, 235, 0.24);
}

/* Daybreak hero — after the landing the hero inherits the normal light
   tokens; give it a sky fallback behind the canvas, a bright veil to seat the
   now-dark text, and a darker display gradient for the name. */
[data-theme="light"] body.cosmos-day .hero {
  background: linear-gradient(to bottom, #9fc0e8 0%, #e8d9c6 62%, #f0dfc2 100%);
}
[data-theme="light"] body.cosmos-day .hero::after {
  background: radial-gradient(120% 90% at 30% 50%, rgba(250,251,255,.60) 0%, rgba(250,251,255,.20) 45%, transparent 75%);
}
[data-theme="light"] body.cosmos-day .hero h1 .glow {
  background: linear-gradient(120deg, #33280a 10%, #8a6210 55%, var(--nebula) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
[data-theme="light"] body.cosmos-day .hero__readout {
  color: #6b7292;
  border-top-color: rgba(28, 38, 92, 0.18);
}

[data-theme="light"] .hero::before {
  height: 28px;
  background: linear-gradient(to bottom, transparent 0%, color-mix(in srgb, var(--page-bg) 52%, transparent) 100%);
}
[data-theme="light"] .hero__readout {
  color: #8a90b6;
}
[data-theme="light"] .nav.scrolled { background: rgba(255,255,255,.94); }
[data-theme="light"] .btn--primary:hover { color: #1a1405; }

/* =========================================================================
   LEGAL — bilingual header, language switch, flexible sections
   ========================================================================= */
.legal__bar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-top: 14px;
}
.legal__app { display: inline-flex; align-items: center; gap: 12px; }
.legal__app-icon {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  display: grid; place-items: center; overflow: hidden;
  background: var(--space-1); border: 1px solid var(--line-strong);
}
.legal__app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }

.langswitch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.langswitch a {
  font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.12em;
  padding: 6px 14px; color: var(--mute);
  transition: background .2s, color .2s;
}
.langswitch a:hover { color: var(--ink); }
.langswitch a.is-active { background: var(--star); color: var(--space-0); }
.nav .langswitch a { padding: 4px 10px; }

.legal__docs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.legal__docs a {
  font-family: var(--font-mono);
  font-size: 0.74rem; letter-spacing: 0.06em;
  padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--mute); transition: border-color .2s, color .2s, background .2s;
}
.legal__docs a:hover { border-color: var(--star); color: var(--star); }
.legal__docs a.is-active { border-color: var(--star); color: var(--space-0); background: var(--star); }

.legal__rich > :first-child { margin-top: 0; }
.legal__rich p { color: var(--mute); margin: 0 0 14px; white-space: pre-line; }
.legal__rich a { color: var(--plasma); border-bottom: 1px solid var(--line-strong); }

.legal__list { padding-left: 20px; margin: 6px 0 8px; }
.legal__list li { color: var(--mute); margin: 6px 0; }

.legal__defs { margin: 6px 0 8px; }
.legal__defs dt {
  color: var(--ink); font-weight: 600; font-family: var(--font-display);
  margin-top: 16px;
}
.legal__defs dt:first-child { margin-top: 0; }
.legal__defs dd { color: var(--mute); margin: 4px 0 0; padding-left: 0; }

.legal__empty { color: var(--faint); font-style: italic; }

/* =========================================================================
   APP CARDS — per-app policy links
   ========================================================================= */
.app__policies {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.app__policies a {
  font-family: var(--font-mono);
  font-size: 0.7rem; letter-spacing: 0.05em;
  color: var(--mute); transition: color .2s;
}
.app__policies a::before { content: "§ "; color: var(--star); }
.app__policies a:hover { color: var(--star); }
