/* ============ Tokens ============ */
:root {
  color-scheme: light;

  --ink: #16213e;
  --ink-soft: #2c3a5e;
  --paper: #faf3e6;
  --paper-raised: #f2e6d0;
  --paper-line: #e2d3b3;
  --amber: #dd9a2e;
  --amber-deep: #b9791c;
  --teal: #1c7c72;
  --teal-deep: #145d55;
  --text: #232a3d;
  --text-muted: #5b6478;
  --white: #fffdf8;

  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  --content-width: 1120px;
  --content-width-narrow: 720px;
  --radius: 14px;
  --shadow-card: 0 18px 40px -22px rgba(22, 33, 62, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.15;
  text-wrap: balance;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }

p { margin: 0 0 1em; }
a { color: inherit; }

.wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
}
.wrap-narrow { max-width: var(--content-width-narrow); }

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--ink);
  color: var(--white);
  padding: 12px 18px;
  border-radius: 8px;
  z-index: 100;
}
.skip-link:focus {
  left: 24px;
  top: 16px;
}

:focus-visible {
  outline: 3px solid var(--amber-deep);
  outline-offset: 3px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-deep);
  margin: 0 0 0.8em;
}
.eyebrow-light { color: #9fd8cf; }

.section-lede {
  max-width: 640px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border-radius: 999px;
  padding: 14px 26px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow-card);
}
.btn-primary:hover { background: var(--ink-soft); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover { background: rgba(22, 33, 62, 0.06); }
.btn-small { padding: 10px 20px; font-size: 0.9rem; }
.btn-wide { width: 100%; padding: 16px 26px; font-size: 1.02rem; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 243, 230, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--paper-line);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding-top: 16px;
  padding-bottom: 16px;
  flex-wrap: wrap;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--ink);
}
.logo span { color: var(--amber-deep); }
.main-nav {
  display: flex;
  gap: 28px;
  font-size: 0.95rem;
  font-weight: 500;
}
.main-nav a { text-decoration: none; color: var(--text); }
.main-nav a:hover { color: var(--ink); }

@media (max-width: 760px) {
  .header-row { justify-content: center; text-align: center; }
  .main-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 0.88rem;
  }
}

/* ---- Language switch ---- */
.lang-switch {
  display: inline-flex;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  flex: none;
}
.lang-btn {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink);
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.lang-btn:hover { background: rgba(22, 33, 62, 0.08); }
.lang-btn.is-active {
  background: var(--ink);
  color: var(--white);
}

/* ============ Hero ============ */
.hero { padding: 64px 0 88px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
.hero-lede { font-size: 1.08rem; color: var(--text-muted); max-width: 46ch; }
.hero-copy em { font-style: italic; color: var(--amber-deep); }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
}

/* ---- Hero photo + score card (hero visual) ---- */
.hero-visual { display: flex; flex-direction: column; align-items: center; gap: 14px; }

.hero-photo {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--paper-line);
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
}

.score-card {
  width: 100%;
  max-width: 400px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 26px 26px 20px;
  transform: rotate(-2deg);
  border: 1px solid var(--paper-line);
}
.score-card-overlap {
  margin-top: -64px;
  position: relative;
  z-index: 2;
}
.score-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px dashed var(--paper-line);
  padding-bottom: 14px;
  margin-bottom: 18px;
}
.score-card-code { color: var(--amber-deep); font-weight: 600; }

.score-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.score-row {
  display: grid;
  grid-template-columns: 74px 1fr 34px;
  align-items: center;
  gap: 12px;
}
.score-label { font-size: 0.86rem; font-weight: 600; color: var(--ink); }
.score-track {
  position: relative;
  height: 8px;
  background: var(--paper-raised);
  border-radius: 999px;
  overflow: visible;
}
.score-fill {
  position: absolute;
  inset: 0;
  width: var(--val);
  background: var(--teal);
  border-radius: 999px;
}
.score-threshold {
  position: absolute;
  left: var(--pos);
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: var(--ink);
}
.score-threshold::after {
  content: "min";
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--text-muted);
}
.score-grade {
  font-family: var(--font-mono);
  font-weight: 600;
  text-align: right;
  color: var(--teal-deep);
}
.score-grade.below { color: var(--amber-deep); }

.score-card-foot { border-top: 1px dashed var(--paper-line); padding-top: 14px; margin-top: 18px; }
.dash-line { display: none; }
.score-card-foot p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
.visual-caption { font-size: 0.8rem; color: var(--text-muted); font-style: italic; }

