/* GyanKosh: a star chart of things to build.
   Layout: dark "sky" hero with a live constellation of topics, then a light/dark
   dashboard body: stats strip, continue-learning, explore grid, catalog chart.
   Topic pages: hero card + timeline path (left) and resource list (right). */
:root {
  --paper: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #eceff4;
  --ink: #121624;
  --muted: #586174;
  --line: #dde2ea;
  --accent: #2346c8;
  --accent-soft: rgba(35, 70, 200, .10);
  --accent-ink: #ffffff;
  --mark: #ffd84a;
  --good: #12805c;
  --good-soft: rgba(18, 128, 92, .12);
  --warn: #9a5b00;
  --shadow: 0 1px 2px rgba(18, 22, 36, .05), 0 10px 30px rgba(18, 22, 36, .07);
  --shadow-lift: 0 2px 4px rgba(18, 22, 36, .06), 0 18px 40px rgba(18, 22, 36, .12);

  /* resource types (validated categorical palette, fixed order) */
  --t-paper: #2a78d6;
  --t-code: #eb6834;
  --t-course: #1baf7a;
  --t-book: #eda100;
  --t-docs: #e87ba4;

  /* the sky hero keeps one look in both themes */
  --sky: #0a0f20;
  --sky-2: #121a33;
  --sky-ink: #eef1fa;
  --sky-muted: #9ba7c6;
  --sky-line: rgba(170, 190, 255, .14);
  --star: #ffd84a;

  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1018; --surface: #151a25; --surface-2: #1c2230; --ink: #e9ecf3; --muted: #9aa3b5; --line: #283042;
    --accent: #93acff; --accent-soft: rgba(147, 172, 255, .12); --accent-ink: #0d1018; --mark: #ffd84a;
    --good: #4fd1a5; --good-soft: rgba(79, 209, 165, .14); --warn: #f0b453;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 30px rgba(0,0,0,.30);
    --shadow-lift: 0 2px 4px rgba(0,0,0,.4), 0 18px 40px rgba(0,0,0,.45);
    --t-paper: #3987e5; --t-code: #d95926; --t-course: #199e70; --t-book: #c98500; --t-docs: #d55181;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1018; --surface: #151a25; --surface-2: #1c2230; --ink: #e9ecf3; --muted: #9aa3b5; --line: #283042;
  --accent: #93acff; --accent-soft: rgba(147, 172, 255, .12); --accent-ink: #0d1018; --mark: #ffd84a;
  --good: #4fd1a5; --good-soft: rgba(79, 209, 165, .14); --warn: #f0b453;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 30px rgba(0,0,0,.30);
  --shadow-lift: 0 2px 4px rgba(0,0,0,.4), 0 18px 40px rgba(0,0,0,.45);
  --t-paper: #3987e5; --t-code: #d95926; --t-course: #199e70; --t-book: #c98500; --t-docs: #d55181;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 24px; }
@media (max-width: 520px) { .wrap { padding-inline: 16px; } }
.mono { font-family: var(--f-mono); }

/* ================= header ================= */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--sky) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--sky-line); color: var(--sky-ink);
}
.top .wrap { display: flex; align-items: center; gap: 16px; padding-block: 12px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; margin-right: auto;
  font: 700 19px/1 var(--f-display); letter-spacing: -.01em; color: var(--sky-ink); text-decoration: none;
}
.brand svg { flex: none; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a, .icon-btn {
  color: var(--sky-muted); text-decoration: none; font-size: 14px; padding: 7px 11px; border-radius: 8px;
  background: none; border: 0; cursor: pointer; transition: color .2s, background .2s;
}
.nav a:hover, .icon-btn:hover { color: var(--sky-ink); background: rgba(255,255,255,.07); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; }
.icon-btn svg { width: 18px; height: 18px; }
.theme-sun { display: none; }
:root[data-theme="dark"] .theme-sun { display: block; }
:root[data-theme="dark"] .theme-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-sun { display: block; }
  :root:not([data-theme="light"]) .theme-moon { display: none; }
}
@media (max-width: 640px) { .nav a { display: none; } }

