/* Chess Hub site: the app's own look. Hub blue (#3346b8), its blue-grey board (#e4e7f0 / #7282ae), white
   cards on a cool off-white page, the app's flat Staunton pieces, and Atkinson Hyperlegible Next.
   Light by default, with the app's dark scheme for phones set to dark. */

:root {
  --bg: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #e9ebf2;
  --text: #1a1f2e;
  --muted: #545c72;
  --line: rgb(26 31 46 / .1);
  --primary: #3346b8;
  --accent: #3346b8;
  --accent-ink: #ffffff;
  --accent-tint: rgb(51 70 184 / .1);
  --sq-light: #e4e7f0;
  --sq-dark: #7282ae;
  --live: #2a7a4b;
  --radius: 20px;
  --font-display: 'Atkinson Hyperlegible Next', 'Noto Sans Variable', 'Noto Sans Arabic Variable', 'Noto Sans Hebrew Variable', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: var(--font-display);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f121b;
    --surface: #171b27;
    --surface-2: #222838;
    --text: #e9ebf2;
    --muted: #a8afc4;
    --line: rgb(233 235 242 / .1);
    --primary: #93a3ff;
    --accent: #93a3ff;
    --accent-ink: #0f121b;
    --accent-tint: rgb(147 163 255 / .14);
    --sq-light: #3a4258;
    --sq-dark: #262c3d;
  }
}

body { font-size: 17px; }

/* ---- header */
.site-header { position: relative; z-index: 2; }
.brand { font-size: 17px; }
.brand img { border-radius: 9px; }
.lang-menu { position: relative; }
.lang-menu summary {
  display: inline-flex; align-items: center; gap: 8px; list-style: none; cursor: pointer;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 14px; font-weight: 600;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary svg { width: 16px; height: 16px; opacity: .75; }
.lang-menu summary:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.lang-menu ul {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 10;
  display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 2px;
  margin: 0; padding: 8px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 18px 50px rgb(16 22 50 / .18);
}
.lang-menu a { display: block; padding: 7px 10px; border-radius: 10px; text-decoration: none; color: var(--muted); font-size: 14px; }
.lang-menu a:hover { background: var(--surface-2); color: var(--text); }
.lang-menu a[aria-current='true'] { color: var(--accent-ink); background: var(--accent); font-weight: 600; }

/* ---- hero */
.hero { position: relative; overflow: hidden; padding-block: clamp(24px, 5vw, 56px) clamp(40px, 7vw, 80px); }
/* A corner of the app's board, fading into the page. */
.board-bg {
  position: absolute; inset: -10% -10% auto auto; width: min(760px, 90vw); aspect-ratio: 1; pointer-events: none;
  background: repeating-conic-gradient(var(--sq-dark) 0 25%, var(--sq-light) 0 50%) 0 0 / 25% 25%;
  opacity: .16; transform: rotate(-8deg);
  mask-image: radial-gradient(closest-side, #000 30%, transparent 100%);
}
[dir='rtl'] .board-bg { inset: -10% auto auto -10%; transform: rotate(8deg); }
.floaters { position: absolute; inset: 0; pointer-events: none; }
.floaters span { position: absolute; width: clamp(44px, 6vw, 76px); opacity: .14; }
.floaters .p1 { top: 9%; left: 4%; rotate: -12deg; }
.floaters .p2 { top: 70%; left: 2%; rotate: 9deg; width: clamp(40px, 5vw, 60px); }
.floaters .p3 { top: 6%; left: 46%; rotate: 8deg; width: clamp(34px, 4vw, 52px); }
.floaters .p4 { bottom: 6%; left: 40%; rotate: -8deg; }
.floaters .p5 { top: 16%; right: 3%; rotate: 12deg; }
.floaters .p6 { bottom: 10%; right: 6%; rotate: -6deg; width: clamp(40px, 5vw, 64px); }
.hero .wrap {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center; gap: clamp(28px, 5vw, 64px);
}
.status-chip {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 22px;
  padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--muted);
}
.status-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #d9932b; box-shadow: 0 0 0 4px rgb(217 147 43 / .2); }
.hero h1 {
  display: flex; align-items: center; gap: clamp(14px, 2vw, 22px);
  font-size: clamp(2.75rem, 7vw, 4.75rem); font-weight: 800; letter-spacing: -.035em; line-height: 1;
}
.hero-icon {
  width: clamp(64px, 8vw, 92px); height: auto; flex: none; border-radius: 24%;
  box-shadow: 0 14px 34px rgb(51 70 184 / .32), 0 2px 6px rgb(16 22 50 / .15);
}
.tagline { font-size: clamp(1.25rem, 2.4vw, 1.6rem); font-weight: 700; letter-spacing: -.01em; max-width: 26ch; margin-top: 18px; }
.lead { color: var(--muted); max-width: 46ch; font-size: 1.06rem; margin-bottom: 26px; }
.trust { display: flex; align-items: center; gap: 10px; margin-top: 20px; color: var(--muted); font-size: 15px; }
.trust svg { width: 20px; height: 20px; flex: none; color: var(--accent); }

/* A phone with a real screenshot of the app. */
.phone {
  position: relative; width: min(300px, 70vw); margin-inline: auto; padding: 10px;
  border-radius: 44px; background: #11141d;
  box-shadow: 0 30px 70px rgb(16 22 50 / .28), 0 6px 18px rgb(16 22 50 / .18), inset 0 0 0 2px #2a2f41;
}
.phone img { width: 100%; height: auto; border-radius: 34px; }
.hero-visual .phone { rotate: 3deg; }
[dir='rtl'] .hero-visual .phone { rotate: -3deg; }

/* ---- store buttons */
.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.store-btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  min-width: 172px; height: 58px; padding: 0 18px 0 14px;
  background: #000; color: #fff; border: 1px solid rgb(255 255 255 / .16); border-radius: 14px;
  text-decoration: none; line-height: 1.1; box-shadow: 0 8px 22px rgb(16 22 50 / .22);
  transition: transform .18s ease, box-shadow .18s ease;
}
.store-btn svg { width: 26px; height: 26px; flex: none; }
.store-btn .store-top { display: block; font-size: 11px; opacity: .85; white-space: nowrap; }
.store-btn .store-bottom { display: block; font-size: 19px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
a.store-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgb(16 22 50 / .3); }
.store-btn.is-soon { cursor: default; opacity: .82; box-shadow: none; }
.store-btn.is-soon .soon-tag {
  position: absolute; top: -10px; inset-inline-end: 10px; padding: 2px 9px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; white-space: nowrap;
}

