/* Sprig website. The app's fonts (Figtree, Fraunces; SIL OFL, in /fonts)
   and colours, light and dark. beta.css builds on this for the beta pages. */
@font-face { font-family: Figtree; font-weight: 400; font-display: swap; src: url(/fonts/figtree-regular.woff2) format('woff2'); }
@font-face { font-family: Figtree; font-weight: 600; font-display: swap; src: url(/fonts/figtree-semibold.woff2) format('woff2'); }
@font-face { font-family: Figtree; font-weight: 700; font-display: swap; src: url(/fonts/figtree-bold.woff2) format('woff2'); }
@font-face { font-family: Fraunces; font-weight: 600; font-display: swap; src: url(/fonts/fraunces-semibold.woff2) format('woff2'); }

:root {
  --bg: #f6f3ea; --paper: #fffdf8; --ink: #1f2e26; --muted: #5d6c62;
  --green: #2a6a47; --on-green: #fffdf8; --soft: #e5ebdc; --line: #e3dccb;
  --warm: #f2e7cc; --warm-ink: #54441c; --shadow: 0 1px 2px rgba(31, 46, 38, .05), 0 8px 24px rgba(31, 46, 38, .06);
  --serif: Fraunces, Georgia, 'Times New Roman', serif;
  --sans: Figtree, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131915; --paper: #1c241f; --ink: #edf2ea; --muted: #a5b4a9;
    --green: #9fd3a5; --on-green: #12201a; --soft: #26332a; --line: #324036;
    --warm: #3b3421; --warm-ink: #ebd59f; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}
* { 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(--bg); color: var(--ink); overflow-wrap: anywhere;
  font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
.wrap { max-width: 44rem; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 2.6rem); letter-spacing: -.02em; margin: 2rem 0 .35rem; }
h2 { font-size: 1.4rem; margin: 2.25rem 0 .6rem; }
h3 { font-size: 1.15rem; margin: 1.5rem 0 .4rem; }
p, li { margin: .55rem 0; }
a { color: var(--green); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 4px; }
strong { font-weight: 700; }
.meta { color: var(--muted); font-size: .95rem; margin-top: 0; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 1.1rem 1.35rem; margin: 1.25rem 0; box-shadow: var(--shadow); }
.note { background: var(--warm); color: var(--warm-ink); border-radius: 12px; padding: .8rem 1rem; }
ol.steps li { margin: .35rem 0; }
.path { background: var(--soft); border-radius: 6px; padding: .05rem .4rem; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* Header: the brand and, on most pages, the site navigation. The plain
   <header><img><a> form is kept for the beta guide and feedback pages. */
header { display: flex; align-items: center; gap: .75rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
header > img { width: 40px; height: 40px; border-radius: 11px; }
header > a { color: inherit; text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 1.45rem; }
.site-header { justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: inherit; text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 11px; }
.brand span, .brand a { font-family: var(--serif); font-weight: 600; font-size: 1.45rem; color: inherit; text-decoration: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-size: .95rem; font-weight: 600; }
.site-nav a { text-decoration: none; color: var(--ink); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--green); text-decoration: underline; }

/* Footer: the legal links and the publisher, on every page. */
footer { margin-top: 3.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0 0 .5rem; padding: 0; list-style: none; }
.footer-links li { margin: 0; }
.footer-links a { color: var(--muted); }
footer p { margin: .25rem 0; }

/* Buttons and pills, shared by the home and beta pages. */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 48px;
  padding: .7rem 1.25rem; border: 1.5px solid var(--green); border-radius: 999px;
  font: 700 1rem/1.2 var(--sans); color: var(--green); background: transparent; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease;
}
.button.primary { background: var(--green); color: var(--on-green); }
.button:hover { transform: translateY(-1px); text-decoration: none; }
.pill { display: inline-block; border-radius: 999px; padding: .15rem .65rem; font-size: .8rem; font-weight: 700; background: var(--soft); color: var(--green); }
.pill.warm { background: var(--warm); color: var(--warm-ink); }
@media (prefers-reduced-motion: reduce) { .button { transition: none; } .button:hover { transform: none; } }

/* Home page. */
.wrap.home { max-width: 72rem; padding-left: clamp(1rem, 4vw, 2.5rem); padding-right: clamp(1rem, 4vw, 2.5rem); }
.home-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 30rem); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; padding: clamp(1.75rem, 5vw, 4rem) 0 1rem; }
.home-hero h1 { font-size: clamp(2.5rem, 6vw, 4.4rem); line-height: 1.04; letter-spacing: -.035em; margin: .4rem 0 1rem; }
.eyebrow { font-size: .9rem; font-weight: 700; color: var(--green); letter-spacing: .02em; margin: 0; }
.lead { font-size: clamp(1.08rem, 2vw, 1.22rem); max-width: 34rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin: 1.6rem 0 .75rem; }
.hero-note { color: var(--muted); font-size: .92rem; display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; }
.home-section { margin: clamp(3rem, 7vw, 5rem) 0; }
.home-section > h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); letter-spacing: -.025em; margin: 0 0 .5rem; }
.home-section > .intro { color: var(--muted); max-width: 40rem; margin: 0 0 1.75rem; }
.shots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.shots li { margin: 0; }
.shots img { display: block; width: 100%; height: auto; border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--paper); }
.shots h3 { margin: 1rem 0 .25rem; font-size: 1.12rem; }
.shots p { margin: 0; color: var(--muted); font-size: .95rem; }
.get { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.25rem; align-items: stretch; }
.get .card { margin: 0; padding: 1.5rem 1.6rem; }
.get h3 { font-size: 1.35rem; margin: .6rem 0 .5rem; }
.get ol { padding-left: 1.25rem; }
.get .hero-actions { margin: 1.1rem 0 .25rem; }
.store-badge { display: inline-block; margin: .6rem 0 .25rem -.6rem; }
.store-badge img { display: block; width: auto; height: 4.5rem; }
.small { font-size: .88rem; color: var(--muted); }

