/* The demo shell borrows the design's own palette and faces; the boards stay light-only, so
   the shell does too. Waypoint colours sit outside that palette on purpose, so they never
   read as part of the design. */
:root {
  --paper: #FAF8F3;
  --card: #FFFFFF;
  --ink: #1D1B18;
  --ink-2: #4A463F;
  --muted: #6E685F;
  --rule: #E4DFD4;
  --field: #DDD6C8;
  --moss: #2F6B4F;
  --moss-deep: #1F4D38;
  --desk: #E9E4D8;
  --wp-go: #2957C9;
  --wp-try: #B3307C;
  --serif: Newsreader, Georgia, 'Times New Roman', serif;
  --sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
html { background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body[data-view="phone"] { background: var(--desk); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--moss); outline-offset: 2px; }

/* ---------- Boards (rules shared by every board's own stylesheet) ---------- */
#stage { overflow-x: hidden; }
#board { width: fit-content; margin: 0 auto; }
#board a { color: var(--moss); text-decoration: none; }
#board a:hover { color: var(--moss-deep); text-decoration: underline; }
#board input, #board textarea, #board button, #board select { font: inherit; }
#board input[type=checkbox], #board input[type=radio] { accent-color: var(--moss); }
body[data-view="phone"] #stage { padding-block: 32px 96px; }
body[data-view="phone"] #board { border-radius: 28px; overflow: hidden; box-shadow: 0 0 0 1px rgba(29, 27, 24, .08), 0 24px 60px -24px rgba(29, 27, 24, .35); }

/* ---------- Waypoints ---------- */
body.wp-on #board [data-wp] {
  outline: 2px solid var(--wp-go) !important;
  outline-offset: 3px !important;
  animation: wp-breathe 2.2s ease-in-out infinite;
}
body.wp-on #board [data-wp="try"] { outline: 2px dashed var(--wp-try) !important; }
@keyframes wp-breathe { 50% { outline-offset: 5px; } }
@media (prefers-reduced-motion: reduce) { body.wp-on #board [data-wp] { animation: none; } }

#wp-tip {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  padding: 5px 9px; border-radius: 5px; background: var(--wp-go); color: #FFFFFF;
  font: 500 12px/1.3 var(--sans); white-space: nowrap; box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .4);
}
#wp-tip[data-kind="try"] { background: var(--wp-try); }

.swatch { display: inline-block; width: 16px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 7px; }
.swatch-go { border: 2px solid var(--wp-go); }
.swatch-try { border: 2px dashed var(--wp-try); }

/* ---------- Dock ---------- */
#dock {
  position: fixed; z-index: 50;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: flex-end; gap: 8px;
}
.dock-btn {
  width: 38px; height: 38px; border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--field); background: rgba(255, 255, 255, .86); color: var(--ink-2);
  box-shadow: 0 6px 18px -10px rgba(29, 27, 24, .45);
  cursor: pointer; opacity: .55; transition: opacity .15s, background .15s, color .15s;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
#dock:hover .dock-btn, .dock-btn:focus-visible, .dock-btn[aria-pressed="true"], .dock-btn[aria-expanded="true"] { opacity: 1; }
.dock-btn:hover { background: var(--card); color: var(--ink); }
#wp-toggle[aria-pressed="true"] { background: var(--wp-go); border-color: var(--wp-go); color: #FFFFFF; }
#menu-toggle[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

#wp-legend {
  position: absolute; right: 0; bottom: 48px;
  display: flex; flex-direction: column; gap: 3px;
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--rule); background: rgba(255, 255, 255, .94);
  font-size: 12px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums;
  box-shadow: 0 8px 24px -14px rgba(29, 27, 24, .5);
}
#wp-legend b { color: var(--ink); font-weight: 600; margin-right: 3px; }
#menu:not([hidden]) ~ #wp-legend, #wp-legend:has(~ #menu:not([hidden])) { display: none; }

#menu {
  position: absolute; right: 0; bottom: 48px;
  width: min(320px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 96px));
  display: flex; flex-direction: column;
  border: 1px solid var(--rule); border-radius: 10px; background: var(--card);
  box-shadow: 0 18px 50px -20px rgba(29, 27, 24, .45);
  font-size: 14px;
}
.menu-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px; border-bottom: 1px solid var(--rule); }
.menu-head > div { flex: 1; min-width: 0; text-align: center; }
.menu-where { font-weight: 600; }
.menu-seen { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.menu-head button {
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--field); background: var(--card);
  font-size: 20px; line-height: 1; color: var(--ink); cursor: pointer;
}
.menu-head button:disabled { opacity: .35; cursor: default; }
.menu-list { overflow-y: auto; padding: 4px 0 8px; overscroll-behavior: contain; }
.menu-list h3, .about-index h3 {
  margin: 12px 16px 4px; font: 500 11px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.menu-list ul, .about-index ul { list-style: none; margin: 0; padding: 0; }
.menu-link { display: flex; align-items: center; gap: 10px; padding: 5px 16px; color: var(--ink-2); text-decoration: none; }
.menu-link:hover { background: var(--paper); color: var(--ink); }
.menu-link[aria-current] { color: var(--ink); font-weight: 600; background: var(--paper); }
.seen { flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--field); }
.seen.is-seen { background: var(--moss); border-color: var(--moss); }
.menu-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--rule); font-size: 13px; }
.menu-foot a { color: var(--moss); text-decoration: none; }
.menu-foot a:hover { text-decoration: underline; }
.menu-foot button { border: 0; padding: 0; background: none; font: inherit; color: var(--muted); cursor: pointer; }
.menu-foot button:hover { color: #A34A28; text-decoration: underline; }

#toast {
  position: fixed; z-index: 70; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 8px;
  background: var(--ink); color: var(--paper); font-size: 14px; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .5);
}

