:root {
  --paper: #F4EFE6;      /* cream */
  --stone: #EAE3D6;      /* soft stone panels */
  --stone-deep: #DFD6C5;
  --line: #CFC5B3;
  --ink: #221E1A;        /* body text, ~15:1 on paper */
  --muted: #554D44;      /* secondary text, ~7.5:1 on paper */
  --accent: #1F3D33;     /* deep bottle green, the single accent */
  --accent-ink: #F4EFE6;
  --error: #8A2A1E;

  --display: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --text: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.1875rem;  /* 19px */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2.5rem 1.375rem 3rem;
}

/* Wordmark */
.masthead { text-align: center; }
.wordmark {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.75rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  padding-left: 0.26em; /* balance trailing letter-spacing */
}
.masthead::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 1px;
  margin: 1.25rem auto 0;
  background: var(--accent);
  opacity: 0.6;
}

/* Intro */
.intro { text-align: center; margin-top: 3.25rem; }
h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: 2.75rem;
  line-height: 1.08;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-wrap: balance;
}
.subline {
  margin: 1.25rem auto 0;
  max-width: 26rem;
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

/* Signup */
.signup { margin-top: 2.75rem; }
.signup-form { display: grid; gap: 0.75rem; }
.field-label {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink);
}
input[type="email"] {
  width: 100%;
  min-height: 3.5rem;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 1.1875rem;
  color: var(--ink);
  background: #FBF8F2;
  border: 1.5px solid #8C8274;
  border-radius: 2px;
  -webkit-appearance: none;
  appearance: none;
}
input[type="email"]::placeholder { color: #8A8075; }
input[type="email"]:focus {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 1px;
  border-color: var(--accent);
}
input[type="email"][aria-invalid="true"] { border-color: var(--error); }

.button {
  min-height: 3.5rem;
  padding: 0.85rem 1.25rem;
  font: inherit;
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 160ms ease;
}
.button:hover { background: #17302A; }
.button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.button[disabled] { opacity: 0.7; cursor: progress; }

.turnstile:empty { display: none; }
.turnstile { min-height: 0; }

.form-error {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--error);
}

.thanks {
  padding: 1.75rem 1.5rem;
  text-align: center;
  background: var(--stone);
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
}
.thanks p {
  margin: 0;
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--accent);
  text-wrap: balance;
}

.privacy {
  margin: 1rem 0 0;
  font-size: 1rem;
  color: var(--muted);
  text-align: center;
  text-wrap: balance;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Collection */
.collection { margin-top: 4rem; }
.rule {
  height: 1px;
  background: var(--line);
  margin-bottom: 3rem;
}
h2 {
  margin: 0;
  text-align: center;
  font-family: var(--display);
  font-weight: 500;
  font-size: 2.125rem;
  line-height: 1.15;
  color: var(--ink);
  text-wrap: balance;
}
.collection-note {
  margin: 0.75rem auto 0;
  max-width: 26rem;
  text-align: center;
  font-size: 1.0625rem;
  color: var(--muted);
}

.puzzles {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.875rem;
}

.puzzle-card {
  position: relative;
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem 0.75rem 0.75rem;
  background: #FBF8F2;
  border: 1.5px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.puzzle-card:hover { border-color: #A69B8A; }

/* Real checkbox: visually hidden, still focusable and announced. */
.puzzle-check {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

/* Art slot. An <img> placed inside fills it and covers the numeral. */
.puzzle-art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--stone);
  outline: 1px solid var(--stone-deep);
  outline-offset: -6px;
}
.puzzle-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.puzzle-numeral {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.75rem;
  color: var(--accent);
  opacity: 0.85;
}

.puzzle-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.15;
  color: var(--ink);
}

.puzzle-tick {
  width: 1.75rem;
  height: 1.75rem;
  border: 1.5px solid #8C8274;
  border-radius: 2px;
  background: #FBF8F2;
  display: grid;
  place-items: center;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.puzzle-tick::after {
  content: "";
  width: 0.5rem;
  height: 0.95rem;
  border: solid var(--accent-ink);
  border-width: 0 2.5px 2.5px 0;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0;
}

.puzzle-check:checked ~ .puzzle-tick { background: var(--accent); border-color: var(--accent); }
.puzzle-check:checked ~ .puzzle-tick::after { opacity: 1; }
.puzzle-card:has(.puzzle-check:checked) { border-color: var(--accent); background: #F7F3EC; }
.puzzle-check:focus-visible ~ .puzzle-tick { outline: 3px solid var(--ink); outline-offset: 3px; }

.footer {
  margin-top: 4rem;
  text-align: center;
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer p { margin: 0; }

/* Larger screens */
@media (min-width: 720px) {
  .page { max-width: 64rem; padding: 4rem 2.5rem 4rem; }
  .wordmark { font-size: 2.125rem; }
  .intro { margin-top: 4.5rem; }
  h1 { font-size: 4.25rem; max-width: 46rem; margin: 0 auto; }
  .subline { font-size: 1.375rem; max-width: 36rem; }
  .signup { max-width: 30rem; margin: 3.25rem auto 0; }
  .collection { margin-top: 5.5rem; }
  h2 { font-size: 2.75rem; }

  .puzzles {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2.75rem;
  }
  .puzzle-card {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: start;
    gap: 1rem 0.75rem;
    padding: 0.75rem 0.75rem 1.25rem;
  }
  .puzzle-art {
    grid-column: 1 / -1;
    aspect-ratio: 4 / 3;
    outline-offset: -10px;
  }
  .puzzle-numeral { font-size: 2.75rem; }
  .puzzle-name { padding-left: 0.5rem; font-size: 1.5rem; }
  .puzzle-tick { margin-top: 0.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
