:root {
  color-scheme: light;
  --accent: #355f4d;
  --accent-strong: #244938;
  --bg: #f6f5ef;
  --board-dark: #587463;
  --board-light: #ded1a9;
  --ink: #111713;
  --line: #d9d4c7;
  --muted: #5f6861;
  --paper: #fffdf7;
  --rust: #b8785f;
  --gold: #d4a93a;
  --shadow: 0 14px 36px rgba(31, 42, 37, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(184, 120, 95, 0.86);
  outline-offset: 3px;
}

button {
  font: inherit;
}

p {
  color: var(--muted);
  line-height: 1.58;
}

.topbar,
main,
footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 18px 0;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: 1px solid transparent;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-weight: 760;
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
}

nav {
  display: flex;
  gap: 18px;
  padding: 0;
  border: 1px solid var(--line);
  border-width: 0 0 1px;
  background: transparent;
  box-shadow: none;
}

nav a {
  min-height: 32px;
  padding: 7px 0;
  border-radius: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 690;
  text-decoration: none;
}

nav a:hover {
  background: transparent;
  color: var(--accent-strong);
}

.hero {
  display: grid;
  grid-template-columns: minmax(430px, 460px) minmax(0, 1fr);
  gap: clamp(56px, 6vw, 82px);
  align-items: start;
  min-height: auto;
  padding: 20px 0 58px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 460px;
  font-size: 4.65rem;
  font-weight: 780;
  line-height: 0.96;
}

h2 {
  font-size: 3rem;
  font-weight: 760;
  line-height: 1;
}

h3 {
  font-size: 1.05rem;
  font-weight: 730;
}

.lede {
  max-width: 450px;
  margin: 25px 0 0;
  font-size: 1.08rem;
}

.actions,
.demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 26px;
}

.demo-actions {
  grid-column: 1;
  grid-row: 3;
  align-self: end;
  margin-top: 0;
}

.button,
.quiet-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 0.94rem;
  font-weight: 720;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.button:hover,
.quiet-button:hover {
  transform: translateY(-1px);
}

.button.primary {
  border: 1px solid #1f2a25;
  background: #1f2a25;
  color: #fff;
  box-shadow: 0 10px 24px rgba(31, 42, 37, 0.14);
}

.button.primary:hover {
  background: #33433b;
}

.button.primary:disabled {
  cursor: default;
  opacity: 0.7;
  transform: none;
}

.button.secondary,
.quiet-button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.quiet-button {
  min-height: 40px;
  color: var(--accent-strong);
}

.challenge-card {
  display: grid;
  grid-template-columns: minmax(190px, 0.72fr) minmax(330px, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  align-items: stretch;
  justify-self: end;
  width: min(100%, 640px);
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: var(--shadow);
  margin-top: 25px;
}

.challenge-copy {
  display: grid;
  grid-column: 1;
  grid-row: 1;
  gap: 10px;
  align-self: start;
  min-width: 0;
}

.lock-state {
  width: fit-content;
  padding: 7px 11px;
  border-left: 3px solid var(--accent);
  border-radius: 0;
  background: #eef2ea;
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 730;
}

.challenge-copy h2 {
  max-width: 260px;
  font-size: 1.95rem;
  line-height: 1.02;
}

.challenge-copy p {
  margin: 0;
}

.board-area {
  display: grid;
  grid-column: 2;
  grid-row: 1 / 4;
  gap: 10px;
  grid-template-rows: auto 1fr;
  justify-self: end;
  width: min(100%, 330px);
  min-width: 0;
}

.demo-board-layout {
  display: grid;
  align-items: end;
  min-width: 0;
}

.board-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  font-size: 0.94rem;
}

.board-hint {
  min-height: 1.5em;
  margin: 0;
  font-size: 0.88rem;
}

.board-meta span {
  color: var(--muted);
  font-weight: 660;
}

.demo-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  justify-self: center;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid rgba(31, 42, 37, 0.7);
  border-radius: 5px;
  background: #26342e;
}

