/* ---------- Tokens ---------- */
:root {
  /* Dark-first per Paro BRAND.md */
  --bg:          #0F0F14;
  --bg-2:        #1A1A24;
  --bg-3:        #25252F;
  --surface:     #1A1A24;
  --text:        #F0F0F8;
  --text-2:      #A8A8B8;
  --text-3:      #6E6E80;
  --rule:        rgba(240, 240, 248, 0.08);
  --rule-strong: rgba(240, 240, 248, 0.16);

  --primary:      #5C6BC0;
  --primary-deep: #3949AB;
  --accent:       #7986CB;
  --accent-soft:  #9FA8DA;
  --glow:         rgba(92, 107, 192, 0.35);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Rounded", "Inter", system-ui, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, monospace;

  --measure: 62ch;
  --gutter:  clamp(20px, 4.5vw, 56px);
  --radius:  10px;
  --radius-lg: 16px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:          #FAFAFB;
    --bg-2:        #F2F2F5;
    --bg-3:        #E6E6EC;
    --surface:     #FFFFFF;
    --text:        #1A1A24;
    --text-2:      #4A4A56;
    --text-3:      #8A8A98;
    --rule:        rgba(26, 26, 36, 0.10);
    --rule-strong: rgba(26, 26, 36, 0.20);
    --primary:      #3949AB;
    --primary-deep: #283593;
    --accent:       #5C6BC0;
    --accent-soft:  #7986CB;
    --glow:         rgba(57, 73, 171, 0.20);
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
::selection { background: var(--primary); color: #fff; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 4px; }

/* ---------- Layout ---------- */
.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(20px, 3vw, 32px) 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: clamp(56px, 9vw, 96px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 24px;
  height: 24px;
  position: relative;
  flex-shrink: 0;
}
.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.brand-mark::before {
  width: 12px;
  height: 24px;
  background: var(--primary);
  border-radius: 12px 0 0 12px;
  left: 0;
}
.brand-mark::after {
  width: 12px;
  height: 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  border-radius: 0 12px 12px 0;
  left: 12px;
  opacity: 0.55;
}
.topnav {
  display: flex;
  gap: clamp(14px, 2.5vw, 28px);
  font-size: 14px;
}
.topnav a {
  color: var(--text-2);
  text-decoration: none;
  padding: 6px 2px;
  position: relative;
  transition: color 0.18s ease;
}
.topnav a:hover { color: var(--text); }
.topnav a.active { color: var(--primary); }
.topnav a.active::after {
  content: "";
  position: absolute;
  left: 2px; right: 2px; bottom: 0;
  height: 1px;
  background: var(--primary);
}

/* ---------- Hero ---------- */
.hero {
  padding-bottom: clamp(48px, 8vw, 88px);
  border-bottom: 1px solid var(--rule);
  margin-bottom: clamp(48px, 7vw, 72px);
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 24px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--primary);
}
.hero h1 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(36px, 7vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--text);
}
.hero h1 .accent {
  color: var(--primary);
  font-weight: 500;
}
.hero .lede {
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.45;
  color: var(--text-2);
  max-width: 56ch;
  margin: 24px 0 0;
  font-weight: 400;
}
.hero .meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-top: 32px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.hero .meta span { white-space: nowrap; }

/* ---------- Landing cards ---------- */
.landing-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--rule-strong);
  margin-top: 0;
}
@media (min-width: 720px) {
  .landing-cards { grid-template-columns: repeat(3, 1fr); border-top: none; }
}
.landing-card {
  display: block;
  padding: 32px 26px 36px;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: background 0.2s ease;
}
@media (min-width: 720px) {
  .landing-card {
    border-bottom: none;
    border-right: 1px solid var(--rule);
    border-top: 1px solid var(--rule-strong);
  }
  .landing-card:last-child { border-right: none; }
}
.landing-card:hover { background: var(--bg-2); }
.landing-card .num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--primary);
  display: block;
  margin-bottom: 16px;
}
.landing-card h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.015em;
  margin: 0 0 8px;
  color: var(--text);
}
.landing-card p {
  font-size: 14.5px;
  color: var(--text-2);
  margin: 0;
  line-height: 1.55;
}
.landing-card .arrow {
  margin-top: 22px;
  font-size: 18px;
  color: var(--text-3);
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1), color 0.18s ease;
  display: inline-block;
}
.landing-card:hover .arrow { transform: translateX(6px); color: var(--primary); }

