/* Relics S01 survey: an explorer's paper journal. One fixed world, so one palette in every theme. */
/* Fonts are served from this site (not Google) so no visitor data goes to a third party. Licences: fonts/OFL-*.txt */
@font-face { font-family: "Patrick Hand"; font-weight: 400; font-display: swap; src: url(../fonts/patrick-hand-400.woff2) format("woff2"); }
@font-face { font-family: "Patrick Hand SC"; font-weight: 400; font-display: swap; src: url(../fonts/patrick-hand-sc-400.woff2) format("woff2"); }
@font-face { font-family: "Kalam"; font-weight: 400; font-display: swap; src: url(../fonts/kalam-400.woff2) format("woff2"); }
@font-face { font-family: "Kalam"; font-weight: 700; font-display: swap; src: url(../fonts/kalam-700.woff2) format("woff2"); }
@font-face { font-family: "Spectral"; font-weight: 400; font-display: swap; src: url(../fonts/spectral-400.woff2) format("woff2"); }
@font-face { font-family: "Spectral"; font-weight: 600; font-display: swap; src: url(../fonts/spectral-600.woff2) format("woff2"); }
:root {
  --paper: #f1e6cd;
  --paper-light: #fbf6ea;
  --ink: #2b2017;
  --ink-soft: #6a5440;
  --terra: #b8582a;
  --terra-tint: rgba(184, 88, 42, 0.14);
  --discord: #5b4fd6;

  --font-hand: "Patrick Hand", "Kalam", cursive;
  --font-caps: "Patrick Hand SC", "Patrick Hand", cursive;
  --font-note: "Kalam", cursive;
  --font-read: "Spectral", Georgia, serif;

  --radius: 12px;
  --shadow-plate: 0 2px 6px rgba(60, 40, 15, 0.25);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(ellipse at 15% 5%, rgba(255, 255, 255, 0.55), transparent 45%),
    radial-gradient(ellipse at 90% 100%, rgba(150, 110, 60, 0.18), transparent 50%),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(90, 65, 35, 0.07) 27px 28px),
    var(--paper);
  background-attachment: fixed;
  color: var(--ink);
  font: 17px/1.5 var(--font-read);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--terra); outline-offset: 3px; }

/* page column */
.page {
  max-width: 460px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(72px, calc(env(safe-area-inset-bottom) + 56px)) max(18px, env(safe-area-inset-left));
  /* Bottom room keeps the Back/Next buttons clear of floating overlays (e.g. Netlify's badge for team members). */
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.screen { display: flex; flex-direction: column; gap: 14px; flex: 1; }

/* Larger screens: scale the whole journal up so it reads comfortably on a monitor. */
@media (min-width: 900px) and (min-height: 700px) {
  .page { zoom: 1.3; min-height: calc(100dvh / 1.3); }
}
@media (min-width: 1400px) and (min-height: 860px) {
  .page { zoom: 1.5; min-height: calc(100dvh / 1.5); }
}
@media (prefers-reduced-motion: no-preference) {
  .screen { animation: turn 0.35s ease-out; }
  @keyframes turn { from { opacity: 0; transform: translateY(8px); } }
}
.blend { filter: drop-shadow(0 2px 2px rgba(60, 40, 15, 0.12)); }

/* header line and trail */
.topline { display: flex; justify-content: space-between; align-items: center; font: 400 0.95rem/1 var(--font-caps); color: var(--ink-soft); letter-spacing: 0.04em; }
.topline .count { font-family: var(--font-note); }
.trail { position: relative; height: 64px; border-radius: 8px; overflow: hidden; flex: none; background: url(../img/m-map.jpg) center 40% / cover; }
.trail::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(241, 230, 205, 0.78), rgba(241, 230, 205, 0.3) 50%, rgba(241, 230, 205, 0.78)); }
.trail svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.stop { position: absolute; top: 50%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 3px; font: 400 0.72rem/1 var(--font-caps); }
.stop i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); background: var(--paper); }
.stop.done i { background: var(--ink); }
.stop.here i { width: 17px; height: 17px; background: var(--terra); border-color: var(--terra); box-shadow: 0 0 0 4px var(--terra-tint); }

/* type */
.question { font: 600 1.45rem/1.22 var(--font-read); margin: 0; text-wrap: balance; }
.question:focus { outline: none; }
.note { font: 400 1rem/1.3 var(--font-note); color: var(--ink-soft); margin: 0; }
.qnum { font: 700 1rem/1 var(--font-note); color: var(--terra); }

/* plates: photos pasted into the journal */
.plate { margin: 0; background: var(--paper-light); padding: 6px; display: grid; gap: 6px; box-shadow: var(--shadow-plate); transform: rotate(var(--tilt, -1deg)); }
.plate figcaption { font: 400 0.85rem/1.2 var(--font-note); color: var(--ink-soft); }

