/* ==========================================================================
   Frontend Interview Prep – styles
   ========================================================================== */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --text: #111827;
  --text-2: #4b5563;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-soft: #eef2ff;
  --accent-text: #4338ca;
  --done: #059669;
  --done-soft: #ecfdf5;
  --star: #b45309;
  --star-soft: #fef3c7;
  --danger: #dc2626;
  --maker: #c2410c;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / 0.05);
  --shadow: 0 1px 3px rgb(16 24 40 / 0.06), 0 4px 12px rgb(16 24 40 / 0.04);
  --radius: 12px;
  --nav-h: 60px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1017;
    --surface: #151922;
    --surface-2: #1b202b;
    --text: #e8eaf0;
    --text-2: #b4bac6;
    --muted: #8a91a0;
    --line: #262c38;
    --line-strong: #333a48;
    --accent: #818cf8;
    --accent-2: #a78bfa;
    --accent-soft: #1e2140;
    --accent-text: #a5b4fc;
    --done: #34d399;
    --done-soft: #0f2a22;
    --star: #fbbf24;
    --star-soft: #33270d;
    --danger: #f87171;
  --maker: #fb923c;
    --shadow-sm: none;
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0d1017;
  --surface: #151922;
  --surface-2: #1b202b;
  --text: #e8eaf0;
  --text-2: #b4bac6;
  --muted: #8a91a0;
  --line: #262c38;
  --line-strong: #333a48;
  --accent: #818cf8;
  --accent-2: #a78bfa;
  --accent-soft: #1e2140;
  --accent-text: #a5b4fc;
  --done: #34d399;
  --done-soft: #0f2a22;
  --star: #fbbf24;
  --star-soft: #33270d;
  --danger: #f87171;
  --maker: #fb923c;
  --shadow-sm: none;
  --shadow: none;
  color-scheme: dark;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

button { font: inherit; color: inherit; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.hidden { display: none !important; }
:root[data-view="list"] #homeView { display: none; } /* see theme.js */

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

.kbd {
  font: 500 11px/1 var(--mono);
  padding: 3px 6px; border-radius: 5px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px;
  color: var(--muted); background: var(--surface-2);
}

/* ---------- Nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 20;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1180px; height: 100%; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 7px; }
.nav-actions { display: flex; gap: 6px; flex: none; }

/* Track links in the header. On small screens they scroll sideways and the brand shrinks to its icon. */
.nav-inner { gap: 16px; }
.brand { flex: none; }
.track-nav {
  flex: 1; min-width: 0; display: flex; gap: 2px; justify-content: center;
  overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
  mask-image: linear-gradient(90deg, #000 92%, transparent);
}
.track-nav::-webkit-scrollbar { display: none; }
.track-nav a {
  flex: none; padding: 6px 10px; border-radius: 8px;
  color: var(--text-2); font-size: 13.5px; font-weight: 500; white-space: nowrap;
}
.track-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.track-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
@media (max-width: 1100px) { .brand span { display: none; } .track-nav { justify-content: flex-start; } }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); text-decoration: none; }

.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

/* ---------- Hero ---------- */

.hero {
  padding: 56px 0 36px;
  background:
    radial-gradient(900px 300px at 10% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    radial-gradient(700px 260px at 90% 0%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 70%);
}
.breadcrumb { margin: 0 0 14px; font-size: 13.5px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; list-style: none; margin: 0; padding: 0; }
.breadcrumb li { display: inline-flex; align-items: center; }
.breadcrumb li + li::before {
  content: ""; width: 6px; height: 6px; margin: 0 10px;
  border-right: 1.5px solid var(--muted); border-top: 1.5px solid var(--muted);
  transform: rotate(45deg); opacity: .7;
}
.breadcrumb a { color: var(--text-2); font-weight: 500; }
.breadcrumb a:hover { color: var(--accent-text); }
.breadcrumb [aria-current="page"] { color: var(--accent-text); font-weight: 600; }

.eyebrow {
  display: inline-block; margin: 0 0 14px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-text);
}
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(28px, 4.2vw, 44px); line-height: 1.12; letter-spacing: -0.025em; font-weight: 750;
}
.lead { max-width: 680px; margin: 0 0 28px; color: var(--text-2); font-size: 16.5px; }
.br-md { display: none; }
@media (min-width: 760px) { .br-md { display: inline; } }

