/* The Detective's Desk · Every Grid Hides a Killer, Vol. 1 */
@font-face {
  font-family: "Limelight";
  src: url("../fonts/Limelight-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Josefin Sans";
  src: url("../fonts/JosefinSans-Variable.ttf") format("truetype");
  font-weight: 100 700;
  font-display: swap;
}

:root {
  --emerald: #0E3B36;
  --emerald-deep: #082925;
  --gold: #D8B76A;
  --gold-soft: #E8D3A0;
  --ivory: #F4EBDD;
  --paper: #FBF6EE;
  --crimson: #A4161A;
  --ink: #142320;
  --muted: #45524F;
  --title: "Limelight", Georgia, "Times New Roman", serif;
  --text: "Josefin Sans", Arial, Helvetica, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.55;
}
[hidden] { display: none !important; }

.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--gold); color: var(--emerald-deep);
  padding: .75rem 1rem; font-weight: 700; z-index: 10; border-radius: 4px;
}
.skip:focus { top: 1rem; }

/* Masthead */
.masthead {
  background: var(--emerald);
  background-image:
    repeating-linear-gradient(90deg, rgba(216,183,106,.07) 0 1px, transparent 1px 28px),
    linear-gradient(180deg, var(--emerald) 0%, var(--emerald-deep) 100%);
  color: var(--ivory);
  text-align: center;
  padding: 2.25rem 1rem 0;
  border-bottom: 4px double var(--gold);
}
.kicker {
  margin: 0;
  font-size: .8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.kicker.dark { color: var(--emerald); }
h1, h2, h3 { font-family: var(--title); font-weight: 400; line-height: 1.15; }
.masthead h1 {
  margin: .5rem 0 .25rem;
  font-size: clamp(2.1rem, 9vw, 3.6rem);
  color: var(--gold);
  letter-spacing: .02em;
}
.place { margin: 0; font-size: 1rem; color: var(--ivory); letter-spacing: .06em; }

.deco { display: flex; align-items: center; justify-content: center; gap: .6rem; margin: 1.1rem auto; max-width: 18rem; }
.deco span { flex: 1; height: 0; border-top: 3px double var(--gold); }
.deco i { width: .7rem; height: .7rem; background: var(--gold); transform: rotate(45deg); }
.deco.small { max-width: 10rem; margin: 0 auto 1rem; }

.tabs { display: flex; justify-content: center; gap: .25rem; flex-wrap: wrap; padding-bottom: .5rem; }
.tabs a {
  color: var(--ivory);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .9rem;
  min-height: 48px;
  display: inline-flex; align-items: center;
  padding: 0 .9rem;
  border-bottom: 2px solid transparent;
}
.tabs a:hover { border-bottom-color: var(--gold); color: var(--gold-soft); }

/* Layout */
main { max-width: 44rem; margin: 0 auto; padding: 1.5rem 1rem 1rem; }
.card {
  background: var(--paper);
  border: 1px solid rgba(14,59,54,.35);
  outline: 1px solid rgba(14,59,54,.18);
  outline-offset: -6px;
  padding: 1.5rem 1.25rem;
  margin: 0 0 1.5rem;
  position: relative;
}
.card:focus { outline: 2px solid var(--emerald); }
.card h2 {
  margin: 0 0 1rem;
  color: var(--emerald);
  font-size: clamp(1.5rem, 6vw, 2rem);
}
.card p { margin: 0 0 .9rem; }
.sign { font-family: var(--title); color: var(--emerald); text-align: right; margin-top: 1rem !important; }

.steps { margin: 0 0 .75rem; padding-left: 1.5rem; }
.steps li { margin: .2rem 0; }
.note { font-size: 1rem; color: var(--muted); }

/* Level selector */
fieldset { border: 0; padding: 0; margin: 1.25rem 0 0; min-width: 0; }
legend, .label, .picker label {
  font-weight: 700; color: var(--emerald); letter-spacing: .06em; text-transform: uppercase;
  font-size: .95rem; margin-bottom: .6rem; padding: 0; display: block;
}
.level-grid, .final-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.level, .final {
  font: inherit;
  min-height: 64px;
  padding: .6rem .7rem;
  border: 2px solid var(--emerald);
  background: var(--paper);
  color: var(--emerald);
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  display: flex; flex-direction: column; justify-content: center;
  line-height: 1.25;
}
.level b, .final b { font-weight: 700; font-size: 1rem; }
.level small, .final small { font-size: .9rem; color: var(--muted); margin-top: .15rem; }
.level.wide { grid-column: 1 / -1; }
.level[aria-pressed="true"], .final[aria-pressed="true"] { background: var(--emerald); color: var(--ivory); }
.level[aria-pressed="true"] small, .final[aria-pressed="true"] small { color: var(--gold-soft); }
.level:hover, .final:hover { box-shadow: inset 0 0 0 1px var(--emerald); }

.picker, .finals { margin-top: 1.25rem; }
.row { display: flex; gap: .6rem; }
input[type="number"], input[type="text"], textarea {
  font: inherit;
  font-size: 1.25rem;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--emerald);
  border-radius: 4px;
  padding: .55rem .75rem;
  min-height: 52px;
  width: 100%;
}
input[type="number"] { max-width: 9rem; font-weight: 600; letter-spacing: .05em; }
textarea { resize: vertical; text-transform: uppercase; letter-spacing: .06em; line-height: 1.4; }
input[type="text"] { text-transform: uppercase; letter-spacing: .06em; }