/* buttons */
.nav { margin-top: auto; padding-top: 10px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0; cursor: pointer;
  font: 400 1.2rem/1 var(--font-caps); letter-spacing: 0.04em;
  background: var(--ink); color: var(--paper); box-shadow: 0 3px 0 #000;
  text-decoration: none;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn.discord { background: var(--discord); color: #fff; box-shadow: 0 3px 0 #2f278a; }
.btn.wide { width: 100%; }

/* answer options */
.options { display: grid; gap: 9px; }
.option {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  min-height: 52px; padding: 8px 14px; border-radius: var(--radius);
  border: 2px solid var(--ink); background: rgba(255, 255, 255, 0.35);
  font: 400 1.15rem/1.2 var(--font-hand);
}
.option .key { flex: none; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; border: 1.5px solid currentColor; font: 700 0.85rem/1 var(--font-note); }
.option img { flex: none; width: 46px; height: 46px; object-fit: contain; }
.option[aria-checked="true"] { background: var(--ink); color: var(--paper); }
@media (hover: hover) { .option:hover { background: rgba(255, 255, 255, 0.7); } .option[aria-checked="true"]:hover { background: var(--ink); } }

/* 1–5 scale of guardians */
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.face {
  display: grid; justify-items: center; gap: 2px; padding: 6px 2px 8px; border: 0; border-radius: var(--radius);
  background: transparent; cursor: pointer; font: 700 1.05rem/1 var(--font-note);
}
.face img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.face[aria-checked="true"] { background: var(--terra-tint); box-shadow: inset 0 0 0 2px var(--terra); color: var(--terra); }
.scale-ends { display: flex; justify-content: space-between; gap: 12px; font: 400 0.95rem/1.2 var(--font-note); color: var(--ink-soft); }
.scale-ends span:last-child { text-align: right; }

/* feature ratings: one row per feature, three pills */
.features { display: grid; gap: 12px; }
.feature { display: grid; gap: 6px; padding-bottom: 10px; border-bottom: 1.5px dashed rgba(106, 84, 64, 0.35); }
.feature-label { font: 400 1.1rem/1.25 var(--font-hand); }
.pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pill {
  min-height: 40px; padding: 6px 4px; border-radius: 999px; border: 2px solid var(--ink); cursor: pointer;
  background: rgba(255, 255, 255, 0.35); font: 400 1rem/1 var(--font-hand);
}
.pill[aria-checked="true"] { background: var(--ink); color: var(--paper); }

/* text answers */
.field { display: grid; gap: 6px; }
.field textarea, .field input {
  width: 100%; border: 0; border-bottom: 2px dashed var(--ink-soft); background: transparent; border-radius: 0;
  padding: 8px 2px; font: 400 1.2rem/1.5 var(--font-note); color: var(--ink); resize: vertical;
}
.field textarea:focus, .field input:focus { outline: none; border-bottom-style: solid; border-bottom-color: var(--terra); }
.field .meta { font: 400 0.85rem/1 var(--font-note); color: var(--ink-soft); text-align: right; }

/* cover */
.cover-head { display: grid; grid-template-columns: 1fr 112px; gap: 14px; align-items: center; }
.cover-title { font: 400 2.5rem/0.92 var(--font-caps); margin: 0; }
.cover-title span { display: block; font-size: 1.15rem; letter-spacing: 0.08em; color: var(--terra); }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { font: 400 0.95rem/1 var(--font-caps); border: 1.5px solid var(--ink); border-radius: 999px; padding: 6px 10px; }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 0.95rem; line-height: 1.4; cursor: pointer; }
.consent input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--terra); }
details.privacy { font-size: 0.9rem; color: var(--ink-soft); }
details.privacy summary { cursor: pointer; font-family: var(--font-note); }
details.privacy ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }

/* section break */
.part-scene { height: 240px; margin: 0 calc(-1 * max(18px, env(safe-area-inset-left))); background-size: cover; background-position: center 30%; }
.part-body { display: grid; justify-items: center; gap: 8px; text-align: center; }
.part-body img { width: 132px; margin-top: -8px; }
.part-body.solo { margin-top: 48px; }
.part-body.solo img { width: 180px; margin-top: 0; }
.kicker { font: 400 1rem/1 var(--font-caps); letter-spacing: 0.1em; color: var(--terra); }
.part-title { font: 400 2.4rem/1 var(--font-caps); margin: 0; }
.part-body p { margin: 0; max-width: 32ch; }

/* concept page */
.concept { display: grid; gap: 20px; }
.concept .plate:nth-child(even) { --tilt: 0.8deg; }
/* Source images are small (100–440 px). Keep the big frame but show the whole picture (no crop),
   with a blurred copy of it filling the edges. */
.concept .frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; display: grid; place-items: center; }
.concept .frame::before { content: ""; position: absolute; inset: -20px; background: var(--bg) center / cover; filter: blur(14px) brightness(0.7); }
.concept .frame img { position: relative; height: 100%; width: auto; max-width: 100%; object-fit: contain; }
.concept .crew { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--paper); }
.concept h3 { font: 400 1.25rem/1.1 var(--font-caps); margin: 4px 0 10px; }
.concept p, .concept ul { margin: 0 0 6px; font-size: 0.98rem; color: var(--ink); }
.concept ul { padding-left: 1.2em; }
.concept li + li { margin-top: 2px; }

/* offer letter */
.letter { display: grid; grid-template-columns: 70px 1fr; gap: 12px; align-items: start; background: var(--paper-light); padding: 12px; box-shadow: var(--shadow-plate); font-size: 0.98rem; line-height: 1.4; }
.letter img { width: 70px; border-radius: 3px; }

/* thanks */
.thanks { text-align: center; align-items: center; }
.thanks .chest { width: 96px; border-radius: 8px; box-shadow: var(--shadow-plate); }
.crowd { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; align-items: end; width: 100%; }
.thanks h2 { font: 400 2.4rem/1 var(--font-caps); margin: 0; }
.thanks p { margin: 0; }

/* status messages */
.alert { border: 2px solid var(--terra); background: var(--terra-tint); border-radius: var(--radius); padding: 10px 12px; font-size: 0.95rem; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