.square {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  aspect-ratio: 1;
  background: transparent;
  color: inherit;
  cursor: default;
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "DejaVu Sans", "Arial Unicode MS", sans-serif;
  font-size: 1.72rem;
  line-height: 1;
}

.demo-board:not(.solved) .square {
  cursor: pointer;
}

.square.light {
  background: var(--board-light);
}

.square.dark {
  background: var(--board-dark);
}

.white-piece {
  color: #fbf3de;
  -webkit-text-stroke: 0.7px rgba(23, 29, 26, 0.7);
  filter: drop-shadow(0 2px 0 rgba(23, 29, 26, 0.22));
}

.black-piece {
  color: #343832;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.16));
}

.square.selected,
.square:focus-visible {
  outline: 3px solid var(--rust);
  outline-offset: -3px;
}

.square.destination::after {
  content: "";
  position: absolute;
  inset: 37%;
  width: 24%;
  aspect-ratio: 1;
  border-radius: 999px;
  background: rgba(17, 23, 19, 0.24);
  pointer-events: none;
}

.square.destination.has-piece::after {
  inset: 13%;
  width: auto;
  border: 3px solid rgba(31, 42, 37, 0.28);
  background: transparent;
}

.square.last-move {
  box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--gold) 30%, transparent);
}

.square.in-check {
  box-shadow: inset 0 0 0 4px rgba(162, 62, 49, 0.82), inset 0 0 20px rgba(162, 62, 49, 0.34);
}

.square.last-move.in-check {
  box-shadow: inset 0 0 0 999px rgba(236, 184, 74, 0.2), inset 0 0 0 4px rgba(162, 62, 49, 0.85), inset 0 0 20px rgba(162, 62, 49, 0.34);
}

.board-shell {
  position: relative;
  align-self: end;
  width: min(100%, 330px);
  min-width: 0;
}

.success-panel {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  background: rgba(31, 42, 37, 0.62);
  color: #fff;
  text-align: center;
}

.success-panel.failed {
  background: rgba(31, 42, 37, 0.7);
}

.success-panel > * {
  position: relative;
  z-index: 1;
}

.success-panel strong {
  font-size: 1.4rem;
}

.success-panel p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.coordinate {
  position: absolute;
  z-index: 4;
  color: rgba(47, 95, 78, 0.72);
  font-size: 0.68rem;
  font-weight: 820;
  line-height: 1;
  pointer-events: none;
}

.dark .coordinate {
  color: rgba(241, 238, 230, 0.78);
}

.rank-coordinate {
  left: 4px;
  top: 4px;
}

.file-coordinate {
  right: 4px;
  bottom: 4px;
}

.move-arrow {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.move-arrow line {
  stroke: rgba(242, 178, 58, 0.82);
  stroke-width: 1.9;
  stroke-linecap: butt;
}

.move-arrow path {
  fill: rgba(242, 178, 58, 0.86);
}

.move-arrow polygon {
  fill: rgba(242, 178, 58, 0.86);
}

.piece {
  position: relative;
  z-index: 3;
  display: block;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-0.035em);
  paint-order: stroke fill;
}


.showcase,
.privacy,
.install,
.principles {
  padding: 58px 0;
  border-top: 1px solid var(--line);
}

.showcase {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.9fr);
  gap: 48px;
  align-items: start;
}

.section-copy h2 {
  max-width: 760px;
}

.settings-panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  overflow: hidden;
}

.interactive-settings {
  display: grid;
  gap: 0;
}

.settings-heading,
.setting-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  min-height: 56px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.settings-heading {
  background: #fbfaf4;
}

.settings-heading span,
.setting-row span {
  color: var(--muted);
}

.settings-heading strong,
.setting-row strong {
  font-size: 0.95rem;
}

.control-group,
.level-control {
  display: grid;
  gap: 11px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.control-label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.segmented-control,
.duration-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.duration-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.segmented-control button,
.duration-options button,
.custom-duration,
.interactive-site-list button,
.site-chip {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fbfaf4;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 720;
  cursor: pointer;
}

.segmented-control button:hover,
.duration-options button:hover,
.custom-duration:hover,
.interactive-site-list button:hover,
.site-chip:hover,
.site-chip:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: #f2f3eb;
}

