/* parlance-docs site layer. Palette and type come from tokens.css (the app's
   own tokens). Rules of use, mirrored from the app:
   - mint (--brand-mint) appears only in brand moments: the mark, the wordmark,
     the hero accent, the primary hero CTA.
   - teal (--accent-primary) carries every interactive element.
   - --success stays semantic (checkmarks, "pass"), never decorative. */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-canvas);
  color: var(--text-main);
  font-family: var(--font-chrome);
  font-size: 15.5px;
  line-height: 1.65;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0 1.25rem;
  height: 54px;
  background: color-mix(in srgb, var(--bg-sunken) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
}

.lockup {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text-main);
}
.lockup .mark { border-radius: 6px; display: block; }
.lockup-name {
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  color: var(--text-main);
}
.lockup:hover .lockup-name { color: var(--brand-mint); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-left: auto;
}
.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}
.site-nav a:hover { color: var(--accent-primary-hover); }
.site-nav a.active { color: var(--accent-primary); }
.pill-download {
  font-size: 0.8rem;
  font-weight: 600;
  color: #06211e;
  background: var(--accent-primary);
  border-radius: 999px;
  padding: 0.28rem 0.85rem;
  white-space: nowrap;
  text-decoration: none;
}
.site-nav a.pill-download:hover { background: var(--accent-primary-hover); color: #06211e; }
.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 1rem;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
}

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.25rem;
  min-height: 60vh;
}
.page-home .layout { max-width: none; padding: 0; }

.page-docs .layout {
  max-width: 1360px;
  grid-template-columns: 250px minmax(0, 1fr) 230px;
  gap: 2.5rem;
}

.main { padding: 2rem 0 4rem; min-width: 0; }

/* ---------- Docs sidebar ---------- */

.sidebar {
  position: sticky;
  top: 54px;
  align-self: start;
  max-height: calc(100vh - 54px);
  overflow-y: auto;
  padding: 1.6rem 0 2rem;
  font-size: 0.88rem;
  border-right: 1px solid var(--border-subtle);
}
.sidebar-group { margin-bottom: 1.4rem; padding-right: 1rem; }
.sidebar-group-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 0.45rem;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: 0.1rem 0; }
.sidebar a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  line-height: 1.4;
}
.sidebar a:hover { color: var(--text-main); background: var(--bg-surface); }
.sidebar a.active {
  color: var(--accent-primary);
  background: var(--accent-primary-tint-bg);
}

/* ---------- On-page ToC ---------- */

.toc {
  position: sticky;
  top: 54px;
  align-self: start;
  max-height: calc(100vh - 54px);
  overflow-y: auto;
  padding: 1.8rem 0 2rem;
  font-size: 0.8rem;
}
.toc-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border-subtle); }
.toc li a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.16rem 0 0.16rem 0.75rem;
  border-left: 2px solid transparent;
  margin-left: -1px;
  line-height: 1.35;
}
.toc li.toc-h3 a { padding-left: 1.6rem; }
.toc li a:hover { color: var(--accent-primary-hover); }

/* ---------- Content typography ---------- */

.main h1 {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0.4rem 0 0.8rem;
}
.main h2 {
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2.2rem 0 0.7rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
}
.main h3 { font-size: 1.08rem; font-weight: 600; margin: 1.6rem 0 0.5rem; }
.main h4 { font-size: 0.95rem; font-weight: 600; margin: 1.3rem 0 0.4rem; }
h1, h2, h3, h4 { scroll-margin-top: 70px; }

.main p, .main ul, .main ol { color: var(--text-secondary); }
.main li { margin: 0.25rem 0; }
.main strong { color: var(--text-main); }

.main a { color: var(--accent-primary); text-decoration: none; }
.main a:hover { color: var(--accent-primary-hover); text-decoration: underline; }

.main code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0.08em 0.35em;
  color: var(--text-main);
}
.main pre {
  position: relative;
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
  line-height: 1.55;
}
.main pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  color: var(--text-main);
}

