:root {
  --ink: #1a1a2e;
  --muted: #5c5c5c;
  --paper: #f8f9fa;
  --white: #fff;
  --blue: #1565c0;
  --blue-dark: #0d47a1;
  --blue-light: #e3f2fd;
  --green: #2e7d32;
  --green-dark: #1b5e20;
  --green-light: #edf7ee;
  --purple: #5e35b1;
  --purple-dark: #4527a0;
  --purple-light: #f3e5f5;
  --amber: #fbbc04;
  --line: #e0e0e0;
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.site-header {
  height: 76px;
  padding: 0 clamp(24px, 6vw, 96px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid rgba(20, 39, 32, .07);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 800 24px/1 "Manrope", sans-serif;
  letter-spacing: -.8px;
}
.brand-mark {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  background: var(--green-dark);
  border-radius: 9px;
}
.brand-mark img { display: block; width: 72%; height: auto; }
nav { display: flex; gap: 34px; font-size: 14px; font-weight: 600; }
nav a:hover { opacity: .6; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.language-control {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
}
.language-control select { border: 0; background: transparent; color: var(--ink); font-weight: 700; outline: 0; cursor: pointer; }
.button {
  border: 0;
  border-radius: 999px;
  padding: 15px 24px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s, background .2s, opacity .2s;
}
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button-small { padding: 11px 18px; font-size: 13px; }
.button-light, .button-primary { background: var(--blue); color: white; }
.button-primary { padding: 17px 25px; }
.button-primary:hover { background: var(--blue-dark); }
.button-dark { background: var(--ink); color: white; display: flex; justify-content: space-between; width: 100%; }
.button-iq, .button-math, .button-chc { color: white; display: flex; justify-content: space-between; width: 100%; }
.button-iq { background: var(--blue-dark); }
.button-math { background: var(--green-dark); }
.button-chc { background: var(--purple-dark); }
.button-outline { border: 1px solid var(--line); background: transparent; width: 100%; }

.hero {
  min-height: 620px;
  padding: 110px 24px 90px;
  text-align: center;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: white;
  background: linear-gradient(180deg, #0a1f5c 0%, #1a4fa8 58%, #f0f5ff 100%);
}
.eyebrow, .kicker {
  text-transform: uppercase;
  letter-spacing: 1.8px;
  font-size: 11px;
  font-weight: 700;
}
.eyebrow { display: flex; align-items: center; gap: 9px; }
.eyebrow > span:first-child { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
h1, h2, h3 { font-family: "Manrope", sans-serif; margin: 0; }
h1 { font-size: clamp(52px, 6.2vw, 90px); line-height: .98; letter-spacing: -5px; margin: 28px 0; }
h1 em { color: #bbdefb; font-style: normal; }
.hero-copy { max-width: 580px; font-size: 19px; line-height: 1.6; color: rgba(255,255,255,.82); margin: 0; }
.hero-actions { display: flex; align-items: center; gap: 26px; margin-top: 34px; }
.text-link { font-weight: 700; border-bottom: 1px solid white; padding-bottom: 4px; }
.hero-note { margin-top: 30px; display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.8); font-size: 13px; }
.hero-note i { width: 3px; height: 3px; background: #a8b0ab; border-radius: 50%; }
.hero-orbit { position: absolute; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; pointer-events: none; }
.orbit-one { width: 680px; height: 680px; top: 28px; }
.orbit-two { width: 950px; height: 450px; top: 160px; }
.hero-symbol { position: absolute; font-size: 42px; color: rgba(255,255,255,.25); }
.symbol-one { left: 12%; top: 30%; transform: rotate(-12deg); }
.symbol-two { right: 14%; top: 25%; }
.symbol-three { right: 10%; bottom: 18%; transform: rotate(17deg); }
.hero > *:not(.hero-orbit):not(.hero-symbol) { position: relative; z-index: 1; }

.section { padding: 100px clamp(24px, 7vw, 110px); }
.tests-section { background: white; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 44px; gap: 30px; }
.section-heading h2, .how-section h2, .trust-section h2 { font-size: clamp(34px, 4vw, 56px); letter-spacing: -2.5px; line-height: 1.05; }
.section-heading > p { color: var(--muted); max-width: 380px; line-height: 1.6; }
.kicker { color: var(--blue); margin: 0 0 14px; }
.test-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.test-card { padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 420px; }
.test-card.iq-card { background: var(--blue-light); border-color: #bbdefb; }
.test-card.math-card { background: var(--green-light); border-color: #c8e6c9; }
.test-card.chc-card { background: var(--purple-light); border-color: #e1bee7; }
.card-topline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 45px; }
.card-icon { background: rgba(255,255,255,.75); width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; font-size: 27px; }
.tag { background: white; border-radius: 999px; padding: 7px 11px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; }
.tag.muted { background: #f0f1ed; color: var(--muted); }
.test-card h3 { font-size: 25px; }
.test-card > p { color: var(--muted); line-height: 1.55; }
.test-card ul { display: flex; gap: 18px; padding: 0; margin: 14px 0 28px; list-style: none; font-size: 12px; font-weight: 600; }
.test-card li + li::before { content: "·"; margin-right: 18px; color: #99a39f; }
.test-card .button { margin-top: auto; }

.how-section { padding: 100px clamp(24px, 7vw, 110px); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 55px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.steps > div { background: var(--paper); padding: 38px; min-height: 240px; }
.steps span { color: var(--blue); font-weight: 700; font-size: 12px; }
.steps h3 { font-size: 21px; margin: 48px 0 10px; }
.steps p { color: var(--muted); line-height: 1.6; margin: 0; }
.trust-section { background: var(--blue-dark); color: white; padding: 90px clamp(24px, 8vw, 130px); display: grid; grid-template-columns: 1fr 1fr; gap: 80px; }
.kicker.light { color: #bbdefb; }
.trust-copy { color: #c8d1cd; font-size: 18px; line-height: 1.65; }
.trust-points { display: grid; gap: 12px; margin-top: 30px; font-size: 14px; color: white; }
.trust-points span::first-letter { color: var(--amber); }
footer { padding: 46px clamp(24px, 7vw, 110px); display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
footer .brand { color: var(--ink); }

dialog { border: 0; padding: 0; }
dialog::backdrop { background: rgba(10, 31, 92, .72); backdrop-filter: blur(7px); }
.app-dialog { width: min(900px, calc(100% - 24px)); max-height: calc(100% - 24px); border-radius: 28px; background: var(--paper); overflow: hidden; }
.account-dialog { width: min(480px, calc(100% - 24px)); border-radius: 24px; background: white; padding: 38px; }
.dialog-close { position: absolute; top: 16px; right: 18px; width: 34px; height: 34px; border: 0; border-radius: 50%; font-size: 22px; cursor: pointer; }
.test-shell { height: min(720px, calc(100vh - 24px)); display: flex; flex-direction: column; overflow: hidden; }
.test-header { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.test-header .brand { font-size: 20px; margin-right: auto; }
/* Static so it cannot sit on top of the timer like the dialog-level close button. */
.test-header .dialog-close { position: static; flex: 0 0 auto; background: #eef0ec; }
.test-timer { font-variant-numeric: tabular-nums; background: var(--blue-light); color: var(--blue-dark); padding: 7px 13px; border-radius: 999px; font-size: 14px; }
.test-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.test-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .92); }
.test-progress { height: 4px; background: #e5e8e2; }
.test-progress span { display: block; height: 100%; background: var(--blue); transition: width .3s; }
.question-panel { width: min(680px, 100%); margin: auto; padding: 22px 24px 18px; }
.question-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.question-panel h2 { font-size: clamp(20px, 2.6vw, 28px); letter-spacing: -.8px; margin: 12px 0 14px; line-height: 1.3; }
.question-image { display: block; max-width: 100%; max-height: min(240px, 30vh); margin: 0 auto 16px; object-fit: contain; background: white; border-radius: 16px; padding: 10px; }
.options { display: grid; gap: 10px; }
.options-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Short answers pack into columns so a full option set fits without scrolling. */
.options-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.options-tight { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.option { text-align: left; padding: 13px 16px; border: 1px solid var(--line); background: white; border-radius: 12px; cursor: pointer; display: flex; gap: 12px; align-items: center; }
.option.option-image { flex-direction: column; align-items: stretch; }
.option.option-image img { width: 100%; max-height: 120px; object-fit: contain; }
.option:hover, .option.selected { border-color: var(--blue); background: var(--blue-light); }
.option b { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: 12px; flex: 0 0 auto; }
.picker-panel { width: min(860px, 100%); margin: auto; padding: 36px 28px; }
.picker-panel h2 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -1.6px; margin: 8px 0 12px; }
.picker-panel > p { color: var(--muted); line-height: 1.6; }
.picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.picker-card { background: white; border: 1px solid var(--line); border-radius: 20px; padding: 22px; text-align: left; }
.picker-card h3 { font-size: 22px; margin: 6px 0 8px; }
.picker-card p { color: var(--muted); margin: 0 0 16px; }
.paper-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.intro-panel, .result-panel { text-align: center; width: min(620px, 100%); margin: auto; padding: 40px 28px; }
.intro-panel .brain, .result-score { width: 120px; height: 120px; display: grid; place-items: center; margin: 0 auto 28px; border-radius: 50%; background: var(--blue); color: white; font: 800 44px "Manrope"; }
.intro-panel h2, .result-panel h2 { font-size: 40px; letter-spacing: -2px; }
.intro-panel p, .result-panel p { color: var(--muted); line-height: 1.65; }
.intro-facts { display: flex; justify-content: center; gap: 28px; margin: 30px 0; font-size: 13px; font-weight: 700; }
.score-bars { display: grid; gap: 13px; text-align: left; margin: 30px 0; }
.score-bar { display: grid; grid-template-columns: 150px 1fr 40px; align-items: center; gap: 12px; font-size: 12px; font-weight: 600; }
.bar-track { height: 8px; border-radius: 99px; background: #e4e8df; overflow: hidden; }
.bar-track span { display: block; height: 100%; border-radius: 99px; background: var(--blue); }
.dialog-brand { margin-bottom: 22px; }
.account-dialog h2 { font-size: 32px; letter-spacing: -1.4px; }
.tabs { display: flex; gap: 8px; margin: 24px 0; }
.tab { border: 0; padding: 9px 14px; border-radius: 999px; cursor: pointer; background: #f0f2ee; }
.tab.active { background: var(--blue); color: white; }
.form { display: grid; gap: 13px; }
.form label { font-size: 12px; font-weight: 700; }
.form input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 6px; }
.form .button { margin-top: 8px; }
.form-note { font-size: 12px; color: var(--muted); line-height: 1.5; }
.form-error { font-size: 13px; color: #d92d20; line-height: 1.5; }
.profile-results { margin-top: 24px; display: grid; gap: 10px; }
.result-row { background: var(--paper); padding: 15px; border-radius: 12px; display: flex; justify-content: space-between; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 120px); background: var(--ink); color: white; padding: 12px 18px; border-radius: 999px; z-index: 50; transition: transform .25s; font-size: 13px; }
#toast.show { transform: translate(-50%, 0); }

@media (max-width: 800px) {
  nav { display: none; }
  .site-header { padding: 0 18px; }
  .language-control { padding: 0 8px; }
  .hero { padding-top: 75px; min-height: 570px; }
  h1 { letter-spacing: -3px; }
  .hero-symbol { display: none; }
  .section-heading, footer { align-items: flex-start; flex-direction: column; }
  .test-grid, .steps, .trust-section, .picker-grid, .options-compact { grid-template-columns: 1fr; }
  .test-shell { height: calc(100vh - 24px); }
  .test-header, .test-footer { padding: 12px 14px; }
  .test-footer .button { flex: 1; }
  .question-panel { padding: 18px 16px 14px; }
  .trust-section { gap: 38px; }
  .steps > div { min-height: 190px; }
  .steps h3 { margin-top: 28px; }
  .test-card { min-height: 380px; }
  footer { gap: 18px; }
  .score-bar { grid-template-columns: 110px 1fr 34px; }
}
