/* INK website: modern light theme */
:root {
  --primary: #3355e0;
  --primary-deep: #2440b8;
  --primary-soft: #eef2ff;
  --saffron: #3355e0;
  --saffron-soft: #eef2ff;
  --green: #138808;
  --green-soft: #eaf7e8;

  --bg: #fbfcff;
  --bg-soft: #f3f6fd;
  --surface: #ffffff;
  --border: #e4e9f4;
  --border-strong: #d3dbec;
  --text: #121a33;
  --text-muted: #5b6684;

  --code-bg: #f8f9fd;
  --code-border: #e4e9f4;
  --code-text: #1f2a44;
  --out-bg: #f2faf3;
  --out-text: #166534;

  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(18, 26, 51, .05);
  --shadow: 0 1px 2px rgba(18, 26, 51, .04), 0 8px 24px rgba(51, 85, 224, .07);
  --shadow-lg: 0 2px 4px rgba(18, 26, 51, .04), 0 24px 60px rgba(51, 85, 224, .14);
  --maxw: 1180px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", var(--font);
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; color: var(--text); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .9em; }
:not(pre) > code {
  background: var(--primary-soft);
  color: var(--primary-deep);
  padding: .1em .4em;
  border-radius: 6px;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .container { padding: 0 16px; } }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--display); font-weight: 700; font-size: 1.3rem; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #3355e0, #6d86f5);
  color: #fff; font-size: .95rem; font-weight: 800;
  box-shadow: 0 4px 12px rgba(51, 85, 224, .35);
}
.nav-links { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.nav-links a {
  color: var(--text-muted); font-size: .95rem; font-weight: 500;
  padding: 8px 12px; border-radius: 8px;
}
.nav-links a:hover { color: var(--text); background: var(--bg-soft); text-decoration: none; }
.nav-links a.active { color: var(--primary); background: var(--primary-soft); }
.nav-links .btn { margin-left: 8px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; color: var(--text); padding: 8px; cursor: pointer; }
.nav-toggle svg { width: 26px; height: 26px; }
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: 66px;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: #fff; padding: 12px 16px 20px;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links .btn { margin: 8px 0 0; justify-content: center; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: .98rem;
  padding: 12px 22px; border-radius: 12px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: #fff !important; box-shadow: 0 8px 20px rgba(51, 85, 224, .28); }
.btn-primary:hover { background: var(--primary-deep); }
.btn-ghost { background: #fff; color: var(--text) !important; border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary) !important; }
.btn-sm { padding: 8px 14px; font-size: .9rem; border-radius: 10px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(700px 420px at 88% 0%, rgba(51, 85, 224, .16), transparent 65%),
    radial-gradient(700px 480px at 0% 100%, rgba(51, 85, 224, .12), transparent 65%),
    linear-gradient(180deg, #ffffff, var(--bg));
  padding: 84px 0 96px;
  border-bottom: 1px solid var(--border);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(51, 85, 224, .14) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse at 70% 30%, #000 10%, transparent 60%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 10%, transparent 60%);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .85rem; font-weight: 600; letter-spacing: .02em;
  color: #2440b8; background: var(--saffron-soft);
  border: 1px solid rgba(51, 85, 224, .3);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 22px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--saffron); box-shadow: 0 0 0 4px rgba(51, 85, 224, .18); }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); margin-bottom: 20px; }
