:root {
  color-scheme: dark;
  --ink: #07080d;
  --navy: #031329;
  --panel: #12131b;
  --panel-2: #191b26;
  --panel-3: #222532;
  --line: #353847;
  --line-soft: rgba(255, 255, 255, .09);
  --text: #f8f7fb;
  --muted: #aaa9b6;
  --pink: #ff3b78;
  --pink-dark: #c91850;
  --yellow: #ffd447;
  --aqua: #8fd9d3;
  --gold: #caa66a;
  --ivory: #eee9dc;
  --green: #58d490;
  --red: #ff7070;
  --shadow: 0 24px 72px rgba(0, 0, 0, .46);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 59, 120, .13), transparent 32rem),
    radial-gradient(circle at 100% 88%, rgba(255, 212, 71, .07), transparent 28rem),
    var(--ink);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

button, input, select { font: inherit; }

button, select { touch-action: manipulation; }

a { color: inherit; }

.site-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(143, 217, 211, .18);
  background: rgba(3, 19, 41, .94);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 82px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 212, 71, .46);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 59, 120, .18), rgba(255, 212, 71, .08));
  color: var(--yellow);
  font-size: .84rem;
  font-weight: 950;
  letter-spacing: -.04em;
}

.brand-copy strong,
.brand-copy small { display: block; }

.brand-copy strong {
  font-size: 1.04rem;
  letter-spacing: .06em;
}

.brand-copy small {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 750;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.main-nav a {
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 800;
  text-decoration: none;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, .07);
  color: var(--text);
}

.language-switcher {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 999px;
  background: rgba(0, 0, 0, .34);
}

.language-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
}

.language-button:hover,
.language-button.is-active {
  border-color: rgba(255, 212, 71, .62);
  background: rgba(255, 255, 255, .09);
}

.language-button:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(255, 212, 71, .62);
  outline-offset: 3px;
}

.page-main { padding: 38px 0 70px; }

.selector-hero {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr);
  gap: 42px;
  align-items: center;
  min-height: calc(100vh - 180px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--pink);
  font-size: .8rem;
  font-weight: 950;
  letter-spacing: .19em;
  text-transform: uppercase;
}

.display-title {
  max-width: 700px;
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.6rem);
  line-height: .88;
  letter-spacing: -.075em;
}

.display-title span { color: var(--yellow); }

.lead {
  max-width: 620px;
  margin: 24px 0 0;
  color: #cbc9d2;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.brand-thought {
  margin: 28px 0 0;
  padding-left: 18px;
  border-left: 3px solid var(--pink);
  color: var(--ivory);
  font-size: 1rem;
  font-weight: 760;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.method-card {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(28, 30, 41, .98), rgba(15, 16, 23, .98));
  box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease;
}

.method-card:hover {
  transform: translateY(-3px);
  border-color: var(--pink);
}

.method-card::after {
  position: absolute;
  right: -28px;
  bottom: -58px;
  color: rgba(255, 255, 255, .035);
  content: attr(data-number);
  font-size: 9rem;
  font-weight: 950;
  line-height: 1;
}

.method-card .card-kicker {
  color: var(--yellow);
  font-size: .76rem;
  font-weight: 950;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.method-card h2 {
  margin: 12px 0 8px;
  font-size: 1.55rem;
  letter-spacing: -.035em;
}

.method-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
}

.card-arrow {
  position: absolute;
  z-index: 2;
  right: 22px;
  top: 22px;
  color: var(--pink);
  font-size: 1.4rem;
}

.page-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.page-intro h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  line-height: .95;
  letter-spacing: -.055em;
}

.page-intro p:not(.eyebrow) {
  max-width: 490px;
  margin: 0;
  color: var(--muted);
}

.trainer-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 19, 27, .97);
  box-shadow: var(--shadow);
}

.control-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #0d0e14;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-group label {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}

.control-group select {
  min-height: 46px;
  padding: 8px 38px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 800;
}

.trainer-content { padding: clamp(20px, 4vw, 38px); }

.problem-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 26px;
}

.problem-label {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.problem {
  margin: 0;
  font-size: clamp(2.4rem, 9vw, 5.4rem);
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  letter-spacing: -.05em;
  line-height: 1;
}

.problem .accent { color: var(--yellow); }

.task-badge {
  min-width: 150px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
  text-align: center;
}

.task-badge small,
.task-badge strong { display: block; }

.task-badge small { color: var(--muted); font-weight: 750; }
.task-badge strong { color: var(--yellow); font-size: 1.45rem; }

.section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.section:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 15px;
}

.section-heading h2 { margin: 0; font-size: 1.1rem; }
.section-heading p { margin: 0; color: var(--muted); font-size: .9rem; }

.fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.field label {
  min-height: 42px;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 760;
  line-height: 1.3;
}

.field input,
.field select {
  width: 100%;
  min-height: 54px;
  padding: 10px 13px;
  border: 2px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: #0b0c11;
  color: var(--text);
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.field input:focus,
.field select:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 4px rgba(255, 212, 71, .1);
}

.field input.correct { border-color: var(--green); }
.field input.wrong { border-color: var(--red); }

.feedback {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: .82rem;
  font-weight: 780;
}

.route-builder {
  display: grid;
  grid-template-columns: minmax(88px, 1fr) 74px minmax(88px, 1fr) 74px minmax(88px, 1fr) 34px minmax(108px, 1fr);
  gap: 9px;
  align-items: end;
}

