:root {
  color-scheme: dark;
  --bg: #0d0f14;
  --panel: #161a23;
  --panel-2: #1e2430;
  --border: #2a3140;
  --purple: #5b6472;
  --cyan: #06b6d4;
  --amber: #f59e0b;
  --text: #e7ebf2;
  --sub: #9aa4b5;
  --dim: #6b7585;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, select { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

.page { min-height: 100vh; padding: 0 0 60px; }
.container { width: min(680px, calc(100% - 36px)); margin: 0 auto; }
.intro { padding-top: 48px; }

.eyebrow { margin: 0 0 12px; color: var(--purple); font-size: 11px; letter-spacing: .25em; }
h1 { margin: 0 0 6px; color: #fff; font-size: 28px; line-height: 1.2; font-weight: 800; }
.lead { margin: 0 0 2px; color: var(--cyan); font-size: 14px; }
.credit { margin: 0 0 16px; color: var(--dim); font-size: 12.5px; }
.description { margin: 0 0 28px; color: var(--sub); font-size: 13px; line-height: 1.7; }
.seo-copy { margin: -8px 0 24px; padding: 14px 16px; border-left: 2px solid var(--cyan); background: rgba(6,182,212,.05); }
.seo-copy h2 { margin: 0 0 6px; color: var(--text); font-size: 14px; line-height: 1.45; }
.seo-copy p { margin: 0; color: var(--sub); font-size: 12px; line-height: 1.75; }
.noscript-copy { width: min(680px, calc(100% - 36px)); margin: 48px auto; padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--sub); line-height: 1.75; }
.noscript-copy h1 { margin-top: 0; color: var(--text); font-size: 24px; }

.card { margin-bottom: 20px; padding: 20px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
.field-label, .section-kicker { display: block; margin-bottom: 6px; color: var(--dim); font-size: 12px; }
.field-title { margin-bottom: 14px; color: var(--sub); font-size: 13px; }
select {
  width: 100%; margin: 6px 0 16px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--panel-2); color: var(--text); font-size: 14px;
}
select:last-child { margin-bottom: 0; }

.primary, .secondary, .option, .choice, .restart {
  border: 0; border-radius: 10px; cursor: pointer; transition: border-color .12s, background .12s, box-shadow .12s, transform .12s;
}
.primary { width: 100%; padding: 15px; background: linear-gradient(135deg, var(--purple), var(--cyan)); color: #fff; font-size: 16px; font-weight: 700; }
.primary:hover:not(:disabled), .secondary:hover, .restart:hover { filter: brightness(1.08); }
.primary:disabled { cursor: not-allowed; background: var(--panel-2); color: var(--dim); }
.quiz-header { position: sticky; top: 0; z-index: 5; padding: 16px 0 12px; border-bottom: 1px solid var(--border); background: rgba(13,15,20,.97); backdrop-filter: blur(9px); }
.status { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--sub); font-size: 12px; }
.pill { display: inline-block; padding: 2px 11px; border-radius: 11px; background: var(--cyan); color: #04222b; font-size: 12px; }
.pill.amber { background: var(--amber); color: #3a2600; }
.progress { height: 4px; overflow: hidden; border-radius: 4px; background: var(--panel-2); }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--purple), var(--cyan)); transition: width .2s ease; }
.quiz { padding-top: 28px; }
.question { margin: 0 0 20px; color: #fff; font-size: 18px; font-weight: 700; line-height: 1.5; }
.hint { margin: -8px 0 16px; color: var(--sub); font-size: 12px; line-height: 1.65; }
.notice { display: flex; gap: 11px; margin-bottom: 18px; padding: 12px 14px; border: 1.5px solid var(--amber); border-radius: 10px; background: rgba(245,158,11,.12); }
.notice-mark { display: grid; width: 20px; height: 20px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--amber); color: #3a2600; font-size: 13px; font-weight: 800; }
.notice strong { display: block; margin-bottom: 4px; color: var(--amber); font-size: 13.5px; }
.notice div { color: var(--text); font-size: 12.5px; line-height: 1.7; }

.options { display: grid; gap: 8px; }
.option, .choice { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 53px; padding: 12px 14px 12px 16px; border: 1.5px solid var(--border); background: var(--panel-2); color: var(--sub); text-align: left; font-size: 14px; line-height: 1.4; }
.option::before { position: absolute; top: 0; bottom: 0; left: 0; width: 4px; border-radius: 10px 0 0 10px; background: transparent; content: ""; }
.option.selected { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan); background: rgba(6,182,212,.20); color: var(--text); }
.option.selected::before { background: var(--cyan); }
.option .check, .choice .badge { flex: 0 0 auto; font-size: 15px; font-weight: 800; color: var(--cyan); }
.choice.first { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan); background: rgba(6,182,212,.20); color: var(--text); }
.choice.second { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); background: rgba(245,158,11,.18); color: var(--text); }
.choice.second .badge { color: var(--amber); }
.nav { display: flex; gap: 10px; margin-top: 28px; }
.secondary { padding: 13px 20px; border: 1px solid var(--border); background: transparent; color: var(--sub); font-size: 14px; }
.nav .primary { padding: 13px; font-size: 15px; }

