/* ══ Self-hosted fonts ══ */

/* Literata,latin-ext */
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/static/fonts/literata-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Literata,latin */
@font-face {
  font-family: 'Literata';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/static/fonts/literata-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Literata italic,latin-ext */
@font-face {
  font-family: 'Literata';
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url('/static/fonts/literata-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Literata italic,latin */
@font-face {
  font-family: 'Literata';
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url('/static/fonts/literata-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* JetBrains Mono,latin-ext */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url('/static/fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* JetBrains Mono,latin */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url('/static/fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Outfit,latin-ext */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/static/fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Outfit,latin */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('/static/fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ══ Dark theme (default) ══ */
:root, [data-theme="dark"] {
  --violet: #a78bfa;
  --violet-bright: #c4b5fd;
  --purple: #8b5cf6;
  --blue: #60a5fa;
  --blue-bright: #7dd3fc;
  --pink: #c084fc;
  --pink-hot: #d946ef;

  --edg-salmon: #f6757a;
  --edg-green: #63c74d;
  --edg-gold: #feae34;
  --edg-cyan: #2ce8f5;
  --edg-orange: #f77622;

  --bg: #19171f;
  --bg-elevated: #1a1820;
  --bg-card: #15131b;
  --surface: #252230;
  --border: #2e2a3a;
  --border-light: #3d3750;

  --text: #f0eef5;
  --text-muted: #c0bdd0;
  --text-dim: #6b6580;

  --gradient-text: linear-gradient(135deg, var(--pink-hot) 0%, var(--violet) 40%, var(--blue) 100%);
  --glow: rgba(139, 92, 246, 0.1);

  --nav-bg: rgba(20, 18, 25, 0.82);
  --nav-border: rgba(46, 42, 58, 0.5);
  --bg-drawer: #0b0a0f;
  --border-drawer: #1e1b28;
  --shadow-demo: 0 4px 12px rgba(0,0,0,0.3), 0 12px 36px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.02) inset;

  --grain-opacity: 0.018;

  --toggle-icon-sun: 0;
  --toggle-icon-moon: 1;

  --font-display: 'Literata', Georgia, serif;
  --font-body: 'Outfit', system-ui, sans-serif;
  --font-mono: Hack, "Fira Code", Consolas, Menlo, Monaco, "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", "Courier New", Courier, monospace;
}

/* ══ Light theme ══ */
[data-theme="light"] {
  --violet: #0d7990;
  --violet-bright: #0a6275;
  --purple: #1a96ad;
  --blue: #0a6275;
  --blue-bright: #085868;
  --pink: #5cb8c9;
  --pink-hot: #0d7990;

  --edg-salmon: #dc2626;
  --edg-green: #16a34a;
  --edg-gold: #0d7990;
  --edg-cyan: #0891b2;
  --edg-orange: #c2410c;

  --bg: #faf8f4;
  --bg-elevated: #f0ede6;
  --bg-card: #fffdf8;
  --surface: #e8e4dc;
  --border: #d6d0c6;
  --border-light: #c4bdb0;

  --text: #1c1917;
  --text-muted: #586063;
  --text-dim: #a0a6a8;

  --gradient-text: linear-gradient(135deg, #0891b2 0%, #0d7990 100%);
  --glow: rgba(13, 121, 144, 0.08);

  --nav-bg: rgba(240, 237, 230, 0.85);
  --nav-border: rgba(214, 208, 198, 0.6);
  --bg-drawer: #f0ede6;
  --border-drawer: #d6d0c6;
  --shadow-demo: 0 20px 60px rgba(10,60,70,0.07), 0 0 0 1px rgba(0,0,0,0.04);

  --grain-opacity: 0;

  --toggle-icon-sun: 1;
  --toggle-icon-moon: 0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: #19171f; }
[data-theme="light"] { background: #faf8f4; }

/* Scrollbar styling */
:root, [data-theme="dark"] {
  color-scheme: dark;
}
[data-theme="light"] {
  color-scheme: light;
}

body {
  background: linear-gradient(160deg, #1f1a25 0%, #19171f 40%, #19171f 60%, #1a1a23 100%) fixed;
  background-color: #19171f;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: color 0.25s ease;
}
[data-theme="light"] body {
  background: linear-gradient(160deg, #fcfbf9 0%, #faf8f4 50%, #f7f4ef 100%) fixed;
  background-color: #faf8f4;
}

/* Touch devices: move scroll to body to prevent iOS overscroll content bleed */
@media (pointer: coarse) {
  html {
    overflow: hidden;
    height: 100%;
  }
  body {
    overflow-y: auto;
    height: 100%;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
}

::selection { background: var(--purple); color: white; }

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px;
  transition: opacity 0.35s ease;
}

a { color: var(--violet-bright); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--blue-bright); }

/* ══ Transition helper ══ */
nav, .demo-container, .demo-titlebar, .demo-code, .demo-preview,
.link-card, .preview-note, footer, .demo-pane-label,
.preview-choice, .hero-desc, .hero-desc strong, .tag, .nav-cta, .lang-switch, .lang-opt {
  transition: background 0.35s ease, border-color 0.35s ease, color 0.25s ease, box-shadow 0.35s ease;
}

/* ══ Nav ══ */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 102;
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--nav-bg);
  backdrop-filter: blur(24px) saturate(1.2);
  border-bottom: none;
}
.nav-cover {
  position: fixed;
  top: -100px;
  left: 0;
  right: 0;
  width: 100%;
  height: 110px;
  background: var(--nav-bg);
  z-index: 101;
  transition: background 0.35s ease;
}
nav::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(210, 108, 240, 0.8), rgba(61, 166, 254, 0.8));
}
[data-theme="light"] nav::after {
  background: linear-gradient(90deg, rgba(180, 160, 120, 0.3), rgba(13, 121, 144, 0.2));
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.logo-light { display: none; }
[data-theme="light"] .logo-dark { display: none; }
[data-theme="light"] .logo-light { display: inline; }

.nav-brand img { width: 28px; height: 28px; }

.nav-brand span {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  margin-right: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.nav-links a:hover { color: var(--text); text-decoration: underline; }
.nav-links a.active { color: var(--edg-gold); }

.nav-cta {
  padding: 0.4rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--border-light) !important;
  background: var(--surface);
  color: var(--text) !important;
  font-weight: 500 !important;
  text-decoration: none !important;
}

.nav-cta:hover {
  border-color: var(--violet) !important;
  background: var(--glow);
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.lang-opt {
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-dim) !important;
  text-decoration: none !important;
  transition: color 0.2s, background 0.2s, border-color 0.35s ease;
}

.lang-opt + .lang-opt {
  border-left: 1px solid var(--border);
}

.lang-opt.active {
  font-weight: 700;
  color: var(--text) !important;
  background: var(--glow);
}
[data-theme="light"] .lang-opt.active {
  background: rgba(0, 0, 0, 0.05);
}

.lang-opt:hover:not(.active) {
  color: var(--text) !important;
  background: var(--glow);
}
[data-theme="light"] .lang-opt:hover:not(.active) {
  background: rgba(0, 0, 0, 0.05);
}

/* ══ Menu toggle ══ */
.menu-toggle {
  display: flex;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 0;
  background: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menu-toggle:hover svg {
  color: var(--text);
}

.menu-toggle svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

/* ══ Docs drawer ══ */
.docs-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.docs-menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.docs-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  z-index: 101;
  padding: 5rem 0 2rem;
  background: var(--bg-drawer);
  border-left: 1px solid var(--border-drawer);
  transform: translateX(100%);
  transition: transform 0.3s ease, background 0.35s ease, border-color 0.35s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.docs-menu.open {
  transform: translateX(0);
}
.docs-menu ul { list-style: none; margin: 0; padding: 0; }
.docs-menu hr {
  border: none;
  border-top: 1px solid var(--border-drawer);
  margin: 0.5rem 1.5rem;
}
.docs-menu li a {
  display: block;
  padding: 0.6rem 1.5rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.92rem;
  text-decoration: none;
  transition: color 0.2s;
}
.docs-menu li.docs-subpage a {
  font-size: 0.88rem;
}
.docs-menu li a:hover {
  color: var(--text);
  text-decoration: underline;
}
.docs-menu li a.active {
  color: var(--text);
  font-weight: 500;
}
.docs-menu .mobile-only { display: none; }
.docs-menu hr.mobile-only { display: none; }
.docs-menu .lang-switch {
  margin: 0.6rem 1.5rem;
}
.docs-menu .lang-opt {
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
}

/* ══ Theme toggle ══ */
.theme-toggle {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 0;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.theme-toggle:hover svg {
  color: var(--text);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
  position: absolute;
  transition: opacity 0.25s ease, transform 0.35s ease;
}

.theme-toggle .icon-sun {
  color: var(--edg-gold);
  opacity: var(--toggle-icon-sun);
  transform: rotate(calc((1 - var(--toggle-icon-sun)) * -90deg));
}

.theme-toggle .icon-moon {
  color: var(--violet);
  opacity: var(--toggle-icon-moon);
  transform: rotate(calc((1 - var(--toggle-icon-moon)) * 90deg));
}

/* ══ Hero ══ */
.hero {
  max-width: 780px;
  margin: 0 auto;
  padding: 9rem 2rem 4rem;
  animation: fadeUp 0.6s ease both;
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.hero-top img { width: 52px; height: 52px; }

.hero-top h1 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.8;
  font-weight: 300;
  max-width: 640px;
}

.hero-desc + .hero-desc { margin-top: 1.1rem; }

.hero-desc strong {
  color: var(--text);
  font-weight: 500;
}

.hero-links {
  display: flex;
  gap: 1.25rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.hero-links a {
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--edg-gold);
  text-decoration: none;
}
.hero-links a:hover {
  color: var(--edg-gold);
}
.hero-links a:hover span:first-child {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-links a .arrow {
  transition: transform 0.2s;
  display: inline-block;
}

.hero-links a:hover .arrow { transform: translateX(2px); }

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border);
  letter-spacing: 0.03em;
}

/* ══ Divider ══ */
.divider {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 2rem;
}

.divider hr {
  border: none;
  border-top: 1px solid var(--border);
  transition: border-color 0.35s ease;
}

/* ══ Demo ══ */
.example-hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem;
  animation: fadeUp 0.6s ease 0.1s both;
}

.example-hero > p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  max-width: 620px;
  font-weight: 300;
  line-height: 1.75;
}

.demo-container {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: var(--shadow-demo);
}

.demo-titlebar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.demo-dots {
  position: absolute;
  left: 1.1rem;
  display: flex;
  gap: 7px;
}

.demo-dot { width: 10px; height: 10px; border-radius: 50%; }
.demo-dot:nth-child(1) { background: #e43b44; }
.demo-dot:nth-child(2) { background: #feae34; }
.demo-dot:nth-child(3) { background: #63c74d; }

.demo-titlebar-text {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.demo-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 500px;
}

.demo-pane-label {
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-family: var(--font-mono);
  padding: 0.85rem 1.5rem 0;
  margin-bottom: -0.25rem;
}

.demo-pane-source {
  border-right: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color 0.35s ease, background 0.35s ease;
}

.demo-code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.9;
  overflow-x: auto;
  white-space: pre;
  color: var(--text-muted);
  background: var(--bg-card);
  font-variant-ligatures: none;
}
.demo-code .shiki code {
  display: inline-block;
  padding: 0.75rem 1.5rem 1.5rem;
  min-width: 100%;
}

.demo-preview {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  font-size: 1.05rem;
  background: var(--bg-card);
}

.preview-line {
  opacity: 0;
  animation: previewFadeIn 0.45s ease forwards;
  padding: 0.1rem 0;
  white-space: pre-wrap;
}

.preview-line.narrative {
  color: var(--text-muted);
  font-family: var(--font-display);
  font-style: italic;
  margin-bottom: 0.7rem;
  line-height: 1.7;
  font-size: 1.05rem;
}

.preview-line.dialogue { margin-bottom: 0.3rem; }

.preview-line .char-name {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
}

.preview-choices {
  margin-top: 1.15rem;
  display: flex;
  flex-direction: column;
  opacity: 0;
  animation: previewFadeIn 0.45s ease 1.8s forwards;
}

.preview-choice {
  margin-top: 0.4rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  background: transparent;
  font-family: var(--font-body);
  text-align: left;
}

.preview-choice:first-child {
  margin-top: 0;
}

@media (hover: hover) {
  .preview-choice:hover {
    border-color: var(--purple);
    color: var(--text);
    background: var(--glow);
  }
}

.preview-choice.selected {
  border-color: var(--purple);
  color: var(--text);
  background: var(--glow);
  cursor: default;
  margin-bottom: 0.6rem;
  transition: transform 0.35s ease-in-out, margin-bottom 0.35s ease;
}

.preview-choice.fading {
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.preview-choice.hidden {
  display: none;
}

.preview-response {
  margin-top: 1.1rem;
}

.preview-reset {
  margin-top: 1.1rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.preview-reset:hover {
  color: var(--text-muted);
  border-color: var(--border-light);
}

/* ══ Shiki dual-theme integration ══ */

/* Dark is default (inline color/bg). Switch to light vars for light theme. */
[data-theme="light"] .shiki {
  color: var(--shiki-light) !important;
  background-color: var(--shiki-light-bg) !important;
}
[data-theme="light"] .shiki span {
  color: var(--shiki-light) !important;
}

/* Override Shiki pre/code to match demo pane (must beat light-theme specificity) */
.demo-code .shiki,
[data-theme="light"] .demo-code .shiki {
  background-color: transparent !important;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.9;
}

.demo-code .shiki code,
[data-theme="light"] .demo-code .shiki code {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  background-color: transparent !important;
}

/* Smooth theme transition for code tokens */
.shiki, .shiki span {
  transition: color 0.25s ease, background-color 0.35s ease;
  font-variant-ligatures: none;
}

/* Loreline code decorations */
.lor-choice-option {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 1px 0;
  transition: background 0.35s ease;
}
[data-theme="light"] .shiki .lor-choice-option {
  background-color: rgba(0, 0, 0, 0.03) !important;
}
.lor-choice-text,
.lor-choice-text span {
  color: rgba(255, 255, 255, 0.84) !important;
}
[data-theme="light"] .shiki .lor-choice-text,
[data-theme="light"] .shiki .lor-choice-text span {
  color: rgba(0, 0, 0, 0.84) !important;
}
.lor-text-statement {
  font-style: italic;
}
.lor-text-content,
.lor-text-content span {
  color: #59bec3 !important;
}
[data-theme="light"] .shiki .lor-text-content,
[data-theme="light"] .shiki .lor-text-content span {
  color: #0b7285 !important;
}
.lor-plural-pipe,
.lor-plural-pipe span {
  color: #dcdcaa !important;
}
[data-theme="light"] .shiki .lor-plural-pipe,
[data-theme="light"] .shiki .lor-plural-pipe span {
  color: #986801 !important;
}
.lor-text-content .lor-plural-pipe,
.lor-text-content .lor-plural-pipe span,
.lor-choice-text .lor-plural-pipe,
.lor-choice-text .lor-plural-pipe span {
  color: #dcdcaa !important;
}
[data-theme="light"] .shiki .lor-text-content .lor-plural-pipe,
[data-theme="light"] .shiki .lor-text-content .lor-plural-pipe span,
[data-theme="light"] .shiki .lor-choice-text .lor-plural-pipe,
[data-theme="light"] .shiki .lor-choice-text .lor-plural-pipe span {
  color: #986801 !important;
}

/* ══ Bottom ══ */
.bottom {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  animation: fadeUp 0.5s ease 0.2s both;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.link-card {
  padding: 1.35rem 1.4rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  background-clip: padding-box;
  text-decoration: none;
  display: block;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
  transition: background 0.35s ease, color 0.25s ease, box-shadow 0.35s ease, transform 0.2s ease, border-color 0.35s ease;
  position: relative;
}
.link-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 11px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(210, 108, 240, 0.8), rgba(61, 166, 254, 0.8));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}
[data-theme="light"] .demo-code,
[data-theme="light"] .demo-pane-source {
  background: #ffffff;
}

[data-theme="light"] .link-card {
  border-color: transparent;
  box-shadow: 3px 3px 0 rgba(80, 60, 30, 0.06);
}
[data-theme="light"] .link-card::before {
  background: linear-gradient(135deg, rgba(160, 140, 90, 1), rgba(13, 121, 144, 0.8));
  opacity: 0.5;
}

.link-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: transparent;
  transform: translateY(-1px);
}
.link-card:hover::before {
  opacity: 1;
}
[data-theme="light"] .link-card:hover {
  background: #ffffff;
  background-clip: padding-box;
}

.link-card-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--edg-gold);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.link-card-title .arrow {
  color: var(--edg-gold);
  font-size: 0.8rem;
  transition: all 0.2s;
}

.link-card:hover .link-card-title .arrow {
  color: var(--edg-gold);
  transform: translateX(2px);
}

.link-card-desc {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.5;
}

.link-card-desc strong {
  font-weight: 600;
  color: var(--text);
}

.preview-note {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.92rem;
  font-style: italic;
  line-height: 1.7;
}

.preview-note a { color: var(--text-muted); }

/* ══ Docs hub ══ */
.docs-hub {
  max-width: 780px;
  margin: 0 auto;
  padding: 7rem 2rem 4rem;
  animation: fadeUp 0.6s ease both;
}
.docs-hub h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.docs-hub-subtitle {
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 2rem;
}

/* ══ Footer ══ */
footer {
  padding: 2rem 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
  max-width: 1100px;
  margin: 0 auto;
}

footer a { color: var(--text-muted); }
footer a:hover { color: var(--violet-bright); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes previewFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .demo-intro-wide { display: none; }
  .demo-body { grid-template-columns: 1fr; min-height: auto; }
  .demo-pane-source {
    border-right: none;
    border-bottom: 1px solid var(--border);
    min-width: 0;
  }
  .demo-code { font-size: 0.85rem; }
  .demo-preview { min-height: 330px; font-size: 0.95rem; }
}

@media (max-width: 640px) {
  nav {
    padding: 0.8rem 1.25rem;
  }
  .nav-right { gap: 0.75rem; }
  .nav-links { display: none; }
  .docs-menu .mobile-only { display: list-item; }
  .docs-menu hr.mobile-only { display: block; }
  .hero { padding-top: 7rem; }
  .link-grid { grid-template-columns: 1fr; }
  .demo-code { font-size: 0.75rem; }
  .demo-code .shiki,
  [data-theme="light"] .demo-code .shiki {
    font-size: 0.75rem;
  }
  .demo-preview { font-size: 0.85rem; }
}

@media (max-width: 360px) {
  .hero-top { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}