.main blockquote {
  margin: 1rem 0;
  padding: 0.6rem 1.1rem;
  border-left: 3px solid var(--accent-primary-tint-border);
  background: var(--accent-primary-tint-bg);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
}
.main blockquote p { margin: 0.3rem 0; }

.main table {
  border-collapse: collapse;
  margin: 1.1rem 0;
  font-size: 0.88rem;
  display: block;
  overflow-x: auto;
  max-width: 100%;
}
.main th, .main td {
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.8rem;
  text-align: left;
  vertical-align: top;
  color: var(--text-secondary);
}
.main th {
  background: var(--bg-surface);
  color: var(--text-main);
  font-weight: 600;
  white-space: nowrap;
}

.main hr { border: none; border-top: 1px solid var(--border-subtle); margin: 2.2rem 0; }

kbd {
  font-family: var(--font-mono);
  font-size: 0.78em;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.1em 0.45em;
  color: var(--text-main);
}

img { max-width: 100%; border-radius: 8px; }

/* Real editor screenshots */
.shot {
  display: block;
  width: 100%;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.55);
}
.shot-caption {
  font-size: 0.8rem;
  color: var(--text-faint);
  text-align: center;
  margin: 0.6rem 0 0;
}
.shot-wide { margin: 2rem 0 0.5rem; }

/* Narrative text — anything a writer/player actually reads renders in the
   prose serif, exactly as it does in the editor. */
.narrative, .narrative p {
  font-family: var(--font-prose);
  font-size: 1.02rem;
  color: var(--text-main);
}
.dialogue-sample {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 1rem 1.3rem;
  margin: 1.1rem 0;
}
.dialogue-sample .speaker {
  font-family: var(--font-chrome);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.dialogue-sample .line {
  font-family: var(--font-prose);
  font-size: 1.05rem;
  color: var(--text-main);
  margin: 0.25rem 0 0;
}

/* Comparison table semantics */
.yes { color: var(--success); font-weight: 600; }
.partial { color: var(--warning); }
.no { color: var(--text-faint); }

/* Copy-code button (added by site.js) */
.copy-btn {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  font-family: var(--font-chrome);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 5px;
  padding: 0.15rem 0.5rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s;
}
.main pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--accent-primary); border-color: var(--accent-primary); }

/* Releases list */
.releases-status { color: var(--text-muted); }
.release {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin: 1rem 0;
  background: var(--bg-surface);
}
.release-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.release-head h3 { margin: 0; font-size: 1.05rem; }
.release-date { font-size: 0.8rem; color: var(--text-faint); font-family: var(--font-mono); }
.release-links { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.8rem 0 0.4rem; }
.release-dl {
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border-default);
  border-radius: 7px;
  padding: 0.3rem 0.8rem;
  color: var(--accent-primary);
}
.release-dl:hover { border-color: var(--accent-primary); background: var(--accent-primary-tint-bg); text-decoration: none; }
.release-dl.is-missing { color: var(--text-faint); border-style: dashed; }
.release-notes-link { margin: 0.4rem 0 0; font-size: 0.85rem; }

/* Synced-page footer stamp */
.synced-footer {
  margin-top: 3rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-faint);
}
.synced-footer a { color: var(--text-muted); }

/* ---------- Buttons ---------- */

