/* Chess Mirror — site styles.
   Two accents carry meaning throughout: green is the real game on chess.com,
   amber is the mirror. Nothing else is allowed to use them. */

:root {
  --ink: #171614;
  --slate: #201e1c;
  --raise: #2a2825;
  --edge: #38342f;
  --chalk: #efece5;
  --dust: #968e86;
  --board: #739552;
  --board-dk: #5d7c41;
  --cream: #ebecd0;
  --amber: #f0c15c;
  --alert: #d76a5a;

  --shell: min(1140px, 100% - 3rem);
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--chalk);
  font: 400 1rem/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

a { color: inherit; }

:where(a, button, input, textarea, summary):focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 3px;
}

.shell { width: var(--shell); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ── Type ─────────────────────────────────────────────────────────── */

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  font-variation-settings: "SOFT" 8, "WONK" 1;
  line-height: 1.04;
  letter-spacing: -0.018em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.5rem, 6.4vw, 4.9rem); }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
h3 { font-size: 1.12rem; font-variation-settings: "SOFT" 0, "WONK" 0; letter-spacing: -0.01em; }

p { margin: 0; }

.lede {
  font-size: clamp(1.02rem, 1.5vw, 1.19rem);
  color: #cfc9c1;
  max-width: 54ch;
  text-wrap: pretty;
}

.eyebrow {
  font: 500 0.7rem/1 var(--mono);
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--dust);
}

/* ── Chrome ───────────────────────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(23, 22, 20, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--edge);
}

.topbar-in {
  display: flex; align-items: center; gap: 1.25rem;
  height: 60px;
}

.wordmark {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.06rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  margin-right: auto;
}

.wordmark svg { width: 26px; height: 26px; border-radius: 7px; display: block; }

.topbar nav { display: flex; align-items: center; gap: 1.4rem; }

.topbar nav a {
  font-size: 0.87rem;
  color: var(--dust);
  text-decoration: none;
  transition: color 0.15s;
}

.topbar nav a:hover { color: var(--chalk); }

@media (max-width: 620px) {
  .topbar nav a.nav-hide { display: none; }
}

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.62rem 1.15rem;
  font: 500 0.9rem/1 var(--body);
  color: var(--ink);
  background: var(--amber);
  border: 1px solid var(--amber);
  border-radius: 7px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.14s, filter 0.14s;
}

.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.45; cursor: default; transform: none; filter: none; }

.btn-quiet {
  color: var(--chalk);
  background: transparent;
  border-color: var(--edge);
}

.btn-quiet:hover { border-color: var(--dust); filter: none; }

.topbar .btn { padding: 0.46rem 0.95rem; font-size: 0.84rem; }

/* ── Hero ─────────────────────────────────────────────────────────── */

.hero { padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(1.75rem, 3vw, 2.5rem); }

.hero h1 { max-width: 19ch; font-size: clamp(2.4rem, 5.6vw, 4.3rem); }

.hero h1 em {
  font-style: normal;
  color: var(--amber);
}

.hero .lede { margin-top: 1.5rem; }

.hero-cta {
  margin-top: 2.1rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
}

.hero-note {
  font: 400 0.8rem/1.5 var(--mono);
  color: var(--dust);
  margin-top: 1rem;
}

