/* One centred column, one question at a time, on the MiC deep green: the
   statement is the page, the answer scale sits under it and navigation just
   below that, the whole block centred in the window so it's all in view at
   once. Each question slides in from the side it comes from. */
:root {
  --ground: #124C3D;   /* brand deep green */
  --raised: #17604D;   /* answer options, cards */
  --line: #2A6B58;     /* hairlines, empty progress */
  --gold: #C4AC73;     /* brand gold: actions, selection */
  --taupe: #DAC5B4;    /* brand warm taupe: secondary text */
  --light: #F1F1F1;    /* brand off-white: body text */
  --muted: #A9BDB4;    /* receding text */
  --on-gold: #0E3A2F;  /* text on gold */
  --display: "Mulish", "Helvetica Neue", Arial, sans-serif;
  --body: "Libre Baskerville", Baskerville, Georgia, serif;
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.1rem;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* Layout rules (display: flex) would otherwise override the hidden attribute. */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--light);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.app {
  text-align: center;
  max-width: 50rem;
  margin: 0 auto;
  min-height: 100%;
  padding-inline: 16px;
  padding-block: 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.preview-note {
  font-family: var(--display);
  font-size: var(--step--1);
  color: var(--taupe);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1.5rem;
}

.screen { display: flex; flex-direction: column; gap: 1.75rem; }
/* Focus moves to each new question for screen readers; no ring for that. */
.screen:focus, [data-focus]:focus { outline: none; }

/* Labels and small print */
.eyebrow {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}
.small { font-family: var(--display); font-size: var(--step--1); color: var(--muted); margin: 0; }
.small a { color: var(--taupe); }

/* Welcome */
.mark {
  --mark: url("assets/mark.png?v=58e1484195");
  width: 104px; height: 104px;
  margin-inline: auto;
  background: var(--gold);
  -webkit-mask: var(--mark) center / contain no-repeat;
  mask: var(--mark) center / contain no-repeat;
}
.wordmark {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  font-size: var(--step--1);
  margin: 0;
}
h1, h2 {
  font-family: var(--body);
  font-weight: 400;
  text-wrap: balance;
  margin: 0;
  line-height: 1.25;
}
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
.lede { color: var(--taupe); margin: 0 auto; max-width: 47rem; font-size: 1.05rem; }
.guide { margin: 0 auto; max-width: 40rem; font-style: italic; color: var(--light); }
/* Question screens keep a reading-width column inside the wider page. */
.screen:not(.welcome) > * { width: 100%; max-width: 38rem; margin-inline: auto; }
.facts {
  font-family: var(--display); font-size: var(--step--1); color: var(--muted);
  letter-spacing: 0.04em; margin: 0;
}
.facts .sep { color: var(--gold); margin-inline: 0.6rem; }
.welcome { gap: 1.4rem; }

/* Progress */
.progress { display: flex; flex-direction: column; gap: 0.5rem; }
.progress-text {
  display: flex; justify-content: space-between; gap: 1rem;
  font-family: var(--display); font-size: var(--step--1); color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.bar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--gold); transition: width 0.3s ease; }

/* A statement */
.statement {
  font-size: var(--step-2);
  line-height: 1.4;
  margin: 0;
  min-height: 5.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-wrap: balance;
}

