/* Sprig website. The app's fonts (Figtree, Fraunces; SIL OFL, in /fonts)
   and colours, light and dark. */
@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);
  /* The redesign's paper and ink, as the app draws Moss's theme
     (mobile/lib/ui/appearance.dart): cards outlined in the tray's ink with
     a lip along the bottom, keys with a darker lip, the board as a tray. */
  --edge: #032c19; --lip: #032c19; --outline: #717972; --dot: #e0a93a;
  --key-lip: rgba(0, 0, 0, .24); --outline-lip: rgba(24, 29, 25, .08);
  --tray: #032c19; --tray-rim: #032c19; --token: #fffdf8; --piece-ink: #24382e; --heart: #d24d63;
  --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);
    --bg: #141914; --paper: #1c221d; --line: #2f372f;
    --edge: #8a938b; --lip: #000; --outline: #8a938b; --dot: #eebb54;
    --key-lip: rgba(0, 0, 0, .34); --outline-lip: rgba(0, 0, 0, .45);
    --tray: #080b09; --tray-rim: #0a5131; --token: #dfe4dd; --piece-ink: #f5faf6; --heart: #f08c9c;
  }
}
* { 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; }
/* A page's section headings, as the app's (SectionHeading): a honey dot,
   the words, then a rule to the end of the line. */
main > h2, .wrap > h2, .home-section > h2, article > h2, section > h2:not(.end-title) {
  display: flex; align-items: flex-start; gap: .55rem;
}
/* Both sit on the middle of the first line (line-height 1.15), so a
   heading that wraps keeps them beside its first words. */
