/* =========================================================
   GRUNT — stone-age style sheet. Rock first. Words second.
   ========================================================= */

:root {
  --charcoal: #3A3A3A;
  --cave: #26231F;        /* deep cave wall */
  --cave-2: #312D28;      /* lighter wall */
  --torch: #FF6B1B;
  --torch-dim: #D9530C;
  --bone: #F4E3C1;
  --bone-2: #E8D3A8;
  --moss: #8FA06E;
  --moss-dark: #5E6B45;
  --ochre: #B8502A;       /* cave paint red */
  --ink: #2A241E;         /* text on bone */
  --ash: #A99F8F;         /* muted text on cave */

  --font-carve: "Rubik Dirt", "Impact", "Arial Black", sans-serif;
  --font-body: "Rubik", "Trebuchet MS", system-ui, sans-serif;

  --radius-rock: 14px 22px 12px 26px / 20px 12px 24px 14px;
  --radius-rock-2: 24px 12px 28px 10px / 12px 26px 14px 22px;
  --shadow-rock: 0 2px 0 rgba(0,0,0,.25), 0 14px 30px -12px rgba(0,0,0,.6);
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--bone);
  background-color: var(--cave);
  /* stone grain + torch glow */
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -5%, rgba(255,107,27,.16), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 30%, rgba(143,160,110,.07), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--torch); text-underline-offset: 3px; }
a:hover { color: #ff8a47; }
:focus-visible { outline: 3px dashed var(--torch); outline-offset: 3px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--torch); color: var(--ink); padding: 8px 14px; z-index: 100;
  border-radius: 8px; font-weight: 700;
}
.skip:focus { left: 8px; }

/* ---------- Carved headings ---------- */
h1, h2, h3, .carve {
  font-family: var(--font-carve);
  font-weight: 400;
  letter-spacing: .5px;
  line-height: 1.05;
  margin: 0 0 .4em;
}
h1 { font-size: clamp(2.6rem, 7vw, 5rem); color: var(--bone);
     text-shadow: 0 3px 0 rgba(0,0,0,.45), 0 0 30px rgba(255,107,27,.25); }
h2 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); color: var(--bone); text-shadow: 0 2px 0 rgba(0,0,0,.4); }
h3 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); }
p { margin: 0 0 1em; }
.torch { color: var(--torch); }
.moss { color: var(--moss); }

/* ---------- Header / nav ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(30,27,24,.92);
  backdrop-filter: blur(6px);
  border-bottom: 3px solid #1a1815;
  box-shadow: 0 6px 20px -10px rgba(0,0,0,.8);
}
.site-head .wrap { max-width: 1340px; }
.brand { flex-shrink: 0; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--bone); }
.brand img { width: 42px; height: 42px; }
.brand span { font-family: var(--font-carve); font-size: 2rem; letter-spacing: 1px; line-height: 1; }
.brand:hover { color: var(--torch); }

.nav-toggle {
  display: none;
  font: 700 15px var(--font-body); color: var(--ink); background: var(--bone);
  border: 0; padding: 9px 14px; border-radius: var(--radius-rock); cursor: pointer;
}
.nav { display: flex; gap: 2px; flex-wrap: nowrap; justify-content: flex-end; }
.nav a {
  display: flex; flex-direction: column; align-items: center;
  text-decoration: none; color: var(--bone); white-space: nowrap;
  padding: 6px 8px; border-radius: 10px;
  font-size: 13px; line-height: 1.15; text-align: center;
  transition: background .15s, color .15s;
}
.nav a b { font-family: var(--font-carve); font-weight: 400; font-size: 16px; letter-spacing: .3px; }
.nav a small { color: var(--ash); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; }
.nav a:hover { background: rgba(244,227,193,.08); color: var(--torch); }
.nav a[aria-current="page"] { background: var(--torch); color: var(--ink); }
.nav a[aria-current="page"] small { color: rgba(42,36,30,.75); }
.nav a .done-dot { display: none; }
.nav a.is-done small::after { content: " ✔"; color: var(--moss); }
.nav a[aria-current="page"].is-done small::after { color: var(--ink); }

@media (max-width: 1280px) {
  .nav-toggle { display: inline-block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: #1e1b18; border-bottom: 3px solid #141210;
    flex-direction: column; padding: 10px 16px 16px; gap: 2px;
  }
  .nav.open { display: flex; }
  .nav a { flex-direction: row; justify-content: space-between; padding: 12px 12px; }
  .nav a b { font-size: 18px; }
}

/* ---------- Hero ---------- */
.hero { padding: 56px 0 40px; position: relative; }
.hero-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 880px) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 1.6px;
  color: var(--torch); margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 26px; height: 4px; background: var(--torch); border-radius: 4px; }
