/* The Second. The app's own tokens: App/Design/Theme.swift. */
:root {
  color-scheme: light dark;
  --ink: #10131c;
  --note: #555a69;
  --faint: #737889;
  --pencil: #2a56d6;
  --amber: #b86e0c;
  --amber-ink: #804a04;
  --plan-ink: #0f766e;
  --good: #23805a;
  --rival: #b7423b;
  --edge: #fafaf8;
  --card: rgba(255, 255, 255, 0.74);
  --card-stroke: rgba(16, 19, 28, 0.07);
  --hair: rgba(16, 19, 28, 0.12);
  --board-stroke: rgba(0, 0, 0, 0.1);
  --board-shadow: 0 1px 1px rgba(16, 24, 48, 0.06), 0 22px 44px -22px rgba(16, 24, 48, 0.42);
  --serif: ui-serif, "New York", "Newsreader", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 16px;
  --max: 1160px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f3f4f8;
    --note: #a9aec2;
    --faint: #8188a0;
    --pencil: #86a4ff;
    --amber: #f2b45a;
    --amber-ink: #f2b45a;
    --plan-ink: #5eead4;
    --good: #62cc98;
    --rival: #f08a80;
    --edge: #07090f;
    --card: rgba(255, 255, 255, 0.065);
    --card-stroke: rgba(255, 255, 255, 0.09);
    --hair: rgba(255, 255, 255, 0.12);
    --board-stroke: rgba(255, 255, 255, 0.14);
    --board-shadow: 0 1px 1px rgba(0, 0, 0, 0.3), 0 26px 50px -24px rgba(0, 0, 0, 0.7);
  }
}
/* Over the amber field grey turns to mud: secondary text takes the field's own ink. */
body[data-mood="out"] { --note: #5c4517; --faint: #6e5a34; }
@media (prefers-color-scheme: dark) {
  body[data-mood="out"] { --note: #f3e3c4; --faint: #d9c7a4; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--edge);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
p, h1, h2, h3, ul, figure { margin: 0; }
a { color: var(--pencil); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
:focus-visible { outline: 2px solid var(--pencil); outline-offset: 3px; border-radius: 4px; }

/* The room: a slow colour field, as in the app. Drawn by app.js. */
.field {
  position: fixed;
  inset: -6vmax;
  width: calc(100% + 12vmax);
  height: calc(100% + 12vmax);
  z-index: -2;
  filter: blur(28px);
  pointer-events: none;
}
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1.2 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 32px; } }

.bar { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 8px; }
.wordmark {
  font: 500 1.375rem/1 var(--serif);
  letter-spacing: -0.012em;
  color: var(--ink);
}
.wordmark:hover { text-decoration: none; }
.soon { font-size: 0.9375rem; color: var(--note); }

/* Type: New York for the coach's voice and every heading, never heavier than semibold. */
.display {
  font: 500 clamp(2.7rem, 1.55rem + 4.7vw, 5.4rem)/1.02 var(--serif);
  letter-spacing: -0.026em;
  text-wrap: balance;
}
.display.small { font-size: clamp(2.2rem, 1.4rem + 3.2vw, 4rem); }
h2 {
  font: 500 clamp(2.05rem, 1.45rem + 2.4vw, 3.3rem)/1.06 var(--serif);
  letter-spacing: -0.021em;
  text-wrap: balance;
}
h3 { font: 500 1.5rem/1.2 var(--serif); letter-spacing: -0.01em; }
.lede { font-size: 1.1875rem; line-height: 1.5; color: var(--note); max-width: 33ch; }
.avail { font-size: 0.9375rem; color: var(--note); max-width: 40ch; }
.note { color: var(--note); }
.kicker { font: 600 0.8125rem/1.3 var(--sans); color: var(--note); }
.kicker.strong { color: var(--ink); opacity: 0.8; }

/* Hero */
/* On a phone the board follows the headline at once; the explanation comes after it. */
.hero { display: grid; grid-template-areas: "title" "board" "more"; gap: 28px; padding-top: 28px; padding-bottom: 72px; }
.hero-title { grid-area: title; }
.hero .coachboard { grid-area: board; }
.hero-more { grid-area: more; display: grid; gap: 20px; }
@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 500px);
    grid-template-rows: 1fr auto auto 1fr;
    grid-template-areas: ". board" "title board" "more board" ". board";
    column-gap: 80px;
    row-gap: 24px;
    align-items: center;
    min-height: min(calc(100svh - 70px), 900px);
    padding-bottom: 72px;
  }
  .hero-more { align-self: start; gap: 24px; }
}