/* The home page puzzle (play/play.js). Region fills are the app's. */
.play { margin: 0; padding: 1.25rem; }
.play-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.play-head h2 { margin: 0; font-size: 1.3rem; }
.bands, .play-tools, .end-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.play button {
  font: 600 .9rem/1.2 var(--sans); color: var(--green); background: var(--paper);
  border: 1px solid var(--line); border-radius: 999px; padding: .45rem .9rem; min-height: 36px; cursor: pointer;
}
.play button:hover { border-color: var(--green); }
.play button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--on-green); }
.play .end-actions button.share { background: var(--green); color: var(--on-green); border-color: var(--green); }
.play-tools { justify-content: space-between; margin-top: .9rem; font-size: .92rem; color: var(--muted); }
.play-tools label { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }
.play-tools input { accent-color: var(--green); width: 1.05rem; height: 1.05rem; }
.hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin: 1rem 0 .6rem; font-variant-numeric: tabular-nums; }
.hearts { color: #d24d63; font-size: 1.3rem; letter-spacing: 2px; line-height: 1; font-family: system-ui, sans-serif; }
.clock { font-size: 1.35rem; font-weight: 700; }
.to-find { color: var(--muted); font-size: .92rem; text-align: right; }
.board {
  display: grid; gap: 4px; width: 100%; margin: 0 auto;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.board .cell {
  position: relative; aspect-ratio: 1; padding: 0; border: 1px solid rgba(0, 0, 0, .08); border-radius: 8px;
  display: grid; place-items: center; cursor: pointer; color: #1f2e26; font: 700 1rem system-ui, sans-serif;
  container-type: inline-size; -webkit-tap-highlight-color: transparent; transition: filter .1s ease;
}
.board .cell:hover { filter: brightness(1.04); }
.board .cell:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; z-index: 1; }
.board .cell[data-state="x"]::before, .board .cell[data-state="wrong"]::before {
  content: '✕'; font-size: 50cqi; line-height: 1;
}
.board .cell[data-state="wrong"] { color: #b3261e; }
.board .cell[data-state="sprig"] { border: 2px solid rgba(0, 0, 0, .35); }
.board .cell img { width: 86%; height: 86%; object-fit: contain; pointer-events: none; }
.board.letters .cell::after {
  content: attr(data-letter); position: absolute; top: 3px; left: 5px;
  font: 700 max(.55rem, 18cqi)/1 var(--sans); opacity: .6;
}
.board.solved .cell[data-state="sprig"] { animation: sprig-pop .5s ease-out; }
@keyframes sprig-pop { 50% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .board.solved .cell[data-state="sprig"] { animation: none; } .board .cell { transition: none; } }
.play-status { min-height: 1.6em; text-align: center; color: var(--green); font-weight: 600; font-size: .95rem; margin: .8rem 0 0; }
.end { background: var(--soft); border-radius: 14px; padding: .9rem 1.1rem; margin-top: .8rem; }
.end-title { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; margin: 0; }
.end-text { margin: .2rem 0 .75rem; }
.end-cta { font-size: .95rem; margin: .75rem 0 0; }
.end[hidden], .end [hidden] { display: none; }
.board .cell.r0 { background: #8bd59d; } .board .cell.r1 { background: #f5c75e; } .board .cell.r2 { background: #b08cdb; } .board .cell.r3 { background: #8edef9; }
.board .cell.r4 { background: #ea7c7b; } .board .cell.r5 { background: #daf77b; } .board .cell.r6 { background: #91b6ff; } .board .cell.r7 { background: #ef993f; }
.board .cell.r8 { background: #1bbcaa; } .board .cell.r9 { background: #f097cc; }
@media (prefers-color-scheme: dark) {
  .board .cell { color: #f1f5ee; border-color: rgba(255, 255, 255, .08); }
  .board .cell[data-state="wrong"] { color: #ffb4ab; }
  .board .cell[data-state="sprig"] { border-color: rgba(255, 255, 255, .45); }
  .board .cell.r0 { background: #0b5640; } .board .cell.r1 { background: #70560b; } .board .cell.r2 { background: #8161b9; } .board .cell.r3 { background: #055f90; }
  .board .cell.r4 { background: #b14f60; } .board .cell.r5 { background: #5c7c02; } .board .cell.r6 { background: #393683; } .board .cell.r7 { background: #752401; }
  .board .cell.r8 { background: #137f7d; } .board .cell.r9 { background: #813b6b; }
}

@media (max-width: 900px) {
  .home-hero { grid-template-columns: 1fr; }
  .home-hero .play { max-width: 32rem; width: 100%; }
  .shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .get { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .site-nav { gap: .25rem .9rem; font-size: .9rem; }
  .play { padding: 1rem .85rem; }
  .shots { gap: 1.25rem .75rem; }
  .shots img { border-radius: 14px; }
  .shots h3 { font-size: 1rem; }
  .shots p { font-size: .88rem; }
}