.tie { padding-top: 48px; }
.tie .card { margin-top: 20px; }
.tie-question { margin: 0 0 20px; font-size: 18px; line-height: 1.5; }

.results { padding-top: 40px; }
.results h1 { font-size: 26px; }
.type-hero { margin: 22px 0 14px; padding: 20px; border: 1px solid var(--type, var(--cyan)); border-radius: 14px; background: var(--panel); box-shadow: 0 0 0 3px var(--type-soft, rgba(6,182,212,.13)); }
.type-code { color: var(--type, var(--cyan)); font-size: 32px; font-weight: 800; letter-spacing: .04em; }
.type-name { margin-top: 3px; color: var(--text); font-size: 15px; font-weight: 700; }
.type-group { margin-top: 8px; color: var(--sub); font-size: 12px; }
.narrative { margin: 0 0 13px; color: var(--sub); font-size: 13.5px; line-height: 1.85; }
.narrative:first-of-type { color: var(--text); font-weight: 700; }
.section-title { display: inline-block; margin: 22px 0 12px; padding: 4px 13px; border-radius: 4px; background: var(--type, var(--cyan)); color: #fff; font-size: 13px; font-weight: 700; }
.metric { margin-bottom: 12px; padding: 15px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.metric-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.metric-name { color: var(--type, var(--cyan)); font-size: 15px; font-weight: 800; }
.metric-value { color: var(--text); font-size: 12.5px; }
.metric-text { margin: 0; color: var(--sub); font-size: 12.5px; line-height: 1.75; }
.bars { display: grid; gap: 6px; margin-top: 12px; }
.bar-row { display: grid; grid-template-columns: 43px 1fr 22px; align-items: center; gap: 8px; font-size: 11px; color: var(--sub); }
.bar-track { height: 8px; overflow: hidden; border-radius: 4px; background: var(--bg); }
.bar { height: 100%; border-radius: inherit; background: var(--type, var(--cyan)); }
.selected-char { color: var(--cyan); font-weight: 700; }
.footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--sub); text-align: center; font-size: 12.5px; line-height: 1.9; }
.footer small { display: block; margin-top: 10px; color: var(--dim); font-size: 10.5px; letter-spacing: .08em; }
.restart { width: 100%; margin-top: 24px; padding: 13px; border: 1px solid var(--border); background: transparent; color: var(--sub); font-size: 14px; }
.loading { min-height: 100vh; display: grid; place-items: center; color: var(--sub); font-size: 14px; }

