/* ChessDuo site. Palette and shapes come from the app's "Duo" design tokens (ChessDuo/Helpers/Theme.swift):
   warm ink, cream paper, gold accent, 20pt continuous-corner cards, 16pt buttons. */
:root {
  --paper: #faf5eb;          /* Duo light background top  (0.98, 0.96, 0.92) */
  --paper-2: #f2ebde;        /* Duo light background bottom (0.95, 0.92, 0.87) */
  --night: #12141f;          /* Duo dark background top  (0.07, 0.08, 0.13) */
  --night-2: #1f1a29;        /* Duo dark background bottom (0.12, 0.10, 0.16) */
  --ink: #1c1f2b;            /* Duo.ink */
  --ink-soft: rgba(28, 31, 43, 0.72);
  --gold: #db9e33;           /* Duo.accent */
  --gold-deep: #b87a1a;      /* Duo.accentDeep */
  --gold-text: #8a5a0e;      /* darker gold for small text on paper (AA contrast) */
  --plum: #5c386b;
  --rose: #db5c70;
  --teal: #29948f;
  --mint: #42b885;
  --sky: #4d8fdb;
  --card: rgba(255, 255, 255, 0.78);
  --card-stroke: rgba(0, 0, 0, 0.06);
  --radius: 20px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, var(--paper), var(--paper-2));
  background-color: var(--paper-2);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; }
.skip:focus { left: 12px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 520px) { .wrap { padding: 0 18px; } }

