:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --ink: #1d2433;
  --muted: #5d6679;
  --accent: #3b6df0;
  --accent-dark: #2a53c4;
  --line: #e3e7ef;
  --good: #1fa971;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

.container { width: min(1060px, 92%); margin: 0 auto; }
.narrow { width: min(680px, 92%); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
nav a { margin-left: 22px; color: var(--muted); text-decoration: none; font-weight: 500; }
nav a:hover { color: var(--accent); }

/* Hero */
.hero { padding: 90px 0 80px; background: linear-gradient(180deg, #eef2ff 0%, var(--bg) 100%); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--accent); margin-bottom: 14px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.15; max-width: 640px; }
.lead { margin: 18px 0 30px; font-size: 1.15rem; color: var(--muted); max-width: 540px; }

/* Buttons */
.btn {
  display: inline-block; cursor: pointer;
  background: var(--accent); color: #fff; border: 2px solid var(--accent);
  padding: 11px 24px; border-radius: 999px;
  font: inherit; font-weight: 600; text-decoration: none;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:active { transform: scale(.97); }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { color: #fff; }

/* Sections */
.section { padding: 72px 0; }
.section.alt { background: var(--surface); border-block: 1px solid var(--line); }
h2 { font-size: 1.9rem; margin-bottom: 8px; }
.section-sub { color: var(--muted); margin-bottom: 32px; }
.muted { color: var(--muted); margin-bottom: 18px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px;
  box-shadow: 0 2px 12px rgba(30,40,70,.05);
}
.card h3 { font-size: 1.3rem; margin-bottom: 4px; }

.stats { display: flex; gap: 12px; margin-bottom: 18px; }
.stats > div { flex: 1; background: var(--bg); border-radius: 10px; padding: 8px 12px; }
.label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stats strong { font-size: 1.15rem; }

/* Pattern board */
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.tile {
  aspect-ratio: 1; border: none; cursor: pointer; border-radius: 12px;
  background: var(--accent); color: transparent; font-size: 2rem;
  display: grid; place-items: center;
  transition: background .2s, transform .2s;
}
.tile:hover { transform: translateY(-2px); }
.tile.open { background: #e8eeff; color: inherit; }
.tile.done { background: #dcf5ea; color: inherit; cursor: default; transform: none; }

/* Reaction panel */
.react-panel {
  width: 100%; height: 150px; margin-bottom: 18px; cursor: pointer;
  border: none; border-radius: 12px; font: inherit; font-weight: 600; font-size: 1.1rem;
  background: #e8eeff; color: var(--ink);
  transition: background .1s;
}
.react-panel.wait { background: #f4d6d6; }
.react-panel.go { background: var(--good); color: #fff; }

.status { margin-top: 12px; min-height: 1.4em; font-weight: 600; color: var(--good); }

/* About */
.ticks { list-style: none; margin-top: 18px; }
.ticks li { padding-left: 28px; margin-bottom: 8px; position: relative; }
.ticks li::before { content: "\2713"; position: absolute; left: 0; color: var(--good); font-weight: 700; }

/* Form */
form label { display: block; font-weight: 600; margin-bottom: 16px; }
form input, form textarea {
  display: block; width: 100%; margin-top: 6px; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: var(--surface);
}
form input:focus, form textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }

/* Footer */
.site-footer { padding: 28px 0; text-align: center; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }

@media (max-width: 520px) {
  nav a { margin-left: 14px; }
  .hero { padding: 60px 0 50px; }
}
