/*
 * The site's shared base: the landing page (styles.css on top) and the legal
 * pages (legal.css on top) both load it. Fonts, the palette in light and
 * dark, the reset, the logo, buttons, the header bar, the theme button and
 * the footer.
 *
 * Palette v2 (.superpowers/ui-overhaul/PALETTE-2.md): emerald is the one
 * brand colour; light is white with neutral greys, dark is neutral black and
 * grey with no blue cast. No gradients, bar the landing hero's faint glow.
 * Every text pair is AA in both themes.
 *
 * Theme: theme.js sets html[data-theme="light" | "dark"] for a pinned choice
 * before the first paint; no attribute follows the system. So the dark tokens
 * appear twice below, once per route in; keep the two blocks identical.
 */
/*
 * DM Sans, self-hosted: the two subsets the site uses (latin, and latin-ext
 * for ₱), the same files as the console's (apps/admin/public/fonts; OFL,
 * fonts/OFL-dm-sans.txt). No third-party font host, so the CSP keeps
 * font-src 'self'. Refresh both files when the console's are.
 */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url(fonts/dm-sans-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url(fonts/dm-sans-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ---------- Light (the default) ---------- */
:root {
  color-scheme: light;
  --ground: #FFFFFF;      /* the page */
  --paper: #FFFFFF;       /* cards: a hairline and a soft shadow separate them */
  --raised: #FFFFFF;      /* menus, floating chips */
  --subtle: #FAFAFA;      /* alternate bands, the product stage */
  --well: #F5F5F5;        /* insets */
  --line: #E5E5E5;
  --line-strong: #D4D4D4;
  --text: #0A0A0A;
  --text-2: #404040;      /* body copy */
  --text-3: #525252;      /* secondary */
  --text-4: #737373;      /* tertiary: on --ground, --paper and --subtle only */
  --brand: #059669;       /* the mark, display accents (large text only) */
  --bright: #10B981;      /* illustration highlights, never text */
  --accent: #047857;      /* green text on white or the tint */
  --tint: #ECFDF5;
  --tint-line: #A7F3D0;
  --action: #047857;      /* filled buttons: white label at 5.5:1 */
  --action-hover: #065F46;
  --on-action: #FFFFFF;
  --ball: #0A0A0A;        /* the logo's ball */
  --bezel: #0A0A0A;       /* the illustrated phone's frame */
  --glow: rgba(16, 185, 129, 0.14);       /* the hero's ambient glow */
  --glow-2: rgba(52, 211, 153, 0.10);
  --court-line: #DCDCDC;                  /* the hero's perspective court */
  --glow-edge: rgba(5, 150, 105, 0.45);   /* a hovered card's edge */
  --glow-shadow: rgba(5, 150, 105, 0.35); /* and its glow */
  --warn-bg: #FEF3C7;
  --warn: #92400E;
  --focus: #059669;
  --header-bg: rgba(255, 255, 255, 0.86);
  --shadow-sm: 0 1px 2px rgba(10, 10, 10, 0.05);
  --shadow-md: 0 1px 2px rgba(10, 10, 10, 0.04), 0 10px 24px -12px rgba(10, 10, 10, 0.14);
  --shadow-lg: 0 2px 4px rgba(10, 10, 10, 0.04), 0 28px 56px -24px rgba(10, 10, 10, 0.24);
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --radius-control: 10px;
  --radius-card: 16px;
  --radius-panel: 24px;
  --header-h: 72px;

  /* The kit's type tiers (the console's _type.scss), the only sizes,
     weights and tracking the site uses. Headings are bold at -2%; body is
     600 or 400 at 1.4; captions are medium, +6%, uppercase. */
  --hero-1: 56px;
  --hero-3: 40px;
  --h-2: 32px;
  --h-3: 24px;
  --h-4: 18px;
  --h-5: 16px;
  --h-6: 14px;
  --body-xl: 20px;
  --body-l: 18px;
  --body-m: 16px;
  --body-s: 14px;
  --body-xs: 12px;
  --caption: 14px;
  --caption-s: 12px;
  --w-bold: 700;
  --w-semi: 600;
  --w-medium: 500;
  --w-regular: 400;
  --lh-heading: 1.2;
  --lh-body: 1.4;
  --track-heading: -0.02em;
  --track-body: -0.02em;
  --track-caption: 0.06em;
  /* The console's icon sizes. */
  --icon-xs: 14px;
  --icon-sm: 16px;
  --icon-md: 20px;
  --icon-lg: 24px;
  --icon-xl: 32px;
}

/* ---------- Dark: neutral black and grey ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0A0A0A;
  --paper: #171717;
  --raised: #1F1F1F;
  --subtle: #111111;
  --well: #262626;
  --line: #262626;
  --line-strong: #3A3A3A;
  --text: #FAFAFA;
  --text-2: #D4D4D4;
  --text-3: #A3A3A3;
  --text-4: #949494;
  --brand: #34D399;
  --bright: #10B981;
  --accent: #34D399;
  --tint: #0C2A1F;
  --tint-line: #14533A;
  --action: #10B981;      /* filled buttons: a black label (white fails on #10B981) */
  --action-hover: #34D399;
  --on-action: #0A0A0A;
  --ball: #FAFAFA;
  --bezel: #2E2E2E;
  --glow: rgba(16, 185, 129, 0.18);
  --glow-2: rgba(52, 211, 153, 0.10);
  --court-line: rgba(255, 255, 255, 0.16);
  --glow-edge: rgba(52, 211, 153, 0.45);
  --glow-shadow: rgba(16, 185, 129, 0.30);
  --warn-bg: #3A2A08;
  --warn: #FCD34D;
  --focus: #34D399;
  --header-bg: rgba(10, 10, 10, 0.82);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 28px 56px -24px rgba(0, 0, 0, 0.7);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0A0A0A;
    --paper: #171717;
    --raised: #1F1F1F;
    --subtle: #111111;
    --well: #262626;
    --line: #262626;
    --line-strong: #3A3A3A;
    --text: #FAFAFA;
    --text-2: #D4D4D4;
    --text-3: #A3A3A3;
    --text-4: #949494;
    --brand: #34D399;
    --bright: #10B981;
    --accent: #34D399;
    --tint: #0C2A1F;
    --tint-line: #14533A;
    --action: #10B981;
    --action-hover: #34D399;
    --on-action: #0A0A0A;
    --ball: #FAFAFA;
    --bezel: #2E2E2E;
    --glow: rgba(16, 185, 129, 0.18);
    --glow-2: rgba(52, 211, 153, 0.10);
    --court-line: rgba(255, 255, 255, 0.16);
    --glow-edge: rgba(52, 211, 153, 0.45);
    --glow-shadow: rgba(16, 185, 129, 0.30);
    --warn-bg: #3A2A08;
    --warn: #FCD34D;
    --focus: #34D399;
    --header-bg: rgba(10, 10, 10, 0.82);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 28px 56px -24px rgba(0, 0, 0, 0.7);
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--body-m);
  line-height: var(--lh-body);
  letter-spacing: var(--track-body);
  color: var(--text);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; }