/* a.btn-* beats the generic `.main a` color rule on specificity. */
a.btn, .btn {
  display: inline-block;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 8px;
  padding: 0.6rem 1.25rem;
  border: 1px solid transparent;
}
a.btn:hover { text-decoration: none; }
a.btn-primary, .btn-primary { background: var(--accent-primary); color: #06211e; }
a.btn-primary:hover { background: var(--accent-primary-hover); color: #06211e; }
a.btn-mint, .btn-mint { background: var(--brand-mint); color: #37474F; }
a.btn-mint:hover { filter: brightness(1.06); color: #37474F; }
a.btn-ghost, .btn-ghost { border-color: var(--border-strong); color: var(--text-main); }
a.btn-ghost:hover { border-color: var(--accent-primary); color: var(--accent-primary); }

/* ---------- Home page ---------- */

.hero {
  text-align: center;
  padding: 5rem 1.5rem 3.5rem;
  background:
    radial-gradient(ellipse 60% 45% at 50% 0%, color-mix(in srgb, var(--brand-mint) 7%, transparent), transparent),
    var(--bg-sunken);
  border-bottom: 1px solid var(--border-subtle);
}
.hero .mark-lg { width: 84px; height: 84px; border-radius: 19px; }
.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 1.2rem auto 0.8rem;
  max-width: 720px;
}
.hero h1 em {
  font-style: normal;
  color: var(--brand-mint);
}
.hero .sub {
  color: var(--text-secondary);
  font-size: 1.12rem;
  max-width: 620px;
  margin: 0 auto 1.8rem;
}
.hero .cta-row {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}
.hero .cta-note { font-size: 0.85rem; color: var(--text-faint); width: 100%; margin-top: 0.9rem; }

.home-section {
  max-width: 1060px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem;
}
.home-section + .home-section { border-top: 1px solid var(--border-subtle); }
.home-section h2 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
}
.home-section .section-sub { color: var(--text-muted); margin: 0 0 2rem; max-width: 640px; }

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  align-items: center;
}
.split .copy h3 { font-size: 1.25rem; margin: 0 0 0.5rem; letter-spacing: -0.01em; }
.split .copy p { color: var(--text-secondary); }
.split .copy a { color: var(--accent-primary); text-decoration: none; }
.split .copy a:hover { text-decoration: underline; }

.code-panel {
  background: var(--bg-sunken);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
}
.code-panel .k { color: var(--syntax-key); }
.code-panel .s { color: var(--syntax-string); }
.code-panel .n { color: var(--syntax-number); }
.code-panel .b { color: var(--syntax-boolean); }
.code-panel .add { color: var(--success); }
.code-panel .del { color: var(--danger); }
.code-panel .comment { color: var(--text-faint); }
.code-panel .prose-str { font-family: var(--font-prose); font-size: 0.9rem; color: var(--syntax-string); }

.feature-row { margin-top: 3rem; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
}
.card:hover { border-color: var(--border-strong); }
.card h3 { font-size: 1rem; margin: 0 0 0.35rem; }
.card p { font-size: 0.88rem; color: var(--text-muted); margin: 0; }
.card a { color: var(--accent-primary); text-decoration: none; font-size: 0.88rem; }
.card a:hover { text-decoration: underline; }

.scoreboard {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--text-secondary);
}
.scoreboard .pass { color: var(--success); font-weight: 600; }
.scoreboard .skip { color: var(--text-faint); }

.closing-cta {
  text-align: center;
  padding: 4rem 1.5rem;
  background: var(--bg-sunken);
  border-top: 1px solid var(--border-subtle);
}
.closing-cta h2 { font-size: 1.6rem; letter-spacing: -0.02em; margin: 0 0 1.2rem; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-sunken);
  font-size: 0.85rem;
}
.footer-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 2.2rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.footer-brand p, .footer-license p { color: var(--text-faint); margin: 0.4rem 0 0; }
.footer-links { display: flex; flex-direction: column; gap: 0.35rem; }
.footer-links a, .footer-license a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover, .footer-license a:hover { color: var(--accent-primary); }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .page-docs .layout { grid-template-columns: 240px minmax(0, 1fr); }
  .toc { display: none; }
}

@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 54px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    background: var(--bg-sunken);
    border-bottom: 1px solid var(--border-default);
    padding: 0.8rem 1.25rem 1rem;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.35rem 0; font-size: 1rem; }

  .page-docs .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .sidebar {
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem 0;
    display: none;
  }
  .sidebar.open { display: block; }
  body.page-docs .main::before { content: ""; }
  .sidebar-toggle {
    display: block;
    margin: 1rem 0 0;
    width: 100%;
    text-align: left;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
    padding: 0.5rem 0.9rem;
    cursor: pointer;
  }
}
@media (min-width: 881px) {
  .sidebar-toggle { display: none; }
}