/* ================= sky hero ================= */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(900px 500px at 78% 30%, rgba(80, 110, 220, .22), transparent 70%),
    radial-gradient(700px 420px at 10% 110%, rgba(255, 216, 74, .07), transparent 70%),
    linear-gradient(180deg, var(--sky) 0%, var(--sky-2) 100%);
  color: var(--sky-ink);
}
#sky { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
.hero-inner { padding-block: 72px 64px; min-height: 560px; display: flex; flex-direction: column; justify-content: center; }
.hero-copy { max-width: 600px; position: relative; }
.hero-copy::before { /* soft scrim so text stays readable over stars */
  content: ""; position: absolute; inset: -40px -60px -40px -200px; z-index: -1;
  background: radial-gradient(closest-side, rgba(10, 15, 32, .85), rgba(10, 15, 32, 0));
  pointer-events: none;
}
.kicker {
  display: inline-flex; align-items: center; gap: 8px; font: 500 12px/1 var(--f-mono); letter-spacing: .12em;
  text-transform: uppercase; color: var(--sky-muted); margin-bottom: 18px;
}
.kicker .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--star); box-shadow: 0 0 10px var(--star); animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .35; } }
.hero h1 {
  font: 800 clamp(40px, 6.6vw, 76px)/.98 var(--f-display);
  letter-spacing: -.035em; margin: 0 0 18px; text-wrap: balance;
}
.hero h1 .hl { position: relative; white-space: nowrap; color: var(--sky);
  background: var(--star); padding: 0 .12em; border-radius: .08em; box-shadow: 0 0 40px rgba(255, 216, 74, .35); }
.hero p.sub { margin: 0 0 28px; color: var(--sky-muted); font-size: 18px; max-width: 54ch; }

.search { position: relative; max-width: 620px; }
.search form {
  display: flex; gap: 8px; padding: 6px; border-radius: 16px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35); transition: border-color .25s, box-shadow .25s, background .25s;
}
.search form:focus-within { border-color: var(--star); background: rgba(255, 255, 255, .10); box-shadow: 0 0 0 4px rgba(255, 216, 74, .15), 0 20px 50px rgba(0,0,0,.35); }
.search .s-icon { align-self: center; margin-left: 10px; color: var(--sky-muted); flex: none; }
.search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--sky-ink);
  font: 18px/1.3 var(--f-body); padding: 12px 8px;
}
.search input:focus { outline: none; }
.search input::placeholder { color: rgba(220, 228, 250, .55); }
.search input::-webkit-search-cancel-button { filter: invert(1); }
.search button[type="submit"] {
  border: 0; border-radius: 11px; background: var(--star); color: #1b1600; cursor: pointer;
  font: 600 16px/1 var(--f-body); padding: 0 20px; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px;
  transition: transform .2s var(--ease), box-shadow .2s;
}
.search button[type="submit"]:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(255, 216, 74, .35); }
.search button[type="submit"]:active { transform: translateY(0); }
.search button svg { transition: transform .25s var(--ease); }
.search button:hover svg { transform: translateX(3px); }
@media (max-width: 520px) {
  .search form { flex-wrap: wrap; }
  .search input { flex-basis: calc(100% - 40px); }
  .search button[type="submit"] { flex-basis: 100%; justify-content: center; padding: 14px; }
}
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lift); padding: 6px; display: grid; gap: 2px;
  animation: drop .18s var(--ease);
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.suggest button {
  all: unset; box-sizing: border-box; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 9px; cursor: pointer;
}
.suggest button:hover, .suggest button[aria-selected="true"] { background: var(--surface-2); }
.suggest .s-field { color: var(--muted); font-size: 12px; font-family: var(--f-mono); white-space: nowrap; }

.examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; align-items: center; }
.examples .lbl { color: var(--sky-muted); font-size: 14px; margin-right: 2px; }
.examples .chip { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.16); color: var(--sky-ink); }
.examples .chip:hover { border-color: var(--star); color: var(--star); background: rgba(255,216,74,.08); }
.sky-hint { margin-top: 26px; font: 12px/1.4 var(--f-mono); color: var(--sky-muted); display: flex; align-items: center; gap: 8px; }
.sky-hint .ln { width: 28px; height: 1px; background: var(--sky-muted); opacity: .6; }
@media (max-width: 860px) { .sky-hint { display: none; } .hero-inner { min-height: 0; padding-block: 48px 44px; } }