.segmented-control button.active,
.duration-options button.active,
.custom-duration.active,
.interactive-site-list button.active,
.site-chip {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
  background: #e7eee6;
  color: var(--accent-strong);
}

.custom-duration {
  display: grid;
  grid-template-columns: auto minmax(42px, 1fr);
  gap: 8px;
  align-items: center;
  cursor: text;
}

.custom-duration span {
  font-size: 0.88rem;
  font-weight: 720;
}

.custom-duration input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 760;
  outline: none;
  text-align: right;
}

.custom-duration input::-webkit-inner-spin-button,
.custom-duration input::-webkit-outer-spin-button {
  opacity: 0.55;
}

.level-control span {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.level-control strong {
  font-size: 0.94rem;
}

.level-control input {
  width: 100%;
  accent-color: var(--accent);
}

.level-control small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.site-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.site-list > span,
.site-list button {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #eef2ea;
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 680;
}

.interactive-site-list button {
  position: relative;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  width: auto;
  background: #fbfaf4;
  color: var(--muted);
}

.site-chip {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 680;
}

.chip-remove {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  min-height: 15px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: transparent;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
}

.site-chip:hover .chip-remove,
.chip-remove:focus-visible {
  background: #b95543;
  color: #fff;
}

.interactive-site-list .add-site-chip {
  width: 36px;
  justify-content: center;
  padding: 0;
  color: var(--accent-strong);
  font-size: 1.05rem;
}

.add-site-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  max-width: 280px;
}

.add-site-preview[hidden] {
  display: none;
}

.add-site-preview input,
.add-site-preview button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fbfaf4;
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 680;
}

.add-site-preview input {
  min-width: 0;
  padding: 0 10px;
  outline: none;
}

.add-site-preview input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 116, 99, 0.14);
}

.add-site-preview button {
  padding: 0 12px;
  cursor: pointer;
}

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
}

.principles article {
  min-height: 190px;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.principles article:first-child {
  border-radius: 8px 0 0 8px;
}

.principles article:last-child {
  border-radius: 0 8px 8px 0;
}

.principles p,
.privacy p {
  margin: 12px 0 0;
}

.privacy {
  max-width: 780px;
}

.install {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.7fr);
  gap: 48px;
}

.install ol {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.6;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

footer span:first-child {
  color: var(--ink);
  font-weight: 760;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media (max-width: 1180px) {
  .hero,
  .showcase,
  .install {
    grid-template-columns: 1fr;
  }

  .hero {
    align-items: start;
    padding-top: 28px;
  }

  h1 {
    max-width: 760px;
    font-size: 4.35rem;
  }

  .challenge-card {
    justify-self: start;
    max-width: 700px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    margin-top: 0;
  }

  .challenge-copy,
  .board-area,
  .demo-actions {
    grid-column: auto;
    grid-row: auto;
  }

  .board-area {
    align-content: start;
  }

  .challenge-copy h2 {
    max-width: 520px;
  }
}

@media (max-width: 960px) {
  h1 {
    font-size: 3.9rem;
  }

  h2 {
    font-size: 2.5rem;
  }

}

@media (max-width: 720px) {
  .topbar,
  main,
  footer {
    width: min(100% - 28px, 1180px);
  }

  .topbar,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  nav a {
    padding-inline: 10px;
  }

  h1 {
    font-size: 3.15rem;
  }

  h2 {
    font-size: 2.1rem;
  }

  .actions,
  .demo-actions,
  .button,
  .quiet-button {
    width: 100%;
  }

  .segmented-control,
  .duration-options {
    grid-template-columns: 1fr;
  }

  .challenge-card {
    border-radius: 8px;
    padding: 16px;
  }

  .challenge-copy h2 {
    font-size: 2rem;
  }

  .board-shell {
    width: min(100%, 360px);
  }

  .demo-board-layout {
    grid-template-columns: 1fr;
  }

  .square {
    font-size: 1.6rem;
  }

  .principles {
    grid-template-columns: 1fr;
  }

  .principles article,
  .principles article:first-child,
  .principles article:last-child {
    border-radius: 8px;
  }
}