/* The board with its margin: moves, the coach's tag, the coach's sentence. */
.coachboard { display: grid; gap: 14px; width: 100%; max-width: 500px; justify-self: center; }
@media (min-width: 960px) { .coachboard { justify-self: end; } }
.margin { display: grid; gap: 8px; min-height: 8.4rem; align-content: end; }
@media (min-width: 960px) { .margin { min-height: 9.6rem; } }
.coachboard.still .margin { min-height: 0; }
.moves { font: 400 1.125rem/1.45 var(--serif); color: var(--note); font-variant-numeric: lining-nums; }
.moves .n { color: var(--faint); }
.moves b { font-weight: 600; color: var(--ink); }
.moves b.bad { color: var(--amber-ink); }
.moves b.good { color: var(--good); }
.tag { font: 500 0.9375rem/1.4 var(--sans); color: var(--amber-ink); }
.tag.plan { font: italic 500 1.1875rem/1.3 var(--serif); color: var(--plan-ink); }
.coach { font: 400 1.5rem/1.28 var(--serif); letter-spacing: -0.008em; text-wrap: pretty; }
.coach.alert { font-weight: 600; }
.coach, .hint, .tag { transition: opacity 0.28s ease-out; }
.fading { opacity: 0; }
.slot { min-height: 3.2rem; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hint { font-size: 0.9375rem; color: var(--note); }
.action {
  appearance: none;
  border: 0;
  background: none;
  padding: 10px 2px;
  margin-left: auto;
  font: 600 1rem/1 var(--sans);
  color: var(--pencil);
  cursor: pointer;
  white-space: nowrap;
}
body[data-mood="out"] .action { color: var(--amber-ink); }

/* Chapters */
.chapter { display: grid; gap: 40px; padding-top: 80px; padding-bottom: 80px; }
.words { display: grid; gap: 18px; align-content: center; max-width: 34rem; }
.words p { font-size: 1.125rem; color: var(--note); max-width: 38ch; }
@media (min-width: 960px) {
  .chapter { grid-template-columns: minmax(0, 1fr) minmax(0, 500px); gap: 80px; align-items: center; padding-top: 112px; padding-bottom: 112px; }
}

/* A sheet of paper lying on the field. */
.sheet {
  background: var(--card);
  border: 1px solid var(--card-stroke);
  border-radius: 24px;
  padding: 24px;
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
  width: 100%;
  max-width: 500px;
  justify-self: center;
}
@media (min-width: 960px) { .sheet { justify-self: end; } }

.report { display: grid; gap: 8px; }
.report figcaption { color: var(--faint); margin-bottom: 14px; }
.verdict { font: 500 1.5rem/1.22 var(--serif); letter-spacing: -0.01em; }
.report > .note { padding-bottom: 20px; border-bottom: 1px solid var(--hair); }
.finding { display: grid; grid-template-columns: 156px minmax(0, 1fr); gap: 20px; align-items: center; padding-top: 16px; }
@media (max-width: 420px) { .finding { grid-template-columns: 124px minmax(0, 1fr); gap: 16px; } }
.finding-title { font: 500 1.375rem/1.2 var(--serif); margin: 2px 0 4px; }
.plain { margin-top: 4px; }

.openings { list-style: none; padding-top: 8px; padding-bottom: 8px; }
.openings li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 18px; align-items: center; padding: 16px 0; }
.openings li + li { border-top: 1px solid var(--hair); }
.row-title { font: 500 1.25rem/1.25 var(--serif); margin-bottom: 4px; }
.openings .note { font-size: 0.9375rem; line-height: 1.45; }

.quiet { align-items: start; }
.pair { display: grid; gap: 36px; max-width: 500px; justify-self: center; width: 100%; }
@media (min-width: 960px) { .pair { justify-self: end; padding-top: 6px; } }
.pair p { color: var(--note); margin-top: 10px; max-width: 40ch; }

.closing { padding-top: 96px; padding-bottom: 120px; display: grid; gap: 18px; }

.foot { display: grid; gap: 14px; padding-top: 36px; padding-bottom: 48px; border-top: 1px solid var(--hair); }
.foot .wordmark { font-size: 1.125rem; }
.foot .note { font-size: 0.875rem; max-width: 62ch; }
.foot nav { display: flex; gap: 22px; font-size: 0.9375rem; }

