/* Decision Coin Flip — base styles.
 * Calm, minimal, adult. One accent. No gradients. No heavy shadows.
 * Dark mode default, light mode via prefers-color-scheme.
 */

:root {
  --paper: #14161a;
  --paper-2: #1b1e23;
  --ink: #ece7df;
  --ink-2: #b3aea5;
  --ink-3: #807a72;
  --rule: #2a2d32;
  --accent: #c7a26b;
  --accent-soft: #8a7045;
  --button-text-on-accent: #14161a;
  --max-width: 640px;
  --radius: 8px;
}

@media (prefers-color-scheme: light) {
  :root {
    --paper: #f7f3ec;
    --paper-2: #efe9df;
    --ink: #1c1d20;
    --ink-2: #4a4843;
    --ink-3: #7a7770;
    --rule: #d8d2c6;
    --accent: #8a6b3d;
    --accent-soft: #c7a26b;
    --button-text-on-accent: #f7f3ec;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
}

a:hover { text-decoration-color: var(--accent); }

.hidden { display: none !important; }

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

.page { padding: 64px 0 96px; }

.section { padding: 24px 0; }

.section-landing { padding-top: 80px; }

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 24px;
}

.hero-title {
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.15;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
  font-weight: 500;
}

.hero-sub {
  color: var(--ink-2);
  max-width: 36ch;
  margin: 0 0 16px;
}

.hero-aside {
  color: var(--ink-2);
  max-width: 36ch;
  margin: 0 0 32px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 12px;
}

.cta-note {
  color: var(--ink-3);
  font-size: 14px;
  margin: 8px 0 0;
}

/* Worked example on the landing. Restrained. No card, no image. */
.example {
  max-width: 36ch;
  margin: 40px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.example-label {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 18px;
}

.example-rows {
  margin: 0 0 16px;
}

.example-rows dt {
  color: var(--ink-3);
  font-size: 13px;
  margin-top: 14px;
}

.example-rows dt:first-of-type { margin-top: 0; }

.example-rows dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
}

.example-rows dd + dd { margin-top: 2px; }

.example-note {
  color: var(--ink-2);
  font-size: 14px;
  margin: 16px 0 0;
}

.primary-button {
  background: var(--accent);
  color: var(--button-text-on-accent);
  border: none;
  border-radius: var(--radius);
  padding: 14px 22px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease;
}

.primary-button:hover { background: var(--accent-soft); }

.secondary-button {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 14px 22px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}

.secondary-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.secondary-button:disabled,
.secondary-button.is-saved {
  cursor: default;
  opacity: 0.55;
}

.secondary-button:disabled:hover,
.secondary-button.is-saved:hover {
  border-color: var(--rule);
  color: var(--ink);
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--ink-3);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-button:hover { color: var(--accent); }

/* App shell -------------------------------------------------------- */

.section-app { padding-top: 16px; }

.step {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px;
  margin: 16px 0;
}

.step-title {
  font-size: clamp(22px, 3.5vw, 28px);
  margin: 0 0 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.step-progress {
  color: var(--ink-3);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.field-label {
  display: block;
  color: var(--ink-2);
  font-size: 14px;
  margin: 16px 0 6px;
}

.text-input {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
}

.text-input:focus {
  outline: none;
  border-color: var(--accent);
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.choice-button {
  flex: 1 1 0;
  min-width: 140px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}

.choice-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.choice-button.is-selected {
  background: var(--accent);
  color: var(--button-text-on-accent);
  border-color: var(--accent);
}

.result-prompt {
  margin-top: 24px;
  color: var(--ink-2);
}

.truth-label {
  margin: 0 0 8px;
  color: var(--ink-2);
}

.entry-error {
  color: var(--accent);
  font-size: 14px;
  margin: 12px 0 0;
}

/* Coin element. Calm, deliberate flip. No slot-machine flash.
 * The disc is a flat circle; rotateX makes it wink out edge-on and back as it
 * tumbles, which reads as "flipping" without needing front/back faces. */
.coin {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--accent);
  margin: 24px auto;
  opacity: 0.85;
  transform-origin: center;
}

.coin.is-flipping {
  animation: coin-flip 1.6s cubic-bezier(0.3, 0, 0.2, 1) forwards;
}

@keyframes coin-flip {
  from { transform: rotateX(0deg); }
  to   { transform: rotateX(1080deg); }
}

/* Local history --------------------------------------------------- */

.history-panel {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

.history-title {
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 12px;
  font-weight: 500;
}

.history-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  color: var(--ink-2);
  font-size: 14px;
}

.history-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}

/* Checkout status banner ----------------------------------------- */

.checkout-status {
  max-width: var(--max-width);
  margin: 16px auto;
  padding: 12px 24px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 14px;
}

/* Footer ---------------------------------------------------------- */

.page-footer {
  text-align: center;
  padding: 32px 24px 64px;
  color: var(--ink-3);
  font-size: 13px;
}

.footer-line { margin: 0 0 8px; }
.footer-links a { margin: 0 6px; }
