/* =========================================================
   Drill Run — site styles
   Palette lifted from the game's own Compose colours so the
   site and the app read as one product.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,600;1,6..72,400&display=swap');

:root {
  --pitch:   #0B0906;
  --basalt:  #14100A;
  --rock:    #1E1710;
  --rock-lit:#261C12;
  --seam:    #3D2C1A;
  --lantern: #FFC56E;   /* from the game */
  --ember:   #FF7A2F;
  --cream:   #F7E7C6;   /* from the game */
  --tan:     #C9B48E;

  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body:    'Newsreader', Georgia, serif;

  --measure: 63ch;
  --gutter:  clamp(1.25rem, 5vw, 3rem);
  --rail:    4.75rem;  /* width of the material rail */
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--pitch);
  color: var(--cream);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--lantern); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--cream); }

:focus-visible {
  outline: 2px solid var(--lantern);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--lantern); color: var(--pitch);
  padding: .6rem 1rem; font-family: var(--display); font-weight: 700;
}
.skip:focus { left: 1rem; top: 1rem; z-index: 99; }

/* ---------- material rail ---------- */
/* The five tiers the pickaxes climb through, used as a scroll indicator. */

.rail {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--rail);
  border-right: 1px solid var(--seam);
  background: var(--pitch);
  z-index: 5;
  pointer-events: none;
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 1.4rem;
  padding: 2rem 0;
}
.rail__mark {
  font-family: var(--display);
  font-weight: 600;
  font-size: .68rem;
  letter-spacing: .005em;
  color: var(--tan);
  opacity: .38;
  text-align: center;
  position: relative;
  padding: .35rem 0;
}
.rail__mark::before {
  content: "";
  position: absolute;
  left: .55rem; right: .55rem; top: 0;
  height: 1px;
  background: currentColor;
  opacity: .5;
}
.rail__mark.is-active {
  opacity: 1;
  color: var(--lantern);
}
@media (min-width: 64rem) {
  .rail { display: flex; }
  body { padding-left: var(--rail); }
}

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1rem 2rem;
  padding: 1.5rem var(--gutter);
  border-bottom: 1px solid var(--seam);
}
.masthead__mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -.02em;
  color: var(--cream);
  text-decoration: none;
}
.masthead nav {
  display: flex;
  gap: 1.4rem;
  margin-left: auto;
  font-size: .95rem;
}
.masthead nav a { text-decoration: none; color: var(--tan); }
.masthead nav a:hover,
.masthead nav a[aria-current="page"] { color: var(--lantern); }

/* ---------- strata sections ---------- */

.stratum {
  padding: clamp(3rem, 8vw, 6rem) var(--gutter);
  position: relative;
}
.stratum > * { max-width: var(--measure); }
.stratum--deep   { background: var(--basalt); }
.stratum--deeper { background: var(--rock); }
.stratum--lit    { background: var(--rock-lit); }

/* the irregular rock seam between bands */
.seam {
  display: block;
  width: 100%;
  height: 26px;
  fill: currentColor;
}
.seam--to-deep   { color: var(--basalt); }
.seam--to-deeper { color: var(--rock); }
.seam--to-lit    { color: var(--rock-lit); }
.seam--to-pitch  { color: var(--pitch); }

/* ---------- hero ---------- */

.hero {
  padding: clamp(4rem, 14vh, 9rem) var(--gutter) clamp(3rem, 8vh, 5rem);
}
.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.2rem, 13vw, 8.5rem);
  line-height: .84;
  letter-spacing: -.045em;
  margin: 0 0 1.5rem;
  color: var(--cream);
  text-wrap: balance;
}
.hero h1 span {
  display: block;
  color: var(--lantern);
}
.hero p {
  max-width: 46ch;
  font-size: 1.2rem;
  color: var(--tan);
  margin: 0 0 2rem;
}

/* ---------- typography inside content ---------- */

h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -.025em;
  margin: 0 0 1rem;
  color: var(--cream);
}
h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -.01em;
  margin: 2.2rem 0 .5rem;
  color: var(--lantern);
}
p { margin: 0 0 1.1rem; }
ul { padding-left: 1.1rem; margin: 0 0 1.1rem; }
li { margin-bottom: .4rem; }
li::marker { color: var(--ember); }

.lede { font-size: 1.15rem; color: var(--tan); }
.muted { color: var(--tan); font-size: .92rem; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  padding: .8rem 1.5rem;
  border-radius: 4px;
  border: 1px solid var(--lantern);
  background: rgba(255,197,110,.14);
  color: var(--lantern);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: rgba(255,197,110,.24); color: var(--cream); }
