/* Village web — shared styles.
   Mirrors DesignSystem.swift (2026-10-24 vibrancy pass): the page is Warm
   Taupe, cards are warm white, Dusty Blue and Clay Red share the accents.
   On the taupe page: cream text, Dusty Blue main action with deep ink, rose
   (clay's on-page value) for small accents. Inside white cards: deep taupe
   text, Clay Red action with cream ink, Dusty Blue selections.
   Type: Nothing You Could Do for the handwritten accent; the system face for
   everything else (as in the app), with Poppins where there is no SF. */

@font-face {
  font-family: "Nothing You Could Do";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/NothingYouCouldDo-Regular.ttf") format("truetype");
}
@font-face { font-family: "Poppins"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/Poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap; src: url("/assets/Poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/Poppins-600.woff2") format("woff2"); }

:root {
  /* the taupe page */
  --page: #5A4D3E;            /* Warm Taupe, as delivered */
  --page-ink: #FBF4EA;        /* taupe (dark value): primary text on the page */
  --page-ink-2: #EFDFD0;      /* warmGray (dark value) */
  --page-ink-3: #E0CCBA;      /* softTaupe (dark value) */
  --page-link: #B9CAE0;       /* dusk (dark value) */
  --page-rose: #F2BDB2;       /* clay (dark value): accents on the page */
  --page-track: #7C6D5C;      /* sand (dark value) */
  --action-page: #8FA6C3;     /* Dusty Blue main action on the page */
  --on-action-page: #2E261F;

  /* white cards */
  --card: #FFFDF9;
  --ink: #3A3027;
  --ink-2: #4E4337;
  --ink-3: #5C5145;
  --sand-soft: #F4EEE8;
  --dusty-blue: #8FA6C3;
  --dusk: #46628A;
  --clay: #7B2D2F;
  --on-clay: #FBF4EA;

  --radius-card: 16px;
  --radius-control: 12px;
  --shadow: 0 2px 8px rgba(34, 27, 20, 0.18);
  --hand: "Nothing You Could Do", "Caveat", "Bradley Hand", cursive;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Poppins", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--page); }
body {
  margin: 0;
  background: var(--page);
  color: var(--page-ink);
  font: 17px/1.45 var(--sans);
  min-height: 100vh;
  min-height: 100dvh;
}
[hidden] { display: none !important; }

.wrap { max-width: 34rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }

.wordmark {
  display: block;
  width: 8.5rem;
  aspect-ratio: 600 / 92;
  background: var(--page-ink);
  -webkit-mask: url("/assets/wordmark.png") center / contain no-repeat;
          mask: url("/assets/wordmark.png") center / contain no-repeat;
  margin: 0.25rem auto 2rem;
}

/* Handwritten accent. Nothing You Could Do runs wide, so sizes stay modest. */
.hand, h1 {
  font-family: var(--hand);
  font-weight: 400;
  font-style: normal;
  font-synthesis: none;
  letter-spacing: 0;
}
h1 { font-size: 2.1rem; line-height: 1.25; margin: 0 0 0.75rem; text-align: center; color: var(--page-ink); }

.lede { text-align: center; color: var(--page-ink-2); margin: 0 auto 0.5rem; max-width: 26rem; }
.meta { text-align: center; color: var(--page-ink-3); font-size: 0.9rem; margin: 0 0 2rem; }

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin: 0 0 1rem;
}

.nudge { border-left: 3px solid var(--clay); }
.nudge .label { font-size: 0.8rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin: 0 0 0.5rem; }
.nudge p.prompt { font-family: var(--hand); font-size: 1.2rem; line-height: 1.45; margin: 0 0 0.75rem; color: var(--ink-2); }

label.field, p.field { display: block; font-weight: 600; font-size: 0.95rem; margin: 0 0 0.5rem; color: var(--ink); }
input[type="text"], textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--sand-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  padding: 0.8rem 0.9rem;
  outline: none;
}
input[type="text"]:focus, textarea:focus { border-color: var(--dusk); }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 0.85; }
textarea { min-height: 9rem; resize: vertical; }
.hint { font-size: 0.85rem; color: var(--ink-3); margin: 0.5rem 0 0; }

.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.choice {
  font: inherit; font-weight: 600; font-size: 0.95rem;
  color: var(--ink);
  background: var(--sand-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  padding: 0.9rem 0.4rem;
  cursor: pointer;
  transition: background-color 300ms ease-in-out;
}
.choice[aria-pressed="true"] { background: var(--dusty-blue); color: var(--ink); }
.choice:focus-visible { outline: 2px solid var(--dusk); outline-offset: 2px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; min-height: 50px;
  font: inherit; font-weight: 600;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  cursor: pointer;
  padding: 0 1rem;
  transition: opacity 300ms ease-in-out;
}
.btn[disabled] { opacity: 0.45; cursor: default; }

/* on the taupe page */
.btn-primary { background: var(--action-page); color: var(--on-action-page); }
.btn-secondary { background: transparent; color: var(--page-ink); border-color: var(--page-ink); }
.btn:focus-visible { outline: 2px solid var(--page-link); outline-offset: 2px; }

/* inside a white card */
.card .btn-primary { background: var(--clay); color: var(--on-clay); }
.card .btn-secondary { color: var(--ink); border-color: var(--ink); }
.card .btn:focus-visible { outline-color: var(--dusk); }
.btn-text { background: none; border: none; width: auto; min-height: 0; padding: 0.25rem 0; text-decoration: underline; text-underline-offset: 3px; color: var(--page-link); }
.card .btn-text { color: var(--dusk); }

.row { display: flex; gap: 0.6rem; }
.row > * { flex: 1; }

/* ---------------------------------------------------------------- recorder */
.recorder { text-align: center; }
.timer { font-variant-numeric: tabular-nums; font-size: 2.25rem; font-weight: 500; letter-spacing: 0.02em; margin: 0.25rem 0; color: var(--ink); }
.timer-cap { font-size: 0.85rem; color: var(--ink-3); margin: 0 0 1rem; }
.rec-dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--on-clay); margin-right: 0.4rem; vertical-align: middle; animation: breathe 2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } }
video.preview { width: 100%; border-radius: 12px; background: var(--ink); aspect-ratio: 3 / 4; object-fit: cover; margin: 0 0 1rem; }
video.preview.mirrored { transform: scaleX(-1); }
audio { width: 100%; margin: 0 0 1rem; }

/* ---------------------------------------------------------------- page bits */
.progress { height: 6px; background: var(--page-track); border-radius: 3px; overflow: hidden; margin: 1rem 0 0.5rem; }
.progress > div { height: 100%; width: 0; background: var(--action-page); transition: width 300ms ease-in-out; }

.error { color: var(--page-rose); font-size: 0.95rem; margin: 0.75rem 0 0; }
.card .error { color: var(--clay); }
.center { text-align: center; }
.footer { text-align: center; font-size: 0.85rem; color: var(--page-ink-3); margin-top: 2rem; }
.footer a { color: var(--page-ink-3); }

.sprout { display: block; margin: 0 auto 1rem; width: 64px; height: 64px; color: var(--page-rose); }
.fade-in { animation: fade 300ms ease-in-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none; } }