/* ================= chips & tabs ================= */
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 6px 13px; font: 14px/1.2 var(--f-body); cursor: pointer; text-decoration: none;
  transition: border-color .2s, color .2s, background .2s, transform .2s var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.tabs {
  position: relative; display: flex; gap: 2px; padding: 4px; border-radius: 12px;
  background: var(--surface-2); overflow-x: auto; scrollbar-width: none; max-width: 100%;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  position: relative; z-index: 1; border: 0; background: none; color: var(--muted); cursor: pointer;
  padding: 8px 14px; border-radius: 9px; font-size: 14px; white-space: nowrap; transition: color .25s;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.tabs .n { font: 12px/1 var(--f-mono); opacity: .6; margin-left: 5px; }
.tabs .ind {
  position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 9px;
  background: var(--surface); box-shadow: var(--shadow);
  transition: transform .38s var(--ease), width .38s var(--ease);
}

/* ================= stats strip ================= */
.stats-band { background: var(--surface); border-bottom: 1px solid var(--line); }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat { padding: 22px 18px; border-left: 1px solid var(--line); display: grid; gap: 4px; }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat b { font: 600 clamp(24px, 3vw, 34px)/1 var(--f-mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 14px; }
.stat i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; background: var(--c, var(--muted)); }
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .stat:nth-child(-n+2) { border-top: 0; }
  .stat:last-child { grid-column: 1 / -1; }
}

/* ================= sections ================= */
.section { padding-block: 44px 8px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 14px 24px; margin-bottom: 20px; }
.sec-head h2 { font: 700 clamp(24px, 3vw, 32px)/1.1 var(--f-display); letter-spacing: -.02em; margin: 0; }
.sec-head p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.eyebrow { font: 500 12px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* continue learning */
.cont { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cont a {
  display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}
.cont a:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: transparent; }
.cont .c-name { font-weight: 600; line-height: 1.25; }
.cont .c-sub { color: var(--muted); font-size: 13px; font-family: var(--f-mono); }

/* progress ring */
.ring { flex: none; transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-2); }
.ring .bar { stroke: var(--good); stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease); }
.ring-wrap { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring-wrap .pct { position: absolute; font: 600 12px/1 var(--f-mono); color: var(--ink); }

/* explore tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tile {
  --mx: 50%; --my: 50%;
  position: relative; display: grid; gap: 10px; align-content: start; text-align: left; cursor: pointer; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; text-decoration: none; min-width: 0; overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
.tile::before { /* cursor spotlight */
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .3s; pointer-events: none;
  background: radial-gradient(320px circle at var(--mx) var(--my), var(--accent-soft), transparent 60%);
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: transparent; }
.tile:hover::before { opacity: 1; }
.tile > * { position: relative; }
.tile .t-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tile .t-field { font: 500 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tile .t-go { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted);
  transition: transform .3s var(--ease), background .3s, color .3s; }
.tile:hover .t-go { transform: rotate(-45deg); background: var(--accent); color: var(--accent-ink); }
.tile .t-name { font: 700 21px/1.15 var(--f-display); letter-spacing: -.015em; }
.tile .t-eg { color: var(--muted); font-size: 14px; line-height: 1.45; }
.tile .t-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font: 12px/1 var(--f-mono); color: var(--muted); }
.tile .done { color: var(--good); }
.minibar { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; }
.minibar span { display: block; height: 100%; background: var(--c); transform-origin: left; }
@media (max-width: 560px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 14px; gap: 8px; }
  .tile .t-name { font-size: 17px; }
  .tile .t-eg, .tile .t-go { display: none; }
  .tile .t-foot { flex-direction: column; align-items: flex-start; gap: 4px; font-size: 11px; }
}
.tile.enter { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* catalog chart */
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: relative; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.bars { display: grid; gap: 14px; margin-top: 18px; }
.bar-row { display: grid; grid-template-columns: 190px minmax(0, 1fr) 44px; gap: 14px; align-items: center; }
.bar-row .lbl { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .val { font: 600 14px/1 var(--f-mono); text-align: right; font-variant-numeric: tabular-nums; }
.track { display: flex; gap: 2px; height: 22px; border-radius: 6px; background: var(--surface-2); overflow: visible; }
.seg { height: 100%; background: var(--c); width: 0; transition: width 1s var(--ease); cursor: default; position: relative; }
.seg:first-child { border-radius: 4px 0 0 4px; }
.seg:last-child { border-radius: 0 4px 4px 0; }
.seg:only-child { border-radius: 4px; }
.seg:hover { filter: brightness(1.1); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--c); z-index: 1; }
@media (max-width: 640px) { .bar-row { grid-template-columns: minmax(0, 1fr) 40px; gap: 6px 10px; } .bar-row .lbl { grid-column: 1 / -1; } }
.tip {
  position: absolute; z-index: 5; pointer-events: none; background: var(--ink); color: var(--paper);
  font-size: 13px; padding: 7px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px));
  box-shadow: var(--shadow-lift);
}
.tip b { font-family: var(--f-mono); }
.chart-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.tbl-wrap { overflow-x: auto; margin-top: 16px; }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { color: var(--muted); font-weight: 500; }