/* ---- sections */
.home-main { padding-bottom: clamp(48px, 8vw, 88px); }
.section { padding-block: clamp(28px, 5vw, 56px); }
.section-title { font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: 26px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.feature {
  padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
  transition: transform .18s ease, box-shadow .18s ease;
}
.feature:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgb(16 22 50 / .1); }
.feature .icon {
  display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 16px;
  border-radius: 14px; background: var(--accent-tint); color: var(--accent);
}
.feature .icon svg { width: 24px; height: 24px; }
.feature h3 { font-size: 1.12rem; font-weight: 750; }
.feature p { margin: 0; color: var(--muted); font-size: 15.5px; }

.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.shot { margin: 0; text-align: center; }
.shot .phone { width: min(260px, 100%); border-radius: 38px; padding: 8px; }
.shot .phone img { border-radius: 30px; }
.shot figcaption { margin-top: 16px; font-weight: 650; color: var(--muted); max-width: 30ch; margin-inline: auto; }

.cta {
  position: relative; overflow: hidden; text-align: center; padding: clamp(32px, 6vw, 56px) var(--gutter);
  border-radius: 28px; color: #fff;
  background:
    repeating-conic-gradient(rgb(255 255 255 / .07) 0 25%, transparent 0 50%) 0 0 / 64px 64px,
    linear-gradient(135deg, #4459d4, #3346b8 55%, #232f86);
}
.cta h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; }
.cta p { opacity: .88; margin: 0; }
.cta .store-buttons { justify-content: center; margin-top: 24px; }
.cta .store-btn.is-soon .soon-tag { background: #fff; color: #232f86; }

/* ---- legal pages and link pages */
.prose a { color: var(--accent); }
.prose .other-lang { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.4em; }
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px;
  border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.button.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.prose a.button { color: var(--accent-ink); }
.prose a.button.secondary { color: var(--text); }
.prose table { background: var(--surface); border-radius: 14px; }
.link-card { text-align: center; }
.link-card .link-piece svg { width: 72px; margin: 0 auto 8px; }
.link-card .code {
  margin: 18px auto 10px; padding: 14px 16px; max-width: 34ch; overflow-wrap: anywhere;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  font-size: 1.05rem; font-weight: 700; letter-spacing: .01em;
}
.link-card .store-buttons { justify-content: center; margin-top: 18px; }

/* ---- motion */
@media (prefers-reduced-motion: no-preference) {
  .floaters span { animation: float 9s ease-in-out infinite; }
  .floaters .p2 { animation-delay: -2s; } .floaters .p3 { animation-delay: -4s; }
  .floaters .p4 { animation-delay: -6s; } .floaters .p5 { animation-delay: -1s; } .floaters .p6 { animation-delay: -3s; }
  .hero-copy, .hero-visual { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-visual { animation-delay: .08s; }
}
@keyframes float { 50% { translate: 0 -10px; } }
@keyframes rise { from { opacity: .4; transform: translateY(14px); } }

/* ---- narrow screens */
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .hero-visual .phone { width: min(230px, 62vw); }
  /* Pieces that would sit behind the text on a phone. */
  .floaters .p2, .floaters .p4, .floaters .p6 { display: none; }
  .shots { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: min(240px, 72vw); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .shot { scroll-snap-align: center; }
}
@media (max-width: 520px) {
  .store-btn { min-width: 0; flex: 1 1 158px; padding-inline: 12px; gap: 8px; }
  .store-btn .store-bottom { font-size: 17px; }
  .lang-menu ul { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: clamp(2.4rem, 11vw, 3rem); }
}
