/* vindex — site styles
   Concept: an answer sheet being marked. Blue ruled lines, a red margin,
   red-pen annotations. Everything else stays quiet. */

:root {
  --page: #f7f6f2;
  --paper: #fffefa;
  --ink: #16161a;
  --ink-2: #4a4a52;
  --muted: #8b8b93;
  --line: #e4e2da;
  --rule: #cfe0ee;          /* notebook ruling */
  --margin: #f0a9a2;        /* notebook margin */
  --pen: #d42a20;           /* teacher's red pen */
  --pen-soft: #fbe7e4;
  --ok: #1f7a4d;
  --code-bg: #121216;
  --code-ink: #e9e9ee;
  --code-dim: #7d7d88;
  --sans: "Instrument Sans", "Noto Sans Devanagari", "Noto Sans Tamil", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Noto Sans Devanagari", ui-monospace, Consolas, monospace;
  --hand: "Kalam", "Comic Sans MS", cursive;
  --deva: "Noto Sans Devanagari", var(--sans);
  --rule-h: 40px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--page); color: var(--ink); font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
code, pre { font-family: var(--mono); }
::selection { background: var(--pen-soft); color: var(--ink); }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 28px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } body { font-size: 16px; } }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 36px; height: 64px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: -.03em; }
.brand-mark { width: 24px; height: 24px; }
.brand small { font: 500 12px/1 var(--mono); color: var(--muted); letter-spacing: 0; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { text-decoration: none; color: var(--ink-2); font-size: 15px; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--ink); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; color: var(--ink-2); }
.icon-btn:hover { color: var(--ink); background: var(--line); }
.icon-btn svg { width: 19px; height: 19px; }
@media (max-width: 760px) { .nav-links { display: none; } }
@media (max-width: 440px) { .nav-cta { display: none !important; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 8px; font: 600 15.5px/1 var(--sans); text-decoration: none; white-space: nowrap; border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #33333a; }
.btn-line { border-color: #cfcdc4; color: var(--ink); background: var(--paper); }
.btn-line:hover { border-color: var(--ink); }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14.5px; }
.install { display: inline-flex; align-items: center; gap: 6px; height: 46px; padding: 0 6px 0 16px; border-radius: 8px; border: 1px solid #cfcdc4; background: var(--paper); font: 500 15px/1 var(--mono); }
.install .dollar { color: var(--muted); user-select: none; }
.copy { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.copy:hover { background: var(--line); color: var(--ink); }
.copy svg { width: 15px; height: 15px; }
.copy.done { color: var(--ok); }

/* ---------- type ---------- */
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.035em; line-height: 1.04; }
h1 { font-size: clamp(42px, 5.2vw, 70px); }
h2 { font-size: clamp(32px, 4.4vw, 52px); }
.pen { color: var(--pen); }
.hand { font-family: var(--hand); color: var(--pen); font-weight: 400; letter-spacing: 0; }
.kicker { font: 500 14px/1 var(--mono); color: var(--muted); }
.lede { font-size: clamp(18px, 1.8vw, 21px); color: var(--ink-2); max-width: 32em; line-height: 1.55; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 96px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
@media (max-width: 980px) { .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; } }
.hero h1 .strike { position: relative; white-space: nowrap; }
.hero h1 .strike svg { position: absolute; left: -4%; top: 52%; width: 108%; height: .5em; transform: translateY(-50%); overflow: visible; pointer-events: none; }
.hero .lede { margin: 26px 0 34px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-foot { margin-top: 28px; font-size: 14.5px; color: var(--muted); }
.hero-foot b { color: var(--ink-2); font-weight: 600; }

/* ---------- the answer sheet ---------- */
.sheet {
  position: relative; background-color: var(--paper);
  background-image:
    linear-gradient(90deg, transparent 63px, var(--margin) 63px, var(--margin) 64px, transparent 64px, transparent 67px, var(--margin) 67px, var(--margin) 68px, transparent 68px),
    repeating-linear-gradient(180deg, transparent 0, transparent calc(var(--rule-h) - 1px), var(--rule) calc(var(--rule-h) - 1px), var(--rule) var(--rule-h));
  background-position: 0 0, 0 22px;
  border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 1px 0 rgba(0,0,0,.03), 0 24px 48px -28px rgba(40, 30, 10, .28);
  padding: 22px 28px 26px 92px; line-height: var(--rule-h); min-width: 0; overflow-wrap: anywhere;
}
.sheet-head { display: flex; gap: 18px; font: 500 13px/var(--rule-h) var(--mono); color: var(--muted); padding-right: 70px; }
.sheet-head span:first-child { padding-left: 0; }
.q { position: relative; }
.q-no { position: absolute; left: -90px; width: 50px; text-align: right; font: 600 14px/var(--rule-h) var(--mono); color: var(--muted); }
.q-text { font-weight: 600; }
.a-text { font-family: var(--deva); font-size: 20px; position: relative; display: inline-block; }
.dev { font-family: var(--deva); }
.mark { position: absolute; pointer-events: none; overflow: visible; max-width: none; }
.mark path { fill: none; stroke: var(--pen); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.draw path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.in .draw path, .draw.in path { animation: draw .7s cubic-bezier(.6,.1,.3,1) forwards; }
.in .draw path:nth-child(2), .draw.in path:nth-child(2) { animation-delay: .25s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.circle-mark { left: -10px; top: -4px; width: calc(100% + 20px); height: calc(100% + 8px); }
.margin-mark { position: absolute; left: -82px; width: 32px; height: 32px; top: 4px; overflow: visible; }
.margin-mark path { fill: none; stroke: var(--pen); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.note { font-family: var(--hand); color: var(--pen); font-size: 21px; line-height: var(--rule-h); }
.note.indent { padding-left: 28px; }
.score { position: absolute; right: 26px; top: 16px; font: 400 34px/1 var(--hand); color: var(--pen); transform: rotate(-6deg); }
.score::after { content: ""; position: absolute; left: -10px; right: -10px; top: -8px; bottom: -6px; border: 2.5px solid var(--pen); border-radius: 50%; transform: rotate(4deg); opacity: .9; }
.machine { margin-top: 2px; font: 500 13.5px/var(--rule-h) var(--mono); color: var(--ink-2); }
.machine b { color: var(--pen); font-weight: 600; }
.machine .ok { color: var(--ok); }
@media (max-width: 640px) {
  .sheet { padding: 18px 16px 20px 64px; --rule-h: 36px; background-image: linear-gradient(90deg, transparent 45px, var(--margin) 45px, var(--margin) 46px, transparent 46px), repeating-linear-gradient(180deg, transparent 0, transparent calc(var(--rule-h) - 1px), var(--rule) calc(var(--rule-h) - 1px), var(--rule) var(--rule-h)); }
  .q-no { display: none; }
  .margin-mark { left: -58px; width: 26px; height: 26px; top: 4px; }
  .sheet-head { font-size: 11px; padding-right: 50px; gap: 10px; }
  .a-text { font-size: 17px; }
  .note { font-size: 18px; }
  .score { font-size: 26px; right: 14px; }
}

/* ---------- sections ---------- */
section { padding: 104px 0; }
@media (max-width: 640px) { section { padding: 68px 0; } }
.head { max-width: 760px; margin-bottom: 44px; }
.head h2 { margin-top: 14px; }
.head p { color: var(--ink-2); font-size: 19px; margin: 18px 0 0; }
.rule-top { border-top: 1px solid var(--line); }

/* three mistakes */
.mistakes .sheet { padding-bottom: 30px; }
.mistake + .mistake { margin-top: var(--rule-h); }
.label-row { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }

/* ---------- report card (checks table) ---------- */
.card-table { width: 100%; table-layout: fixed; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.card-table th, .card-table td { padding: 20px 22px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.card-table tr:last-child td { border-bottom: 0; }
.card-table th { font: 500 13px/1.2 var(--mono); color: var(--muted); background: #fbfaf5; }
.card-table th:first-child { width: 24%; } .card-table th:last-child { width: 24%; }
.card-table code.fn { font-size: 16px; font-weight: 600; color: var(--ink); }
.card-table td p { margin: 4px 0 0; color: var(--ink-2); font-size: 15.5px; }
.card-table .cost { font: 500 14px/1.5 var(--mono); color: var(--ink-2); }
.card-table .free { color: var(--ok); }
.card-table .snippet { display: block; margin-top: 12px; font-size: 13.5px; color: var(--ink-2); background: #f3f2ec; border-radius: 6px; padding: 8px 11px; overflow-x: auto; white-space: nowrap; }
@media (max-width: 760px) {
  .card-table, .card-table tbody, .card-table tr, .card-table td { display: block; width: 100% !important; }
  .card-table thead { display: none; }
  .card-table td { border-bottom: 0; padding: 6px 18px; }
  .card-table tr { border-bottom: 1px solid var(--line); padding: 14px 0; }
  .card-table tr:last-child { border-bottom: 0; }
}

/* ---------- playground ---------- */
.play { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 920px) { .play { grid-template-columns: minmax(0, 1fr); } }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.presets button { border: 1px solid #d6d4cb; background: var(--paper); color: var(--ink-2); border-radius: 6px; padding: 7px 12px; font: 500 14px/1.2 var(--sans); cursor: pointer; }
.presets button:hover { border-color: var(--ink); color: var(--ink); }
.presets button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.field { margin-bottom: 16px; }
.field label { display: flex; justify-content: space-between; font: 500 13px/1 var(--mono); color: var(--muted); margin-bottom: 8px; }
.field label span { color: var(--ink-2); }
.field textarea { width: 100%; min-height: 84px; resize: vertical; border: 1px solid #d6d4cb; border-radius: 6px; padding: 12px 14px; background: var(--paper); color: var(--ink); font: 18px/1.5 var(--sans); outline: none; }
.field textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22,22,26,.08); }
.toggle { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; color: var(--ink-2); cursor: pointer; }
.toggle input { accent-color: var(--pen); width: 16px; height: 16px; margin-top: 4px; flex: none; }
.play .sheet { min-height: 100%; }
.pg-row { position: relative; }
.pg-row .a-text { font-family: var(--sans); font-size: 18px; }
.pg-verdict { display: flex; align-items: center; gap: 14px; }
.pg-verdict svg { width: 40px; height: 40px; flex: none; }
.pg-verdict svg path { fill: none; stroke: var(--pen); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.pg-verdict .hand { font-size: 28px; }
.pg-verdict.pass svg path { stroke: var(--ok); }
.pg-verdict.pass .hand { color: var(--ok); }
#pg-reason { font-size: 21px; }
.pg-out-machine { font: 500 13.5px/1.7 var(--mono); color: var(--ink-2); margin-top: 8px; line-height: var(--rule-h); }

/* ---------- code ---------- */
.code { background: var(--code-bg); color: var(--code-ink); border-radius: 8px; overflow: hidden; }
.code-bar { display: flex; align-items: center; gap: 4px; padding: 8px; border-bottom: 1px solid rgba(255,255,255,.07); overflow-x: auto; scrollbar-width: none; }
.code-bar::-webkit-scrollbar { display: none; }
.code-bar button { flex: none; border: 0; background: transparent; color: var(--code-dim); padding: 8px 13px; border-radius: 5px; font: 500 14px/1 var(--sans); cursor: pointer; }
.code-bar button:hover { color: var(--code-ink); }
.code-bar button[aria-selected="true"] { background: rgba(255,255,255,.08); color: #fff; }
.code-bar .title { color: var(--code-dim); font: 13px var(--mono); padding: 6px 8px; }
.tabpanel { position: relative; }
.tabpanel[hidden] { display: none; }
.code pre { margin: 0; padding: 24px 26px; font: 14px/1.75 var(--mono); overflow-x: auto; }
.tabpanel .copy, .code .copy { position: absolute; top: 12px; right: 12px; color: var(--code-dim); }
.tabpanel .copy:hover, .code .copy:hover { background: rgba(255,255,255,.08); color: #fff; }
.code .k { color: #ff9d85; } .code .s { color: #a8e0b5; } .code .c, .code .d { color: var(--code-dim); } .code .f { color: #9cbcff; } .code .p { color: #ffb36b; }
.code .r { color: #ff7a6b; } .code .y { color: #f2c86b; } .code .g { color: #6fd39a; } .code .b { color: #fff; font-weight: 600; }
.cli-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
.cli-grid > *, .play > * { min-width: 0; }
@media (max-width: 960px) { .cli-grid { grid-template-columns: minmax(0, 1fr); } }
.cli-notes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 960px) { .cli-notes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cli-notes { grid-template-columns: minmax(0, 1fr); } }
.tbar { display: inline-block; width: 160px; height: 8px; border-radius: 9px; background: #2a2a31; vertical-align: 1px; overflow: hidden; }
.tbar i { display: block; height: 100%; border-radius: 9px; background: #f2c86b; }
.cli-notes h3 { font-size: 19px; letter-spacing: -.02em; }
.cli-notes p { margin: 6px 0 0; color: var(--ink-2); font-size: 16px; }
.cli-notes code { font-size: .88em; background: #ecebe4; padding: 1px 6px; border-radius: 4px; }

/* ---------- scripts line ---------- */
.scripts { display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 24px; color: var(--ink); }
.scripts span small { display: block; font: 500 12px/1.4 var(--mono); color: var(--muted); }

/* ---------- closing ---------- */
.closing { padding: 120px 0 128px; text-align: center; }
.closing h2 { font-size: clamp(38px, 5.6vw, 68px); }
.closing .hand { font-size: clamp(24px, 2.6vw, 32px); display: block; margin-top: 18px; }
.closing .actions { justify-content: center; margin-top: 34px; }

footer { border-top: 1px solid var(--line); padding: 36px 0 52px; font-size: 14.5px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 24px; }
footer a { text-decoration: none; } footer a:hover { color: var(--ink); }
footer .brand { color: var(--ink); font-size: 17px; }

.reveal { opacity: 0; transform: translateY(12px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .draw path { stroke-dashoffset: 0; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ====================================================================== */
/* docs                                                                    */
/* ====================================================================== */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 72px; padding-top: 48px; padding-bottom: 120px; }
@media (max-width: 960px) { .docs { grid-template-columns: 1fr; gap: 0; } }
.sidebar { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 116px); overflow-y: auto; font-size: 15px; }
.sidebar h5 { margin: 26px 0 6px; font: 500 12.5px/1 var(--mono); color: var(--muted); }
.sidebar h5:first-child { margin-top: 0; }
.sidebar a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; text-decoration: none; color: var(--ink-2); border-left: 2px solid var(--line); }
.sidebar a:hover { color: var(--ink); }
.sidebar a.active { color: var(--pen); border-left-color: var(--pen); font-weight: 600; }
@media (max-width: 960px) {
  .sidebar { position: static; max-height: none; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 18px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
  .sidebar h5 { display: none; }
  .sidebar a { flex: none; border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; margin: 0; font-size: 14px; background: var(--paper); }
}
.prose { min-width: 0; max-width: 760px; }
.prose h1 { font-size: clamp(40px, 5vw, 56px); margin-bottom: 16px; }
.prose .lead { font-size: 20px; color: var(--ink-2); margin: 0 0 12px; }
.prose h2 { font-size: 32px; margin: 84px 0 16px; }
.prose h3 { font-size: 21px; letter-spacing: -.02em; margin: 44px 0 10px; }
.prose p, .prose li { color: var(--ink-2); font-size: 16.5px; }
.prose li { margin: 7px 0; }
.prose strong { color: var(--ink); }
.prose a { color: var(--ink); text-decoration-color: var(--pen); text-underline-offset: 3px; }
.prose :not(pre) > code { font-size: .86em; background: #ecebe4; padding: 2px 6px; border-radius: 4px; color: var(--ink); }
.prose pre { position: relative; background: var(--code-bg); color: var(--code-ink); border-radius: 8px; padding: 18px 22px; font-size: 14px; line-height: 1.75; overflow-x: auto; margin: 18px 0 24px; }
.prose pre .k { color: #ff9d85; } .prose pre .s { color: #a8e0b5; } .prose pre .c { color: var(--code-dim); } .prose pre .f { color: #9cbcff; } .prose pre .p { color: #ffb36b; }
.prose pre .copy { position: absolute; top: 10px; right: 10px; color: var(--code-dim); }
.prose pre .copy:hover { background: rgba(255,255,255,.08); color: #fff; }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0 26px; font-size: 15px; display: block; overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; }
.prose th, .prose td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose th { font: 500 12.5px/1.2 var(--mono); color: var(--muted); background: #fbfaf5; }
.prose td code { white-space: nowrap; }
.callout { display: flex; gap: 14px; padding: 16px 18px; border-radius: 6px; background: var(--pen-soft); border-left: 3px solid var(--pen); margin: 22px 0; }
.callout p { margin: 0; color: var(--ink); font-size: 15.5px; }
.callout svg { flex: none; width: 20px; height: 20px; color: var(--pen); margin-top: 2px; }
.callout.note { background: #efeee8; border-left-color: var(--muted); }
.callout.note svg { color: var(--muted); }
.sig { font: 500 14px/1.6 var(--mono); background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--ink); border-radius: 4px; padding: 12px 16px; overflow-x: auto; white-space: pre; margin: 14px 0 20px; }
@media (max-width: 640px) { .tbar { width: 64px; } .code pre { font-size: 12px; padding: 18px; } }