/* The 1-7 scale: wider circles at the ends, for a stronger answer */
.scale-wrap { display: flex; flex-direction: column; gap: 0.6rem; }
.scale {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: center;
  justify-items: center;
  gap: 0.25rem;
}
.point {
  --size: 2.3rem;
  width: var(--size); height: var(--size);
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: transparent;
  color: var(--taupe);
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.point[data-v="1"], .point[data-v="7"] { --size: 2.9rem; }
.point[data-v="2"], .point[data-v="6"] { --size: 2.55rem; }
.point[data-v="4"] { border-color: var(--muted); }
.point:hover { background: var(--raised); }
.point[aria-checked="true"] { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.scale-labels {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  font-family: var(--display); font-size: var(--step--1); color: var(--muted);
}
.scale-labels span:nth-child(2) { text-align: center; }
.scale-labels span:last-child { text-align: right; }

/* Two-option Deciders */
.options { display: grid; gap: 0.75rem; }
.option {
  text-align: center;
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.5;
  color: var(--light);
  background: var(--raised);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.option:hover { border-color: var(--gold); }
.option[aria-checked="true"] { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }

/* Forms */
.fields { display: grid; gap: 1.1rem; text-align: left; }
.fields .small { text-align: center; }
.name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 420px) { .name-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 0.35rem; min-width: 0; }
.field label {
  font-family: var(--display); font-weight: 600; font-size: var(--step--1);
  letter-spacing: 0.06em; color: var(--taupe);
}
.field input, .field select {
  font: inherit;
  font-family: var(--display);
  color: var(--light);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.7rem 0.8rem;
  width: 100%;
}
.field input[readonly] { color: var(--muted); }
.field input:focus, .field select:focus { border-color: var(--gold); outline: none; }
.ts { display: flex; justify-content: center; }
.ts:empty { display: none; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
a.btn { display: inline-block; text-decoration: none; }
.error { font-family: var(--display); font-size: var(--step--1); color: var(--gold); margin: 0; }

/* Navigation */
.nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.btn {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 6px;
  padding: 0.85rem 1.4rem;
  cursor: pointer;
  border: 2px solid var(--gold);
}
.btn-primary { background: var(--gold); color: var(--on-gold); }
.btn-primary:disabled { opacity: 0.4; cursor: default; }
.btn-quiet { background: transparent; color: var(--taupe); border-color: transparent; padding-inline: 0.25rem; }
.btn-quiet:hover { color: var(--light); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: center; }
.nav .actions { justify-content: flex-end; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--light);
  outline-offset: 3px;
}

/* Result (preview) */
.type {
  font-family: var(--display);
  font-weight: 700;
  font-size: 3.4rem;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin: 0;
  line-height: 1;
}
.dims { display: grid; gap: 1.1rem; margin: 0; }
.dim { display: grid; gap: 0.35rem; }
.dim-head {
  display: flex; justify-content: space-between; gap: 1rem;
  font-family: var(--display); font-size: var(--step--1); color: var(--taupe);
  font-variant-numeric: tabular-nums;
}
.dim-head strong { color: var(--light); font-weight: 700; }
.dim-bar { position: relative; height: 6px; background: var(--line); border-radius: 3px; }
.dim-bar > i { position: absolute; top: -4px; width: 3px; height: 14px; background: var(--gold); border-radius: 2px; transform: translateX(-50%); }
.dim-bar::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--muted); opacity: 0.6; }
.panel { background: var(--raised); border-radius: 8px; padding: 1rem 1.1rem; display: grid; gap: 0.5rem; min-width: 0; text-align: left; }
.panel p { margin: 0; }
.panel a { color: var(--gold); word-break: break-all; font-family: var(--display); font-size: var(--step--1); }
.panel pre {
  margin: 0; overflow-x: auto; font-size: 0.75rem; line-height: 1.5; color: var(--taupe);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
details summary { font-family: var(--display); font-size: var(--step--1); color: var(--taupe); cursor: pointer; }

/* Motion: a chosen answer pulses, then the next question slides in from the
   right (from the left when going back). */
@keyframes pulse { 0% { transform: scale(1); } 45% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes in-fwd { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes in-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes out-fwd { to { opacity: 0; transform: translateX(-28px); } }
@keyframes out-back { to { opacity: 0; transform: translateX(28px); } }
.chosen { animation: pulse 0.22s ease-out; }
/* While the results page loads: the mark breathes slowly. */
@keyframes breathe { 0%, 100% { opacity: 0.55; transform: scale(0.96); } 50% { opacity: 1; transform: scale(1); } }
.leaving .mark { animation: breathe 2.4s ease-in-out infinite; }
.fallback { opacity: 0; visibility: hidden; transition: opacity 1.2s ease, visibility 1.2s; }
.fallback.shown { opacity: 1; visibility: visible; }
.enter-fwd { animation: in-fwd 0.22s ease-out; }
.enter-back { animation: in-back 0.22s ease-out; }
.leave-fwd { animation: out-fwd 0.13s ease-in forwards; }
.leave-back { animation: out-back 0.13s ease-in forwards; }

/* Embedded in a page (makeitconscious.com/pda): size to the content so the
   frame can be fitted to it, rather than filling a fixed height. */
html.embedded { height: 100%; }
html.embedded body { height: auto; min-height: 100%; display: flex; flex-direction: column; justify-content: center; }
html.embedded .app { min-height: 0; width: 100%; padding-block: 1.5rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