.lede { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--bone-2); max-width: 36em; }
.hero-art {
  position: relative; border-radius: var(--radius-rock-2);
  background: radial-gradient(ellipse at 50% 40%, #4a423a, #2b2622 75%);
  box-shadow: inset 0 0 60px rgba(0,0,0,.6), var(--shadow-rock);
  padding: 18px; aspect-ratio: 4 / 3;
  display: grid; place-items: center; overflow: hidden;
}
.hero-art svg { width: 100%; height: auto; }
.hero-art::after { /* torch flicker */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 20% 15%, rgba(255,107,27,.22), transparent 55%);
  animation: flicker 3.2s infinite alternate ease-in-out;
}
@keyframes flicker { 0% { opacity: .55 } 40% { opacity: .9 } 60% { opacity: .7 } 100% { opacity: 1 } }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 700 16px var(--font-body); text-decoration: none; cursor: pointer;
  padding: 13px 22px; border: 0; border-radius: var(--radius-rock);
  background: var(--torch); color: var(--ink);
  box-shadow: 0 4px 0 var(--torch-dim), 0 10px 20px -8px rgba(0,0,0,.6);
  transition: transform .1s, box-shadow .1s;
}
.btn:hover { color: var(--ink); transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--torch-dim); }
.btn.ghost { background: transparent; color: var(--bone); box-shadow: inset 0 0 0 2px var(--bone-2); }
.btn.ghost:hover { color: var(--torch); box-shadow: inset 0 0 0 2px var(--torch); }

/* ---------- Sections ---------- */
section { padding: 36px 0; }
.section-head { max-width: 46em; margin-bottom: 26px; }
.section-head p { color: var(--bone-2); }

.divider {
  height: 26px; margin: 10px 0;
  background: url("../assets/tracks.svg") center / auto 26px repeat-x;
  opacity: .5;
}