.btn {
  font: inherit;
  font-weight: 700;
  letter-spacing: .06em;
  min-height: 52px;
  padding: .6rem 1.25rem;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid var(--emerald);
}
.btn.gold { background: var(--gold); color: var(--emerald-deep); border-color: var(--gold); box-shadow: inset 0 0 0 1px rgba(8,41,37,.35); }
.btn.gold:hover { background: #E2C47F; }
.btn.outline { background: transparent; color: var(--emerald); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

:focus-visible { outline: 3px solid var(--crimson); outline-offset: 2px; }

/* Case card */
.case {
  margin-top: 1.5rem;
  border-top: 3px double var(--emerald);
  padding-top: 1.25rem;
}
.case-kicker { font-size: .85rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 .25rem !important; }
.case h3 { margin: 0 0 1.1rem; font-size: clamp(1.35rem, 5.5vw, 1.7rem); color: var(--emerald); }
.case h3:focus { outline: none; }
.hint { margin-bottom: 1rem; }
.hint .btn { width: 100%; text-align: left; }
.hint-text {
  margin-top: .6rem;
  background: #fff;
  border-left: 4px solid var(--gold);
  padding: .9rem 1rem .2rem;
}
.hint-text.firm { border-left-color: var(--emerald); }
.hint-name { font-family: var(--title); color: var(--emerald); margin-bottom: .35rem !important; }

/* Confession */
.spoiler {
  border: 2px solid var(--crimson);
  border-radius: 4px;
  padding: .8rem 1rem;
  background: #fff;
}
.spoiler strong { color: var(--crimson); }
#confession-form label { display: block; font-weight: 700; color: var(--emerald); margin: 0 0 .4rem; }
.seals legend span { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); }
.seal-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; margin-bottom: 1.25rem; }
#confession-form .btn { width: 100%; }
.result { margin-top: 1rem; }
.result p { padding: .9rem 1rem; border-radius: 4px; margin: 0 0 .6rem; background: #fff; border-left: 4px solid var(--muted); }
.result .yes { border-left-color: var(--emerald); }
.result .yes strong { color: var(--emerald); }
.result .no { border-left-color: var(--crimson); }
.result .no strong { color: var(--crimson); }

/* Volume 2 */
.vol2 { text-align: center; background: var(--paper); border-color: var(--gold); }
.vol2 .lead { font-family: var(--title); color: var(--emerald); font-size: 1.3rem; line-height: 1.35; }
.vol2 .sign { text-align: center; }

/* Footer */
.foot { text-align: center; padding: 1rem 1rem 2.5rem; color: var(--emerald); }
.foot p { margin: .25rem 0; font-weight: 600; letter-spacing: .04em; }
.foot .fine { font-weight: 400; font-size: .9rem; color: var(--muted); }
.noscript { text-align: center; padding: 1rem; background: var(--crimson); color: #fff; margin: 0; }

@media (min-width: 640px) {
  main { padding-top: 2.5rem; }
  .card { padding: 2rem 2.25rem; }
  .level-grid { grid-template-columns: repeat(4, 1fr); }
  .final-grid { grid-template-columns: repeat(4, 1fr); }
  .seal-grid { grid-template-columns: repeat(3, 1fr); }
  #confession-form .btn { width: auto; }
}
