:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f8;
  --border: #e3e6ef;
  --text: #141824;
  --muted: #5d6475;
  --accent: #6d4aff;
  --accent-2: #00b894;
  --accent-soft: #efeaff;
  --danger: #e5484d;
  --warn: #f5a524;
  --ok: #12a150;
  --heat-0: #e9ecf3;
  --heat-1: #c9bdff;
  --heat-2: #a08bff;
  --heat-3: #7b5cff;
  --heat-4: #5531e8;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --radius: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.55 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 600; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--danger); min-height: 1.2em; margin: .5rem 0 0; font-size: .9rem; }

/* ---------- Buttons & inputs ---------- */
.btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: .55rem .95rem; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer;
  transition: transform .05s, background .15s, border-color .15s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.small { padding: .35rem .65rem; font-size: .85rem; }
input, textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; padding: .6rem .75rem;
}
input:focus, textarea:focus, select:focus, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
textarea { resize: vertical; min-height: 90px; }
.form { display: grid; gap: .85rem; }
.form label { display: grid; gap: .3rem; font-weight: 600; font-size: .9rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }

/* ---------- Auth dialog ---------- */
.brand { font-weight: 800; font-size: 1.1rem; letter-spacing: -.01em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand.big { font-size: 1.4rem; color: var(--accent); }
.tabs { display: flex; gap: .25rem; background: var(--surface-2); padding: .25rem; border-radius: 10px; margin-bottom: 1rem; }
.tab { flex: 1; border: 0; background: transparent; padding: .5rem; border-radius: 8px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.auth-dialog {
  width: min(420px, calc(100vw - 32px)); border: 1px solid var(--border); border-radius: 18px;
  background: var(--surface); color: var(--text); padding: 1.6rem; box-shadow: 0 24px 64px rgba(0,0,0,.3);
}
.auth-dialog::backdrop { background: rgba(10, 12, 20, .55); backdrop-filter: blur(4px); }
.auth-dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.dialog-x { position: absolute; top: .8rem; right: .8rem; border: 0; background: transparent; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: .3rem .5rem; border-radius: 8px; }
.dialog-x:hover { background: var(--surface-2); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 1.25rem 1rem; border-right: 1px solid var(--border);
  background: var(--surface); display: flex; flex-direction: column; gap: 1.5rem;
}
#nav { display: grid; gap: .2rem; }
#nav a { display: flex; gap: .65rem; align-items: center; padding: .55rem .7rem; border-radius: 10px; color: var(--text); font-weight: 500; }
#nav a:hover { background: var(--surface-2); text-decoration: none; }
#nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.sidebar-foot { margin-top: auto; display: grid; gap: .5rem; }
.main { padding: 2rem clamp(16px, 3vw, 2.5rem) 4rem; max-width: 1180px; width: 100%; outline: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head p { margin: 0; color: var(--muted); }

/* ---------- Dashboard ---------- */
.grid { display: grid; gap: 1rem; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { display: flex; gap: 1rem; align-items: center; }
.stat .num { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.stat .lbl { color: var(--muted); font-size: .85rem; }
.stat .emoji { font-size: 1.8rem; }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0);
  display: grid; place-items: center; }
.ring span { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: .9rem; }
.two { grid-template-columns: 1.4fr 1fr; margin-top: 1rem; }
.quote { font-style: italic; color: var(--muted); margin: 0; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .4s; }
.phase-row { display: grid; grid-template-columns: 1.6rem 1fr 3.2rem; gap: .6rem; align-items: center; padding: .45rem 0; color: var(--text); }
.phase-row:hover { text-decoration: none; }
.phase-row .name { font-weight: 600; font-size: .92rem; margin-bottom: .3rem; }
.phase-row .pct { text-align: right; font-weight: 700; font-size: .85rem; }
.status-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .65rem; border-radius: 99px; font-weight: 600; font-size: .8rem; background: var(--surface-2); }
.status-pill.ok { color: var(--ok); }
.status-pill.warn { color: var(--warn); }
.status-pill.bad { color: var(--danger); }

.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); gap: 3px; overflow-x: auto; padding-bottom: .25rem; }
.heatmap i { width: 12px; height: 12px; border-radius: 3px; background: var(--heat-0); }
.heatmap i[data-l="1"] { background: var(--heat-1); }
.heatmap i[data-l="2"] { background: var(--heat-2); }
.heatmap i[data-l="3"] { background: var(--heat-3); }
.heatmap i[data-l="4"] { background: var(--heat-4); }
.heatmap i.future { visibility: hidden; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .6rem; }
.badge { text-align: center; padding: .7rem .4rem; border-radius: 12px; background: var(--surface-2); font-size: .75rem; font-weight: 600; }
.badge .ic { font-size: 1.6rem; display: block; }
.badge.locked { opacity: .35; filter: grayscale(1); }