/* ---------- Header ---------- */
.site-header { position: absolute; top: 0; left: 0; right: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.nav { display: flex; gap: 6px; }
.nav a { text-decoration: none; font-size: 15px; font-weight: 600; padding: 8px 12px; border-radius: 12px; opacity: .85; }
.nav a:hover { opacity: 1; background: rgba(255,255,255,.08); }
.on-dark { color: #fff; }
.on-light .nav a:hover { background: rgba(0,0,0,.05); }
.site-header.on-light { position: relative; }
@media (max-width: 520px) { .nav a.hide-sm { display: none; } .nav a { padding: 8px 9px; font-size: 14px; } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  color: #fff;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(219, 158, 51, 0.22), transparent 60%),
    radial-gradient(700px 520px at 92% 30%, rgba(219, 92, 112, 0.16), transparent 60%),
    linear-gradient(180deg, var(--night), var(--night-2));
  overflow: hidden;
  padding: 132px 0 0;
}
.hero::before {
  /* faint board pattern, like the icon */
  content: "";
  position: absolute; inset: 0;
  background-image: conic-gradient(rgba(255,255,255,.035) 25%, transparent 0 50%, rgba(255,255,255,.035) 0 75%, transparent 0);
  background-size: 88px 88px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 45%, transparent 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 45%, transparent 100%);
  pointer-events: none;
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero-copy { padding-bottom: 112px; }
.app-id { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.app-id img { width: 92px; height: 92px; border-radius: 22.5%; box-shadow: 0 18px 40px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.08); }
.app-id .name { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.1; }
.app-id .meta { font-size: 15px; color: rgba(255,255,255,.7); margin-top: 4px; }
.hero h1 { font-size: clamp(40px, 5.6vw, 72px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 800; margin: 0 0 22px; }
.hero h1 .gold { background: linear-gradient(180deg, #f0c06a, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { font-size: clamp(17px, 1.5vw, 20px); color: rgba(255,255,255,.78); max-width: 34em; margin: 0 0 32px; }
.badge-link { display: inline-block; line-height: 0; border-radius: 12px; transition: transform .2s ease; }
.badge-link:hover { transform: translateY(-2px); }
.badge-link img { height: 56px; width: auto; }
.facts { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li { font-size: 14px; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.9); }

.hero-phones { position: relative; align-self: end; height: 640px; }
.hero-phones .phone { position: absolute; bottom: -120px; width: 290px; }
.hero-phones .p1 { left: 50%; transform: translateX(-88%) rotate(-6deg); z-index: 1; filter: brightness(.9); }
.hero-phones .p2 { left: 50%; transform: translateX(-8%) rotate(4deg); bottom: -70px; z-index: 2; }

/* ---------- Phone frame ---------- */
.phone {
  position: relative;
  background: linear-gradient(145deg, #2b2a31, #0c0c10);
  padding: 3.4%;
  border-radius: 15% / 7%;
  box-shadow: 0 40px 80px rgba(10, 8, 20, .35), 0 12px 24px rgba(10, 8, 20, .22), inset 0 0 0 1.5px rgba(255,255,255,.14);
}
.phone picture, .phone img { display: block; width: 100%; border-radius: 12% / 5.5%; overflow: hidden; }
.phone img { aspect-ratio: 1287 / 2796; height: auto; background: var(--paper); }
.phone::after { /* dynamic island */
  content: ""; position: absolute; left: 50%; top: 4.2%; transform: translateX(-50%);
  width: 27%; height: 2.5%; background: #07070a; border-radius: 999px;
}

/* ---------- Sections ---------- */
section { position: relative; }
.section { padding: 112px 0; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-text); margin-bottom: 14px; }
.h2 { font-size: clamp(32px, 4vw, 52px); line-height: 1.06; letter-spacing: -0.03em; font-weight: 800; margin: 0 0 18px; }
.sub { font-size: clamp(17px, 1.4vw, 19px); color: var(--ink-soft); max-width: 36em; margin: 0; }
.center { text-align: center; }
.center .sub { margin: 0 auto; }

.card {
  background: var(--card);
  border: 1px solid var(--card-stroke);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .06);
}

/* Split layout: copy + phone */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.split.reverse .split-media { order: -1; }
.split-media { display: flex; justify-content: center; }
.split-media .phone { width: 300px; }

.steps { list-style: none; padding: 0; margin: 36px 0 0; display: grid; gap: 14px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 18px 20px; align-items: start; }
.steps li::before {
  counter-increment: step; content: counter(step);
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  font-weight: 800; font-size: 18px; color: #fff;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  box-shadow: 0 6px 14px rgba(219, 158, 51, .35);
}
.steps strong { display: block; font-size: 17px; margin-bottom: 2px; }
.steps span { color: var(--ink-soft); font-size: 15.5px; }

.code-chip { display: inline-flex; align-items: center; gap: 12px; margin-top: 26px; padding: 12px 18px; }
.code-chip .lbl { font-size: 13px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; }
.code-chip .code { font-family: var(--mono); font-weight: 800; font-size: 26px; letter-spacing: .18em; color: var(--ink); }

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; padding: 0; list-style: none; }
.pills li { font-size: 14px; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: rgba(0,0,0,.05); border: 1px solid var(--card-stroke); }

/* Gallery */
.gallery-section { padding-top: 40px; }
.gallery {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 28px; margin-top: 56px;
  list-style: none; padding: 0;
}
.gallery figure { margin: 0; }
.gallery figcaption { text-align: center; margin-top: 18px; font-weight: 700; font-size: 16px; }
.gallery figcaption span { display: block; font-weight: 500; font-size: 14px; color: var(--ink-soft); }

/* Features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 56px; list-style: none; padding: 0; }
.feature { padding: 26px 24px 24px; }
.tile { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 18px; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.tile svg { width: 26px; height: 26px; }
.feature h3 { font-size: 19px; letter-spacing: -0.01em; margin: 0 0 6px; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 15.5px; }
.t-gold { background: linear-gradient(180deg, #e6b053, var(--gold-deep)); }
.t-teal { background: linear-gradient(180deg, #37aaa4, #227c78); }
.t-plum { background: linear-gradient(180deg, #74498a, var(--plum)); }
.t-sky  { background: linear-gradient(180deg, #67a2e6, #3a78c2); }
.t-rose { background: linear-gradient(180deg, #e67688, #c44a5e); }
.t-mint { background: linear-gradient(180deg, #58c996, #2f9a6b); }
.t-ink  { background: linear-gradient(180deg, #3a3e50, var(--ink)); }

/* Coach list */
.checks { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 12px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; font-size: 16.5px; }
.checks li::before { content: ""; flex: 0 0 24px; height: 24px; margin-top: 1px; border-radius: 50%; background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 15px no-repeat; }
.note { margin-top: 22px; font-size: 15px; color: var(--ink-soft); }

/* Boards */
.boards { display: grid; grid-template-columns: repeat(10, 1fr); gap: 14px; margin-top: 48px; list-style: none; padding: 0; }
.board { text-align: center; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.board i {
  display: block; aspect-ratio: 1; border-radius: 14px; margin-bottom: 10px;
  border: 5px solid var(--f);
  background: conic-gradient(var(--d) 25%, var(--l) 0 50%, var(--d) 0 75%, var(--l) 0) 0 0 / 50% 50%;
  box-shadow: 0 8px 18px rgba(0,0,0,.12);
}
.board.custom i { border-style: dashed; border-color: rgba(28,31,43,.35); background: conic-gradient(from 0deg, #db5c70, #db9e33, #42b885, #4d8fdb, #5c386b, #db5c70); opacity: .9; }

/* CTA */
.cta {
  color: #fff; text-align: center; overflow: hidden;
  background:
    radial-gradient(600px 360px at 50% 0%, rgba(219, 158, 51, 0.25), transparent 70%),
    linear-gradient(180deg, var(--night), var(--night-2));
  border-radius: 32px; padding: 88px 24px; position: relative;
}
.cta img.icon { width: 108px; height: 108px; border-radius: 22.5%; margin: 0 auto 26px; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.cta .h2 { color: #fff; }
.cta p { color: rgba(255,255,255,.78); font-size: 18px; margin: 0 auto 30px; max-width: 30em; }

/* Footer */
.site-footer { padding: 48px 0 56px; font-size: 14.5px; color: var(--ink-soft); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-footer a { text-decoration: none; font-weight: 600; color: var(--ink); }
.site-footer a:hover { text-decoration: underline; }
.hosted a { font-weight: 600; }

/* Doc pages (privacy, support, 404) */
.doc-hero { padding: 40px 0 8px; }
.doc-hero h1 { font-size: clamp(36px, 5vw, 56px); letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 12px; font-weight: 800; }
.doc-hero p { color: var(--ink-soft); margin: 0; font-size: 18px; }
.doc { max-width: 780px; margin: 32px auto 0; padding: 40px 44px; }
.doc h2 { font-size: 22px; letter-spacing: -0.01em; margin: 34px 0 10px; }
.doc h2:first-child { margin-top: 0; }
.doc p, .doc li { font-size: 16.5px; color: #2c2f3b; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 6px 0; }
.doc a { color: var(--gold-text); font-weight: 600; }
.doc .updated { font-size: 14.5px; color: var(--ink-soft); }
.faq details { border-top: 1px solid rgba(0,0,0,.08); padding: 16px 0; }
.faq details:last-child { border-bottom: 1px solid rgba(0,0,0,.08); }
.faq summary { cursor: pointer; font-weight: 700; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 500; font-size: 22px; line-height: 1; color: var(--gold-deep); flex: none; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 10px 0 0; }
.contact-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 28px; margin: 0 0 8px; background: linear-gradient(180deg, #fff8ea, #fbf0da); border-radius: 18px; border: 1px solid rgba(219,158,51,.3); }
.contact-card strong { display: block; font-size: 18px; }
.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 16px; color: #fff !important; padding: 13px 22px; border-radius: 16px; background: linear-gradient(180deg, var(--gold-deep), #9a6512); box-shadow: 0 8px 18px rgba(184,122,26,.3); }
.btn:hover { filter: brightness(1.06); }

.nf { text-align: center; padding: 60px 0 40px; }
.nf .mini-board { width: 160px; height: 160px; margin: 0 auto 28px; border-radius: 18px; border: 8px solid #52331f; background: conic-gradient(#8c5938 25%, #e8cca3 0 50%, #8c5938 0 75%, #e8cca3 0) 0 0 / 25% 25%; box-shadow: 0 16px 36px rgba(0,0,0,.18); position: relative; }
.nf .mini-board span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 92px; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
.nf h1 { font-size: clamp(36px, 5vw, 56px); margin: 0 0 12px; letter-spacing: -0.03em; }
.nf p { color: var(--ink-soft); font-size: 18px; margin: 0 auto 28px; max-width: 28em; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .gallery { grid-template-columns: repeat(5, 220px); overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px 24px 36px; margin-left: -24px; margin-right: -24px; scrollbar-width: none; }
  .gallery::-webkit-scrollbar { display: none; }
  .gallery li { scroll-snap-align: center; }
  .boards { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 960px) {
  .hero { padding-top: 112px; }
  .hero .wrap { grid-template-columns: 1fr; text-align: center; gap: 0; }
  .hero-copy { padding-bottom: 40px; }
  .app-id { justify-content: center; }
  .hero .lede { margin-left: auto; margin-right: auto; }
  .facts { justify-content: center; }
  .hero-phones { height: 520px; }
  .hero-phones .phone { width: 250px; }
  .split, .split.reverse { grid-template-columns: 1fr; gap: 48px; }
  .split.reverse .split-media { order: 0; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 84px 0; }
}
@media (max-width: 600px) {
  .hero-copy { padding-bottom: 28px; }
  .app-id { flex-direction: column; gap: 14px; margin-bottom: 22px; }
  .app-id img { width: 84px; height: 84px; }
  .hero-phones { height: 430px; }
  .hero-phones .phone { width: 200px; }
  .hero-phones .p1 { transform: translateX(-86%) rotate(-6deg); bottom: -110px; }
  .hero-phones .p2 { transform: translateX(-12%) rotate(4deg); bottom: -60px; }
  .features { grid-template-columns: 1fr; }
  .split-media .phone { width: 250px; }
  .gallery { grid-template-columns: repeat(5, 210px); padding-left: 18px; padding-right: 18px; margin-left: -18px; margin-right: -18px; }
  .boards { grid-template-columns: repeat(5, 1fr); gap: 10px; }
  .board i { border-width: 4px; border-radius: 10px; }
  .board { font-size: 11.5px; }
  .cta { border-radius: 24px; padding: 64px 20px; }
  .doc { padding: 28px 22px; }
  .section { padding: 64px 0; }
  .gallery-section { padding-top: 24px; }
  .steps li { padding: 16px; grid-template-columns: 40px 1fr; gap: 14px; }
  .steps li::before { width: 40px; height: 40px; }
  .code-chip .code { font-size: 22px; }
  .site-footer .wrap { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .badge-link { transition: none; } }

/* Gallery phones sit in a scroller on smaller screens; keep their shadow inside it. */
.gallery .phone { box-shadow: 0 18px 32px rgba(10, 8, 20, .18), 0 6px 12px rgba(10, 8, 20, .12), inset 0 0 0 1.5px rgba(255,255,255,.14); }
@media (max-width: 1100px) { .gallery { padding-top: 16px; padding-bottom: 48px; } }
@media (max-width: 600px) { .gallery-section { padding-bottom: 24px; } }

/* ---------- Phone menu ---------- */
.nav-menu { display: none; place-items: center; width: 42px; height: 42px; padding: 0; margin-left: 2px; border: 0; border-radius: 12px; background: rgba(255,255,255,.1); color: inherit; cursor: pointer; }
.on-light .nav-menu { background: rgba(0,0,0,.05); }
.nav-menu svg { width: 22px; height: 22px; }
.nav-menu:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 12px; }
.menu-panel {
  display: none; position: absolute; top: 70px; left: 12px; right: 12px; z-index: 20; padding: 8px; color: #fff; border-radius: var(--radius);
  background: radial-gradient(420px 220px at 12% 0%, rgba(219, 158, 51, 0.22), transparent 70%), linear-gradient(180deg, var(--night), var(--night-2));
  box-shadow: 0 24px 60px rgba(10, 8, 20, .4), inset 0 0 0 1px rgba(255,255,255,.08);
}
.menu-panel nav { display: grid; gap: 2px; }
.menu-panel nav a { text-decoration: none; font-size: 17px; font-weight: 600; padding: 12px 14px; border-radius: 12px; }
.menu-panel nav a:hover, .menu-panel nav a[aria-current="page"] { background: rgba(255,255,255,.08); }
.menu-cta { margin: 6px 6px 0; padding: 14px 8px 8px; border-top: 1px solid rgba(255,255,255,.1); }
.menu-badge { display: inline-block; line-height: 0; border-radius: 12px; }
.menu-badge img { height: 50px; width: auto; }
@media (max-width: 520px) {
  .nav a { display: none; }
  .nav-menu { display: grid; }
  .menu-panel:not([hidden]) { display: block; }
}

/* ---------- Jump button ---------- */
.jump {
  position: fixed; right: calc(18px + env(safe-area-inset-right)); bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 30;
  display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; color: #fff;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  box-shadow: 0 8px 20px rgba(184, 122, 26, .35), inset 0 0 0 1px rgba(255,255,255,.18);
  opacity: 0; visibility: hidden; transform: translateY(10px) scale(.92);
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
.jump.show { opacity: 1; visibility: visible; transform: none; transition: opacity .2s ease, transform .2s ease; }
.jump:hover { filter: brightness(1.06); }
.jump svg { width: 22px; height: 22px; }
.jump:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 50%; }
@media (prefers-reduced-motion: reduce) { .jump, .jump.show { transition: none; } }
