/* Campfire Heroes - campfireheroes.org. The game's own fonts and colours; one moment of motion (day turning to night). */
@font-face { font-family: "Grenze Gotisch"; src: url("fonts/grenze-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/garamond.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/garamond-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }

:root {
  --ember: #e8822a;
  --gold: #f2c14e;
  --bark: #3b2418;
  --bark-dark: #24150e;
  --night: #14161f;
  --parchment: #eadfc8;
  --ash: #a89a82;
  --brass: #b98b4e;
  --display: "Grenze Gotisch", "Palatino Linotype", Georgia, serif;
  --body: "EB Garamond", Garamond, Georgia, serif;
  --wrap: 1120px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--night); }
body {
  margin: 0;
  background: var(--night);
  color: var(--parchment);
  font: 500 1.1875rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: #ffd98a; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0; letter-spacing: 0.005em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.skip { position: absolute; left: 16px; top: -60px; z-index: 10; background: var(--gold); color: var(--night); padding: 8px 14px; border-radius: 4px; }
.skip:focus { top: 16px; }

/* ---------- The story: the town by day, turning to night as you scroll ---------- */
.story { position: relative; height: 320vh; height: 320svh; }
.stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  --p: 0;            /* 0 = day, 1 = night (set by site.js from the scroll) */
}
.scene, .scene img { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene img { object-fit: cover; object-position: 50% 55%; }
.scene-day img { transform: scale(calc(1.06 - 0.06 * var(--p))); transform-origin: 50% 60%; }
.scene-night { opacity: var(--p); }
.scene-night img { transform: scale(1.0); }
.shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 62%, transparent 35%, rgba(10, 8, 14, calc(0.55 + 0.3 * var(--p))) 100%),
    linear-gradient(to bottom, rgba(10, 8, 14, 0.55) 0%, transparent 32%, transparent 68%, var(--night) 100%);
}
/* night falling: a cold dark over everything but the fire's circle */
.dusk {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(38% 34% at 50% 84%, rgba(12, 14, 34, 0) 0%, rgba(12, 14, 34, 0.55) 55%, rgba(8, 9, 22, 0.9) 100%);
  opacity: var(--p);
}
@media (max-aspect-ratio: 4/5) {
  .dusk { background: radial-gradient(55% 22% at 50% 62%, rgba(12, 14, 34, 0) 0%, rgba(12, 14, 34, 0.55) 55%, rgba(8, 9, 22, 0.9) 100%); }
}
.embers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.title {
  position: absolute; left: 50%; top: 46%;
  width: min(92vw, 760px);
  transform: translate(-50%, calc(-50% - 60px * var(--p)));
  text-align: center;
  opacity: calc(1 - var(--p) * 3.2);
}
.title h1 { margin: 0; }
.title h1 img { width: min(86vw, 640px); margin: 0 auto; filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.75)); }
.tagline {
  margin: 10px auto 0; max-width: 30ch;
  font-style: italic; font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.35;
  color: var(--parchment);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}