.stats {
  display: grid; gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 2fr);
}
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.stat-num { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-progress { justify-content: center; gap: 10px; }
.stat-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

@media (max-width: 760px) {
  .hero { padding: 36px 0 24px; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-progress { grid-column: 1 / -1; }
}

/* ---------- Track tabs (Theory / Coding) ---------- */

.tabs { display: flex; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow-sm);
}
.tab:hover { color: var(--text); border-color: var(--line-strong); text-decoration: none; }
.tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab-count { font-size: 12.5px; font-weight: 500; opacity: .8; font-variant-numeric: tabular-nums; }

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

.home { padding-top: 8px; padding-bottom: 64px; }
.home-search { max-width: 720px; }
.home-h { margin: 28px 0 12px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.continue {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px;
  margin-top: 20px; padding: 14px 18px; border-radius: var(--radius);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  color: var(--accent-text);
}
.continue:hover { text-decoration: none; border-color: var(--accent); }
.continue-label { font-size: 13px; color: var(--text-2); }
.continue-where { font-weight: 650; }

.track-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.track-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  color: var(--text);
}
a.track-card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.track-card h3 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.track-card p { margin: 0; color: var(--text-2); font-size: 14px; }
.track-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.track-stars { font-size: 13px; color: var(--star); font-weight: 600; white-space: nowrap; }
.track-tabs { color: var(--muted) !important; font-size: 13px !important; margin-top: auto !important; padding-top: 4px; }
.track-progress { display: flex; align-items: center; gap: 10px; }
.track-progress .bar { flex: 1; }
.track-done { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.track-card.complete .track-done { color: var(--done); font-weight: 600; }
.track-card.soon { background: var(--surface-2); box-shadow: none; border-style: dashed; }
.badge {
  font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
.home-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-top: 24px; }
.home-foot .btn:hover { text-decoration: none; }

.gresults { margin-top: 16px; }
.gresults .result-count { margin-bottom: 4px; }
.gr-track { margin: 18px 0 6px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.gr-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gr-list li + li { border-top: 1px solid var(--line); }
.gr-list a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; color: var(--text); }
.gr-list a:hover { background: var(--surface-2); text-decoration: none; }
.gr-q { font-weight: 500; }
.gr-meta { font-size: 12.5px; color: var(--muted); }
.gr-done { color: var(--done); }
.gr-star { color: var(--star); }
.gr-empty { color: var(--muted); padding: 24px 0; }

/* Highlight a question opened from a link (e.g. home search). */
.qitem.flash { animation: flash 2s ease-out; }
@keyframes flash { 0%, 30% { background: var(--accent-soft); } 100% { background: transparent; } }

/* ---------- Progress bars ---------- */

.bar { display: block; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar-fill {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--done), color-mix(in srgb, var(--done) 70%, var(--accent)));
  transition: width .35s ease;
}

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

.layout {
  display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px;
  align-items: start; padding-top: 8px; padding-bottom: 64px;
}
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
}

/* ---------- Sidebar ---------- */

.sidebar {
  position: sticky; top: calc(var(--nav-h) + 16px);
  max-height: calc(100vh - var(--nav-h) - 32px); overflow-y: auto;
  padding-right: 4px;
}
.toc-title {
  margin: 4px 0 8px 10px;
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center;
  padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-size: 13.5px; line-height: 1.35;
}
.toc a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.toc a.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 550; }
.toc-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.toc a.complete .toc-count { color: var(--done); font-weight: 600; }
.toc .bar { grid-column: 1 / -1; height: 3px; }

/* ---------- Toolbar ---------- */

.toolbar {
  position: sticky; top: var(--nav-h); z-index: 10;
  padding: 14px 0 10px; margin-bottom: 8px;
  background: var(--bg);
  display: flex; flex-direction: column; gap: 10px;
}
.toolbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line);
}

.search {
  position: relative; display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.search svg { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text);
  font: inherit; padding: 10px 12px 10px 36px;
}
.search input::placeholder { color: var(--muted); }
.search .kbd { margin-right: 10px; }
.search:focus-within .kbd { display: none; }

.toolbar-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
}
.seg button {
  border: 0; background: transparent; color: var(--text-2);
  padding: 5px 12px; border-radius: 7px; font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }

.btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  padding: 6px 12px; border-radius: 9px; font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }
.btn-danger:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }

.result-count { margin: 0; font-size: 13px; color: var(--muted); min-height: 1em; }
.result-count:empty { display: none; }

