/* Pragma Chess site. One stylesheet, no framework; the palette echoes the
   board: warm light squares, dark wood, the blue of the client's selection. */

:root {
  --ink: #23201c;
  --ink-soft: #5a554e;
  --paper: #faf7f2;
  --paper-deep: #f1ebe1;
  --wood: #8b5a3c;
  --wood-dark: #5e3a24;
  --blue: #2f7bd8;
  --blue-dark: #1f5fae;
  --line: #e2d9cc;
  --card: #ffffff;
  --shadow: 0 10px 30px rgba(35, 32, 28, 0.10);
  --radius: 14px;
  --max: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ece7df;
    --ink-soft: #b4ada3;
    --paper: #17150f;
    --paper-deep: #1f1c15;
    --line: #35302a;
    --card: #231f18;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
section { padding: 4rem 1.25rem; }
section > h2, section > .section-lead, section > .grid, section > .gallery, section > .platforms,
section > .download-note, section > .formats, section > .clubs { max-width: var(--max); margin-left: auto; margin-right: auto; }
.section-lead { color: var(--ink-soft); font-size: 1.1rem; margin-bottom: 2rem; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.6rem 1.25rem;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--ink); font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 1.25rem; }
.nav a { color: var(--ink); font-weight: 500; }
.nav .languages { display: flex; gap: 0.4rem; margin-left: 0.5rem; padding-left: 1rem; border-left: 1px solid var(--line); }
.languages a { color: var(--ink-soft); font-size: 0.95rem; }
.languages a.current { color: var(--ink); font-weight: 700; }
.menu-toggle { display: none; }
.menu-button { display: none; }

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3rem; align-items: center;
  max-width: var(--max); margin: 0 auto; padding-top: 4.5rem;
}
.lead { font-size: 1.25rem; color: var(--ink-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 0.75rem; }
.hero-note { color: var(--ink-soft); font-size: 0.95rem; }
.hero-shot video { width: 100%; height: auto; display: block; background: #000; }
.hero-shot figcaption { color: var(--ink-soft); font-size: 0.9rem; text-align: center; margin-top: 0.6rem; }
.hero-shot video, .hero-shot img, .gallery img {
  border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line);
}
.button {
  display: inline-block; padding: 0.7rem 1.3rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.button:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.button.primary:hover { background: var(--blue-dark); }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem;
}
.card .icon { font-size: 1.8rem; line-height: 1; margin-bottom: 0.6rem; color: var(--wood); }
.card p { color: var(--ink-soft); margin: 0; }
.card p + a { display: inline-block; margin-top: 0.75rem; font-weight: 600; }
.features { background: var(--paper-deep); }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.shot { color: var(--ink); }
.shot:hover { text-decoration: none; }
.shot img { transition: transform 0.15s ease; }
.shot:hover img { transform: translateY(-3px); }
.shot span { display: block; margin-top: 0.6rem; color: var(--ink-soft); font-size: 0.95rem; }
.lightbox {
  position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(10, 8, 6, 0.9); padding: 2rem;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 82vh; width: auto; border-radius: 8px; box-shadow: var(--shadow); }
.lightbox p { color: #eee; margin-top: 1rem; text-align: center; }
.lightbox .close {
  position: absolute; top: 1rem; right: 1.25rem; font-size: 2rem; line-height: 1; color: #fff;
  background: none; border: 0; cursor: pointer;
}

/* Download */
.download { background: var(--paper-deep); }
.version { font-weight: 700; color: var(--ink); }
.platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.25rem; }
.platform {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem;
  display: flex; flex-direction: column;
}
.platform .icon { font-size: 2rem; line-height: 1; margin-bottom: 0.5rem; }
.platform .badge { display: inline-block; vertical-align: middle; margin-left: 0.4rem; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--blue); background: color-mix(in srgb, var(--blue) 14%, transparent); }
.platform p { color: var(--ink-soft); flex: 1; }
.platform .button { text-align: center; }
.platform small { color: var(--ink-soft); margin-top: 0.5rem; word-break: break-all; font-size: 0.8rem; min-height: 1.2em; }
.platform.here { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 20%, transparent); }
.download-note { color: var(--ink-soft); margin-top: 1.5rem; }
.formats h3 { margin-top: 2rem; }
.formats ul { padding-left: 1.2rem; color: var(--ink-soft); }
.formats li { margin-bottom: 0.4rem; }

/* Support */
.clubs { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.clubs ul { padding-left: 1.2rem; }

/* Footer */
.bottom {
  padding: 2.5rem 1.25rem 3rem; text-align: center; color: var(--ink-soft); font-size: 0.95rem;
  border-top: 1px solid var(--line);
}
.bottom .languages { display: flex; justify-content: center; gap: 1rem; }
.credits { font-size: 0.85rem; }

/* Phones and small tablets */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 3rem; text-align: center; }
  .actions { justify-content: center; }
  .menu-button {
    display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 36px; cursor: pointer;
  }
  .menu-button span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .nav a { padding: 0.9rem 1.25rem; border-top: 1px solid var(--line); }
  .nav .languages { margin: 0; padding: 0.6rem 1.25rem; border-left: 0; border-top: 1px solid var(--line); gap: 1rem; }
  .nav .languages a { padding: 0; border: 0; }
  .menu-toggle:checked ~ .nav { display: flex; }
  section { padding: 3rem 1rem; }
}

/* Supporters */
.supporters { background: var(--paper-deep); }
.supporters > h2, .supporters > .section-lead, .supporters > .clubs-grid, .supporters > .join {
  max-width: var(--max); margin-left: auto; margin-right: auto;
}
.clubs-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem; }
.club {
  flex: 0 1 260px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.9rem;
  padding: 1.6rem 1.2rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); font-weight: 600; line-height: 1.3;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.club:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.club img { width: 120px; height: 120px; object-fit: contain; border-radius: 50%; background: #fff; padding: 6px; }
.join {
  margin-top: 2.5rem; padding: 2rem 2.25rem; border-radius: var(--radius);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem 2.5rem; align-items: center;
  background: linear-gradient(135deg, var(--wood-dark), var(--wood)); color: #fff;
  box-shadow: var(--shadow);
}
.join h3 { margin: 0 0 0.4rem; color: #fff; }
.join p { margin: 0; color: rgba(255, 255, 255, 0.85); }
.join .button.primary { background: #fff; border-color: #fff; color: var(--wood-dark); white-space: nowrap; }
.join .button.primary:hover { background: var(--paper); }
@media (max-width: 860px) {
  .join { grid-template-columns: 1fr; text-align: center; padding: 1.75rem 1.25rem; }
  .join .button.primary { justify-self: center; }
  .club { flex-basis: 100%; }
}
