:root {
  --ink: #111411;
  --panel: #171b17;
  --paper: #f2f0e8;
  --muted: #aeb4ad;
  --acid: #d8ff39;
  --mint: #6bffb1;
  --orange: #ff673d;
  --line: rgba(242, 240, 232, 0.22);
  --mono: "IBM Plex Mono", monospace;
  --display: "Unbounded", sans-serif;
  --page: clamp(20px, 4vw, 72px);
}

* { box-sizing: border-box; }
html { color-scheme: dark; background: var(--ink); color: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(216,255,57,.04) 50%, transparent 50.2%),
    radial-gradient(circle at 76% 12%, rgba(107,255,177,.12), transparent 27%),
    var(--ink);
  font-family: var(--mono);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  z-index: 10;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
}

a, button { font: inherit; }
button { color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }
.skip-link {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--acid);
  color: var(--ink);
}
.skip-link:focus { top: 12px; }

.topbar {
  min-height: 82px;
  padding: 0 var(--page);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 36px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand { min-height: 44px; display: flex; align-items: center; gap: 12px; text-decoration: none; font: 600 18px var(--display); }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--acid); }
.topnav { justify-self: center; display: flex; gap: clamp(16px, 3vw, 38px); }
.topnav a, .login {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 10px 4px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
}
.topnav a:hover, .topnav a:focus-visible, .login:hover { color: var(--acid); }
.login-form, .logout-form, .hero-login-form { margin: 0; }
.login-form, .logout-form { justify-self: end; }
.login {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.auth-nav-status {
  justify-self: end;
  color: var(--acid);
  font-size: 11px;
  letter-spacing: .04em;
}

main { padding: 0 var(--page) 84px; }
.hero { min-height: 660px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: clamp(40px, 7vw, 120px); align-items: center; }
.hero-copy { padding: 68px 0; }
.eyebrow { margin: 0 0 18px; color: var(--acid); font-size: 12px; text-transform: uppercase; letter-spacing: .14em; }
h1 { margin: 0; font: 600 clamp(42px, 5.7vw, 86px)/1.04 var(--display); letter-spacing: -.055em; }
h1 span { color: transparent; -webkit-text-stroke: 1px rgba(242,240,232,.55); }
h2, h3 { font-family: var(--display); }
.lead { max-width: 720px; color: var(--muted); font-size: clamp(15px, 1.35vw, 19px); line-height: 1.7; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 20px; text-decoration: none; border: 1px solid var(--acid); }
.primary { color: var(--ink); background: var(--acid); font-weight: 600; }
.secondary { color: var(--paper); background: transparent; }
.primary[disabled] { cursor: not-allowed; opacity: .48; }
.hero-actions, .lesson-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 12px; }
.hero-login-form .primary { min-height: 53px; cursor: pointer; }
.quota, .status-muted { color: #7e877d; font-size: 11px; }

.mental-model, .track-card, .guide-section, .lab-state, .lab-grid > article, .lesson-body section {
  border: 1px solid var(--line);
  background: rgba(8, 11, 8, .72);
}
.mental-model { padding: 24px; }
.mental-model ol { list-style: none; margin: 0; padding: 0; }
.mental-model li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.mental-model b { color: var(--acid); }

.track-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.section-intro { grid-column: 1 / -1; }
.track-card { padding: 30px; }
.track-index { color: var(--acid); font: 600 42px var(--display); }
.stack-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0; border: 1px solid var(--line); }
.stack-strip span { padding: 18px; text-align: center; border-right: 1px solid var(--line); font-size: 12px; }
.stack-strip span:last-child { border-right: 0; }
.demo-panel, .lab-state { display: flex; justify-content: space-between; gap: 28px; align-items: center; padding: 30px; }