.btn--quiet {
  border-color: var(--seam);
  background: transparent;
  color: var(--tan);
}
.btn--quiet:hover { color: var(--cream); background: rgba(255,255,255,.04); }
.btn--danger {
  border-color: var(--ember);
  background: rgba(255,122,47,.12);
  color: #FFB183;
}
.btn--danger:hover { background: rgba(255,122,47,.22); color: #FFD6BC; }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- leaderboard: a drill log, not a table of cards ---------- */

.log { width: 100%; border-collapse: collapse; max-width: none; }
.log caption {
  text-align: left;
  color: var(--tan);
  font-size: .92rem;
  padding-bottom: .9rem;
}
.log th {
  text-align: left;
  font-family: var(--display);
  font-weight: 600;
  font-size: .85rem;
  color: var(--tan);
  padding: 0 .75rem .5rem 0;
  border-bottom: 1px solid var(--seam);
}
.log td {
  padding: .7rem .75rem .7rem 0;
  border-bottom: 1px solid rgba(61,44,26,.55);
  vertical-align: baseline;
}
.log td:first-child {
  font-family: var(--display);
  font-weight: 700;
  color: var(--tan);
  width: 3.5rem;
  font-variant-numeric: tabular-nums;
}
.log tr:nth-child(-n+3) td:first-child { color: var(--lantern); }
.log .num {
  font-family: var(--display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--cream);
  text-align: right;
  white-space: nowrap;
}
.log .num--quiet { font-weight: 600; color: var(--tan); }
.log .when { color: var(--tan); font-size: .88rem; white-space: nowrap; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.75rem; }
.filters a {
  font-family: var(--display);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  padding: .4rem .85rem;
  border: 1px solid var(--seam);
  border-radius: 3px;
  color: var(--tan);
}
.filters a[aria-current="true"] {
  border-color: var(--lantern);
  color: var(--lantern);
  background: rgba(255,197,110,.1);
}

.empty {
  border-left: 2px solid var(--ember);
  padding: 1rem 0 1rem 1.25rem;
  color: var(--tan);
}

/* ---------- forms ---------- */

form { max-width: 34rem; }
label {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: .95rem;
  margin-bottom: .4rem;
  color: var(--cream);
}
input[type="email"], input[type="text"] {
  width: 100%;
  padding: .8rem 1rem;
  font-family: var(--body);
  font-size: 1rem;
  color: var(--cream);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--seam);
  border-radius: 4px;
}
input::placeholder { color: rgba(201,180,142,.5); }
.field { margin-bottom: 1.4rem; }
.hint { font-size: .9rem; color: var(--tan); margin: .45rem 0 0; }

.notice {
  border-left: 2px solid var(--lantern);
  background: rgba(255,197,110,.07);
  padding: 1rem 1.25rem;
  margin: 0 0 1.75rem;
}
.notice--warn { border-left-color: var(--ember); background: rgba(255,122,47,.08); }
.notice p:last-child { margin-bottom: 0; }

/* ---------- what gets deleted / kept ---------- */

.ledger { margin: 1.5rem 0; }
.ledger dt {
  font-family: var(--display);
  font-weight: 600;
  color: var(--lantern);
  margin-top: 1rem;
}
.ledger dd { margin: .2rem 0 0; color: var(--tan); }

/* ---------- footer ---------- */

.foot {
  padding: 2.5rem var(--gutter) 3.5rem;
  border-top: 1px solid var(--seam);
  color: var(--tan);
  font-size: .9rem;
}
.foot nav { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-bottom: .9rem; }
.foot a { text-decoration: none; }

/* seam backgrounds: `from-` is the band above, `to-` (fill) is the band below */
.seam--from-pitch  { background: var(--pitch); }
.seam--from-deep   { background: var(--basalt); }
.seam--from-deeper { background: var(--rock); }
.seam--from-lit    { background: var(--rock-lit); }

/* ---------- hero board ---------- */

.board {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  border: 1px solid var(--seam);
  border-radius: 6px;
  margin: 0 0 2.25rem;
}
@media (min-width: 52rem) {
  .hero__split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: clamp(2rem, 6vw, 4rem);
    align-items: center;
    max-width: none;
  }
  .hero__split > div { max-width: var(--measure); }
  .board { margin: 0; max-width: 300px; }
}

/* ---------- tile legend ---------- */

.tiles { margin: 1.75rem 0 0; }
.tiles div {
  display: flex;
  gap: 1rem;
  padding: .65rem 0;
  border-top: 1px solid rgba(61,44,26,.55);
}
.tiles dt {
  font-family: var(--display);
  font-weight: 600;
  font-size: .95rem;
  color: var(--cream);
  flex: 0 0 7.5rem;
}
.tiles dd { margin: 0; color: var(--tan); font-size: .95rem; }
@media (max-width: 32rem) {
  .tiles div { flex-direction: column; gap: .15rem; }
  .tiles dt { flex: none; }
}

/* ---------- documentation page ---------- */

/* Progressive disclosure: the plain-language paragraph is full width, the
   technical detail is inset with a rule. Nothing is hidden behind a toggle —
   a reader scanning for signal will not click eight accordions. */
.deep {
  border-left: 2px solid var(--seam);
  padding-left: clamp(1rem, 3vw, 1.75rem);
  margin: 1.5rem 0 2rem;
}
.deep > h4 {
  font-family: var(--display);
  font-weight: 600;
  font-size: .95rem;
  color: var(--lantern);
  margin: 0 0 .6rem;
}
.deep p, .deep ul { font-size: .98rem; }
.deep > :last-child { margin-bottom: 0; }

pre {
  background: rgba(0,0,0,.35);
  border: 1px solid var(--seam);
  border-radius: 4px;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  font-size: .84rem;
  line-height: 1.55;
  margin: 0 0 1.1rem;
}
code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .9em;
  color: var(--cream);
}
p > code, li > code, dd > code {
  background: rgba(255,255,255,.06);
  padding: .1em .35em;
  border-radius: 3px;
}

figure { margin: 1.75rem 0; max-width: none; }
figure svg { width: 100%; height: auto; max-width: 640px; display: block; }
figcaption { color: var(--tan); font-size: .88rem; margin-top: .6rem; }

.shot {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  border: 1px solid var(--seam);
  border-radius: 6px;
  margin: 1.75rem 0;
}

.toc { margin: 2rem 0 0; }
.toc ol { padding-left: 1.2rem; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.credits { max-width: var(--measure); }
.credits h3 { margin-top: 0; }

.log--compact td { padding: .5rem .75rem .5rem 0; }
.log--compact td:first-child { width: 2.5rem; }