/* ---------- Plan ---------- */
.phase { margin-bottom: 2rem; }
.phase-head { display: flex; gap: .9rem; align-items: center; margin-bottom: .9rem; }
.phase-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; background: var(--surface-2); flex: none; }
.phase-head .bar { margin-top: .4rem; max-width: 320px; }
.week { padding: 0; overflow: hidden; margin-bottom: .6rem; }
.week-head { display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: center; padding: .9rem 1.1rem; cursor: pointer; user-select: none; }
.week-head:hover { background: var(--surface-2); }
.wk-num { font-weight: 800; font-size: .8rem; color: var(--accent); background: var(--accent-soft); border-radius: 8px; padding: .3rem .5rem; white-space: nowrap; }
.week.complete .wk-num { background: var(--ok); color: #fff; }
.week.current { border-color: var(--accent); }
.wk-title { font-weight: 600; }
.wk-meta { font-size: .8rem; color: var(--muted); }
.wk-prog { font-weight: 700; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.week-body { padding: 0 1.1rem 1.1rem; border-top: 1px solid var(--border); }
.goal { margin: .9rem 0; color: var(--muted); }
.task { display: grid; grid-template-columns: auto 1fr; gap: .75rem; padding: .6rem 0; border-bottom: 1px dashed var(--border); align-items: start; }
.task:last-of-type { border-bottom: 0; }
.task input[type="checkbox"] { width: 20px; height: 20px; margin-top: .15rem; accent-color: var(--accent); cursor: pointer; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-title { font-weight: 500; }
.task-meta { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .25rem; }
.pill { font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: 99px; background: var(--surface-2); color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.pill.watch { color: #e5484d; } .pill.read { color: #0091ff; } .pill.course { color: #8e4ec6; }
.pill.do { color: #12a150; } .pill.build { color: #f76b15; } .pill.opt { color: var(--muted); font-style: italic; }
.deliverable { margin-top: .9rem; padding: .75rem .9rem; border-radius: 10px; background: var(--accent-soft); font-size: .92rem; }
.notes { margin-top: .9rem; }
.notes label { font-weight: 600; font-size: .85rem; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.toolbar label { display: flex; gap: .4rem; align-items: center; font-size: .9rem; color: var(--muted); cursor: pointer; }
.toolbar input[type="checkbox"] { width: auto; accent-color: var(--accent); }

/* ---------- Library ---------- */
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface); padding: .35rem .8rem; border-radius: 99px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.lib { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 1rem; }
.res { display: flex; flex-direction: column; gap: .4rem; }
.res a.title { font-weight: 700; color: var(--text); }
.stars { color: #f5a524; letter-spacing: .1em; font-size: .85rem; }
.avoid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.avoid .card { border-left: 4px solid var(--danger); }

/* ---------- Log ---------- */
.log-form { display: grid; grid-template-columns: 160px 120px 1fr auto; gap: .6rem; align-items: end; }
.log-form label { display: grid; gap: .3rem; font-weight: 600; font-size: .85rem; }
.log-list { list-style: none; padding: 0; margin: 0; }
.log-list li { display: grid; grid-template-columns: 110px 80px 1fr auto; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--border); align-items: center; }
.log-list li:last-child { border-bottom: 0; }

/* ---------- Settings ---------- */
.settings { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

/* ---------- Toast & confetti ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 120px); z-index: 50;
  background: var(--text); color: var(--bg); padding: .7rem 1.1rem; border-radius: 12px; font-weight: 600;
  box-shadow: var(--shadow); transition: transform .25s, visibility .25s; max-width: calc(100vw - 32px); visibility: hidden;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

/* ---------- Landing ---------- */
.landing { overflow-x: hidden; }
.lp-wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.lp-wrap.narrow { max-width: 680px; }
.center { text-align: center; }
.lp-nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.lp-nav-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 62px; }
.lp-links { display: flex; gap: 1.4rem; }
.lp-links a { color: var(--muted); font-weight: 500; font-size: .93rem; }
.lp-links a:hover { color: var(--text); text-decoration: none; }
.btn.lg { padding: .85rem 1.4rem; font-size: 1rem; border-radius: 12px; }
a.btn:hover { text-decoration: none; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: .3rem .7rem; border-radius: 99px; }

.hero { position: relative; min-height: calc(100vh - 62px); display: flex; align-items: center; overflow: hidden;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, var(--accent-soft), transparent 70%); }
#netCanvas { position: absolute; inset: 0; opacity: .55; }
.hero-in { position: relative; text-align: center; padding-top: 4rem; padding-bottom: 4rem; pointer-events: none; }
.hero-in .btn, .hero-in a { pointer-events: auto; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4.2rem); line-height: 1.05; letter-spacing: -.035em; margin: 1.2rem 0; }
.grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: clamp(1.02rem, 2vw, 1.22rem); color: var(--muted); max-width: 640px; margin: 0 auto; }
.rotator { color: var(--text); font-weight: 700; }
.caret { display: inline-block; width: 2px; height: 1.1em; background: var(--accent); vertical-align: -0.15em; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-cta { justify-content: center; margin: 2rem 0 2.2rem; }
.hero-tags { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center; max-width: 720px; margin: 0 auto; }
.hero-tags.left { justify-content: flex-start; margin: 0; }
.hero-tags span { font-size: .8rem; font-weight: 600; padding: .3rem .7rem; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }

.lp-section { padding: 5.5rem 0; }
.lp-section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.lp-h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); font-weight: 800; letter-spacing: -.025em; margin: .8rem 0 .6rem; }
.lp-lead { color: var(--muted); font-size: 1.05rem; max-width: 640px; margin: 0 0 2rem; }
.center .lp-lead { margin-left: auto; margin-right: auto; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.fact { display: flex; flex-direction: column; gap: .6rem; padding: 1.4rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); transition: transform .2s, border-color .2s; }
.fact:hover { transform: translateY(-4px); border-color: var(--accent); text-decoration: none; }
.fact-num { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; color: var(--accent); line-height: 1; }
.fact-txt { font-size: .95rem; }
.fact-src { margin-top: auto; font-size: .78rem; color: var(--muted); font-weight: 600; }

.uses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.use { text-align: left; font: inherit; color: var(--text); cursor: pointer; display: flex; flex-direction: column; gap: .35rem; padding: 1.4rem; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border); transition: transform .2s, border-color .2s, box-shadow .2s; }
.use:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.use-icon { font-size: 2rem; transition: transform .3s; }
.use:hover .use-icon { transform: scale(1.15) rotate(-6deg); }
.use-title { font-weight: 700; font-size: 1.05rem; }
.use-blurb { color: var(--muted); font-size: .92rem; }
.use-projects { margin: 0; padding-left: 1.1rem; font-size: .9rem; overflow: hidden; max-height: 0; transition: max-height .35s ease, margin .35s; }
.use.open .use-projects { max-height: 200px; margin: .4rem 0; }
.use.open { border-color: var(--accent); }
.use-projects li { margin: .2rem 0; }
.use-more { margin-top: auto; font-size: .82rem; font-weight: 700; color: var(--accent); }

.impact-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1.2rem 0 1.5rem; }
.impact-tabs .chip { font-size: .95rem; padding: .5rem 1.1rem; }
.impact-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.impact-card { display: flex; gap: 1rem; padding: 1.3rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); animation: fadeUp .35s ease both; }
.impact-card:nth-child(2) { animation-delay: .05s; } .impact-card:nth-child(3) { animation-delay: .1s; } .impact-card:nth-child(4) { animation-delay: .15s; }
.impact-card p { margin: .2rem 0 0; font-size: .93rem; }
.impact-ic { font-size: 1.8rem; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }

.path { display: grid; grid-template-columns: 320px 1fr; gap: 1.5rem; align-items: start; }
.path-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; position: relative; }
.path-step { width: 100%; display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; border-radius: 12px; border: 1px solid transparent; background: transparent; font: inherit; color: var(--muted); font-weight: 600; text-align: left; cursor: pointer; transition: background .15s, color .15s; }
.path-step:hover { background: var(--bg); color: var(--text); }
.path-step.active { background: var(--bg); border-color: var(--c); color: var(--text); }
.path-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.path-step.active .path-ic { background: var(--c); }
.path-detail { position: sticky; top: 80px; min-height: 380px; animation: fadeUp .3s ease; }
.path-detail h4 { margin: 1.2rem 0 .5rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.path-big { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.6rem; flex: none; }
.topic-list { columns: 2; gap: 1.5rem; margin: 0; padding-left: 1.1rem; }
.topic-list li { margin: .25rem 0; break-inside: avoid; }

.quiz { padding: 1.8rem; }
.quiz-prog { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-bottom: 1.2rem; }
.quiz-prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s; }
.quiz-q { font-size: 1.3rem; margin: .4rem 0 1.1rem; }
.quiz-opts { display: grid; gap: .6rem; }
.quiz-opt { text-align: left; font: inherit; font-weight: 600; padding: .9rem 1.1rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer; transition: border-color .15s, transform .1s; }
.quiz-opt:hover { border-color: var(--accent); transform: translateX(4px); }
.quiz-result { text-align: center; animation: fadeUp .35s ease; }
.quiz-result .path-big { margin: 0 auto .8rem; }