@media (max-width: 600px) {
  .toolbar { position: static; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 6px 4px; }
  .actions { width: 100%; }
  .actions .btn { flex: 1; }
  .search .kbd { display: none; }
}

/* ---------- Sections ---------- */

.section {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  margin-top: 16px; overflow: hidden; box-shadow: var(--shadow);
}
.section-head {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 16px 18px; border: 0; background: transparent; text-align: left; cursor: pointer;
}
.section-head:hover { background: var(--surface-2); }
.section-head:focus-visible { outline-offset: -2px; border-radius: var(--radius); }
.section-num {
  flex: none; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.section.complete .section-num { background: var(--done-soft); color: var(--done); }
.section-title { flex: 1; min-width: 0; margin: 0; font-size: 16.5px; font-weight: 650; letter-spacing: -0.01em; }
.section-meta { display: flex; align-items: center; gap: 12px; flex: none; }
.section-count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.section-meta .bar { width: 90px; height: 6px; }
.chev { color: var(--muted); transition: transform .2s; flex: none; }
.section.closed .chev { transform: rotate(-90deg); }
.section.closed .section-body:not(.force-open) { display: none; }

@media (max-width: 600px) {
  .section-meta .bar { display: none; }
  .section-head { padding: 14px; gap: 10px; }
}

.group {
  padding: 10px 18px 6px; border-top: 1px solid var(--line); background: var(--surface-2);
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}

/* ---------- Questions ---------- */

.qlist { list-style: none; margin: 0; padding: 0; }
.qitem { border-top: 1px solid var(--line); transition: background .15s; }
.qitem.done { background: color-mix(in srgb, var(--done-soft) 70%, transparent); }

.qrow { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; cursor: pointer; }
.qrow:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }

.check {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 20px; height: 20px; margin: 2px 0 0;
  border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--surface);
  display: grid; place-items: center; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.check::after {
  content: ""; width: 10px; height: 6px; margin-top: -2px;
  border: 2px solid #fff; border-top: 0; border-right: 0;
  transform: rotate(-45deg) scale(0); transition: transform .15s;
}
.check:checked { background: var(--done); border-color: var(--done); }
.check:checked::after { transform: rotate(-45deg) scale(1); }
.check:hover { border-color: var(--done); }