.hero-note[data-games] { color: #b9b2aa; margin-top: 1.4rem; }
.hero-note[data-games] + .hero-note { margin-top: 0.3rem; }

/* ── The mirror demo (signature) ──────────────────────────────────── */

.demo { padding-bottom: clamp(3.5rem, 7vw, 5.5rem); }

.mirror {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: clamp(0.75rem, 2.5vw, 2rem);
}

.stage { min-width: 0; }

.stage-head {
  display: flex; align-items: baseline; gap: 0.5rem;
  margin-bottom: 0.6rem;
  min-height: 2.4em;
  flex-wrap: wrap;
}

.stage-head b {
  font: 500 0.78rem/1.3 var(--mono);
  letter-spacing: 0.02em;
}

.stage-head span {
  font-size: 0.76rem;
  color: var(--dust);
  line-height: 1.3;
}

.frame {
  border-radius: 12px;
  padding: 10px;
  background: var(--slate);
  border: 1px solid var(--edge);
}

.stage-tab .frame { border-color: rgba(115, 149, 82, 0.5); }
.stage-panel .frame { border-color: rgba(240, 193, 92, 0.55); }

/* The background tab is the real game, but it is not being looked at —
   and, while hidden, not reliably repainted either. */
.stage-tab .board { opacity: 0.74; filter: saturate(0.72); }

.stage-tab b { color: var(--board); }
.stage-panel b { color: var(--amber); }

.board { display: block; width: 100%; height: auto; border-radius: 5px; }
.board .lt { fill: var(--cream); }
.board .dk { fill: var(--board); }

.pc { transition: transform 0.34s cubic-bezier(0.22, 0.72, 0.3, 1); }
.pc.w { fill: #f4f2e7; stroke: #1b1917; stroke-width: 3; stroke-linejoin: round; }
.pc.b { fill: #22201d; stroke: #100f0d; stroke-width: 3; stroke-linejoin: round; }
.pc.gone { opacity: 0; transition: opacity 0.18s; }

.hl rect { fill: var(--amber); opacity: 0.3; }

/* The link between them. Its direction is the whole point: an opponent
   move travels tab → panel, and your move travels panel → tab. */
.link {
  align-self: center;
  display: grid;
  place-items: center;
  gap: 0.5rem;
  padding-top: 3.2rem;
}

.link svg { width: 30px; height: 30px; overflow: visible; }
.link path { fill: none; stroke: var(--edge); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.25s; }
.link[data-dir="to-panel"] .to-panel path { stroke: var(--board); }
.link[data-dir="to-tab"] .to-tab path { stroke: var(--amber); }

.link-label {
  font: 400 0.68rem/1.45 var(--mono);
  color: var(--dust);
  text-align: center;
  width: 13ch;
  min-height: 4.4em;
  margin-top: 0.3rem;
}

@media (max-width: 800px) {
  .mirror { grid-template-columns: 1fr; }
  .link { padding-top: 0; }
  .link svg { transform: rotate(90deg); }
  .link-label { max-width: none; }
}

.movelist {
  margin-top: 1.6rem;
  padding: 0.85rem 1rem;
  background: var(--slate);
  border: 1px solid var(--edge);
  border-radius: 10px;
  font: 400 0.84rem/2 var(--mono);
  color: var(--dust);
  display: flex; flex-wrap: wrap; gap: 0 0.55rem;
  min-height: 3.9rem;
}

.movelist .no { color: #5c5651; }
.movelist .san { color: #625c56; transition: color 0.25s; }
.movelist .san.played { color: #cbc5bd; }
.movelist .san.live { color: var(--ink); background: var(--amber); border-radius: 3px; padding-inline: 0.3rem; }

/* ── Sections ─────────────────────────────────────────────────────── */

.band { padding: clamp(3.5rem, 7vw, 6rem) 0; border-top: 1px solid var(--edge); }
.band-head { max-width: 60ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.band-head .eyebrow { display: block; margin-bottom: 1rem; }
.band-head p { margin-top: 1.1rem; color: #c6c0b8; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1px;
  background: var(--edge);
  border: 1px solid var(--edge);
  border-radius: 12px;
  overflow: hidden;
}

.card { background: var(--slate); padding: 1.6rem 1.5rem 1.75rem; }
.card h3 { margin-bottom: 0.6rem; }
.card p { color: #b8b2aa; font-size: 0.93rem; }

.card-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--raise);
  margin-bottom: 1.1rem;
}

.card-mark svg { width: 18px; height: 18px; fill: none; stroke: var(--board); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ── The pipeline: each hop is labelled with what actually crosses it ─ */

.rail { max-width: 780px; margin-left: 3px; }

.hop, .wire { border-left: 1px solid var(--edge); padding-left: clamp(1.25rem, 3vw, 2rem); }

.hop { position: relative; padding-block: 0.15rem 1.1rem; }

.hop::before {
  content: "";
  position: absolute;
  left: -4.5px; top: 0.5rem;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--edge);
}

.hop.real::before { background: var(--board); }

.hop-where {
  display: block;
  font: 500 0.78rem/1.5 var(--mono);
  color: var(--chalk);
  margin-bottom: 0.25rem;
}

.hop-what { color: #b8b2aa; font-size: 0.93rem; max-width: 62ch; }

.wire { padding-block: 0.5rem; }

.wire code {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font: 400 0.74rem/1.5 var(--mono);
  color: var(--dust);
  background: var(--raise);
  border: 1px solid var(--edge);
  border-radius: 5px;
  padding: 0.25rem 0.6rem;
}

.wire code i { font-style: normal; color: var(--board); }
.wire.back code i { color: var(--amber); }

/* ── Disclosure: detail for the people who want it, folded away for
      everyone who came here to find out whether it works ───────────── */

.more { margin-top: 2.75rem; max-width: 820px; border-top: 1px solid var(--edge); }

.more summary {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 1rem 0;
  cursor: pointer;
  font: 500 0.8rem/1 var(--mono);
  letter-spacing: 0.02em;
  color: var(--dust);
  list-style: none;
  transition: color 0.15s;
}

.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "+"; color: var(--board); font-size: 1rem; width: 0.8em; }
.more[open] summary::before { content: "–"; }
.more summary:hover { color: var(--chalk); }
.more > .rail { padding: 0.5rem 0 1.5rem; }

/* ── Constraint list ──────────────────────────────────────────────── */

.rules { display: grid; gap: 1px; max-width: 980px; background: var(--edge); border-radius: 12px; overflow: hidden; border: 1px solid var(--edge); }
.rule { background: var(--slate); padding: 1.5rem; display: grid; grid-template-columns: minmax(0, 22ch) 1fr; gap: 1.5rem; }
.rule h3 { color: var(--cream); }
.rule p { color: #b8b2aa; font-size: 0.93rem; max-width: 68ch; }
.rule p + p { margin-top: 0.7rem; }

@media (max-width: 720px) { .rule { grid-template-columns: 1fr; gap: 0.6rem; } }

/* ── Risk ─────────────────────────────────────────────────────────── */

.risk {
  border: 1px solid rgba(215, 106, 90, 0.45);
  background: rgba(215, 106, 90, 0.07);
  border-radius: 12px;
  padding: clamp(1.5rem, 3vw, 2.2rem);
  max-width: 68ch;
}

.risk .eyebrow { color: var(--alert); }
.risk h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); margin: 0.9rem 0 1rem; }
.risk p { color: #ddd2cd; font-size: 0.97rem; }
.risk p + p { margin-top: 0.9rem; }

/* ── Install ──────────────────────────────────────────────────────── */

.steps { counter-reset: step; display: grid; gap: 1px; background: var(--edge); border: 1px solid var(--edge); border-radius: 12px; overflow: hidden; max-width: 760px; }

.step {
  background: var(--slate);
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  align-items: baseline;
  gap: 0.5rem;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  font: 500 0.8rem/1 var(--mono);
  color: var(--board);
}

.step p { font-size: 0.95rem; color: #c6c0b8; }
.step code { font: 400 0.86em var(--mono); color: var(--cream); }

/* ── Forms (uninstall survey) ─────────────────────────────────────── */

.form { max-width: 640px; }

fieldset { border: 0; padding: 0; margin: 0 0 1.75rem; }
legend { padding: 0; font: 500 0.95rem/1.5 var(--body); margin-bottom: 0.9rem; }

.choices { display: grid; gap: 0.5rem; }

.choice {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--slate);
  border: 1px solid var(--edge);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.choice:hover { border-color: var(--dust); }
.choice input { accent-color: var(--amber); margin: 0.28rem 0 0; flex: none; }
.choice:has(input:checked) { border-color: var(--amber); background: var(--raise); }
.choice span { font-size: 0.94rem; }

textarea, input[type="text"], input[type="email"] {
  width: 100%;
  padding: 0.8rem 0.9rem;
  background: var(--slate);
  color: var(--chalk);
  border: 1px solid var(--edge);
  border-radius: 9px;
  font: 400 0.94rem/1.6 var(--body);
}

textarea { min-height: 116px; resize: vertical; }
textarea.short { min-height: 84px; }
textarea.code { font-family: var(--mono); font-size: 0.85rem; }

:where(textarea, input)::placeholder { color: #6f6862; }
:where(textarea, input):focus { border-color: var(--amber); }

.field { margin-bottom: 1.5rem; }
.field > label { display: block; font: 500 0.95rem/1.5 var(--body); margin-bottom: 0.5rem; }
.field .hint { display: block; font-size: 0.82rem; color: var(--dust); font-weight: 400; margin-top: 0.15rem; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 640px) { .pair { grid-template-columns: 1fr; gap: 0; } }

/* ── Screenshots ──────────────────────────────────────────────────── */

.drop {
  display: grid;
  place-items: center;
  gap: 0.35rem;
  padding: 1.6rem 1rem;
  text-align: center;
  border: 1px dashed var(--edge);
  border-radius: 10px;
  background: var(--slate);
  color: var(--dust);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.drop:hover, .drop.over { border-color: var(--amber); background: var(--raise); color: var(--chalk); }
.drop small { font: 400 0.76rem/1.4 var(--mono); color: #6f6862; }
.drop u { text-decoration-color: var(--dust); text-underline-offset: 3px; }

.shots { list-style: none; margin: 0.9rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.7rem; }

.shot {
  position: relative;
  width: 108px; height: 82px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--edge);
  background: var(--raise);
}

.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }

.shot button {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(20, 19, 17, 0.86);
  color: var(--chalk);
  font: 500 13px/1 var(--body);
  cursor: pointer;
}

.shot button:hover { background: var(--alert); color: #fff; }

.sent-with {
  margin-top: 0.4rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: var(--slate);
  font-size: 0.83rem;
  color: var(--dust);
}

.sent-with b { color: #b8b2aa; font-weight: 500; }
.sent-with code { font: 400 0.92em var(--mono); color: #8d867f; word-break: break-all; }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.form-note { font-size: 0.8rem; color: var(--dust); max-width: 44ch; }

.form-msg { margin-top: 1rem; font-size: 0.9rem; min-height: 1.4em; }
.form-msg[data-tone="bad"] { color: var(--alert); }

.done { display: none; }
.form.sent .done { display: block; }
.form.sent form { display: none; }

.done h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin-bottom: 0.9rem; }
.done p { color: #c6c0b8; max-width: 52ch; }

/* ── Footer ───────────────────────────────────────────────────────── */

.foot {
  border-top: 1px solid var(--edge);
  padding: 2.5rem 0 3rem;
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center;
  font-size: 0.83rem;
  color: var(--dust);
}

.foot a { text-decoration: none; }
.foot a:hover { color: var(--chalk); }
.foot .spacer { margin-left: auto; }