/* ---------- Article ---------- */
.article {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(40px, 6vw, 64px);
  padding-bottom: clamp(64px, 10vw, 120px);
}
@media (min-width: 880px) {
  .article { grid-template-columns: 200px minmax(0, 1fr); }
}
.toc {
  position: sticky;
  top: 32px;
  align-self: start;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  border-top: 1px solid var(--rule-strong);
  padding-top: 14px;
  display: none;
}
@media (min-width: 880px) { .toc { display: block; } }
.toc-label {
  text-transform: uppercase;
  color: var(--text-3);
  letter-spacing: 0.16em;
  margin-bottom: 14px;
}
.toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: toc;
}
.toc li {
  counter-increment: toc;
  display: flex;
  gap: 10px;
}
.toc li::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--text-3);
  flex-shrink: 0;
}
.toc a {
  color: var(--text-2);
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.16s ease;
}
.toc a:hover { color: var(--primary); }

/* ---------- Prose ---------- */
.prose { max-width: var(--measure); }
.prose section + section { margin-top: clamp(36px, 5vw, 56px); }

.prose h2 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(22px, 2.8vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.018em;
  margin: 0 0 14px;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.prose h2::before {
  content: attr(data-num);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--primary);
  font-weight: 400;
  flex-shrink: 0;
  position: relative;
  top: -2px;
}
.prose h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 16.5px;
  letter-spacing: -0.005em;
  margin: 24px 0 6px;
  color: var(--text);
}
.prose p {
  margin: 0 0 16px;
  color: var(--text-2);
  font-size: 16px;
}
.prose ul {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}
.prose ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
  color: var(--text-2);
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 12px;
  height: 1px;
  background: var(--primary);
}
.prose a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--primary);
  padding-bottom: 1px;
  transition: background 0.16s ease, color 0.16s ease;
}
.prose a:hover { background: rgba(92, 107, 192, 0.12); color: var(--primary); }
.prose strong { color: var(--text); font-weight: 600; }
.prose em { font-style: italic; color: var(--text); }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 6px;
  background: var(--bg-2);
  border-radius: 4px;
  color: var(--text);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}
.prose table th,
.prose table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}
.prose table th {
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--rule-strong);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.prose table td { color: var(--text-2); }

.callout {
  margin: 28px 0;
  padding: 20px 22px;
  background: var(--bg-2);
  border-left: 2px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-2);
}
.callout strong { color: var(--primary); }

/* ---------- Support page ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding-bottom: clamp(56px, 9vw, 96px);
}
@media (min-width: 880px) {
  .contact-grid { grid-template-columns: 1.2fr 1fr; gap: 48px; }
}
.contact-card {
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  padding: 32px 28px;
  border-radius: var(--radius-lg);
  position: relative;
}
.contact-card .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
  display: block;
}
.contact-card .email {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(20px, 2.6vw, 26px);
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--primary);
  padding-bottom: 2px;
  display: inline-block;
  word-break: break-all;
}
.contact-card .email:hover { color: var(--primary); }
.contact-card p { font-size: 14.5px; color: var(--text-2); margin: 18px 0 0; }

.faq-list { list-style: none; padding: 0; margin: 0; }
.faq-item {
  border-bottom: 1px solid var(--rule);
  padding: 20px 0;
}
.faq-item:first-child {
  border-top: 1px solid var(--rule-strong);
  padding-top: 22px;
}
.faq-q {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 17px;
  margin: 0 0 6px;
  color: var(--text);
  letter-spacing: -0.005em;
}
.faq-a {
  font-size: 14.5px;
  color: var(--text-2);
  margin: 0;
  line-height: 1.6;
}
.faq-a a {
  color: var(--text);
  border-bottom: 1px solid var(--primary);
  text-decoration: none;
  padding-bottom: 1px;
}
.faq-a a:hover { color: var(--primary); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--rule);
  padding: 36px 0 56px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-3);
}
@media (min-width: 720px) {
  .footer { grid-template-columns: 1fr auto; align-items: center; }
}
.footer .colophon {
  font-family: var(--font-sans);
  font-size: 13.5px;
  letter-spacing: -0.005em;
  color: var(--text-3);
  line-height: 1.55;
}
.footer nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.footer nav a {
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.16s ease;
}
.footer nav a:hover { color: var(--primary); }

/* ---------- Animations ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.prose section { animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.prose section:nth-of-type(1) { animation-delay: 0.04s; }
.prose section:nth-of-type(2) { animation-delay: 0.08s; }
.prose section:nth-of-type(3) { animation-delay: 0.12s; }
.prose section:nth-of-type(4) { animation-delay: 0.16s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