.qn { flex: none; min-width: 28px; padding-top: 1px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.qbody { flex: 1; min-width: 0; }
.qt { font-weight: 500; }
.qitem.done .qt { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.qline { display: flex; align-items: flex-start; }
.qline .qrow { flex: 1; min-width: 0; }
.starbtn {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin: 6px 8px 0 0;
  border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer;
  opacity: .55; transition: opacity .15s, color .15s, background .15s;
}
.starbtn svg { fill: none; }
.starbtn:hover, .starbtn:focus-visible { opacity: 1; background: var(--surface-2); }
.qitem.starred .starbtn { opacity: 1; color: var(--star); }
.qitem.starred .starbtn svg { fill: currentColor; }
.note { display: block; margin-top: 4px; color: var(--muted); font-size: 13.5px; }

.more { padding: 0 18px 14px 80px; margin-top: -6px; }
@media (max-width: 600px) { .more { padding-left: 18px; } .qrow { gap: 10px; padding: 14px; } }
.more-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.linkbtn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--accent-text);
  padding: 3px 10px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.linkbtn:hover { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.linkbtn .chev-sm { transition: transform .2s; }
.linkbtn[aria-expanded="true"] .chev-sm { transform: rotate(180deg); }

/* ---------- Answers & code ---------- */

.answer {
  margin-top: 10px; padding: 14px 16px;
  background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0; font-size: 14.5px; color: var(--text);
}
.answer p { margin: 0 0 10px; }
.answer ul, .answer ol { margin: 0 0 10px; padding-left: 22px; }
.answer li { margin: 3px 0; }
.answer > :last-child { margin-bottom: 0; }
.answer strong { font-weight: 650; }

code {
  font-family: var(--mono); font-size: .88em; font-variant-ligatures: none;
  background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--text);
  border-radius: 5px; padding: 1px 5px;
}

.codeblock { position: relative; margin: 8px 0 12px; }
.answer > .codeblock:last-child { margin-bottom: 0; }
pre {
  margin: 0; padding: 14px 16px; overflow-x: auto;
  background: #0f1320; color: #e2e6f0;
  border: 1px solid #1f2536; border-radius: 10px;
  font-size: 13px; line-height: 1.6; tab-size: 2;
}
pre code { font-variant-ligatures: none; background: none; color: inherit; padding: 0; font-size: inherit; border-radius: 0; }
.qcode { margin-top: 10px; }

.copy {
  position: absolute; top: 8px; right: 8px;
  border: 1px solid #2a3147; background: #1a2033; color: #aab3c8;
  padding: 3px 9px; border-radius: 6px; font-size: 12px; cursor: pointer;
  opacity: 0; transition: opacity .15s, color .15s;
}
.codeblock:hover .copy, .copy:focus-visible { opacity: 1; }
.copy:hover { color: #fff; }
@media (hover: none) { .copy { opacity: 1; } }

/* ---------- Code editor ---------- */

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.editor {
  margin-top: 10px; padding: 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
}
.ed-task { margin: 0 0 10px; font-size: 14px; color: var(--text-2); }
.ed-code {
  display: block; width: 100%; min-height: 160px; max-height: 640px; resize: vertical;
  margin: 0; padding: 12px 14px;
  background: #0f1320; color: #e2e6f0; caret-color: #fff;
  border: 1px solid #1f2536; border-radius: 10px;
  font: 13px/1.6 var(--mono); font-variant-ligatures: none; tab-size: 2;
  white-space: pre; overflow: auto;
}
.ed-code:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ed-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); border-color: transparent; color: #fff; }
.btn:disabled { opacity: .55; cursor: progress; }
.ed-hint { margin-left: auto; font-size: 12px; color: var(--muted); }
@media (hover: none) { .ed-hint { display: none; } }

.ed-preview-wrap { margin-top: 12px; }
.ed-preview {
  display: block; width: 100%; height: 160px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}

/* HTML & CSS preview: a white "browser tab" the user can resize, with a mobile width option. */
.ed-width { margin-bottom: 8px; }
.ed-width button { font-size: 12.5px; padding: 4px 10px; }
.ed-frame-box {
  width: 100%; height: 340px; min-height: 120px; max-height: 900px;
  resize: vertical; overflow: hidden;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  transition: width .2s ease;
}
.ed-frame-box.mobile { width: 375px; max-width: 100%; }
.ed-preview.ed-preview-html { height: 100%; border: 0; border-radius: 0; background: #fff; }

.ed-out { margin-top: 12px; display: grid; gap: 10px; font-size: 13.5px; }
.ed-status { font-weight: 600; }
.ed-pass { color: var(--done); }
.ed-fail { color: var(--danger); }
.ed-muted { font-weight: 400; color: var(--muted); }
.ed-error {
  padding: 8px 12px; border-radius: 8px; white-space: pre-wrap;
  font: 12.5px/1.5 var(--mono); color: var(--danger);
  background: color-mix(in srgb, var(--danger) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
}
.ed-tests { display: grid; gap: 6px; }
.ed-tests:empty { display: none; }
.ed-test { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: baseline; }
.ed-icon { font-size: 12px; }
.ed-name { font-family: var(--mono); font-size: 12.5px; word-break: break-word; }
.ed-diff { grid-column: 2; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 2px 0 4px; font-size: 12.5px; }
.ed-diff dt { color: var(--muted); }
.ed-diff dd { margin: 0; min-width: 0; word-break: break-word; }
.ed-tip {
  padding: 8px 12px; border-radius: 8px; color: var(--text);
  background: var(--done-soft); border: 1px solid color-mix(in srgb, var(--done) 35%, transparent);
}
.ed-tip .linkbtn { margin-left: 6px; }
.ed-console { border: 1px solid #1f2536; border-radius: 10px; background: #0f1320; padding: 8px 12px; overflow-x: auto; }
.ed-label { margin: 0 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #8a93a8; }
.ed-line { margin: 0; padding: 0; border: 0; background: none; color: #e2e6f0; font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; overflow: visible; }
.ed-warn { color: #fbbf24; }
.ed-error.ed-line, .ed-line.ed-error { color: #fca5a5; background: none; border: 0; padding: 0; }

/* ---------- Empty state & footer ---------- */

.empty { text-align: center; color: var(--muted); padding: 56px 0; }
.empty p { margin: 0; }
.empty-title { color: var(--text); font-weight: 600; font-size: 16px; margin-bottom: 4px !important; }

.footer { border-top: 1px solid var(--line); padding: 24px 0 32px; color: var(--muted); font-size: 13.5px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.footer p { margin: 0; }
.footer a { color: var(--text-2); }
.footer-site { display: flex; flex-direction: column; gap: 4px; }
/* Shubham Works block: one column, quiet text, only the mark is orange. */
.made-by { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; line-height: 1.6; }
.made-by-title { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-2); }
.maker-mark { flex-shrink: 0; color: var(--maker); }

/* ---------- Confirm dialog ---------- */

.modal {
  width: min(420px, calc(100vw - 32px)); padding: 22px 22px 18px; margin: auto;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 50px rgb(0 0 0 / 0.25);
}
.modal::backdrop { background: rgb(10 12 18 / 0.55); backdrop-filter: blur(2px); }
.modal[open] { animation: modal-in .16s ease-out; }
.modal[open]::backdrop { animation: fade-in .16s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
.modal-title { margin: 0 0 8px; font-size: 17px; font-weight: 650; }
.modal-msg { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.modal-actions .btn { padding: 8px 14px; }
.btn-solid-danger { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.btn-solid-danger:hover { background: color-mix(in srgb, var(--danger) 88%, #000); border-color: transparent; color: var(--surface); }
@media (max-width: 600px) { .modal-actions .btn { flex: 1; } }

.noscript { text-align: center; padding: 24px; color: var(--danger); }

/* ---------- Motion ----------
   Light motion, CSS only (the same style as CloudPrep): content fades and rises into place
   once, and cards and large buttons lift slightly on hover. No loops, no parallax.
   The reduced-motion rules below switch all of it off. */

:root { --ease: cubic-bezier(.2, 0, 0, 1); --shadow-lift: 0 10px 24px -10px rgb(0 0 0 / .28); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes rise-sm { from { opacity: 0; transform: translateY(-4px); } }

/* Hero: one line after another. */
.hero .breadcrumb, .hero .eyebrow, .hero h1, .hero .lead, .hero .stats, .hero .tabs,
.lp-cta, .lp-proof, .lp-shot { animation: rise 560ms var(--ease) both; }
.hero h1 { animation-delay: 70ms; }
.hero .lead { animation-delay: 140ms; }
.hero .stats, .lp-cta { animation-delay: 210ms; }
.hero .tabs, .lp-proof { animation-delay: 280ms; }
.lp-shot { animation-delay: 200ms; animation-duration: 700ms; }

/* App: track cards and question sections follow the hero. Only while the page first loads
   (theme.js sets data-intro briefly), so search and filters don't replay it. */
:root[data-intro] :is(.track-grid > *, .continue, .section) { animation: rise 560ms var(--ease) both; animation-delay: 300ms; }
:root[data-intro] :is(.track-grid > :nth-child(2), .section:nth-child(2)) { animation-delay: 350ms; }
:root[data-intro] :is(.track-grid > :nth-child(3), .section:nth-child(3)) { animation-delay: 400ms; }
:root[data-intro] :is(.track-grid > :nth-child(4), .section:nth-child(4)) { animation-delay: 450ms; }
:root[data-intro] :is(.track-grid > :nth-child(5), .section:nth-child(5)) { animation-delay: 500ms; }
:root[data-intro] :is(.track-grid > :nth-child(n+6), .section:nth-child(n+6)) { animation-delay: 550ms; }

/* Answers and code slide in when opened. */
.answer, .qcode { animation: rise-sm 220ms var(--ease) both; }

/* Hover lift on cards and large buttons. */
a.track-card, .continue, .lp-track:not(.lp-track-soon), .lp-steps li, .btn-lg, .nav-cta {
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), border-color .15s, background .15s, color .15s;
}
a.track-card:hover, .continue:hover, .lp-track:not(.lp-track-soon):hover, .lp-steps li:hover, .btn-lg:hover, .nav-cta:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-lift);
}

/* Landing page sections fade in as they scroll into view. landing.js adds these classes,
   so without JavaScript (or for search engines) everything is simply shown. */
:root .reveal { opacity: 0; transform: translateY(12px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
:root .reveal.shown { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .reveal, a.track-card:hover, .continue:hover, .lp-track:hover, .lp-steps li:hover, .btn-lg:hover, .nav-cta:hover { transform: none !important; }
  .reveal { opacity: 1 !important; }
}

@media print {
  .nav, .sidebar, .toolbar, .footer, .more-btns, .copy, .starbtn, .editor { display: none !important; }
  .layout { display: block; }
  .section { box-shadow: none; break-inside: avoid-page; }
  .reveal { opacity: 1; transform: none; }
}