/* ---------- About ---------- */
.about-bar {
  height: 60px; box-sizing: border-box; padding: 0 clamp(16px, 4vw, 48px);
  display: flex; align-items: center; gap: 20px; border-bottom: 1px solid var(--rule);
}
.wordmark { font-family: var(--serif); font-size: 23px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.wordmark i { font-weight: 400; }
.about-bar-label { font-size: 14px; color: var(--muted); }
.about-bar-go {
  margin-left: auto; height: 36px; padding: 0 16px; display: inline-flex; align-items: center;
  border-radius: 6px; background: var(--moss); color: #FFFFFF; font-size: 14px; font-weight: 600; text-decoration: none;
}
.about-bar-go:hover { background: var(--moss-deep); }

.about-body { max-width: 680px; margin: 0 auto; padding: 56px 16px 120px; display: flex; flex-direction: column; gap: 52px; }
.about-body a { color: var(--moss); }
.about-body a:hover { color: var(--moss-deep); }
.eyebrow { margin: 0 0 14px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.about-hero h1 { margin: 0; font-family: var(--serif); font-size: clamp(38px, 7vw, 56px); line-height: 1.04; font-weight: 500; letter-spacing: -.02em; text-wrap: balance; }
.lede { margin: 18px 0 0; font-family: var(--serif); font-size: 21px; line-height: 1.5; color: var(--ink-2); }
.about-meta { margin: 18px 0 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.about-section { display: flex; flex-direction: column; gap: 14px; }
.about-section > p { margin: 0; }
.about-section h2 {
  margin: 0; padding-bottom: 8px; border-bottom: 1px dotted #BDB5A6;
  font-family: var(--serif); font-size: 22px; line-height: 1.2; font-weight: 600; text-wrap: balance;
}

.facts { list-style: none; margin: 0; padding: 0; }
.facts li { display: flex; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.facts li > span:first-child { width: 96px; flex-shrink: 0; color: var(--muted); font-size: 14px; }

.starts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.start {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px;
  border: 1px solid var(--field); border-radius: 8px; background: var(--card); text-decoration: none;
}
.about-body .start b { color: var(--ink); font-weight: 600; }
.about-body .start span { color: var(--muted); font-size: 14px; }
.about-body .start:hover { border-color: var(--moss); }
.about-body .start:hover b { color: var(--moss); }

.howto { display: flex; flex-direction: column; gap: 16px; }
.howto-row { display: flex; gap: 14px; align-items: flex-start; }
.howto-row > div { min-width: 0; }
.dock-demo {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--field); background: var(--card);
  display: flex; align-items: center; justify-content: center; color: var(--ink-2);
}
.legend-list { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }

.keys { border-collapse: collapse; font-size: 14px; }
.keys caption { text-align: left; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding-bottom: 6px; }
.keys td { padding: 5px 0; border-bottom: 1px solid var(--rule); }
.keys td:first-child { width: 96px; white-space: nowrap; }
kbd {
  display: inline-block; min-width: 22px; padding: 1px 6px; box-sizing: border-box; text-align: center;
  border: 1px solid var(--field); border-bottom-width: 2px; border-radius: 4px; background: var(--card);
  font: 500 12px/1.5 var(--sans); color: var(--ink);
}

.tries, .questions { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.questions { font-family: var(--serif); font-size: 17px; }

.notes-label { margin-top: 6px; font-weight: 600; font-size: 14px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.notes-label span { font-weight: 400; color: var(--muted); font-size: 13px; }
#notes {
  display: block; width: 100%; box-sizing: border-box; padding: 12px 14px;
  border: 1px solid var(--field); border-radius: 6px; background: var(--card);
  font: 17px/1.6 var(--serif); color: var(--ink); resize: vertical;
}
#notes:focus { outline: 2px solid var(--moss); outline-offset: 1px; }
.notes-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.notes-actions p { margin: 0; font-size: 14px; }
#notes-copy {
  height: 38px; padding: 0 16px; border: 0; border-radius: 6px; background: var(--ink); color: var(--paper);
  font: 600 14px var(--sans); cursor: pointer;
}
#notes-copy:hover { background: #000000; }
.fine { font-size: 14px; color: var(--muted); }

.about-index { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 24px; }
.about-index h3 { margin: 4px 0 6px; }
.index-link { display: flex; align-items: center; gap: 9px; padding: 3px 0; font-size: 14px; text-decoration: none; }
