/* The Veda Challenge: styles.
   Layout: one narrow left-aligned column on deep navy; gold is reserved for
   the primary action, progress and category labels. */

@font-face {
  font-family: "Marcellus";
  src: url("../assets/fonts/marcellus-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("../assets/fonts/figtree-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* Color */
  --navy-deep: #071428;
  --navy: #0a1b36;
  --navy-raised: #12284c;
  --navy-line: #2a426b;
  --white: #ffffff;
  --mist: #b4c2d9;
  --gold: #d6b25e;
  --gold-bright: #e6c779;
  --correct: #7fd8a8;
  --wrong: #ff9f93;

  /* Type */
  --font-display: "Marcellus", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;

  --column: 31rem;
  --radius: 0.625rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background:
    radial-gradient(120% 60% at 85% 0%, #17335f 0%, rgba(23, 51, 95, 0) 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%) var(--navy-deep);
  background-attachment: fixed;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.5;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: calc(var(--column) + 2.5rem);
  flex: 1;
  margin-inline: auto;
  padding-block: 1.75rem 1.5rem;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ---------- header and footer ---------- */

/* White band so the navy Veda logo is shown in its own colors, unaltered */
.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--gold);
}
.brand {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: calc(var(--column) + 2.5rem);
  min-height: 5.5rem;
  margin-inline: auto;
  padding-block: 0.75rem;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.brand__logo { display: block; height: 4.5rem; width: auto; max-width: 100%; }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--navy);
}

.stage { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.site-footer { padding-top: 1rem; border-top: 1px solid var(--navy-line); }
.disclaimer {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--mist);
}

/* ---------- shared pieces ---------- */

.screen {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  min-width: 0;
  animation: rise 0.35s ease-out both;
}
.screen--landing { justify-content: center; flex: 1; gap: 1.5rem; padding-block: 1rem 2rem; }

h1, h2, h3, p, ol, dl, dd { margin: 0; }
h1:focus, h2:focus { outline: none; }

.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.75rem, 13vw, 4rem);
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-wrap: balance;
}
.display--small { font-size: clamp(2rem, 9vw, 2.75rem); }

.lede {
  max-width: 28rem;
  font-size: 1.1875rem;
  line-height: 1.45;
  color: var(--mist);
  text-wrap: pretty;
}

.actions { display: flex; flex-direction: column; gap: 0.75rem; width: 100%; }
.meta {
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  color: var(--mist);
}
.row { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.875rem 1.25rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.985); }
.btn--large { min-height: 4rem; font-size: 1.0625rem; }
.btn--primary { background: var(--gold); color: var(--navy-deep); }
.btn--primary:hover { background: var(--gold-bright); }
.btn--secondary { background: transparent; border-color: var(--gold); color: var(--white); }
.btn--secondary:hover { background: var(--navy-raised); }
.btn--tertiary { background: transparent; border-color: var(--navy-line); color: var(--white); }
.btn--tertiary:hover { border-color: var(--mist); }

.link {
  min-height: 2.75rem;
  padding: 0.5rem 0;
  border: 0;
  background: none;
  color: var(--white);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.3em;
  cursor: pointer;
}
.link:hover { color: var(--gold-bright); }

:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- question screen ---------- */

.progress { display: flex; flex-direction: column; gap: 0.5rem; width: 100%; }
.progress__label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
  font-variant-numeric: tabular-nums;
}
.progress__bar { display: flex; gap: 0.375rem; }
.progress__seg { flex: 1; height: 4px; border-radius: 2px; background: var(--navy-line); }
.progress__seg.is-done { background: var(--gold); }
.progress__seg.is-current { background: var(--white); }

.category {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.question {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 6.4vw, 1.875rem);
  line-height: 1.2;
  text-wrap: balance;
}

.answers {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  width: 100%;
  padding: 0;
  list-style: none;
}
.answer {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  min-height: 3.75rem;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--navy-line);
  border-radius: var(--radius);
  background: var(--navy-raised);
  color: var(--white);
  font: inherit;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.answer:hover:not(:disabled) { border-color: var(--gold); }
.answer:disabled { cursor: default; color: var(--mist); }
.answer__key {
  flex: none;
  width: 1.75rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--gold);
}
.answer__text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.answer__mark { flex: none; width: 1.25rem; font-weight: 700; text-align: center; }
.answer.is-correct { border-color: var(--correct); color: var(--white); }
.answer.is-correct .answer__mark, .answer.is-correct .answer__key { color: var(--correct); }
.answer.is-wrong { border-color: var(--wrong); color: var(--white); }
.answer.is-wrong .answer__mark, .answer.is-wrong .answer__key { color: var(--wrong); }

.feedback { display: flex; flex-direction: column; gap: 0.375rem; width: 100%; }
.feedback:empty { display: none; }
.feedback__verdict { font-weight: 700; }
.feedback.is-correct .feedback__verdict { color: var(--correct); }
.feedback.is-wrong .feedback__verdict { color: var(--wrong); }
.feedback__why { color: var(--mist); }

/* ---------- result screen ---------- */

.result__emoji { font-size: 3rem; line-height: 1; }
.report {
  width: 100%;
  border-top: 1px solid var(--navy-line);
  font-variant-numeric: tabular-nums;
}
.report > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--navy-line);
}
.report dt {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mist);
}
.report dd { font-weight: 600; text-align: right; }

.next-heading {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.cta-stack { display: flex; flex-direction: column; gap: 0.75rem; width: 100%; }

.cta-note {
  font-size: 0.9375rem;
  color: var(--mist);
  user-select: all;
  -webkit-user-select: all;
  overflow-wrap: anywhere;
}

/* A destination that has not been set yet in config.js */
.pending {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1.5px dashed var(--navy-line);
  border-radius: var(--radius);
}
.pending__label {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mist);
}
.pending__note { color: var(--white); }

/* ---------- motion ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  .btn, .answer { transition: none; }
}

/* ---------- larger screens ---------- */

@media (min-width: 48rem) {
  .page { padding-block: 2.5rem 2rem; gap: 2.5rem; }
  .brand { min-height: 6.5rem; }
  .brand__logo { height: 5.25rem; }
  .screen--landing { padding-block: 2rem 4rem; }
}