.route-symbol {
  display: grid;
  min-height: 54px;
  place-items: center;
  color: var(--yellow);
  font-size: 1.35rem;
  font-weight: 950;
}

.route-builder .field label { min-height: 22px; }

.route-builder select {
  width: 100%;
  min-height: 54px;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #0b0c11;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 900;
}

.route-options {
  display: grid;
  grid-template-columns: minmax(190px, 280px) 1fr;
  gap: 14px;
  align-items: end;
  margin-top: 14px;
}

.route-preview {
  min-height: 48px;
  margin: 0;
  padding: 11px 14px;
  border: 1px dashed var(--line);
  border-radius: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button {
  min-height: 52px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 900;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}

.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { background: var(--pink); color: white; }
.button-primary:hover { background: var(--pink-dark); }
.button-secondary { border-color: var(--line); background: var(--panel-2); color: var(--text); }

.result {
  display: none;
  margin-top: 20px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-2);
}

.result.show { display: block; }
.result.success { border-color: var(--green); }
.result.failure { border-color: var(--red); }
.result h3 { margin: 0 0 6px; font-size: 1.02rem; }
.result.success h3 { color: var(--green); }
.result.failure h3 { color: #ffaaaa; }
.result p { margin: 0; color: var(--muted); }

.alternatives {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.alternative {
  padding: 12px 14px;
  border-left: 3px solid var(--yellow);
  border-radius: 7px 11px 11px 7px;
  background: rgba(0, 0, 0, .24);
  color: var(--ivory);
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #0d0e14;
}

.mode-option { position: relative; }
.mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.mode-option label {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
  text-align: center;
}

.mode-option input:checked + label {
  border-color: var(--pink);
  background: rgba(255, 59, 120, .13);
  color: var(--text);
}

.mode-option input:focus-visible + label {
  outline: 3px solid rgba(255, 212, 71, .55);
  outline-offset: 2px;
}

.hidden { display: none !important; }

.note {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: .9rem;
}

.ladder {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.ladder-step {
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, .025);
  color: var(--muted);
  font-size: .9rem;
}

.ladder-step strong { display: block; color: var(--text); }

.legal-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 34px;
}

.legal-nav {
  position: sticky;
  top: 110px;
  align-self: start;
  display: grid;
  gap: 6px;
}

.legal-nav a {
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.legal-nav a:hover { background: var(--panel-2); color: var(--text); }

.legal-content {
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.legal-section + .legal-section {
  margin-top: 34px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

.legal-section h1,
.legal-section h2 { margin-top: 0; }
.legal-section p,
.legal-section li { color: #c4c2cc; }
.legal-section strong { color: var(--text); }
.legal-warning {
  padding: 14px 16px;
  border: 1px solid rgba(255, 212, 71, .45);
  border-radius: 12px;
  background: rgba(255, 212, 71, .08);
  color: var(--ivory);
}

.site-footer {
  border-top: 1px solid rgba(143, 217, 211, .18);
  background: #050c17;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 26px;
  align-items: center;
  padding: 28px 0;
}

.sse-signet strong,
.sse-signet span { display: block; }
.sse-signet strong { color: var(--ivory); letter-spacing: .08em; }
.sse-signet span { color: var(--aqua); font-size: .78rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: end; gap: 14px; }
.footer-links a { color: var(--muted); font-size: .88rem; font-weight: 750; text-decoration: none; }
.footer-links a:hover { color: var(--text); }

@media (max-width: 900px) {
  .header-inner { grid-template-columns: 1fr auto; }
  .main-nav { display: none; }
  .selector-hero { grid-template-columns: 1fr; min-height: auto; }
  .display-title { max-width: 680px; }
  .page-intro { align-items: start; flex-direction: column; }
  .route-builder { grid-template-columns: 1fr 70px 1fr; }
  .route-builder > :nth-child(4) { grid-column: 1; }
  .route-builder > :nth-child(5) { grid-column: 2 / 4; }
  .route-builder > :nth-child(6) { display: none; }
  .route-builder > :nth-child(7) { grid-column: 1 / 4; }
  .legal-layout { grid-template-columns: 1fr; }
  .legal-nav { position: static; grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 680px) {
  .site-shell { width: min(100% - 18px, 1120px); }
  .header-inner { min-height: 72px; gap: 10px; }
  .brand-copy small { display: none; }
  .brand-mark { width: 39px; height: 39px; }
  .language-switcher { gap: 2px; padding: 3px; }
  .language-button { width: 36px; height: 36px; font-size: 1.2rem; }
  .page-main { padding-top: 25px; }
  .selector-hero { gap: 30px; }
  .method-grid { grid-template-columns: 1fr; }
  .method-card { min-height: 180px; }
  .problem-head { align-items: stretch; flex-direction: column; }
  .task-badge { text-align: left; }
  .fields,
  .fields.two,
  .fields.four { grid-template-columns: 1fr; }
  .field label { min-height: 0; }
  .section-heading { align-items: start; flex-direction: column; gap: 3px; }
  .mode-tabs { grid-template-columns: 1fr; }
  .actions { display: grid; grid-template-columns: 1fr; }
  .button { width: 100%; }
  .route-options { grid-template-columns: 1fr; }
  .ladder { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-content: start; }
  .legal-nav { grid-template-columns: 1fr; }
}