.back-home { position: fixed; top: 18px; left: max(18px, calc(50% - 340px)); z-index: 20; color: var(--sub); font-size: 12px; text-decoration: none; }
.back-home:hover { color: var(--cyan); }
.home-page { min-height: 100vh; background: #10131a; }
.home-container { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }
.site-nav { display: flex; align-items: center; justify-content: space-between; width: min(1120px, calc(100% - 48px)); height: 76px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-size: 17px; font-weight: 800; letter-spacing: .02em; text-decoration: none; }
.brand-mark { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: var(--cyan); color: #07181d; font-size: 16px; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { color: var(--sub); font-size: 13px; text-decoration: none; }
.nav-links a:hover { color: #fff; }
.home-hero { border-top: 1px solid rgba(42,49,64,.7); border-bottom: 1px solid var(--border); background: radial-gradient(circle at 80% 18%, rgba(6,182,212,.10), transparent 28%), #0d0f14; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); gap: 70px; align-items: center; min-height: 560px; padding: 76px 0 80px; }
.hero-copy h1 { max-width: 720px; margin: 0 0 20px; font-size: clamp(34px, 5vw, 58px); line-height: 1.1; letter-spacing: 0; }
.hero-lead { max-width: 640px; margin: 0; color: var(--sub); font-size: 15px; line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.home-primary, .home-secondary, .test-card-cta { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border-radius: 9px; font-size: 14px; font-weight: 700; text-decoration: none; }
.home-primary, .test-card-cta { background: var(--cyan); color: #06141a; }
.home-secondary { border: 1px solid var(--border); color: var(--text); }
.trust-row { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 34px; color: var(--dim); font-size: 12px; }
.trust-row strong { margin-right: 5px; color: var(--text); font-size: 19px; }
.hero-panel { padding: 28px; border: 1px solid #344052; border-radius: 14px; background: linear-gradient(150deg, #1a202b, #131720); box-shadow: 0 18px 50px rgba(0,0,0,.24); }
.panel-topline, .card-label { margin-bottom: 13px; color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.hero-panel h2 { margin: 0 0 10px; font-size: 26px; line-height: 1.25; }
.hero-panel p { margin: 0; color: var(--sub); font-size: 13.5px; line-height: 1.8; }
.test-meta, .test-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.test-meta span, .test-stats span { padding: 5px 9px; border: 1px solid var(--border); border-radius: 5px; color: var(--sub); font-size: 11px; }
.test-card-cta { width: 100%; }
.home-section { padding: 88px 0; }
.catalog-band { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #141820; }
.section-heading { max-width: 640px; margin-bottom: 32px; }
.section-heading .eyebrow { margin-bottom: 9px; }
.section-heading h2, .method-grid h2 { margin: 0; color: #fff; font-size: 31px; line-height: 1.2; }
.section-heading > p:last-child { margin: 10px 0 0; color: var(--sub); font-size: 14px; line-height: 1.7; }
.featured-grid { display: grid; grid-template-columns: 1.25fr .875fr .875fr; gap: 14px; }
.test-card { min-height: 260px; padding: 24px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel); }
.test-card.large { display: flex; flex-direction: column; border-color: #335765; background: linear-gradient(150deg, rgba(6,182,212,.08), var(--panel) 60%); }
.test-card h3 { margin: 0 0 10px; font-size: 21px; }
.test-card p { margin: 0; color: var(--sub); font-size: 13px; line-height: 1.75; }
.test-card.large .test-stats { margin-top: auto; }
.test-card.large a { align-self: flex-start; color: var(--cyan); font-size: 13px; font-weight: 700; text-decoration: none; }
.test-card.muted { opacity: .72; }
.test-card.muted .card-label { color: var(--dim); }
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.category-card { min-height: 160px; padding: 20px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); text-decoration: none; }
.category-card.active { border-color: #267388; background: rgba(6,182,212,.08); }
.category-card > span { color: var(--cyan); font-size: 11px; font-weight: 800; }
.category-card h3 { margin: 27px 0 7px; font-size: 17px; }
.category-card p { margin: 0; color: var(--sub); font-size: 12px; line-height: 1.65; }
.method-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 100px; }
.method-list { display: grid; gap: 22px; }
.method-list > div { padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.method-list h3 { margin: 0 0 7px; color: var(--text); font-size: 16px; }
.method-list p { margin: 0; color: var(--sub); font-size: 13px; line-height: 1.7; }

@media (max-width: 440px) {
  .container { width: min(100% - 28px, 680px); }
  .intro { padding-top: 34px; }
  h1 { font-size: 25px; }
  .card { padding: 16px; }
  .question { font-size: 17px; }
  .option, .choice { min-height: 50px; font-size: 13.5px; }
}

@media (max-width: 760px) {
  .site-nav { width: min(100% - 28px, 1120px); height: 64px; }
  .nav-links { display: none; }
  .home-container { width: min(100% - 28px, 1120px); }
  .hero-grid, .method-grid { grid-template-columns: 1fr; gap: 34px; min-height: 0; padding: 54px 0 60px; }
  .hero-copy h1 { font-size: 36px; }
  .hero-panel { padding: 22px; }
  .home-section { padding: 60px 0; }
  .featured-grid, .category-grid { grid-template-columns: 1fr; }
  .test-card { min-height: 0; }
  .category-card { min-height: 125px; }
  .category-card h3 { margin-top: 16px; }
  .back-home { position: static; display: block; width: min(100% - 28px, 680px); margin: 14px auto -26px; }
}