h1, h2, h3 { text-wrap: balance; color: var(--text); }
p { text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 60; display: inline-flex; align-items: center; min-height: 44px; background: var(--action); color: var(--on-action); padding: 0 16px; border-radius: var(--radius-control); text-decoration: none; font-size: var(--body-s); font-weight: var(--w-semi); }
.skip:focus { top: 12px; color: var(--on-action); }
.ico { width: var(--icon-md); height: var(--icon-md); flex: none; }

/* ---------- Logo: the linked-racquets mark in emerald, the ball in ink ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); text-decoration: none; flex: none; }
.logo:hover { color: var(--text); }
.logo__mark { width: var(--icon-xl); height: var(--icon-xl); color: var(--brand); }
.logo__ball { fill: var(--ball); }
.logo__word { font-size: var(--h-3); font-weight: var(--w-bold); letter-spacing: var(--track-heading); line-height: 1; }
.logo__word span { font-weight: var(--w-regular); color: var(--text-3); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font: var(--w-semi) var(--body-s)/1 'DM Sans', system-ui, sans-serif; letter-spacing: var(--track-body);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  position: relative;
  transition: transform .2s var(--ease);
}
/* Filled buttons glow on hover: a pseudo-element's opacity, not a repaint. */
.btn--primary::before, .btn--invert::before { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 10px 24px -8px var(--glow-shadow); opacity: 0; transition: opacity .25s var(--ease); pointer-events: none; }
.btn:hover { transform: translate3d(0, -1px, 0); }
.btn:hover::before { opacity: 1; }
.btn:active { transform: scale(0.97); transition-duration: .08s; }
.btn--sm { min-height: 44px; padding: 0 18px; }
.btn--primary { background: var(--action); color: var(--on-action); }
.btn--primary:hover { background: var(--action-hover); color: var(--on-action); }
.btn--outline { background: var(--paper); color: var(--text); border-color: var(--line-strong); }
.btn--outline:hover { border-color: var(--text); color: var(--text); }
.btn--ghost { background: transparent; color: var(--text); }
.btn--ghost:hover { background: var(--well); color: var(--text); }
.btn .ico { width: var(--icon-sm); height: var(--icon-sm); }
@keyframes nudge { 0%, 100% { transform: none; } 50% { transform: translate3d(4px, 0, 0); } }
.btn:hover .ico--go { animation: nudge .9s var(--ease) infinite; }