.steps3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
.step-n { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); margin-bottom: .8rem; }
.steps3 p { margin: .3rem 0 0; }
.lp-final { padding: 6rem 0; background: radial-gradient(ellipse 70% 80% at 50% 100%, var(--accent-soft), transparent 70%); }
.lp-foot { padding: 1.5rem 0; border-top: 1px solid var(--border); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .uses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .path { grid-template-columns: 1fr; }
  .path-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .path-detail { position: static; min-height: 0; }
  .lp-links { display: none; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; padding: .6rem 16px; gap: .75rem; overflow-x: auto; }
  .sidebar .brand, .sidebar-foot #whoami { display: none; }
  #nav { display: flex; gap: .15rem; }
  #nav a { padding: .45rem .6rem; font-size: .85rem; white-space: nowrap; }
  #nav a span { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; }
  .main { padding: 1.25rem 16px 3rem; }
  .log-form { grid-template-columns: 1fr 1fr; }
  .log-form .note-field, .log-form button { grid-column: 1 / -1; }
  .log-list li { grid-template-columns: 90px 60px 1fr auto; font-size: .9rem; }
}
@media (max-width: 600px) {
  .facts, .uses, .impact-panel, .steps3 { grid-template-columns: 1fr; }
  .topic-list { columns: 1; }
  .lp-section { padding: 3.5rem 0; }
  .path-name { font-size: .85rem; }
}
@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr; }
  .path-steps { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