/* ============ Generic section ============ */
.section { padding: 84px 0; }
.section-dark {
  background: var(--ink);
  color: #dfe6f5;
}
.section-dark h2 { color: var(--white); }

/* ============ Pain points ============ */
.section-pain { padding-top: 56px; padding-bottom: 56px; }
.section-pain h2 { max-width: 20ch; }
.pain-list {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  border-top: 1px solid var(--paper-line);
}
.pain-item {
  position: relative;
  padding: 22px 0 22px 30px;
  border-bottom: 1px solid var(--paper-line);
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink-soft);
  line-height: 1.4;
}
.pain-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 28px;
  width: 14px;
  height: 2px;
  background: var(--amber-deep);
}
.pain-item em { font-style: italic; color: var(--amber-deep); }

/* ============ Sub-tests ============ */
.subtest-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 40px;
}
.subtest-card {
  background: var(--white);
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  padding: 26px 22px;
}
.subtest-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber-deep);
  margin-bottom: 10px;
}
.subtest-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.subtest-card p { color: var(--text-muted); font-size: 0.94rem; margin: 0; }

@media (max-width: 980px) {
  .subtest-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .subtest-grid { grid-template-columns: 1fr; }
}

/* ============ Destinations ============ */
.destination-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin-top: 40px;
  border-radius: var(--radius);
  overflow: hidden;
}
.destination-card {
  background: #1c2a4d;
  padding: 26px 22px;
}
.destination-card h3 { color: var(--white); font-size: 1.05rem; margin-bottom: 6px; }
.destination-card p { color: #a8b3cf; font-size: 0.9rem; margin: 0; }

.fine-note { font-size: 0.85rem; color: #a8b3cf; margin-top: 28px; max-width: 640px; }
.section-dark .fine-note { color: #8b96b8; }

@media (max-width: 980px) {
  .destination-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .destination-grid { grid-template-columns: 1fr; }
}

/* ============ Program ============ */
.program-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 32px;
  margin-top: 40px;
}
.program-item h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}
.program-item h3::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  flex: none;
}
.program-item p { color: var(--text-muted); font-size: 0.94rem; margin: 0; }

@media (max-width: 900px) {
  .program-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .program-grid { grid-template-columns: 1fr; }
}

/* ============ FAQ ============ */
.faq-list { margin-top: 32px; border-top: 1px solid var(--paper-line); }
.faq-item {
  border-bottom: 1px solid var(--paper-line);
  padding: 4px 0;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  padding: 18px 32px 18px 0;
  position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 16px;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--amber-deep);
  transition: transform 0.15s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { color: var(--text-muted); padding-bottom: 18px; max-width: 62ch; }

/* ============ Register ============ */
.section-register { background: var(--paper-raised); }
#register-form { margin-top: 36px; }
.form-row { margin-bottom: 20px; display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-weight: 600; font-size: 0.92rem; color: var(--ink); }
.form-row input, .form-row select {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 13px 14px;
  border-radius: 9px;
  border: 1.5px solid var(--paper-line);
  background: var(--white);
  color: var(--text);
}
.form-row input:focus, .form-row select:focus {
  border-color: var(--teal);
}
.form-row.has-error input,
.form-row.has-error select { border-color: #b3401f; }
.field-error {
  font-size: 0.85rem;
  color: #b3401f;
  margin: 0;
  min-height: 1.1em;
}
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-note { font-size: 0.85rem; color: var(--text-muted); margin-top: 14px; text-align: center; }

.error-summary {
  background: #fbeae4;
  border: 1px solid #e0a68f;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 28px;
}
.error-summary h3 { font-family: var(--font-body); font-size: 1rem; color: #7a2811; margin: 0 0 8px; }
.error-summary ul { margin: 0; padding-left: 20px; }
.error-summary a { color: #7a2811; text-decoration: underline; }

.form-success {
  background: var(--white);
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  padding: 32px;
  margin-top: 36px;
  text-align: center;
}
.form-success h3 { color: var(--teal-deep); }

/* ============ Footer ============ */
.site-footer {
  background: var(--ink);
  color: #a8b3cf;
  padding: 36px 0;
}
.footer-row p { margin: 0 0 6px; font-size: 0.88rem; }
.footer-row .fine-note { color: #7c88ab; margin-top: 4px; }