.page-head { max-width: 980px; padding: 72px 0 42px; }
.page-head h1, .lesson-body h1 { font-size: clamp(38px, 5vw, 72px); }
.guide-toc { display: flex; flex-wrap: wrap; gap: 10px; position: sticky; top: 0; z-index: 5; padding: 12px 0; background: var(--ink); }
.guide-toc a { padding: 9px 12px; border: 1px solid var(--line); text-decoration: none; font-size: 11px; }
.guide-section { margin: 18px 0; padding: clamp(24px, 4vw, 48px); scroll-margin-top: 70px; }
.compare-grid, .action-grid, .lab-grid, .three-questions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.action-grid, .three-questions { grid-template-columns: repeat(3, 1fr); }
.three-questions > h2 { grid-column: 1 / -1; }
.compare-grid article, .action-grid article, .three-questions article { padding: 20px; border: 1px solid var(--line); }
.notice { margin-top: 18px; padding: 16px; border-left: 3px solid var(--orange); background: rgba(255,103,61,.08); }

.lesson-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.lesson-list li { display: grid; grid-template-columns: 64px 1fr auto; gap: 20px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); }
.lesson-layout { display: grid; grid-template-columns: 210px minmax(0, 900px); gap: clamp(32px, 6vw, 92px); padding-top: 48px; }
.lesson-sidebar, .lesson-body { min-width: 0; }
.lesson-body h2 { overflow-wrap: anywhere; }
.lesson-sidebar { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 24px; align-self: start; font-size: 12px; }
.lesson-body section { margin: 18px 0; padding: clamp(22px, 4vw, 42px); }
pre { max-width: 100%; overflow: auto; padding: 18px; color: var(--mint); background: #090d0a; }
[role="tablist"] { display: flex; flex-wrap: wrap; gap: 8px; }
[role="tab"] { padding: 10px 12px; color: var(--muted); background: transparent; border: 1px solid var(--line); cursor: pointer; }
[role="tab"][aria-selected="true"] { color: var(--ink); background: var(--acid); border-color: var(--acid); }
.knowledge-check details { margin-top: 14px; }
.status-demo { color: var(--orange); font-weight: 600; letter-spacing: .12em; }

.auth-pending-shell {
  min-height: calc(100vh - 164px);
  display: grid;
  place-items: center;
  padding: 64px 0;
}
.auth-pending-card {
  width: min(100%, 980px);
  min-width: 0;
  padding: clamp(28px, 6vw, 68px);
  border: 1px solid var(--line);
  border-top-color: var(--acid);
  background:
    linear-gradient(115deg, rgba(216,255,57,.055), transparent 42%),
    rgba(8, 11, 8, .82);
}
.auth-pending-card-head {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-start;
}
.auth-pending-status {
  display: inline-flex;
  flex: none;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  color: var(--acid);
  border: 1px solid rgba(216,255,57,.42);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.auth-pending-status > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 4px rgba(216,255,57,.1);
}
.auth-pending-card h1 {
  max-width: 850px;
  margin-top: 42px;
  font-size: clamp(38px, 5vw, 68px);
  overflow-wrap: anywhere;
}
.auth-pending-card .lead { max-width: 700px; }
.auth-pending-steps { margin: 44px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.auth-pending-steps li {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.auth-pending-steps li > span { color: var(--acid); font-size: 11px; }
.auth-pending-steps strong { font-family: var(--display); font-size: clamp(15px, 2vw, 20px); }
.telegram-handle { color: var(--acid); overflow-wrap: anywhere; }
.auth-pending-steps p { margin: 8px 0 0; color: var(--muted); line-height: 1.6; }
.auth-pending-note {
  margin: 22px 0 0;
  color: #7e877d;
  font-size: 11px;
}

.dashboard-shell { max-width: 1280px; margin: 0 auto; padding: 70px 0 34px; }
.dashboard-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(36px, 8vw, 120px);
  align-items: end;
  padding-bottom: 44px;
}
.dashboard-head h1 { max-width: 900px; }
.identity-stamp {
  width: 178px;
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  gap: 10px;
  border: 1px solid var(--acid);
  border-radius: 50%;
  color: var(--acid);
  text-align: center;
  text-transform: uppercase;
  transform: rotate(5deg);
}
.identity-stamp > span { font: 600 34px var(--display); line-height: 1; }
.identity-stamp strong { font-size: 11px; line-height: 1.5; letter-spacing: .12em; }
.dashboard-status {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 0 18px;
  border: 1px solid var(--line);
  background: rgba(8, 11, 8, .72);
}
.dashboard-status > div { min-width: 0; padding: 18px 20px; border-right: 1px solid var(--line); }
.dashboard-status > div:last-child { border-right: 0; }
.dashboard-status dt {
  margin-bottom: 9px;
  color: #7e877d;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.dashboard-status dd { margin: 0; overflow-wrap: anywhere; font-size: 12px; }
.status-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(107,255,177,.1);
}
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 18px; }
.next-action-card, .increment-card { min-width: 0; border: 1px solid var(--line); background: rgba(8, 11, 8, .72); }
.next-action-card { padding: clamp(26px, 5vw, 54px); }
.next-action-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 70px;
  color: #7e877d;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.lesson-kicker { color: var(--acid); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.next-action-card h2 { max-width: 760px; margin: 12px 0; font-size: clamp(27px, 3.5vw, 48px); line-height: 1.12; }
.next-action-card > p:not(.lesson-kicker) { max-width: 680px; color: var(--muted); line-height: 1.7; }
.next-action-card .primary { margin-top: 24px; }
.increment-card { padding: clamp(24px, 3vw, 34px); border-top-color: var(--orange); }
.increment-label {
  display: inline-block;
  margin: 4px 0 38px;
  padding: 6px 8px;
  color: var(--orange);
  border: 1px solid rgba(255,103,61,.5);
  font-size: 10px;
}
.increment-card h2 { font-size: clamp(20px, 2.2vw, 30px); line-height: 1.25; }
.increment-card p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.text-link { display: inline-block; margin-top: 20px; color: var(--acid); font-size: 12px; }

footer { padding: 24px var(--page); display: flex; justify-content: space-between; color: #7e877d; border-top: 1px solid var(--line); font-size: 11px; }

@media (max-width: 900px) {
  .topbar { grid-template-columns: auto 1fr; }
  .topnav { grid-column: 1 / -1; justify-self: start; order: 3; padding-bottom: 14px; }
  .login { justify-self: end; }
  .hero, .lesson-layout { grid-template-columns: 1fr; }
  .lesson-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .track-grid, .lab-grid { grid-template-columns: 1fr; }
  .dashboard-head { align-items: start; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .stack-strip { grid-template-columns: 1fr; }
  .stack-strip span { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 620px) {
  .topnav { gap: 12px; overflow-x: auto; width: 100%; }
  .topnav a { white-space: nowrap; }
  h1 { font-size: 38px; }
  .hero { min-height: auto; padding: 28px 0 54px; }
  .hero-copy { padding: 22px 0 0; }
  .compare-grid, .action-grid, .three-questions { grid-template-columns: 1fr; }
  .demo-panel, .lab-state { align-items: stretch; flex-direction: column; }
  .lesson-list li { grid-template-columns: 42px 1fr; }
  .lesson-list li > :last-child { grid-column: 2; }
  .dashboard-head { grid-template-columns: 1fr; }
  .identity-stamp { width: 132px; }
  .dashboard-status { grid-template-columns: 1fr; }
  .dashboard-status > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .dashboard-status > div:last-child { border-bottom: 0; }
  .next-action-meta { margin-bottom: 42px; }
  .auth-pending-card-head { align-items: flex-start; flex-direction: column; }
  .auth-pending-card h1 { margin-top: 34px; }
}

@media (max-width: 390px) {
  :root { --page: 16px; }
  .topbar { gap: 18px; }
  .brand { font-size: 16px; }
  .brand-mark { width: 34px; height: 34px; }
  .topnav {
    flex-wrap: wrap;
    gap: 0 12px;
    overflow-x: visible;
    margin-right: 0;
    padding-right: 0;
  }
  .login { max-width: 112px; text-align: right; line-height: 1.35; }
  .dashboard-shell { padding-top: 44px; }
  .dashboard-head h1 { font-size: 34px; overflow-wrap: anywhere; }
  .dashboard-grid, .next-action-card, .increment-card { width: 100%; }
  .next-action-meta { align-items: flex-start; flex-direction: column; gap: 8px; }
  .next-action-card .primary { width: 100%; gap: 12px; }
  .auth-pending-shell { min-height: auto; padding: 44px 0; }
  .auth-pending-card { width: 100%; padding: 24px 20px; }
  .auth-pending-card h1 { font-size: 30px; }
  .auth-pending-steps li { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; }
  footer { gap: 18px; align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