.soon {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 22px 0 0; padding: 9px 18px 9px 14px;
  font-size: 1.05rem; color: var(--parchment);
  background: rgba(20, 22, 31, 0.72);
  border: 1px solid rgba(242, 193, 78, 0.45);
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.play-mark {
  width: 0; height: 0;
  border-style: solid; border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent var(--gold);
}

.lines { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; pointer-events: none; }
.lines li {
  position: absolute; left: 50%; top: 50%;
  width: min(90vw, 900px);
  text-align: center;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.4rem, 6.4vw, 5.2rem); line-height: 1;
  color: var(--parchment);
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translate(-50%, -50%);
}
.lines li:nth-child(3) { color: #d9d3e8; }

.scroll-hint {
  position: absolute; left: 50%; bottom: 26px; margin: 0;
  transform: translateX(-50%);
  font-size: 0.95rem; color: var(--ash); letter-spacing: 0.04em;
  opacity: calc(1 - var(--p) * 6);
}
.scroll-hint::after {
  content: ""; display: block; width: 1px; height: 34px; margin: 8px auto 0;
  background: linear-gradient(var(--ash), transparent);
}

/* ---------- Features: one tab per part of the game ---------- */
main { position: relative; }
.features { padding: 96px 0 100px; background: linear-gradient(var(--night), #1a1410 55%, var(--night)); }
.features h2, .fields h2 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); color: var(--gold); max-width: 18ch; }

.tabs { margin-top: 44px; }
.tablist { display: flex; gap: 6px; border-bottom: 1px solid rgba(185, 139, 78, 0.35); overflow-x: auto; scrollbar-width: none; }
.tablist::-webkit-scrollbar { display: none; }
.tablist button {
  flex: 0 0 auto;
  appearance: none; background: none; border: 0; cursor: pointer;
  padding: 12px 18px 14px;
  font: 700 1.45rem/1 var(--display); color: var(--ash);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.tablist button:hover { color: var(--parchment); }
.tablist button[aria-selected="true"] { color: var(--gold); border-bottom-color: var(--ember); }

.panels { position: relative; }
.panel {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: 56px; align-items: center;
  padding-top: 48px;
}
.panel[hidden] { display: none; }
.panel.is-in .copy, .panel.is-in .phone { animation: tab-in 0.42s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.panel.is-in .phone { animation-delay: 0.05s; }
@keyframes tab-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.copy h3 { font-size: clamp(2rem, 3.6vw, 2.9rem); color: var(--parchment); }
.copy p { margin: 18px 0 0; max-width: 34ch; font-size: 1.3rem; color: #d8ccb4; }

/* The phone wears the game's own panel: dark wood, a brass edge, a bolt in each corner */
.phone {
  position: relative; margin: 0; justify-self: center;
  width: min(100%, 300px);
  padding: 12px;
  background: linear-gradient(160deg, #4a2e1f, var(--bark) 40%, var(--bark-dark));
  border: 1px solid #6b4a2c;
  border-radius: 22px;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35), 0 30px 60px -20px rgba(0, 0, 0, 0.8), 0 0 80px -30px rgba(232, 130, 42, 0.45);
}
.phone::before, .phone::after {
  content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f0d39a, var(--brass) 55%, #5a3d1e);
  top: 5px; left: 5px;
}
.phone::after { left: auto; right: 5px; }
.phone img { border-radius: 12px; aspect-ratio: 9 / 16; object-fit: cover; width: 100%; }

/* ---------- The fields ---------- */
.fields { padding: 40px 0 120px; }
.lede { margin: 14px 0 0; font-style: italic; font-size: 1.35rem; color: var(--ash); }
.field-list { list-style: none; padding: 0; margin: 44px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.field { position: relative; overflow: hidden; border-radius: 6px; background: var(--bark-dark); border: 1px solid rgba(185, 139, 78, 0.28); }
.field img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; object-position: 45% 55%; transition: transform 0.6s ease; }
.field:hover img { transform: scale(1.04); }
.field-text {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 60px 16px 16px;
  background: linear-gradient(transparent, rgba(12, 10, 14, 0.92) 55%);
}
.field h3 { font-size: 2.1rem; color: var(--parchment); }
.field p { margin: 6px 0 0; font-size: 1.05rem; color: var(--gold); }
.field p.unknown { color: var(--ash); font-style: italic; }
/* the further fields keep their secrets: darker, colder */
.field:nth-child(n + 2) img { filter: saturate(0.7) brightness(0.85); }
.field:nth-child(n + 2):hover img { filter: saturate(0.9) brightness(0.95); }

/* ---------- Can you hold? ---------- */
.hold {
  position: relative; min-height: 80vh; display: grid; place-items: center; text-align: center;
  background: url("img/town-night.webp") 50% 60% / cover no-repeat;
}
.hold::before { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 70% at 50% 55%, rgba(20, 22, 31, 0.35), var(--night) 92%); }
.hold-inner { position: relative; padding: 0 24px; }
.hold h2 { font-size: clamp(3rem, 9vw, 7rem); color: var(--parchment); text-shadow: 0 6px 40px rgba(0, 0, 0, 0.9); }

/* ---------- Footer ---------- */
.foot { padding: 40px 0 48px; border-top: 1px solid rgba(185, 139, 78, 0.2); }
.foot-inner { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.foot-mark { border-radius: 12px; }
.foot nav { display: flex; gap: 6px 22px; flex-wrap: wrap; font-size: 1.05rem; }
.contact { color: var(--ash); }

/* ---------- Smaller screens ---------- */
@media (max-width: 760px) {
  body { font-size: 1.125rem; }
  .wrap { padding: 0 16px; }
  .features { padding: 88px 0 80px; }
  .tablist { gap: 0; justify-content: space-between; }
  .tablist button { font-size: 1.15rem; padding: 10px 6px 12px; }
  .title { top: 36%; }
  .panel { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; }
  .copy p { font-size: 1.2rem; }
  .phone { width: min(78vw, 320px); }
}
@media (max-width: 640px) {
  .field-list { grid-template-columns: 1fr; gap: 16px; }
}

/* ---------- No motion wanted: a still night scene, no embers, no zoom ---------- */
@media (prefers-reduced-motion: reduce) {
  .story { height: auto; }
  .stage { position: relative; }
  .scene-day img { transform: none; }
  .title { opacity: 1; transform: translate(-50%, -50%); }
  .embers, .scroll-hint, .lines { display: none; }
  .panel.is-in .copy, .panel.is-in .phone { animation: none; }
  .field img, .field:hover img { transition: none; transform: none; }
}