/* stone tablet card */
.tablet {
  background: linear-gradient(160deg, var(--bone), var(--bone-2));
  color: var(--ink);
  border-radius: var(--radius-rock);
  padding: 24px;
  box-shadow: var(--shadow-rock), inset 0 -6px 0 rgba(120,90,50,.18);
  position: relative;
}
.tablet h3 { color: var(--ink); }
.tablet p:last-child { margin-bottom: 0; }
.tablet a { color: var(--ochre); font-weight: 600; }
.tablet.dark {
  background: linear-gradient(160deg, #3f3933, #2f2a25);
  color: var(--bone);
  box-shadow: var(--shadow-rock), inset 0 0 0 2px rgba(244,227,193,.06);
}
.tablet.dark h3 { color: var(--bone); }
.tablet.dark a { color: var(--torch); }

.grid { display: grid; gap: 20px; }
@media (min-width: 640px) { .grid.two { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 640px) { .grid.three { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid.three { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Numbered steps (the hunt) ---------- */
.steps { counter-reset: step; display: grid; gap: 22px; }
.step {
  counter-increment: step;
  display: grid; gap: 6px 22px; grid-template-columns: 1fr;
  padding-left: 0;
}
@media (min-width: 720px) { .step { grid-template-columns: 84px 1fr; } }
.step::before {
  content: counter(step);
  font-family: var(--font-carve); font-size: 2.6rem; line-height: 1;
  width: 72px; height: 72px; display: grid; place-items: center;
  color: var(--ink);
  background: url("../assets/rock.svg") center / contain no-repeat;
  padding-top: 4px;
}
.step .tablet { grid-column: 1 / -1; }
@media (min-width: 720px) { .step .tablet { grid-column: 2; } }

.big-word {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  background: var(--ink); color: var(--bone); padding: 3px 9px; border-radius: 6px; margin-bottom: 10px;
}
.big-word::before { content: "Fancy people say: "; color: var(--torch); }
.tablet.dark .big-word { background: var(--bone); color: var(--ink); }
.tablet.dark .big-word::before { color: var(--ochre); }

.rock-list { list-style: none; padding: 0; margin: 0 0 1em; }
.rock-list li { position: relative; padding-left: 28px; margin-bottom: 8px; }
.rock-list li::before {
  content: ""; position: absolute; left: 0; top: .45em; width: 14px; height: 12px;
  background: var(--ochre); border-radius: 50% 40% 55% 45% / 55% 50% 45% 50%;
}
.tablet.dark .rock-list li::before { background: var(--torch); }

/* ---------- Grog says ---------- */
.grog {
  display: grid; grid-template-columns: 76px 1fr; gap: 16px; align-items: center;
  background: rgba(143,160,110,.14);
  border: 2px dashed var(--moss);
  border-radius: var(--radius-rock-2);
  padding: 16px 20px; margin: 22px 0;
  color: var(--bone);
}
.grog img { width: 76px; height: auto; }
.grog strong { font-family: var(--font-carve); font-weight: 400; color: var(--moss); font-size: 1.25rem; display: block; line-height: 1.1; margin-bottom: 4px; }
.grog p { margin: 0; }
.tablet .grog { color: var(--ink); background: rgba(143,160,110,.22); border-color: var(--moss-dark); }
.tablet .grog strong { color: var(--moss-dark); }

/* ---------- Danger / do-dont ---------- */
.do-dont { display: grid; gap: 16px; }
@media (min-width: 640px) { .do-dont { grid-template-columns: 1fr 1fr; } }
.do, .dont { border-radius: var(--radius-rock); padding: 18px 20px; }
.do { background: rgba(143,160,110,.18); border-left: 6px solid var(--moss); }
.dont { background: rgba(184,80,42,.18); border-left: 6px solid var(--ochre); }
.do h3, .dont h3 { font-size: 1.3rem; }
.do h3 { color: var(--moss); } .dont h3 { color: #e0784f; }
.do ul, .dont ul { margin: 0; padding-left: 20px; }

/* ---------- Tool (interactive) frame ---------- */
.tool {
  background: linear-gradient(160deg, #423b34, #2c2723);
  border-radius: var(--radius-rock-2);
  box-shadow: var(--shadow-rock), inset 0 0 0 2px rgba(255,107,27,.25);
  padding: 22px; color: var(--bone);
}
@media (min-width: 720px) { .tool { padding: 30px; } }
.tool-title { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.tool-title img { width: 40px; height: 40px; }
.tool-title h3 { margin: 0; color: var(--torch); }
.tool-grid { display: grid; gap: 24px; margin-top: 18px; }
@media (min-width: 860px) { .tool-grid { grid-template-columns: 1fr 1fr; } }
.tool-grid > * { min-width: 0; }

label, .label { display: block; font-weight: 700; font-size: 14px; letter-spacing: .4px; margin: 0 0 6px; color: var(--bone-2); }
.field { margin-bottom: 16px; }
input[type=text], input[type=number], select, textarea {
  width: 100%; font: 500 16px var(--font-body);
  color: var(--ink); background: var(--bone);
  border: 0; border-radius: 10px; padding: 11px 13px;
  box-shadow: inset 0 2px 0 rgba(0,0,0,.15);
}
textarea { resize: vertical; min-height: 70px; }
input[type=range] { width: 100%; accent-color: var(--torch); }
.hint { font-size: 13px; color: var(--ash); margin-top: 4px; }

.choice-row { display: flex; flex-wrap: wrap; gap: 10px; }
.choice {
  position: relative; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 999px;
  background: rgba(244,227,193,.08); border: 2px solid rgba(244,227,193,.25);
  font-weight: 600; font-size: 15px; color: var(--bone);
  user-select: none; transition: all .15s;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:hover { border-color: var(--torch); }
.choice:has(input:checked) { background: var(--torch); border-color: var(--torch); color: var(--ink); }
.choice:has(input:focus-visible) { outline: 3px dashed var(--torch); outline-offset: 3px; }

.readout {
  background: rgba(0,0,0,.28); border-radius: var(--radius-rock);
  padding: 18px 20px; display: grid; gap: 12px;
}
.stat { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 1px dashed rgba(244,227,193,.15); padding-bottom: 8px; }
.stat:last-child { border-bottom: 0; padding-bottom: 0; }
.stat span { color: var(--bone-2); font-size: 15px; }
.stat b { font-family: var(--font-carve); font-weight: 400; font-size: 1.6rem; color: var(--torch); font-variant-numeric: tabular-nums; white-space: nowrap; }
.verdict {
  font-family: var(--font-carve); font-size: 1.35rem; line-height: 1.2;
  padding: 14px 16px; border-radius: 12px; background: rgba(143,160,110,.2); color: var(--bone);
  border-left: 6px solid var(--moss);
}
.verdict.warn { background: rgba(255,107,27,.16); border-left-color: var(--torch); }
.verdict.bad { background: rgba(184,80,42,.24); border-left-color: var(--ochre); }

/* ---------- Checklist ---------- */
.hunt-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.hunt-list label {
  display: flex; gap: 14px; align-items: flex-start; cursor: pointer;
  font-weight: 500; font-size: 16px; color: var(--ink); margin: 0;
  padding: 12px 14px; border-radius: 12px; background: rgba(42,36,30,.06);
  transition: background .15s;
}
.hunt-list label:hover { background: rgba(42,36,30,.12); }
.hunt-list input {
  appearance: none; flex: 0 0 26px; height: 26px; margin: 0; cursor: pointer;
  border: 3px solid var(--ink); border-radius: 7px 10px 6px 9px; background: var(--bone);
  display: grid; place-items: center;
}
.hunt-list input:checked { background: var(--moss); border-color: var(--moss-dark); }
.hunt-list input:checked::after { content: "✔"; color: var(--ink); font-weight: 900; font-size: 16px; line-height: 1; }
.hunt-list input:checked + span { text-decoration: line-through; text-decoration-thickness: 2px; opacity: .65; }
.hunt-progress { font-family: var(--font-carve); font-size: 1.25rem; margin-top: 14px; color: var(--ochre); }

/* ---------- Glossary table ---------- */
.glossary { width: 100%; border-collapse: collapse; font-size: 16px; }
.glossary th, .glossary td { text-align: left; padding: 10px 12px; border-bottom: 1px dashed rgba(42,36,30,.25); vertical-align: top; }
.glossary th { font-family: var(--font-carve); font-weight: 400; font-size: 1.15rem; color: var(--ochre); }
.glossary td:first-child { font-weight: 700; white-space: nowrap; }
@media (max-width: 560px) {
  .glossary, .glossary tbody, .glossary tr, .glossary td { display: block; }
  .glossary thead { display: none; }
  .glossary tr { padding: 10px 0; border-bottom: 1px dashed rgba(42,36,30,.25); }
  .glossary td { border: 0; padding: 2px 0; white-space: normal !important; }
}

/* ---------- Next hunt ---------- */
.next-hunt { display: grid; gap: 14px; margin: 20px 0 10px; }
@media (min-width: 640px) { .next-hunt { grid-template-columns: 1fr 1fr; } }
.next-hunt a {
  display: flex; flex-direction: column; gap: 4px; text-decoration: none;
  padding: 18px 22px; border-radius: var(--radius-rock);
  background: rgba(244,227,193,.06); border: 2px solid rgba(244,227,193,.15); color: var(--bone);
  transition: border-color .15s, background .15s;
}
.next-hunt a:hover { border-color: var(--torch); background: rgba(255,107,27,.08); color: var(--bone); }
.next-hunt a small { color: var(--ash); text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; font-size: 12px; }
.next-hunt a b { font-family: var(--font-carve); font-weight: 400; font-size: 1.6rem; color: var(--torch); }
.next-hunt a.next { text-align: right; }
.next-hunt a.only { grid-column: 1 / -1; }

/* ---------- Footer ---------- */
.site-foot {
  margin-top: 40px; padding: 36px 0 44px;
  background: #1a1815; border-top: 3px solid #141210; color: var(--ash);
}
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: center; }
.foot-row .brand span { font-size: 1.6rem; }
.tagline { font-family: var(--font-carve); color: var(--bone); font-size: 1.3rem; }
.site-foot p { margin: 0; font-size: 14px; }

/* ---------- Misc ---------- */
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: rgba(255,107,27,.18); color: var(--torch); font-weight: 700; font-size: 13px;
}
.tablet .pill { background: rgba(184,80,42,.15); color: var(--ochre); }
.center { text-align: center; }
.mt0 { margin-top: 0; }
.muted { color: var(--ash); }
.tablet .muted { color: #6b5f52; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* cave paint stroke anim for hero svgs */
.paint path, .paint line, .paint polyline, .paint circle.draw {
  stroke-dasharray: 1200; stroke-dashoffset: 1200;
  animation: paint 2.4s ease-out forwards;
}
.paint .d2 { animation-delay: .4s; }
.paint .d3 { animation-delay: .8s; }
.paint .d4 { animation-delay: 1.2s; }
@keyframes paint { to { stroke-dashoffset: 0; } }