/* Board: vellum and ink-blue, the same by day and night. */
.board {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  isolation: isolate;
  container-type: inline-size;
  box-shadow: var(--board-shadow);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.board::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--board-stroke); pointer-events: none; z-index: 40; }
.board.mini { border-radius: 6px; box-shadow: 0 10px 22px -14px rgba(16, 24, 48, 0.45); }
.board.live { touch-action: none; cursor: grab; }
.sqs { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); }
.sq { background: #efe8dc; transition: background-color 0.25s ease-out; }
.sq.d { background: #7389ab; }
.sq.last { background: #f3dc8c; }
.sq.d.last { background: #d4b55a; }
.sq.from { background: #f2dfa2; }
.sq.d.from { background: #dcc481; }
.sq.alarm { background: #f7b84a; }
.sq.d.alarm { background: #e89b1f; }
.sq.alarmfrom { background: #f3ce8c; }
.sq.d.alarmfrom { background: #ebbe74; }
.sq.sel { box-shadow: inset 0 0 0 3px rgba(43, 92, 230, 0.75); }
.coord { position: absolute; z-index: 1; font: 600 2.1cqw/1 ui-rounded, var(--sans); pointer-events: none; }
.coord.l { color: #7389ab; }
.coord.d { color: #efe8dc; }
.pc {
  position: absolute;
  left: 0;
  top: 0;
  width: 12.5%;
  height: 12.5%;
  z-index: 2;
  transition: transform 0.34s cubic-bezier(0.25, 0.9, 0.3, 1.08), opacity 0.25s ease-out;
  pointer-events: none;
}
.pc img { display: block; width: 100%; height: 100%; filter: drop-shadow(0 1.5px 1px rgba(0, 0, 0, 0.2)); transition: transform 0.22s cubic-bezier(0.3, 1.4, 0.5, 1), filter 0.22s; }
.pc.top { z-index: 3; }
.pc.lift { z-index: 12; transition: opacity 0.25s; }
.pc.lift img { transform: scale(1.14) translateY(-8%); filter: drop-shadow(0 10px 7px rgba(0, 0, 0, 0.3)); }
.pc.gone { opacity: 0; }
.pc.gone img { transform: scale(0.55); }
.pc.wobble img { animation: wobble 0.42s ease-in-out; }
@keyframes wobble { 20% { transform: translateX(-9%); } 45% { transform: translateX(8%); } 70% { transform: translateX(-5%); } 100% { transform: none; } }
.marks { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 20; pointer-events: none; overflow: visible; }
.marks .draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.marks.shown .draw { animation: draw 0.42s ease-out forwards; }
.marks .glyph .draw { animation-duration: 0.34s; }
.marks .dot { transform-box: fill-box; transform-origin: center; transform: scale(0.01); }
.marks.shown .dot { animation: dot 0.3s cubic-bezier(0.3, 1.7, 0.5, 1) 0.32s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes dot { to { transform: scale(1); } }
.ripple {
  position: absolute;
  width: 12.5%;
  height: 12.5%;
  border-radius: 50%;
  border: 2px solid #e89b1f;
  z-index: 15;
  pointer-events: none;
  animation: ripple 1.1s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
@keyframes ripple { from { transform: scale(0.5); opacity: 0.9; } to { transform: scale(5.2); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .pc, .pc img, .sq { transition: none; }
  .marks .draw { stroke-dashoffset: 0; animation: none !important; }
  .marks .dot { transform: none; animation: none !important; }
  .ripple { display: none; }
}

/* Plain pages: privacy, support, not found. */
.page { padding-top: 56px; padding-bottom: 96px; max-width: 760px; }
.page h1 { font: 500 clamp(2.4rem, 1.6rem + 3vw, 3.6rem)/1.05 var(--serif); letter-spacing: -0.022em; margin-bottom: 12px; }
.page .updated { color: var(--faint); font-size: 0.9375rem; margin-bottom: 40px; }
.page h2 { font-size: 1.5rem; letter-spacing: -0.01em; margin-top: 40px; margin-bottom: 10px; }
.page p { color: var(--note); max-width: 62ch; }
.page p + p { margin-top: 12px; }
.page p strong { color: var(--ink); font-weight: 600; }
.nw { white-space: nowrap; }