.accent {
  background: linear-gradient(90deg, #3355e0, #6366f1 50%, #1e3a8a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { font-size: 1.18rem; color: var(--text-muted); max-width: 34em; margin-bottom: 32px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 36px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; color: var(--text-muted); font-size: .92rem; }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta svg { width: 16px; height: 16px; color: var(--saffron); }
@media (max-width: 960px) {
  .hero { padding: 56px 0 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* ---------- Code windows ---------- */
.window {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  color: var(--code-text);
  min-width: 0;
}
.window-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.window-bar i { width: 11px; height: 11px; border-radius: 50%; background: #d7deee; display: block; }
.window-bar i:nth-child(1) { background: #ff6b5f; }
.window-bar i:nth-child(2) { background: #ffbd2e; }
.window-bar i:nth-child(3) { background: #28c840; }
.window-title { margin-left: 10px; font-family: var(--mono); font-size: .8rem; color: var(--text-muted); }
.window pre { margin: 0; padding: 20px 22px; overflow-x: auto; font-family: var(--mono); font-size: .92rem; line-height: 1.7; background: var(--surface); }
.output {
  border-top: 1px solid var(--border); background: var(--out-bg);
  padding: 14px 22px 18px; font-family: var(--mono); font-size: .88rem;
}
.output-label { display: block; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #4d7c57; margin-bottom: 6px; font-family: var(--font); font-weight: 700; }
.output pre { padding: 0; color: var(--out-text); background: transparent; }

pre.code {
  background: var(--code-bg); color: var(--code-text);
  border: 1px solid var(--code-border); border-radius: 12px;
  padding: 18px 20px; margin: 0 0 1.2em; overflow-x: auto;
  font-family: var(--mono); font-size: .9rem; line-height: 1.7;
}
pre.code.out { color: var(--out-text); background: var(--out-bg); border-color: #d4ecd8; }
pre.code.out::before { content: "Output"; display: block; font-family: var(--font); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: #4d7c57; font-weight: 700; margin-bottom: 4px; }

/* syntax tokens (light) */
.t-kw { color: #2440b8; font-weight: 600; }
.t-ty { color: #0369a1; }
.t-fn { color: #6d28d9; }
.t-st { color: #15803d; }
.t-nu { color: #b45309; }
.t-co { color: #8a94ad; font-style: italic; }
.t-op { color: #be123c; }
.t-va { color: #1d4ed8; }

/* ---------- Sections ---------- */
section { padding: 96px 0; }
section.soft { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
@media (max-width: 700px) { section { padding: 64px 0; } }
.section-head { max-width: 760px; margin-bottom: 48px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.kicker { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--primary); margin-bottom: 12px; }
.section-head p { color: var(--text-muted); font-size: 1.1rem; }

/* features */
.features { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.features .card { grid-column: span 2; }
.features .card:nth-child(n+4) { grid-column: span 3; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } .features .card, .features .card:nth-child(n+4) { grid-column: auto; } }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  min-width: 0;
}
.card:hover { transform: translateY(-3px); border-color: rgba(51, 85, 224, .35); box-shadow: var(--shadow-lg); }
.card .icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--saffron-soft), var(--primary-soft));
  color: var(--saffron); margin-bottom: 18px;
}
.card .icon svg { width: 24px; height: 24px; }
.card p { color: var(--text-muted); margin: 0; font-size: .97rem; }

/* words */
.words { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.word {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.word .old { font-family: var(--mono); color: var(--text-muted); text-decoration: line-through; text-decoration-color: rgba(220, 38, 38, .55); font-size: .92rem; min-width: 100px; }
.word .arrow { color: var(--saffron); flex: none; }
.word .new { font-family: var(--mono); font-weight: 700; color: #2440b8; font-size: 1.05rem; }
.word .why { margin-left: auto; font-size: .82rem; color: var(--text-muted); text-align: right; }
.quote { margin: 40px auto 0; max-width: 760px; text-align: center; font-family: var(--display); font-size: 1.25rem; }
.quote span { color: #2440b8; }

/* pipeline */
.pipeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; align-items: stretch; }
.stage {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 18px; text-align: center; box-shadow: var(--shadow);
}
.stage .num { font-family: var(--mono); font-size: .75rem; color: var(--primary); font-weight: 700; letter-spacing: .1em; }
.stage h3 { margin: 8px 0 6px; font-size: 1.1rem; }
.stage p { margin: 0; font-size: .88rem; color: var(--text-muted); }
.stage code { font-size: .8rem; }
.stage:not(:last-child)::after {
  content: "→"; position: absolute; right: -14px; top: 50%; transform: translate(50%, -50%);
  color: var(--saffron); font-weight: 700; font-size: 1.2rem; z-index: 1;
}
.stage.asm { border-color: rgba(51, 85, 224, .45); background: linear-gradient(180deg, #fff, var(--saffron-soft)); }
.pipeline-note { text-align: center; color: var(--text-muted); margin-top: 28px; font-size: .95rem; }
.pipeline-note b { color: #2440b8; }
@media (max-width: 900px) {
  .pipeline { grid-template-columns: 1fr; }
  .stage:not(:last-child)::after { content: "↓"; right: 50%; top: auto; bottom: -14px; transform: translate(50%, 50%); }
}

/* examples */
.examples { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.ex-tabs { display: flex; flex-direction: column; gap: 6px; }
.ex-tab {
  text-align: left; font: inherit; font-size: .95rem; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; display: flex; gap: 12px; align-items: center;
  transition: border-color .15s ease, background .15s ease;
}
.ex-tab .n { font-family: var(--mono); font-size: .78rem; color: var(--text-muted); }
.ex-tab:hover { border-color: rgba(51, 85, 224, .4); }
.ex-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 6px 16px rgba(51, 85, 224, .25); }
.ex-tab.active .n { color: #dbe3ff; }
.ex-panel { display: none; }
.ex-panel.active { display: block; }
.ex-panel .desc { color: var(--text-muted); margin: 14px 4px 0; font-size: .95rem; }
@media (max-width: 820px) {
  .examples { grid-template-columns: minmax(0, 1fr); }
  .ex-tabs { flex-direction: row; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .ex-tab { flex: none; }
}

/* get started */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-family: var(--display);
  margin-bottom: 14px;
}
.step p { color: var(--text-muted); font-size: .95rem; }
.step pre.code { font-size: .82rem; margin: 0; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } }
.req { margin-top: 24px; color: var(--text-muted); font-size: .95rem; text-align: center; }

/* status + roadmap */
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 860px) { .status-grid { grid-template-columns: 1fr; } }
.roadmap { list-style: none; padding: 0; margin: 0; }
.roadmap li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.roadmap li:last-child { border-bottom: 0; }
.roadmap .chk { flex: none; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; margin-top: 2px; font-size: .8rem; font-weight: 700; }
.roadmap .done .chk { background: var(--green-soft); color: var(--green); }
.roadmap .todo .chk { border: 1.5px dashed var(--border-strong); color: var(--text-muted); }
.roadmap .todo { color: var(--text-muted); }
.limits { margin: 0; padding-left: 1.2em; color: var(--text-muted); }
.limits li { margin-bottom: 8px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pill { font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-muted); }
.pill.ok { color: var(--green); border-color: rgba(19, 136, 8, .3); background: var(--green-soft); }

/* CTA band */
.cta-band {
  background:
    radial-gradient(500px 260px at 95% 0%, rgba(51, 85, 224, .22), transparent 65%),
    radial-gradient(500px 260px at 0% 100%, rgba(51, 85, 224, .18), transparent 65%),
    #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 24px; padding: 56px 40px; text-align: center;
}
.cta-band p { color: var(--text-muted); max-width: 600px; margin: 0 auto 28px; font-size: 1.08rem; }
.cta-band .hero-cta { justify-content: center; margin: 0; }
@media (max-width: 600px) { .cta-band { padding: 40px 20px; } }

/* footer */
footer { background: #fff; border-top: 1px solid var(--border); color: var(--text-muted); padding: 56px 0 32px; font-size: .93rem; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 36px; }
footer h4 { font-size: .95rem; margin-bottom: 12px; font-family: var(--font); letter-spacing: 0; }
footer a { color: var(--text-muted); display: block; padding: 3px 0; }
footer a:hover { color: var(--primary); }
footer .brand { margin-bottom: 12px; color: var(--text); }
.foot-bottom { border-top: 1px solid var(--border); padding-top: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.tricolor { display: inline-flex; height: 4px; width: 54px; border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 10px; border: 1px solid var(--border); }
.tricolor i { flex: 1; } .tricolor i:nth-child(1) { background: #ff9933; } .tricolor i:nth-child(2) { background: #fff; } .tricolor i:nth-child(3) { background: var(--green); }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > div:first-child { grid-column: 1 / -1; } }

/* ---------- Inner page hero ---------- */
.page-hero {
  position: relative; overflow: hidden; padding: 64px 0 56px;
  background:
    radial-gradient(600px 300px at 92% 0%, rgba(51, 85, 224, .15), transparent 65%),
    radial-gradient(600px 300px at 0% 100%, rgba(51, 85, 224, .1), transparent 65%),
    #fff;
  border-bottom: 1px solid var(--border);
}
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.page-hero p { color: var(--text-muted); font-size: 1.12rem; max-width: 700px; margin: 0; }

/* ---------- Learn page ---------- */
.docs { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; padding-top: 56px; padding-bottom: 96px; }
.toc { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow-y: auto; }
.toc h4 { font-size: .75rem; text-transform: uppercase; letter-spacing: .14em; color: var(--text-muted); margin-bottom: 10px; font-family: var(--font); }
.toc a { display: block; color: var(--text-muted); font-size: .93rem; padding: 6px 12px; border-left: 2px solid var(--border); }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.active { color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
.doc h2 { font-size: 1.9rem; margin-top: 64px; padding-top: 8px; }
.doc h2:first-child { margin-top: 0; }
.doc h2 .sn { color: var(--saffron); font-family: var(--mono); font-size: .65em; margin-right: 10px; vertical-align: middle; }
.doc h3 { margin-top: 32px; }
.doc .muted { color: var(--text-muted); }
.callout {
  border: 1px solid rgba(51, 85, 224, .35); background: var(--saffron-soft);
  border-radius: 12px; padding: 16px 18px; margin: 0 0 1.2em; font-size: .97rem;
}
.callout b { color: #2440b8; }
.ref-table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: .94rem; }
.ref-table th, .ref-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ref-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
.ref-table td:first-child { font-family: var(--mono); font-weight: 700; color: #2440b8; white-space: nowrap; }
.ref-table td:nth-child(2) { font-family: var(--mono); color: var(--text-muted); }
.table-wrap { overflow-x: auto; }
.mobile-toc { display: none; margin-bottom: 24px; }
.mobile-toc select { width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
@media (max-width: 900px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 32px; }
  .toc { display: none; }
  .mobile-toc { display: block; }
}

/* ---------- Compare ---------- */
.c-ink { --lang: #1e40af; --lang-soft: #e8eefc; }
.c-py { --lang: #3572a5; --lang-soft: #eaf2fb; }
.c-php { --lang: #6f74b8; --lang-soft: #f1f1fa; }
.c-cs { --lang: #8a3ffc; --lang-soft: #f4edff; }
.c-node { --lang: #3c873a; --lang-soft: #ecf6ea; }
.lang-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--lang); }

.lang-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1080px) { .lang-cards { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); } }
.lang-card { border-top: 4px solid var(--lang); padding: 22px; }
.lang-card .tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--lang); background: var(--lang-soft); padding: 3px 8px; border-radius: 6px; margin-bottom: 10px; }
.lang-card h3 { margin-bottom: 4px; }
.lang-card .since { font-size: .82rem; color: var(--text-muted); margin-bottom: 10px; }
.lang-card p { font-size: .92rem; }

.cmp-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.cmp-table { width: 100%; border-collapse: collapse; min-width: 960px; font-size: .9rem; }
.cmp-table th, .cmp-table td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.cmp-table thead th { background: var(--bg-soft); font-family: var(--display); font-size: 1rem; white-space: nowrap; }
.cmp-table thead th .lang-dot { margin-right: 8px; }
.cmp-table tbody th { font-weight: 600; color: var(--text); width: 160px; background: #fcfdff; }
.cmp-table td { color: var(--text-muted); }
.cmp-table tr:last-child th, .cmp-table tr:last-child td { border-bottom: 0; }
.cmp-table .ink-col { background: #eef3ff; }
.cmp-table thead th.ink-col { background: var(--saffron-soft); }
.lvl { display: inline-block; font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-bottom: 4px; white-space: nowrap; }
.lvl.hi { background: var(--green-soft); color: var(--green); }
.lvl.mid { background: #fff6dc; color: #a16207; }
.lvl.lo { background: #fdecec; color: #b91c1c; }

.ease { display: grid; gap: 16px; max-width: 860px; margin: 0 auto; }
.ease-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 130px; gap: 16px; align-items: center; }
.ease-row .nm { font-weight: 600; display: flex; align-items: center; gap: 10px; }
.ease-bar { height: 12px; border-radius: 999px; background: #fff; border: 1px solid var(--border); overflow: hidden; }
.ease-bar span { display: block; height: 100%; border-radius: 999px; background: var(--lang); }
.ease-row .lbl { font-size: .88rem; color: var(--text-muted); }
.ease-note { text-align: center; color: var(--text-muted); font-size: .88rem; margin-top: 24px; }
@media (max-width: 600px) { .ease-row { grid-template-columns: 1fr; gap: 6px; } }

.task-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.task-tab, .lang-toggle {
  font: inherit; font-size: .9rem; cursor: pointer; border-radius: 999px;
  padding: 8px 16px; border: 1px solid var(--border-strong); background: #fff; color: var(--text);
  transition: all .15s ease;
}
.task-tab:hover { border-color: var(--primary); color: var(--primary); }
.task-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(51, 85, 224, .25); }
.lang-toggles { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 24px; }
.lang-toggles .hint { font-size: .85rem; color: var(--text-muted); margin-right: 4px; }
.lang-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; }
.lang-toggle.on { border-color: var(--lang); background: var(--lang-soft); font-weight: 600; }
.lang-toggle:not(.on) { opacity: .5; }
.task-intro { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px 20px; margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 6px 24px; align-items: baseline; }
.task-intro h3 { margin: 0; }
.task-intro p { margin: 0; color: var(--text-muted); flex: 1 1 320px; }
.code-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 18px; align-items: stretch; }
@media (max-width: 420px) { .code-grid { grid-template-columns: minmax(0, 1fr); } }
.code-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); min-width: 0; display: flex; flex-direction: column; }
.code-card header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--lang-soft); border-bottom: 1px solid var(--border); }
.code-card header b { font-family: var(--display); font-size: 1rem; }
.code-card header .meta { margin-left: auto; font-size: .75rem; font-weight: 600; color: var(--text-muted); background: #fff; border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.code-card pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: .84rem; line-height: 1.7; color: var(--code-text); flex: 1; }
.code-card .note { font-size: .84rem; color: var(--text-muted); padding: 10px 16px; border-top: 1px dashed var(--border); }
.code-card .res { font-family: var(--mono); font-size: .8rem; padding: 10px 16px; background: var(--out-bg); color: var(--out-text); border-top: 1px solid var(--border); white-space: pre-wrap; }
.code-card .res.bad { background: #fff6f6; color: #b91c1c; }

.pros-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.pros-card { border-top: 4px solid var(--lang); }
.pros-card h3 { display: flex; align-items: center; gap: 10px; }
.pros-card h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; margin: 16px 0 8px; font-family: var(--font); }
.pros-card h4.good { color: var(--green); }
.pros-card h4.bad { color: #b91c1c; }
.pros-card ul { margin: 0; padding-left: 1.1em; color: var(--text-muted); font-size: .93rem; }
.pros-card li { margin-bottom: 6px; }
.pros-card .best { margin-top: 16px; font-size: .9rem; background: var(--lang-soft); border-radius: 10px; padding: 10px 12px; color: var(--text); }

.paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.path .goal { font-size: .78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.path .pick { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; }

.compare-teaser { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; }
.teaser-list { display: grid; gap: 10px; }
.teaser-row { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--lang); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow-sm); min-width: 0; }
.teaser-row b { font-size: .88rem; width: 78px; flex: none; }
.teaser-row code { font-family: var(--mono); font-size: .86rem; color: var(--code-text); overflow-x: auto; white-space: nowrap; background: none !important; padding: 0 !important; }
.mini-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 8px; }
.mini-table th, .mini-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.mini-table th { font-weight: 600; color: var(--text-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
@media (max-width: 860px) { .compare-teaser { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Code comparison page ---------- */
.code-toolbar {
  position: sticky; top: 66px; z-index: 20;
  background: rgba(251, 252, 255, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 12px 0 4px; margin-bottom: 8px; border-bottom: 1px solid var(--border);
}
.code-toolbar .lang-toggles { margin-bottom: 8px; }
.code-toolbar .mobile-toc { margin-bottom: 8px; }
.toc-cat { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--text); margin: 18px 0 6px; }
.toc h4 + .toc-cat { margin-top: 4px; }
.cat-title { font-size: 1.6rem; margin: 56px 0 8px; padding-bottom: 10px; border-bottom: 2px solid var(--border); }
.cat-title:first-child { margin-top: 24px; }
.task-block { padding-top: 28px; }
.task-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.task-num {
  flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: .85rem;
  background: var(--primary-soft); color: var(--primary);
}
.task-head h3 { margin: 4px 0 2px; }
.task-head p { margin: 0; color: var(--text-muted); font-size: .95rem; }
.docs main { min-width: 0; }
html:has(.code-toolbar) { scroll-padding-top: 150px; }
@media (max-width: 900px) { html:has(.code-toolbar) { scroll-padding-top: 200px; } }

/* Code page: cards / table switch */
.toolbar-row { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 8px; }
.toolbar-row .lang-toggles { margin-bottom: 0; }
.view-switch { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--border); }
.view-switch button {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .88rem; font-weight: 600;
  padding: 6px 14px; border-radius: 9px; border: 0; background: none; color: var(--text-muted); cursor: pointer;
}
.view-switch button svg { width: 16px; height: 16px; }
.view-switch button.on { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); }


.table-hint { color: var(--text-muted); font-size: .9rem; margin: 16px 0 12px; }
.ct-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.code-table { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: .85rem; }
.code-table th, .code-table td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); vertical-align: top; text-align: left; }
.code-table tr > :last-child { border-right: 0; }
.code-table thead th {
  background: var(--lang-soft, var(--bg-soft)); padding: 12px 14px; font-family: var(--display); font-size: .98rem; white-space: nowrap;
  border-top: 3px solid var(--lang, var(--border));
}
.code-table thead th .lang-dot { margin-right: 8px; }
.code-table .ct-prog {
  position: sticky; left: 0; z-index: 2; background: #fff; width: 190px; min-width: 190px; max-width: 190px;
  padding: 14px; font-weight: 400; box-shadow: 1px 0 0 var(--border);
}
.code-table thead .ct-prog { background: var(--bg-soft); z-index: 3; border-top-color: var(--border); }
.code-table .ct-prog .task-num { width: 30px; height: 30px; font-size: .75rem; margin-bottom: 8px; }
.code-table .ct-prog b { display: block; font-size: .92rem; line-height: 1.35; }
.ct-out { margin-top: 8px; font-family: var(--mono); font-size: .75rem; white-space: pre-wrap; background: var(--out-bg); color: var(--out-text); border-radius: 6px; padding: 6px 8px; }
.code-table td { min-width: 290px; padding: 0; }
.code-table td pre { margin: 0; padding: 12px 14px; font-family: var(--mono); font-size: .8rem; line-height: 1.6; white-space: pre; color: var(--code-text); }
.ct-meta { font-size: .72rem; font-weight: 600; color: var(--text-muted); padding: 0 14px 8px; }
.ct-note { font-size: .78rem; color: var(--text-muted); padding: 8px 14px; border-top: 1px dashed var(--border); }
.ct-res { font-family: var(--mono); font-size: .75rem; padding: 8px 14px; background: var(--out-bg); color: var(--out-text); border-top: 1px solid var(--border); white-space: pre-wrap; }
.ct-res.bad { background: #fff6f6; color: #b91c1c; }
.code-table .ct-cat th { position: static; background: var(--primary-soft); padding: 0; }
.code-table .ct-cat th span { position: sticky; left: 0; display: inline-block; padding: 8px 14px; font-family: var(--display); font-weight: 700; color: var(--primary-deep); }
.code-table tbody tr:last-child > * { border-bottom: 0; }
@media (max-width: 600px) {
  .code-table .ct-prog { width: 120px; min-width: 120px; max-width: 120px; padding: 10px; }
  .code-table td { min-width: 250px; }
}

/* Frozen table header + first column (Code page, table view) */
#tableView .ct-wrap {
  position: sticky;
  top: var(--ct-top, 150px);
  max-height: calc(100vh - var(--ct-top, 150px) - 24px);
  overflow: auto;
  overscroll-behavior: contain;
}
.code-table thead th { position: sticky; top: 0; z-index: 4; }
.code-table thead th.ct-prog { left: 0; z-index: 6; }
.code-table tbody th.ct-prog { z-index: 3; }
.code-table .ct-cat th span { z-index: 1; }

/* Table view: use the full page width and tighter columns so 4-5 languages fit */
.docs.table-mode {
  max-width: min(1640px, calc(100vw - 40px));
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 28px;
}
.docs.table-mode .code-table td { min-width: 200px; }
.docs.table-mode .code-table td pre { font-size: .76rem; padding: 12px 12px; }
.docs.table-mode .code-table .ct-prog { width: 160px; min-width: 160px; max-width: 160px; }
.docs.table-mode .code-table thead th { font-size: .92rem; padding: 12px; }
.docs.table-mode .ct-meta, .docs.table-mode .ct-note, .docs.table-mode .ct-res { padding-left: 12px; padding-right: 12px; }
/* Wide screens: drop the side list, fit every shown language across the full
   width, and wrap long code lines so nothing needs horizontal scrolling. */
@media (min-width: 1000px) {
  .docs.table-mode .code-table { table-layout: fixed; width: 100%; min-width: 0; }
  .docs.table-mode .code-table .ct-prog,
  .docs.table-mode .code-table thead th.ct-prog { width: 150px; min-width: 150px; max-width: 150px; }
  .docs.table-mode .code-table td { min-width: 0; }
  .docs.table-mode .code-table td pre { white-space: pre-wrap; overflow-wrap: anywhere; }
}
/* Below that, give the table the full width and scroll sideways instead. */
@media (max-width: 999px) {
  .docs.table-mode { grid-template-columns: minmax(0, 1fr); max-width: calc(100vw - 32px); }
  .docs.table-mode .toc { display: none; }
  .docs.table-mode .mobile-toc { display: block; }
}

/* ---------- Words page (keyword dictionary) ---------- */
.words-table { min-width: 1000px; }
.words-table tbody th { width: 220px; min-width: 220px; font-weight: 600; }
.words-table td { color: var(--text); white-space: nowrap; }
.words-table td code,
.words-table th code { background: var(--bg-soft); border: 1px solid var(--border); color: var(--code-text); font-family: var(--mono); font-size: .84rem; padding: .08em .45em; border-radius: 6px; white-space: nowrap; }
.words-table .ink-col code { background: var(--saffron-soft); border-color: rgba(51, 85, 224, .35); color: #2440b8; font-weight: 600; }
.words-table td.same code { background: transparent; border-color: transparent; color: var(--text-muted); padding-left: 0; }
.words-table .hint { color: var(--text-muted); font-size: .8rem; font-family: var(--font); }
.words-table td.hint { color: var(--text-muted); }
.words-table tr.wcat th {
  background: var(--primary-soft); color: var(--primary-deep);
  font-family: var(--display); font-weight: 700; font-size: .92rem;
  text-align: left; padding: 9px 16px; position: sticky; left: 0; z-index: 1;
  border-top: 1px solid var(--border);
}
/* Keep the description column fixed while scrolling the words table sideways */
.words-table tbody th { position: sticky; left: 0; z-index: 2; box-shadow: 1px 0 0 var(--border); }
.words-table thead th:first-child { position: sticky; left: 0; z-index: 3; background: var(--bg-soft); }

/* Words page: pin the table under the nav and freeze its header row */
.words-wrap {
  position: sticky;
  top: 66px;
  max-height: calc(100vh - 82px);
  overflow: auto;
  overscroll-behavior: contain;
}
.words-table thead th { position: sticky; top: 0; z-index: 4; }
.words-table thead th:first-child { left: 0; z-index: 6; }
.words-table tbody th { z-index: 3; }
.words-table tr.wcat th { z-index: 2; }

/* ---------- Download row + Feedback form ---------- */
.dl-row { text-align: center; margin-top: 28px; }
.dl-note { color: var(--text-muted); font-size: .9rem; margin: 12px 0 0; }
.feedback-form { max-width: 680px; margin: 0 auto; display: grid; gap: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
@media (max-width: 560px) { .feedback-form { padding: 20px; } }
.feedback-form label { display: grid; gap: 7px; font-weight: 600; font-size: .95rem; color: var(--text); }
.feedback-form .opt { font-weight: 400; color: var(--text-muted); font-size: .85rem; }
.feedback-form input, .feedback-form select, .feedback-form textarea { font: inherit; font-weight: 400; padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: 10px; background: #fff; color: var(--text); width: 100%; }
.feedback-form input:focus, .feedback-form select:focus, .feedback-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(51, 85, 224, .15); }
.feedback-form textarea { resize: vertical; }
.ff-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .ff-row { grid-template-columns: 1fr; } }
.ff-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ff-note { font-size: .9rem; color: var(--text-muted); }
.ff-note.ok { color: var(--green); font-weight: 600; }
.ff-note.err { color: #b91c1c; }

/* ---------- Try INK playground (hero) ---------- */
.hero-demo { min-width: 0; }
.pg-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pg-tab { font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; padding: 5px 13px; border-radius: 999px; border: 1px solid var(--border-strong); background: #fff; color: var(--text-muted); transition: all .15s ease; }
.pg-tab:hover { border-color: var(--primary); color: var(--primary); }
.pg-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(51, 85, 224, .25); }
#playground .window-bar { align-items: center; }
.pg-run { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; padding: 5px 14px; border-radius: 8px; border: 0; background: var(--primary); color: #fff; }
.pg-run:hover { background: var(--primary-deep); }
.pg-run svg { width: 13px; height: 13px; }
#playground pre { min-height: 148px; }
#pgOut.pg-running { color: var(--text-muted); font-style: italic; }
.pg-caption { color: var(--text-muted); font-size: .9rem; margin: 14px 2px 0; text-align: center; }
.pg-caption a { font-weight: 600; }

/* ---------- Download section ---------- */
.dl-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 44px; align-items: center; }
@media (max-width: 860px) { .dl-grid { grid-template-columns: 1fr; gap: 28px; } }
.dl-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 14px; }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; }
.dl-sub { color: var(--text-muted); font-size: .92rem; }
.dl-sub code { font-size: .84rem; }
.dl-card h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 20px 0 8px; font-family: var(--font); }
.dl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dl-list li { position: relative; padding-left: 28px; color: var(--text); font-size: .95rem; }
.dl-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--green); font-weight: 700; }
.dl-req { color: var(--text-muted); font-size: .93rem; margin: 0; }

/* ---------- Download page: release card ---------- */
.release-card { display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 36px; box-shadow: var(--shadow-lg); }
@media (max-width: 760px) { .release-card { grid-template-columns: 1fr; gap: 24px; padding: 24px; } }
.release-tag { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); background: var(--primary-soft); padding: 4px 11px; border-radius: 999px; margin-bottom: 12px; }
.release-main h2 { font-size: 2.4rem; margin-bottom: 8px; }
.release-main > p { color: var(--text-muted); max-width: 34em; }
.release-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.release-facts li { display: flex; justify-content: space-between; gap: 16px; background: var(--bg-soft); padding: 12px 16px; font-size: .92rem; }
.release-facts span { color: var(--text-muted); }
.release-facts b { color: var(--text); text-align: right; }

/* ---------- What you can build ---------- */
.use-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.use-card .icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--saffron-soft), var(--primary-soft)); color: var(--primary); margin-bottom: 16px; }
.use-card .icon svg { width: 24px; height: 24px; }
.use-card h3 { margin-bottom: 8px; }
.use-card p { color: var(--text-muted); font-size: .95rem; margin: 0; }
.use-note { text-align: center; color: var(--text-muted); margin-top: 28px; font-size: .95rem; }

/* ---------- What's new ---------- */
.news-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.news-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.news-tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); background: var(--primary-soft); padding: 3px 10px; border-radius: 999px; margin-bottom: 12px; }
.news-item h3 { font-size: 1.12rem; margin-bottom: 8px; }
.news-item p { color: var(--text-muted); font-size: .93rem; margin: 0; }