/* ================= topic page ================= */
.topic { padding-block: 28px 64px; }
.back {
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); background: none; border: 0;
  padding: 0; cursor: pointer; margin-bottom: 18px; transition: color .2s, gap .2s var(--ease);
}
.back:hover { color: var(--accent); gap: 10px; }
.topic-hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 32px; margin-bottom: 30px;
  background: var(--surface); border: 1px solid var(--line);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center;
}
.topic-hero::after {
  content: ""; position: absolute; right: -120px; top: -160px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-soft), transparent); pointer-events: none;
}
.topic-hero h2 { font: 800 clamp(30px, 4.6vw, 50px)/1.02 var(--f-display); letter-spacing: -.03em; margin: 10px 0 12px; text-wrap: balance; }
.topic-hero p { margin: 0; font-size: 18px; color: var(--muted); max-width: 64ch; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); }
.badge i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.badge b { font-family: var(--f-mono); }
.hero-ring { display: grid; justify-items: center; gap: 6px; position: relative; z-index: 1; }
.hero-ring .lbl { font-size: 12px; color: var(--muted); font-family: var(--f-mono); }
.hero-ring .ring-wrap .pct { font-size: 16px; }
@media (max-width: 680px) { .topic-hero { grid-template-columns: minmax(0, 1fr); padding: 24px; } .hero-ring { justify-items: start; grid-auto-flow: column; align-items: center; justify-content: start; } }

.cols { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 36px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
.panel-h { font: 700 21px/1.2 var(--f-display); margin: 0 0 4px; letter-spacing: -.01em; }
.panel-sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.path { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 76px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
@media (max-width: 900px) { .path { position: static; } }
.steps { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 4px; }
.steps::before { /* timeline spine draws in */
  content: ""; position: absolute; left: 15px; top: 16px; bottom: 16px; width: 2px; background: var(--line);
  transform-origin: top; animation: spine .9s var(--ease) both .1s;
}
@keyframes spine { from { transform: scaleY(0); } }
.steps li { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 8px 0; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 70ms + .15s); }
.step-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--ink); background: var(--surface); color: var(--ink);
  display: grid; place-items: center; font: 600 13px/1 var(--f-mono); cursor: pointer; position: relative; z-index: 1;
  transition: background .25s, border-color .25s, color .25s, transform .2s var(--ease);
}
.step-btn:hover { transform: scale(1.08); }
.step-btn .ck { display: none; }
li.done .step-btn { background: var(--good); border-color: var(--good); color: var(--surface); animation: pop .35s var(--ease); }
li.done .step-btn .ck { display: block; }
li.done .step-btn .num { display: none; }
@keyframes pop { 50% { transform: scale(1.18); } }
.steps .txt { font-size: 15px; padding-top: 5px; transition: color .25s; }
li.done .txt { color: var(--muted); }
.path-foot { margin-top: 14px; font-size: 13px; color: var(--muted); }

.res-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 14px; }
.list { display: grid; gap: 10px; }
.item {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 16px; align-items: start;
  padding: 16px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
  animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms + .1s);
}
.item:hover { transform: translateX(4px); box-shadow: var(--shadow); border-color: var(--c); }
.item .type { font: 600 11px/1.9 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.item .type::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--c); flex: none; }
.item .title { font-weight: 600; font-size: 17px; line-height: 1.35; overflow-wrap: anywhere; }
.item .meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; }
.item .src { font-family: var(--f-mono); font-size: 12px; overflow-wrap: anywhere; }
.item .note { margin: 6px 0 0; font-size: 15px; }
.item .go { color: var(--muted); transition: transform .25s var(--ease), color .25s; padding-top: 2px; }
.item:hover .go { transform: translate(3px, -3px); color: var(--accent); }
@media (max-width: 560px) { .item { grid-template-columns: minmax(0, 1fr) auto; } .item .type { grid-column: 1 / -1; } }
.c-paper { --c: var(--t-paper); } .c-code { --c: var(--t-code); } .c-course { --c: var(--t-course); }
.c-book { --c: var(--t-book); } .c-docs { --c: var(--t-docs); }

