:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --text: #0f1726;
  --muted: #5b6577;
  --line: #e3e8f0;
  --accent: #2f6bff;
  --accent-soft: #e6eeff;
  --ink: #111318;
  --ink-text: #ffffff;
  --hero-a: #dbe8ff;
  --hero-b: #a9c9ff;
  --t1: #1f9d6b; --t1-bg: #e3f6ee;
  --t2: #2f6bff; --t2-bg: #e6eeff;
  --t3: #8a4dff; --t3-bg: #f0e8ff;
  --t4: #c2410c; --t4-bg: #fdeee3;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0e14; --surface: #121722; --surface-2: #182030; --text: #e8ecf3; --muted: #9aa5b8;
    --line: #232c3d; --accent: #6d97ff; --accent-soft: #1b2847; --ink: #f2f4f8; --ink-text: #0b0e14;
    --hero-a: #13213d; --hero-b: #1d3a6e;
    --t1: #4fd1a0; --t1-bg: #10291f; --t2: #7ea3ff; --t2-bg: #16223d;
    --t3: #b592ff; --t3-bg: #241a3d; --t4: #ff9a62; --t4-bg: #33200f;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  --bg: #0b0e14; --surface: #121722; --surface-2: #182030; --text: #e8ecf3; --muted: #9aa5b8;
  --line: #232c3d; --accent: #6d97ff; --accent-soft: #1b2847; --ink: #f2f4f8; --ink-text: #0b0e14;
  --hero-a: #13213d; --hero-b: #1d3a6e;
  --t1: #4fd1a0; --t1-bg: #10291f; --t2: #7ea3ff; --t2-bg: #16223d;
  --t3: #b592ff; --t3-bg: #241a3d; --t4: #ff9a62; --t4-bg: #33200f;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img, svg { display: block; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

/* Nav */
.nav { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: var(--ink-text); display: grid; place-items: center; font-family: var(--serif); font-size: 20px; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; line-height: 1; }
.nav-links { display: none; gap: 28px; font-size: 14px; }
.nav-links a { text-decoration: none; color: var(--muted); }
.nav-links a:hover { color: var(--text); }
@media (min-width: 860px) { .nav-links { display: flex; } }
.nav-actions { display: flex; gap: 8px; align-items: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; font: 500 14px var(--sans); cursor: pointer; text-decoration: none; transition: transform .15s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn-ink { background: var(--ink); color: var(--ink-text); }
.btn-ink:hover { opacity: .9; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-lg { padding: 14px 24px; font-size: 15px; border-radius: 12px; }
.icon-btn { width: 38px; height: 38px; padding: 0; }

/* Hero */
.hero { margin: 16px auto 0; border-radius: 24px; background: radial-gradient(120% 90% at 50% 0%, var(--hero-a), var(--hero-b)); padding: 72px 20px 80px; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 64px 64px; opacity: .35; mask-image: radial-gradient(70% 60% at 50% 40%, #000, transparent); }
.hero > * { position: relative; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--line); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pill b { color: var(--text); font-weight: 600; }
h1, h2, h3 { letter-spacing: -.02em; margin: 0; }
.hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 7vw, 76px); line-height: 1.02; margin: 22px auto 18px; max-width: 900px; }
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto 30px; font-size: 17px; }
.hero-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 28px 0 0; }
.stats div { background: var(--surface); padding: 20px; text-align: center; }
.stats strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.1; }
.stats span { color: var(--muted); font-size: 13px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }

/* Sections */
section { padding: 88px 0 0; }
.eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 10px; }
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 4.5vw, 48px); line-height: 1.08; }
.section-head p { color: var(--muted); margin: 12px 0 0; }

/* Tier ladder */
.ladder { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .ladder { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .ladder { grid-template-columns: repeat(4, 1fr); } }
.tier-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; cursor: pointer; text-align: left; font: inherit; color: inherit; transition: border-color .15s, transform .15s; }
.tier-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.tier-card .rate { font-family: var(--serif); font-size: 30px; line-height: 1.1; }
.tier-card p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.tier-card .count { font-size: 13px; color: var(--muted); }
.tier-step { font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; width: fit-content; }
.badge.t1 { color: var(--t1); background: var(--t1-bg); }
.badge.t2 { color: var(--t2); background: var(--t2-bg); }
.badge.t3 { color: var(--t3); background: var(--t3-bg); }
.badge.t4 { color: var(--t4); background: var(--t4-bg); }