main > h2::before, .wrap > h2::before, .home-section > h2::before, article > h2::before, section > h2:not(.end-title)::before {
  content: ''; flex: none; width: min(.45em, 12px); height: min(.45em, 12px); border-radius: 50%; background: var(--dot);
  margin-top: calc(.575em - min(.225em, 6px));
}
main > h2::after, .wrap > h2::after, .home-section > h2::after, article > h2::after, section > h2:not(.end-title)::after {
  content: ''; flex: 1 1 2rem; min-width: 2rem; height: 1.5px; background: var(--edge); opacity: .3;
  margin-top: calc(.575em - .75px);
}
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: 1.4px solid var(--edge); border-radius: 16px;
  padding: 1.1rem 1.35rem calc(1.1rem + 3.5px); margin: 1.25rem 0; box-shadow: inset 0 -3.5px 0 var(--lip);
}
.card > h3:first-child { margin-top: 0; }
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 the site navigation, on every page. */
header { display: flex; align-items: center; gap: .75rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.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. */
/* Keys, as the app's buttons: a rounded key with a darker lip along the
   bottom that sinks when pressed. */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 50px;
  padding: .7rem 1.25rem calc(.7rem + 3px); border: 1px solid var(--outline); border-radius: 14px;
  font: 600 1rem/1.2 var(--sans); color: var(--green); background: var(--paper); text-decoration: none; cursor: pointer;
  box-shadow: inset 0 -3px 0 var(--outline-lip); transition: box-shadow .1s ease, transform .1s ease;
}
.button.primary {
  min-height: 52px; border-color: var(--green); background: var(--green); color: var(--on-green); font-weight: 700;
  padding-bottom: calc(.7rem + 4px); box-shadow: inset 0 -4px 0 var(--key-lip);
}
.button:hover { text-decoration: none; filter: brightness(1.04); }
.button:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 var(--outline-lip); }
.button.primary:active { box-shadow: inset 0 -1px 0 var(--key-lip); }
@media (prefers-reduced-motion: reduce) { .button { transition: none; } .button:active { 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; }
.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: 1.4px solid var(--edge); 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: 1fr 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; }
.app-store-badge { margin-left: 0; padding: .75rem 0; }
.app-store-badge img { height: 3rem; }
.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(--outline); border-radius: 12px; padding: .45rem .9rem calc(.45rem + 2px); min-height: 38px; cursor: pointer;
  box-shadow: inset 0 -2px 0 var(--outline-lip);
}
.play button:hover { border-color: var(--green); }
/* The chosen band is set into the tray, as the app's chosen segment. */
.play button[aria-pressed="true"] { background: var(--tray); border-color: var(--tray); color: var(--token); box-shadow: none; }
.play .end-actions button.share-picture { border-color: var(--green); }
.play .challenge, .play .newer { margin: 0 0 .6rem; padding: .55rem .8rem; border-radius: 12px; background: var(--honey, #f2e7cc); color: #54441c; font-weight: 600; }
.play .challenge a { color: inherit; }
.play .share-nudge { margin: .2rem 0 .5rem; color: var(--green); font-weight: 600; }
.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: var(--heart); 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 {
  /* The tray: a dark well under the pieces, as the app's board. */
  /* As the app (pieceShape): hairline seams, a narrow groove between
     colours and small corners, so rows and columns run straight. */
  --seam: .5px; --groove: 1px; --square: 1px; --round: 4px;
  display: grid; gap: 0; width: 100%; margin: 0 auto; padding: 6px; border-radius: 15px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tray) 60%, #000) 0, var(--tray) 12px);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.board .cell {
  position: relative; aspect-ratio: 1; border: 0; border-radius: 0; background: none; margin: 0;
  display: grid; cursor: pointer; color: var(--piece-ink); font: 700 1rem system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.board .piece {
  position: relative; display: grid; place-items: center; min-width: 0; min-height: 0;
  border-radius: var(--corners); container-type: inline-size; transition: filter .1s ease;
}
.board .cell:hover .piece { filter: brightness(1.05); }
/* The smallest phones (320 px): a little less groove and rounding, so an
   8×8 board fits the screen with room for each square. */
@media (max-width: 360px) { .play { padding: .9rem; } .board { --round: 3px; padding: 5px; } }
.board .cell:focus-visible { outline: 3px solid var(--dot); outline-offset: -1px; z-index: 1; border-radius: 6px; }
.board .cell[data-state="x"] .piece::before, .board .cell[data-state="wrong"] .piece::before {
  content: '✕'; font-size: 50cqi; line-height: 1;
}
.board .cell[data-state="wrong"] { color: #b3261e; }
/* A Sprig on its token: a disc in the token colour, rimmed with the tray,
   the Sprig standing a little above its middle. */
.board .token {
  width: 78%; aspect-ratio: 1; border-radius: 50%; background: var(--token);
  border: max(1.5px, 6cqi) solid var(--tray); box-shadow: 0 7cqi 0 rgba(0, 0, 0, .32);
  display: grid; place-items: center; overflow: visible;
}
.board .token img { width: 100%; height: 100%; object-fit: contain; transform: translateY(-8%); pointer-events: none; }
.board.letters .piece::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"] .token { 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"] .token { animation: none; } .board .piece { 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; }
/* After a board a friend shared with their code: add them in the app. */
.add-friend { margin: .25rem 0 1rem; }
.add-friend p { margin: 0 0 .6rem; }
.end-cta { font-size: .95rem; margin: .75rem 0 0; }
.end[hidden], .end [hidden] { display: none; }
.board .cell.r0 .piece { background: #7dcd94; } .board .cell.r1 .piece { background: #f9c36b; } .board .cell.r2 .piece { background: #b191d7; } .board .cell.r3 .piece { background: #93dffc; }
.board .cell.r4 .piece { background: #e28587; } .board .cell.r5 .piece { background: #c3e2a6; } .board .cell.r6 .piece { background: #99b8f5; } .board .cell.r7 .piece { background: #e6a062; }
.board .cell.r8 .piece { background: #4ab6aa; } .board .cell.r9 .piece { background: #e9a1c9; }
@media (prefers-color-scheme: dark) {
  /* The near-black tray carries the theme's colour in its rim. */
  .board { border: 2px solid var(--tray-rim); }
  .board .cell[data-state="wrong"] { color: #ffb4ab; }
  .board .cell.r0 .piece { background: #0b5640; } .board .cell.r1 .piece { background: #70560b; } .board .cell.r2 .piece { background: #8161b9; } .board .cell.r3 .piece { background: #055f90; }
  .board .cell.r4 .piece { background: #b14f60; } .board .cell.r5 .piece { background: #5c7c02; } .board .cell.r6 .piece { background: #393683; } .board .cell.r7 .piece { background: #752401; }
  .board .cell.r8 .piece { background: #137f7d; } .board .cell.r9 .piece { background: #813b6b; }
  /* A dark piece too close to the tray gets a lighter edge (pieceEdge). */
  .board .cell.r0 .piece { box-shadow: inset 0 0 0 1px #118362; } .board .cell.r1 .piece { box-shadow: inset 0 0 0 1px #95730f; }
  .board .cell.r3 .piece { box-shadow: inset 0 0 0 1px #0780c1; } .board .cell.r6 .piece { box-shadow: inset 0 0 0 1px #7370c4; }
  .board .cell.r7 .piece { box-shadow: inset 0 0 0 1px #da4302; } .board .cell.r9 .piece { box-shadow: inset 0 0 0 1px #b05393; }
}

@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 .8rem; 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; }
}
/* The smallest phones: the five links in two even rows, not four and one. */
@media (max-width: 359px) {
  .site-nav { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; }
}

/* Puzzle guides and the standalone play page. */
.skip-link { position: absolute; top: -6rem; left: 1rem; z-index: 10; padding: .6rem 1rem; background: var(--paper); border: 2px solid var(--green); border-radius: 8px; }
.skip-link:focus { top: .5rem; }
.wrap.guide { max-width: 54rem; }
.guide main { max-width: 44rem; margin: 2rem auto 0; }
.guide main > h1 { margin-top: .5rem; }
.guide .card h2, .controls h2, .guide-cards h3 { margin-top: 0; }
.guide-figure { margin: 1.75rem 0; }
.guide-figure img { display: block; width: 100%; max-width: 30rem; height: auto; border-radius: 16px; border: 1.4px solid var(--edge); }
.guide-figure figcaption { max-width: 35rem; margin-top: .7rem; color: var(--muted); font-size: .92rem; }
.guide-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.guide-cards .card { margin: 0; padding: 1.25rem; }
.guide-cards p { margin-bottom: 0; }
.table-scroll { overflow-x: auto; margin: 1.25rem 0; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .95rem; }
caption { text-align: left; font-weight: 600; margin-bottom: .5rem; }
th, td { padding: .65rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead { background: var(--soft); }
/* The practice page: the heading, then the board, then the controls. On a
   wide screen the board sits beside the other two; on a phone it comes
   straight after the heading. Keyboard help shows only where a keyboard is
   likely (a fine pointer). */
.play-page { grid-template-areas: "intro play" "more play"; }
.play-page .play-intro { grid-area: intro; }
.play-page .play { grid-area: play; }
.play-page .play-more { grid-area: more; }
.play-page .play-intro .lead { margin-bottom: 0; }
.play-page .controls { margin-top: 0; }
@media (max-width: 900px) {
  .play-page { grid-template-areas: "intro" "play" "more"; }
  .play-page .play-intro h1 { font-size: clamp(2rem, 8vw, 2.6rem); margin-bottom: .5rem; }
}
@media (hover: none) and (pointer: coarse) { .controls .keys { display: none; } }
@media (max-width: 700px) { .guide-cards { grid-template-columns: 1fr; } }
/* The daily puzzle (daily.html and the home page). */
.daily-page { max-width: 36rem; }
.daily-page .play { margin-top: 1.25rem; }
.daily-title { margin: 0; }
.daily-label { margin: .15rem 0 0; color: var(--muted); font-size: .92rem; }
.board .cell[data-state="reveal"] .token { opacity: .45; }
.daily-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; margin: 0 0 .9rem; text-align: center; }
/* Number above label, every number on one line and level with the others,
   however many lines a label takes on a narrow phone. */
.daily-stats div { display: flex; flex-direction: column; min-width: 0; }
.daily-stats dt { order: 1; font-size: .74rem; line-height: 1.25; color: var(--muted); overflow-wrap: anywhere; }
.daily-stats dd { margin: 0; font: 600 clamp(1rem, 5vw, 1.3rem)/1.2 var(--serif); font-variant-numeric: tabular-nums; white-space: nowrap; }
.daily-next { margin: .6rem 0 0; color: var(--muted); font-size: .92rem; font-variant-numeric: tabular-nums; }
.daily-next:empty { display: none; }

/* The daily archive's list of past boards. */
.archive-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .6rem; margin: 0; padding: 0; list-style: none; }
.archive-list li {
  display: flex; flex-direction: column; margin: 0; padding: .65rem .9rem calc(.65rem + 2.5px); background: var(--paper);
  border: 1.4px solid var(--edge); border-radius: 14px; box-shadow: inset 0 -2.5px 0 var(--lip);
}
.archive-list li[data-result="solved"] { border-color: var(--green); box-shadow: inset 0 -2.5px 0 var(--green); }
.archive-list a { font-weight: 700; }
.archive-list a[aria-current="page"] { color: var(--ink); text-decoration: none; }
.archive-list span { color: var(--muted); font-size: .9rem; }