.related { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.related .lbl { color: var(--muted); font-size: 14px; margin-right: 4px; }

/* live search */
.live { margin-top: 52px; }
.live-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 8px 20px; margin-bottom: 18px; }
.live-head h3 { font: 700 24px/1.15 var(--f-display); margin: 6px 0 0; letter-spacing: -.015em; }
.live-head code { font-family: var(--f-mono); font-size: 13px; background: var(--surface); border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; }
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-right: 8px; position: relative; vertical-align: 1px; }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--good); animation: ping 1.8s ease-out infinite; }
@keyframes ping { to { transform: scale(2.6); opacity: 0; } }
.live-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 980px) { .live-grid { grid-template-columns: minmax(0, 1fr); } }
.src-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.src-col h4 { margin: 0 0 4px; font: 700 17px/1.2 var(--f-display); display: flex; justify-content: space-between; gap: 8px; }
.src-col .src-sub { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.status { font: 500 11px/1 var(--f-mono); padding: 5px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; align-self: center; }
.status.ok { color: var(--good); border-color: currentColor; }
.status.off { color: var(--warn); border-color: currentColor; }
.hits { list-style: none; margin: 0; padding: 0; display: grid; }
.hits li { padding: 11px 0; border-top: 1px solid var(--line); min-width: 0; animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.hits a { font-weight: 600; font-size: 15px; line-height: 1.35; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.hits a:hover { color: var(--accent); text-decoration: underline; }
.hits .hm { font-size: 13px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.skel { height: 13px; border-radius: 6px; margin: 13px 0; background: linear-gradient(90deg, var(--surface-2) 0%, var(--line) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skel.s2 { width: 70%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.fallback { font-size: 14px; color: var(--muted); margin: 6px 0 0; }
.fallback a { display: inline-block; margin-top: 8px; font-weight: 600; }
.outlinks { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.outlinks .lbl { color: var(--muted); font-size: 14px; margin-right: 4px; }

.miss { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 26px; max-width: 820px; }
.miss h2 { font: 700 28px/1.15 var(--f-display); margin: 8px 0 8px; letter-spacing: -.02em; }
.miss p { margin: 0; color: var(--muted); }

/* view enter animation */
.view-in > * { animation: rise .5s var(--ease) both; }
.view-in > *:nth-child(2) { animation-delay: .06s; }
.view-in > *:nth-child(3) { animation-delay: .12s; }
.view-in > *:nth-child(4) { animation-delay: .18s; }
::view-transition-old(root) { animation: vt-out .22s ease both; }
::view-transition-new(root) { animation: vt-in .38s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; transition: opacity .3s, transform .3s var(--ease);
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow-lift);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* footer */
footer { margin-top: 56px; background: var(--sky); color: var(--sky-muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding-block: 28px 36px; }
footer b { color: var(--sky-ink); font-family: var(--f-display); }
footer code { font-family: var(--f-mono); color: var(--sky-ink); }
kbd { font-family: var(--f-mono); font-size: 12px; border: 1px solid var(--sky-line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--sky-ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* ================= accounts & premium (account.js) ================= */
.acct-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: var(--sky-ink); font-size: 14px; font-weight: 500;
  transition: background .2s, border-color .2s;
}
.acct-btn:hover { background: rgba(255,255,255,.12); border-color: var(--star); }
.acct-btn.signed { padding: 0 6px 0 4px; }
.acct-btn .avatar { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--star); color: var(--sky); font: 700 13px/1 var(--f-mono); }
.plan-pill { font: 600 11px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; padding: 5px 7px; border-radius: 6px; background: rgba(255,255,255,.1); color: var(--sky-muted); }
.plan-pill.prem { background: rgba(255,216,74,.18); color: var(--star); }

.deeper {
  margin-top: 40px; padding: 28px; border-radius: 20px; position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center;
  background: linear-gradient(180deg, var(--sky) 0%, var(--sky-2) 100%); color: var(--sky-ink);
}
.deeper::after { content: ""; position: absolute; right: -80px; top: -120px; width: 360px; height: 360px; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, rgba(255,216,74,.18), transparent); }
.deeper .eyebrow { color: var(--star); }
.deeper h3 { font: 800 clamp(22px, 3vw, 30px)/1.1 var(--f-display); letter-spacing: -.02em; margin: 8px 0 8px; }
.deeper p { margin: 0 0 12px; color: var(--sky-muted); max-width: 60ch; }
.deeper-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; }
.deeper-list li::before { content: "✓"; color: var(--star); margin-right: 8px; font-weight: 700; }
.deeper-cta { display: grid; gap: 8px; justify-items: center; }
.deeper-btn { text-decoration: none; display: inline-block;
  border: 0; border-radius: 12px; background: var(--star); color: #1b1600; font-weight: 600; font-size: 16px; padding: 14px 22px; cursor: pointer;
  white-space: nowrap; transition: transform .2s var(--ease), box-shadow .2s;
}
.deeper-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(255,216,74,.3); }
.deeper-note { font: 12px/1 var(--f-mono); color: var(--sky-muted); }
@media (max-width: 720px) { .deeper { grid-template-columns: minmax(0, 1fr); padding: 22px; } .deeper-cta { justify-items: start; } }

.pf-modal {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: rgba(8, 11, 22, .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fadein .2s ease;
}
@keyframes fadein { from { opacity: 0; } }
.pf-card {
  position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--surface); color: var(--ink); border-radius: 18px; padding: 28px; box-shadow: var(--shadow-lift);
  animation: rise .35s var(--ease) both;
}
.pf-x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.pf-card h3 { font: 800 26px/1.1 var(--f-display); letter-spacing: -.02em; margin: 6px 0 6px; }
.pf-sub { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.pf-note { background: var(--accent-soft); color: var(--ink); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 0 0 14px; }
.pf-test { background: rgba(255,216,74,.18); border: 1px solid rgba(201,133,0,.35); color: var(--ink); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 8px 0 14px; }
.pf-field { display: grid; gap: 6px; margin-bottom: 14px; font-size: 13px; color: var(--muted); font-weight: 500; }
.pf-field input {
  font: 16px/1.3 var(--f-body); color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px;
}
.pf-field input:focus { outline: none; border-color: var(--accent); }
.pf-field input.otp { font: 600 22px/1 var(--f-mono); letter-spacing: .4em; text-align: center; }
.pf-err { color: #c0392b; font-size: 14px; margin: 0 0 12px; }
.pf-primary, .pf-secondary {
  display: block; width: 100%; text-align: center; text-decoration: none; border-radius: 12px; padding: 13px 16px; font: 600 16px/1.2 var(--f-body); cursor: pointer;
  transition: transform .2s var(--ease), opacity .2s;
}
.pf-primary { border: 0; background: var(--ink); color: var(--paper); }
.pf-secondary { border: 1px solid var(--line); background: var(--surface); color: var(--ink); margin-top: 8px; }
.pf-primary:hover, .pf-secondary:hover { transform: translateY(-1px); }
.pf-primary:disabled, .pf-primary.busy { opacity: .6; cursor: progress; transform: none; }
.pf-alt { text-align: center; color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.pf-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.pf-plan { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.pf-plan b { font: 700 20px/1.1 var(--f-display); }
.pf-plan span:last-child { color: var(--muted); font-size: 14px; }
.pf-plan.prem { border-color: var(--t-book); background: rgba(237,161,0,.08); }
.pf-feats { list-style: none; padding: 0; margin: 4px 0 16px; display: grid; gap: 8px; font-size: 14px; }
.pf-feats li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; }
.pf-feats li::before { content: "✓"; color: var(--good); font-weight: 700; }
.pf-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.pf-plan-opt {
  position: relative; display: grid; gap: 2px; text-align: left; padding: 14px 12px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); transition: border-color .2s, background .2s;
}
.pf-plan-opt[aria-checked="true"] { border-color: var(--ink); background: var(--surface-2); }
.pf-plan-opt .pn { font-size: 12px; color: var(--muted); }
.pf-plan-opt .pp { font: 700 24px/1.1 var(--f-display); }
.pf-plan-opt .pb { font-size: 12px; color: var(--muted); }
.pf-plan-opt .best { position: absolute; top: -9px; right: 10px; font: 600 10px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; padding: 4px 7px; border-radius: 999px; background: var(--t-book); color: #1b1300; }
.pf-center { text-align: center; padding: 8px 0; }
.spinner { width: 40px; height: 40px; margin: 8px auto 14px; border-radius: 50%; border: 3px solid var(--surface-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pf-check { width: 56px; height: 56px; margin: 4px auto 12px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; font-weight: 700; color: #fff; background: var(--good); animation: pop .5s var(--ease); }
@media (max-width: 420px) { .pf-plans { grid-template-columns: 1fr; } .pf-card { padding: 22px; } }