/* ---------- Header: a sticky bar; a hairline and blur once the page scrolls ---------- */
.top { position: sticky; top: 0; z-index: 40; background: var(--header-bg); -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px); }
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); opacity: 0; transition: opacity .2s var(--ease); }
.top.is-scrolled::after, .top--ruled::after { opacity: 1; }
.top__bar { display: flex; align-items: center; gap: 24px; height: var(--header-h); }

/* ---------- Theme: one button, a small menu of Light / Dark / System ---------- */
.theme { position: relative; flex: none; }
.no-js .theme { display: none; }
.theme__btn {
  width: 44px; height: 44px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--text-2); cursor: pointer;
  transition: transform .16s var(--ease);
}
.theme__btn:hover { color: var(--text); border-color: var(--line-strong); }
.theme__btn:active { transform: scale(0.96); }
.theme__btn { position: relative; }
.theme__btn .ico { position: absolute; top: 50%; left: 50%; width: var(--icon-md); height: var(--icon-md); margin: -10px 0 0 -10px; opacity: 0; transform: rotate(-90deg) scale(0.5); transition: opacity .3s var(--ease), transform .45s var(--ease); }
.theme[data-choice="light"] .theme__ic--light,
.theme[data-choice="dark"] .theme__ic--dark,
.theme[data-choice="system"] .theme__ic--system { opacity: 1; transform: none; }
.theme__menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 168px;
  padding: 6px; border-radius: 14px; background: var(--raised); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-4px); visibility: hidden;
  transition: opacity .16s var(--ease), transform .16s var(--ease), visibility 0s linear .16s;
}
.theme.is-open .theme__menu { opacity: 1; transform: none; visibility: visible; transition: opacity .16s var(--ease), transform .16s var(--ease); }
.theme__menu [role="menuitemradio"] {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px;
  border: 0; border-radius: 9px; background: transparent; color: var(--text-2); cursor: pointer;
  font: var(--w-semi) var(--body-s)/1 'DM Sans', system-ui, sans-serif; letter-spacing: var(--track-body); text-align: left;
}
.theme__menu [role="menuitemradio"]:hover, .theme__menu [role="menuitemradio"]:focus-visible { background: var(--well); color: var(--text); }
.theme__menu [role="menuitemradio"] .ico { width: var(--icon-sm); height: var(--icon-sm); }
.theme__menu .theme__tick { margin-left: auto; color: var(--accent); opacity: 0; }
.theme__menu [aria-checked="true"] { color: var(--text); }
.theme__menu [aria-checked="true"] .theme__tick { opacity: 1; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); color: var(--text-3); font-size: var(--body-s); }
.foot__grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px; padding-top: 64px; padding-bottom: 32px; }
.foot__brand p { margin: 14px 0 0; max-width: 300px; }
.foot__nav { display: flex; gap: 72px; flex-wrap: wrap; }
.foot__nav div { display: flex; flex-direction: column; }
.foot__nav b { color: var(--text); font-weight: var(--w-semi); font-size: var(--h-6); margin-bottom: 6px; }
.foot__nav a { display: inline-flex; align-items: center; min-height: 40px; color: var(--text-3); text-decoration: none; }
.foot__nav a:hover { color: var(--text); }
.foot__legal { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 24px; display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; font-size: var(--body-xs); color: var(--text-4); }

@media (prefers-reduced-motion: reduce) {
  .btn, .btn::before, .theme__btn, .theme__btn .ico, .theme__menu, .top::after { transition: none; }
  .btn:hover, .btn:active, .theme__btn:active { transform: none; }
  .btn:hover .ico--go { animation: none; }
}

@media (max-width: 640px) {
  :root { --header-h: 64px; }
  .wrap { padding: 0 16px; }
  .top__bar { gap: 12px; }
  .foot__grid { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 48px; }
  .foot__nav { gap: 24px 40px; }
  .foot__nav a { min-height: 44px; }
}