/* Domains */
.domains { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .domains { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1040px) { .domains { grid-template-columns: repeat(6, 1fr); } }
.domain { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; font: inherit; color: inherit; text-align: left; transition: border-color .15s; }
.domain:hover { border-color: var(--accent); }
.domain .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.domain b { font-size: 14px; font-weight: 600; line-height: 1.25; }
.domain span { font-size: 12px; color: var(--muted); }

/* Catalog */
.filters { display: grid; gap: 10px; grid-template-columns: 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
@media (min-width: 860px) { .filters { grid-template-columns: 2fr 1.4fr 1fr 1fr; align-items: center; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 500; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
input[type="range"] { padding: 0; background: none; border: 0; accent-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 6px 12px; font: 500 13px var(--sans); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--ink-text); border-color: var(--ink); }
.result-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 14px; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.job { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: border-color .15s, box-shadow .15s; text-align: left; font: inherit; color: inherit; }
.job:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.job h3 { font-size: 17px; font-weight: 600; line-height: 1.3; }
.job p { margin: 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.job-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--muted); }
.job-foot .pay { color: var(--text); font-weight: 600; font-size: 15px; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }

/* Calculator */
.calc { display: grid; gap: 24px; grid-template-columns: 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); }
@media (min-width: 860px) { .calc { grid-template-columns: 1.2fr 1fr; padding: 36px; } }
.calc-out { background: var(--surface-2); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.calc-out .big { font-family: var(--serif); font-size: clamp(44px, 7vw, 64px); line-height: 1; }
.calc-out small { color: var(--muted); }
.calc .field + .field { margin-top: 16px; }
.range-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }

/* Steps */
.steps { display: grid; gap: 12px; grid-template-columns: 1fr; counter-reset: s; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step .n { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.step h3 { font-size: 18px; margin: 10px 0 6px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

.why { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .why { grid-template-columns: repeat(3, 1fr); } }
.why div { padding: 20px; border-radius: var(--radius); background: var(--surface-2); }
.why b { display: block; margin-bottom: 4px; }
.why span { color: var(--muted); font-size: 14px; }

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 20px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 16px; color: var(--muted); }

.cta-band { margin: 88px auto 0; text-align: center; border-radius: 24px; background: var(--ink); color: var(--ink-text); padding: 64px 20px; }
.cta-band h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 5vw, 52px); }
.cta-band p { opacity: .7; margin: 10px auto 26px; max-width: 520px; }
.cta-band .btn { background: var(--ink-text); color: var(--ink); }

footer { padding: 48px 0 40px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 24px; }
footer a { text-decoration: none; margin-left: 18px; }

/* Modal */
dialog { border: 0; padding: 0; border-radius: 20px; background: var(--surface); color: var(--text); width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(8,12,20,.55); backdrop-filter: blur(3px); }
.modal-body { padding: 28px; overflow: auto; }
.modal-body h2 { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.1; margin: 10px 0 8px; }
.modal-body h4 { margin: 22px 0 8px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.modal-body ul { margin: 0; padding-left: 20px; }
.modal-body li { margin: 4px 0; }
.modal-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.modal-meta span { background: var(--surface-2); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 28px; border-top: 1px solid var(--line); }
.close-x { position: absolute; top: 14px; right: 14px; }

/* Apply page */
.apply-layout { display: grid; gap: 24px; grid-template-columns: 1fr; padding: 40px 0 0; }
@media (min-width: 960px) { .apply-layout { grid-template-columns: 1.6fr 1fr; align-items: start; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); }
@media (min-width: 720px) { .panel { padding: 32px; } }
.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: span 2; } }
.form-title { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 5vw, 48px); line-height: 1.05; margin-bottom: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check input { width: auto; margin-top: 3px; }
.selected-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.role-tag { display: inline-flex; gap: 6px; align-items: center; background: var(--accent-soft); color: var(--accent); padding: 4px 6px 4px 10px; border-radius: 999px; font-size: 13px; }
.role-tag button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
.success { text-align: center; padding: 40px 10px; }
.success .tick { width: 56px; height: 56px; border-radius: 50%; background: var(--t1-bg); color: var(--t1); display: grid; place-items: center; margin: 0 auto 16px; }
.side-list { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 14px; }
.side-list li { display: flex; gap: 12px; font-size: 14px; color: var(--muted); }
.side-list b { color: var(--text); display: block; }
.side-list .n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.error { color: #d92d20; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Accounts */
.auth-card { max-width: 460px; margin: 48px auto 64px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; margin: 24px 0 16px; }
.auth-card .btn-lg { width: 100%; }
.auth-card .success { padding: 16px 0; }
.dash-head { padding: 40px 0 24px; }
.dash-head p { margin: 4px 0 0; }
.progress { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .progress { grid-template-columns: repeat(3, 1fr); } }
.progress li { display: grid; grid-template-columns: 32px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.progress .dot { grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.progress li span:last-child { font-size: 13px; color: var(--muted); }
.progress li.done .dot { background: var(--t1-bg); color: var(--t1); }
.progress li.current { border-color: var(--accent); }
.progress li.current .dot { background: var(--accent); color: #fff; }
.progress li.locked { opacity: .6; }
.dash-grid { display: grid; gap: 16px; grid-template-columns: 1fr; padding-bottom: 24px; }
@media (min-width: 960px) { .dash-grid { grid-template-columns: 1.2fr 1fr; align-items: start; } }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { font-size: 20px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.app-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.app-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.app-list li:first-child { border-top: 0; }
.app-list li div { display: flex; flex-direction: column; gap: 2px; }
.test-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.app-list li div .small:not(.muted) { margin-top: 4px; }

/* Skills test */
.test-wrap { max-width: 780px; padding-bottom: 64px; }
.test-intro { margin-top: 40px; }
.test-intro .btn-lg { margin-top: 16px; }
.test-form { display: flex; flex-direction: column; gap: 14px; }
.question { border: 1px solid var(--line); margin: 0; }
.question legend { display: flex; flex-direction: column; gap: 4px; padding: 0; margin-bottom: 12px; float: left; width: 100%; }
.question legend + * { clear: both; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; cursor: pointer; }
.choice:hover { border-color: var(--accent); }
.choice input { width: auto; margin-top: 3px; accent-color: var(--accent); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.test-submit { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; position: sticky; bottom: 0; background: var(--bg); padding: 14px 0; border-top: 1px solid var(--line); }
.timer { font-variant-numeric: tabular-nums; font-weight: 600; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.timer.low { color: #d92d20; }
.gate { text-align: center; padding: 32px 8px; }
.gate p { max-width: 460px; margin: 8px auto 20px; }
