/*
 * tokens.css: the Traqprep "Living Glass" design language as CSS custom properties.
 *
 * Sources (ref/ is the read-only app snapshot; line numbers are in DESIGN.md):
 *   global.css                 @theme (radii, spacing, type, shadows, motion), :root,
 *                              .tp-theme-dark, @media (prefers-color-scheme: dark)
 *   constants/glassTokens.ts   tpLight / tpDark (surfaces, text, accents, halos, plate)
 *   constants/semanticTokens.ts METALLIC_*, GLASS_SHEEN, CARD_SHADOW, ATMOSPHERE*,
 *                              TAB_HALO*, TAB_LABEL_ACTIVE, STATUS_FADE_*, SCRIM, MEDIA_SCRIM
 *
 * Scheme: light values are the :root default. Dark values apply when the system asks for
 * dark (prefers-color-scheme: dark), unless the page sets data-theme="light". Setting
 * data-theme="dark" forces dark. This is how the app follows the system setting.
 *
 * Fonts: copy the TTFs from the app's assets/fonts/ into the site's /assets/fonts/ folder.
 * No WOFF2 was produced (no local encoder was available), so these load as TTF.
 *
 * Colour values are hex or rgb()/rgba(). Triplets (--tp-pool-*, --tp-halo-rgb) are
 * space-separated RGB for use inside rgb(var(...) / alpha).
 */

/* ---------- Fonts (assets/fonts/, same files as the app) ---------- */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* The app resolves Inter 700 and 800 to Bold (design.md:334). */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-Bold.woff2") format("woff2");
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
}

/* The app resolves Plus Jakarta Sans 500 to SemiBold (design.md:336). */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/PlusJakartaSans-SemiBold.woff2") format("woff2");
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/PlusJakartaSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/fonts/PlusJakartaSans-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Scheme-independent tokens ---------- */

:root {
  /* Families (global.css:105-111) */
  --tp-font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --tp-font-body: Inter, system-ui, sans-serif;

  /* Type scale (global.css:153-192). Line heights are unitless ratios. */
  --tp-type-display-lg-size: 32px;
  --tp-type-display-lg-lh: 1.1875;
  --tp-type-display-lg-ls: -0.02em;
  --tp-type-display-lg-weight: 800;

  --tp-type-display-size: 26px;
  --tp-type-display-lh: 1.2308;
  --tp-type-display-ls: -0.015em;
  --tp-type-display-weight: 700;

  --tp-type-headline-size: 20px;
  --tp-type-headline-lh: 1.3;
  --tp-type-headline-ls: -0.01em;
  --tp-type-headline-weight: 700;

  --tp-type-title-size: 17px;
  --tp-type-title-lh: 1.2941;
  --tp-type-title-ls: 0em;
  --tp-type-title-weight: 600;

  --tp-type-body-size: 15px;
  --tp-type-body-lh: 1.4667;
  --tp-type-body-ls: 0em;
  --tp-type-body-weight: 400;

  --tp-type-body-strong-size: 15px;
  --tp-type-body-strong-lh: 1.4667;
  --tp-type-body-strong-ls: 0em;
  --tp-type-body-strong-weight: 600;

  --tp-type-caption-size: 13px;
  --tp-type-caption-lh: 1.3846;
  --tp-type-caption-ls: 0em;
  --tp-type-caption-weight: 500;

  --tp-type-micro-size: 11px;
  --tp-type-micro-lh: 1.2727;
  --tp-type-micro-ls: 0.02em;
  --tp-type-micro-weight: 600;

  /* label: ALL-CAPS overline (apply text-transform: uppercase in the page) */
  --tp-type-label-size: 11px;
  --tp-type-label-lh: 1.2727;
  --tp-type-label-ls: 0.08em;
  --tp-type-label-weight: 700;

  /* numeric: metric values. Add font-variant-numeric: tabular-nums (global.css:199-201) */
  --tp-type-numeric-size: 28px;
  --tp-type-numeric-lh: 1.2143;
  --tp-type-numeric-ls: 0em;
  --tp-type-numeric-weight: 700;

  /* Spacing, 4px base grid (global.css:95-103) */
  --tp-space-1: 4px;
  --tp-space-2: 8px;
  --tp-space-3: 12px;
  --tp-space-4: 16px;
  --tp-space-5: 20px;
  --tp-space-6: 24px;
  --tp-space-8: 32px;
  --tp-space-10: 40px;
  --tp-space-12: 48px;

  /* Page gutter on phone width (design.md:356). */
  --tp-gutter: 16px;

  /* Radius ladder (global.css:89-93). Legacy island names are aliases (global.css:208-212). */
  --tp-radius-xs: 8px;
  --tp-radius-sm: 12px;
  --tp-radius-md: 20px;
  --tp-radius-lg: 28px;
  --tp-radius-xl: 36px;
  --tp-radius-full: 9999px;

  /* Minimum touch target (constants/touchTarget.ts; design.md:645). */
  --tp-touch-min: 48px;

  /* Motion (global.css:142-147; glassTokens.ts:227-239). Springs are JS-only and are not here. */
  --tp-dur-micro: 120ms;
  --tp-dur-quick: 200ms;
  --tp-dur-base: 300ms;
  --tp-dur-slow: 450ms;
  --tp-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --tp-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  /* Press feedback: scale 0.97 and opacity 0.92 (design.md:465). */
  --tp-press-scale: 0.97;
  --tp-press-opacity: 0.92;

  /* Metallic glass for solid-colour buttons (semanticTokens.ts:52-97). Same in both schemes. */
  --tp-metal-accent: linear-gradient(180deg, #4a86f2 0%, #2459d6 30%, #1b45b4 70%, #163a9a 100%);
  --tp-metal-activity: linear-gradient(180deg, #22a05c 0%, #0f703c 30%, #0d6438 70%, #09502f 100%);
  --tp-metal-danger: linear-gradient(180deg, #ea565c 0%, #bd2932 30%, #a82129 70%, #8a1a20 100%);
  --tp-metal-specular: linear-gradient(
    180deg,
    rgb(255 255 255 / 0.4) 0%,
    rgb(255 255 255 / 0.14) 18%,
    rgb(255 255 255 / 0.03) 30%,
    rgb(255 255 255 / 0) 46%
  );
  --tp-metal-caustic: linear-gradient(
    180deg,
    rgb(255 255 255 / 0) 0%,
    rgb(255 255 255 / 0) 74%,
    rgb(255 255 255 / 0.16) 100%
  );
  --tp-metal-rim-top: rgb(255 255 255 / 0.55);
  --tp-metal-rim-side: rgb(255 255 255 / 0.16);
  --tp-metal-glow-accent: rgba(36, 89, 214, 0.55);
  --tp-metal-glow-activity: rgba(15, 112, 60, 0.5);
  --tp-metal-glow-danger: rgba(189, 41, 50, 0.5);
  --tp-metal-pressed-gloss: 0.45;

  /* Shadows that do not change with the scheme (global.css:113-115) */
  --tp-shadow-glass: 0 4px 24px rgba(26, 35, 50, 0.08);
  --tp-shadow-glass-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --tp-shadow-accent: 0 4px 16px rgba(45, 108, 223, 0.3);

  /* Scrims (semanticTokens.ts:244-254). The same in both schemes. */
  --tp-scrim: rgba(0, 0, 0, 0.4);
  --tp-media-scrim: rgba(0, 0, 0, 0.6);

  /* Foregrounds that are white in both schemes (glassTokens.ts:195, 203). */
  --tp-on-accent: #ffffff;
  --tp-on-media: #ffffff;

  /* Glass blur radii for the web translation (GlassSurface.tsx:110, SheetGlassBackground.tsx:42). */
  --tp-blur-card: 32px;
  --tp-blur-sheet: 28px;
  --tp-saturate: 180%;

  /* Atmosphere geometry (semanticTokens.ts:151-155). Radii are a fraction of the width.
     The first pool sits at x 88%, y 6%, the second at x 2%, y 46%, the third at x 96%, y 90%. */
  --tp-atmosphere-pools:
    radial-gradient(
      circle 95vw at 88% 6%,
      rgb(var(--tp-pool-1) / var(--tp-pool-opacity)) 0%,
      rgb(var(--tp-pool-1) / calc(var(--tp-pool-opacity) * 0.45)) 55%,
      rgb(var(--tp-pool-1) / 0) 100%
    ),
    radial-gradient(
      circle 85vw at 2% 46%,
      rgb(var(--tp-pool-2) / var(--tp-pool-opacity)) 0%,
      rgb(var(--tp-pool-2) / calc(var(--tp-pool-opacity) * 0.45)) 55%,
      rgb(var(--tp-pool-2) / 0) 100%
    ),
    radial-gradient(
      circle 90vw at 96% 90%,
      rgb(var(--tp-pool-3) / var(--tp-pool-opacity)) 0%,
      rgb(var(--tp-pool-3) / calc(var(--tp-pool-opacity) * 0.45)) 55%,
      rgb(var(--tp-pool-3) / 0) 100%
    );
}

/* ---------- Light scheme (the :root default) ---------- */

:root {
  color-scheme: light;

  /* Canvas (glassTokens.ts:87; global.css:45) */
  --tp-bg: #d8e4f0;

  /* Atmosphere pools as RGB triplets (glassTokens.ts:88-90), opacity 1 (semanticTokens.ts:162) */
  --tp-pool-1: 230 239 255;
  --tp-pool-2: 219 243 238;
  --tp-pool-3: 251 232 222;
  --tp-pool-opacity: 1;
  --tp-wash: linear-gradient(180deg, rgb(255 255 255 / 0.4) 0%, rgb(255 255 255 / 0) 45%);
  /* Round 3: the grain tile is transparent RGBA noise (work/tools/make-grain.mjs), so the app value 0.55 applies (DESIGN.md section 3). */
  --tp-grain-opacity: 0.55;

  /* Glass tiers (glassTokens.ts:91-97). glass (0.60) is the standard frost; glass-high (0.50)
     is a denser-tint step, not more opaque. This is intentional (global.css:46-48). */
  --tp-glass-low: rgba(255, 255, 255, 0.35);
  --tp-glass: rgba(255, 255, 255, 0.6);
  --tp-glass-high: rgba(255, 255, 255, 0.5);
  --tp-glass-higher: rgba(255, 255, 255, 0.72);
  --tp-glass-bright: rgba(255, 255, 255, 0.88);

  /* Gloss across the top of every glass pane (semanticTokens.ts:127-131) */
  --tp-glass-sheen: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.42) 0%,
    rgba(255, 255, 255, 0.1) 32%,
    rgba(255, 255, 255, 0) 62%
  );

  /* Rim, edge and plate (glassTokens.ts:98-101) */
  --tp-edge: rgba(255, 255, 255, 0.45);
  --tp-rim-top: rgba(255, 255, 255, 0.9);
  --tp-rim: rgba(255, 255, 255, 0.45);
  --tp-plate: rgba(255, 255, 255, 0.82);

  /* Text (glassTokens.ts:102-105) */
  --tp-text-primary: #1a2332;
  --tp-text-secondary: #4a5568;
  --tp-text-muted: #566579;
  --tp-text-inverse: #ffffff;

  /* Accents (glassTokens.ts:106-113) */
  --tp-accent: #2d6cdf;
  --tp-accent-light: #5b92ff;
  --tp-accent-dark: #1a4db8;
  --tp-accent-warm: #e07850;
  --tp-accent-warm-light: #f09878;
  --tp-accent-cool: #4338ca;
  --tp-tertiary: #0d9488;
  --tp-tertiary-container: rgba(13, 148, 136, 0.15);

  /* Semantic (glassTokens.ts:114-117) */
  --tp-success: #22c55e;
  --tp-warning: #f59e0b;
  --tp-error: #ef4444;
  --tp-info: #3b82f6;

  /* Lines and focus (glassTokens.ts:118, 120) */
  --tp-ghost: rgba(26, 35, 50, 0.1);
  --tp-focus-ring: rgba(45, 108, 223, 0.5);

  /* Sheen (glassTokens.ts:124-125) */
  --tp-sheen: rgba(255, 255, 255, 0.1);
  --tp-sheen-strong: rgba(255, 255, 255, 0.18);

  /* Lift (semanticTokens.ts:115-119; global.css:116-118, 121-122) */
  --tp-shadow-card: 0px 1px 2px rgba(20, 40, 80, 0.06), 0px 10px 24px -8px rgba(30, 60, 120, 0.22);
  --tp-shadow-contact: 0 1px 2px rgba(10, 20, 40, 0.06), 0 4px 12px rgba(10, 20, 40, 0.05);
  --tp-shadow-float: 0 2px 4px rgba(10, 20, 40, 0.08), 0 12px 32px rgba(10, 20, 40, 0.1);
  --tp-shadow-sheet: 0 -4px 24px rgba(10, 20, 40, 0.12);

  /* Status-bar fade colour (semanticTokens.ts:183) and its top opacity (semanticTokens.ts:188) */
  --tp-status-fade: #e8eff6;
  --tp-status-fade-opacity: 0.85;

  /* Tab halos (semanticTokens.ts:207-225). Inactive: white, 0.98/0.94/0.55/0.12/0.
     Active: white at full strength, blooming further out, 1/1/0.9/0.45/0. */
  --tp-halo-rgb: 255 255 255;
  --tp-halo: radial-gradient(
    circle closest-side,
    rgb(var(--tp-halo-rgb) / 0.98) 0%,
    rgb(var(--tp-halo-rgb) / 0.94) 46%,
    rgb(var(--tp-halo-rgb) / 0.55) 72%,
    rgb(var(--tp-halo-rgb) / 0.12) 92%,
    rgb(var(--tp-halo-rgb) / 0) 100%
  );
  --tp-halo-active: radial-gradient(
    circle closest-side,
    rgb(255 255 255 / 1) 0%,
    rgb(255 255 255 / 1) 46%,
    rgb(255 255 255 / 0.9) 72%,
    rgb(255 255 255 / 0.45) 92%,
    rgb(255 255 255 / 0) 100%
  );
  --tp-tab-label-active: #1a4db8;
}

/* ---------- Dark scheme: the system asks for dark, and the page has not forced light ---------- */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --tp-bg: #070d1f;

    --tp-pool-1: 14 36 86;
    --tp-pool-2: 10 47 56;
    --tp-pool-3: 42 22 48;
    --tp-pool-opacity: 0.8;
    --tp-wash: linear-gradient(180deg, rgb(40 80 160 / 0.1) 0%, rgb(40 80 160 / 0) 45%);
    --tp-grain-opacity: 0.7;

    --tp-glass-low: rgba(15, 35, 80, 0.25);
    --tp-glass: rgba(20, 45, 100, 0.38);
    --tp-glass-high: rgba(25, 55, 120, 0.54);
    --tp-glass-higher: rgba(30, 65, 140, 0.72);
    --tp-glass-bright: rgba(35, 75, 160, 0.88);

    --tp-glass-sheen: linear-gradient(
      180deg,
      rgba(150, 190, 255, 0.07) 0%,
      rgba(150, 190, 255, 0.02) 32%,
      rgba(150, 190, 255, 0) 62%
    );

    --tp-edge: rgba(140, 180, 255, 0.1);
    --tp-rim-top: rgba(160, 195, 255, 0.28);
    --tp-rim: rgba(140, 180, 255, 0.12);
    --tp-plate: rgba(7, 13, 31, 0.74);

    --tp-text-primary: #e8edf5;
    --tp-text-secondary: #a0aec8;
    --tp-text-muted: #98a7c4;
    --tp-text-inverse: #070d1f;

    --tp-accent: #4a9eff;
    --tp-accent-light: #7bb8ff;
    --tp-accent-dark: #2a7ae0;
    --tp-accent-warm: #ff9a70;
    --tp-accent-warm-light: #ffb899;
    --tp-accent-cool: #a5b4fc;
    --tp-tertiary: #2dd4bf;
    --tp-tertiary-container: rgba(45, 212, 191, 0.2);

    --tp-success: #4ade80;
    --tp-warning: #fbbf24;
    --tp-error: #f87171;
    --tp-info: #60a5fa;

    --tp-ghost: rgba(100, 140, 220, 0.12);
    --tp-focus-ring: rgba(74, 158, 255, 0.6);

    --tp-sheen: rgba(140, 180, 255, 0.12);
    --tp-sheen-strong: rgba(140, 180, 255, 0.2);

    --tp-shadow-card: 0px 1px 2px rgba(0, 0, 0, 0.3), 0px 12px 28px -8px rgba(0, 0, 0, 0.55);
    --tp-shadow-contact: 0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.18);
    --tp-shadow-float: 0 2px 4px rgba(0, 0, 0, 0.25), 0 12px 32px rgba(0, 0, 0, 0.3);
    --tp-shadow-sheet: 0 -4px 24px rgba(0, 0, 0, 0.35);

    --tp-status-fade: #0a142c;

    --tp-halo-rgb: 25 55 120;
    --tp-halo: radial-gradient(
      circle closest-side,
      rgb(25 55 120 / 0.96) 0%,
      rgb(25 55 120 / 0.9) 46%,
      rgb(25 55 120 / 0.48) 72%,
      rgb(25 55 120 / 0.1) 92%,
      rgb(25 55 120 / 0) 100%
    );
    --tp-halo-active: radial-gradient(
      circle closest-side,
      rgb(27 73 126 / 0.96) 0%,
      rgb(27 73 126 / 0.9) 46%,
      rgb(27 73 126 / 0.48) 72%,
      rgb(27 73 126 / 0.1) 92%,
      rgb(27 73 126 / 0) 100%
    );
    --tp-tab-label-active: #99c8ff;
  }
}

/* Forced dark (a page toggle sets data-theme="dark"). Same values as the block above. */
:root[data-theme="dark"] {
  color-scheme: dark;

  --tp-bg: #070d1f;

  --tp-pool-1: 14 36 86;
  --tp-pool-2: 10 47 56;
  --tp-pool-3: 42 22 48;
  --tp-pool-opacity: 0.8;
  --tp-wash: linear-gradient(180deg, rgb(40 80 160 / 0.1) 0%, rgb(40 80 160 / 0) 45%);
  --tp-grain-opacity: 0.7;

  --tp-glass-low: rgba(15, 35, 80, 0.25);
  --tp-glass: rgba(20, 45, 100, 0.38);
  --tp-glass-high: rgba(25, 55, 120, 0.54);
  --tp-glass-higher: rgba(30, 65, 140, 0.72);
  --tp-glass-bright: rgba(35, 75, 160, 0.88);

  --tp-glass-sheen: linear-gradient(
    180deg,
    rgba(150, 190, 255, 0.07) 0%,
    rgba(150, 190, 255, 0.02) 32%,
    rgba(150, 190, 255, 0) 62%
  );

  --tp-edge: rgba(140, 180, 255, 0.1);
  --tp-rim-top: rgba(160, 195, 255, 0.28);
  --tp-rim: rgba(140, 180, 255, 0.12);
  --tp-plate: rgba(7, 13, 31, 0.74);

  --tp-text-primary: #e8edf5;
  --tp-text-secondary: #a0aec8;
  --tp-text-muted: #98a7c4;
  --tp-text-inverse: #070d1f;

  --tp-accent: #4a9eff;
  --tp-accent-light: #7bb8ff;
  --tp-accent-dark: #2a7ae0;
  --tp-accent-warm: #ff9a70;
  --tp-accent-warm-light: #ffb899;
  --tp-accent-cool: #a5b4fc;
  --tp-tertiary: #2dd4bf;
  --tp-tertiary-container: rgba(45, 212, 191, 0.2);

  --tp-success: #4ade80;
  --tp-warning: #fbbf24;
  --tp-error: #f87171;
  --tp-info: #60a5fa;

  --tp-ghost: rgba(100, 140, 220, 0.12);
  --tp-focus-ring: rgba(74, 158, 255, 0.6);

  --tp-sheen: rgba(140, 180, 255, 0.12);
  --tp-sheen-strong: rgba(140, 180, 255, 0.2);

  --tp-shadow-card: 0px 1px 2px rgba(0, 0, 0, 0.3), 0px 12px 28px -8px rgba(0, 0, 0, 0.55);
  --tp-shadow-contact: 0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.18);
  --tp-shadow-float: 0 2px 4px rgba(0, 0, 0, 0.25), 0 12px 32px rgba(0, 0, 0, 0.3);
  --tp-shadow-sheet: 0 -4px 24px rgba(0, 0, 0, 0.35);

  --tp-status-fade: #0a142c;

  --tp-halo-rgb: 25 55 120;
  --tp-halo: radial-gradient(
    circle closest-side,
    rgb(25 55 120 / 0.96) 0%,
    rgb(25 55 120 / 0.9) 46%,
    rgb(25 55 120 / 0.48) 72%,
    rgb(25 55 120 / 0.1) 92%,
    rgb(25 55 120 / 0) 100%
  );
  --tp-halo-active: radial-gradient(
    circle closest-side,
    rgb(27 73 126 / 0.96) 0%,
    rgb(27 73 126 / 0.9) 46%,
    rgb(27 73 126 / 0.48) 72%,
    rgb(27 73 126 / 0.1) 92%,
    rgb(27 73 126 / 0) 100%
  );
  --tp-tab-label-active: #99c8ff;
}

/* ---------- Reduced motion: every duration token collapses to 0 (design.md:648) ---------- */

@media (prefers-reduced-motion: reduce) {
  :root {
    --tp-dur-micro: 0ms;
    --tp-dur-quick: 0ms;
    --tp-dur-base: 0ms;
    --tp-dur-slow: 0ms;
  }
}

:root {
  --shot-ratio: 1080 / 2400;
}
/* ---------- Site styles. Appended after tokens.css by work/build/build.mjs.
   Colours come from tokens only (no hex, no rgba literals here). ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  margin: 0;
  background: var(--tp-bg);
  color: var(--tp-text-primary);
  font-family: var(--tp-font-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--tp-text-primary);
  font-family: var(--tp-font-display);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.125rem, 1.5rem + 2.6vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1875;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  font-weight: 700;
  line-height: 1.2308;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.2941;
}

p {
  margin: 0;
}

p + p,
p + ul,
ul + p,
ul + ul {
  margin-top: 0.875rem;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

a {
  color: var(--tp-tab-label-active);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--tp-tab-label-active);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--tp-focus-ring);
}

/* Running-text links and footer credits: a 48 px tap height, the copy unchanged (DESIGN.md section 9). */
main p a,
main li a,
.footer-small a {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  vertical-align: middle;
}

[id] {
  scroll-margin-top: 6rem;
}

strong {
  font-weight: 600;
}

/* ---------- Atmosphere: the canvas, three light pools, a wash, and grain (DESIGN.md section 3) ---------- */

.tp-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--tp-wash), var(--tp-atmosphere-pools), var(--tp-bg);
}

.tp-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/assets/textures/grain.png") repeat;
  opacity: var(--tp-grain-opacity);
}

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--tp-gutter);
}

@media (min-width: 48rem) {
  .wrap {
    padding-inline: 2rem;
  }
}

main {
  display: block;
  padding-bottom: 1rem;
}

.section {
  padding-block: 1.25rem;
}

@media (min-width: 60rem) {
  .section {
    padding-block: 1.75rem;
  }
}

.eyebrow {
  margin-bottom: 1rem;
  color: var(--tp-text-secondary);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.2727;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  max-width: 36rem;
  margin-top: 1.25rem;
  color: var(--tp-text-secondary);
  font-size: 1.125rem;
  line-height: 1.5;
}

.note {
  color: var(--tp-text-secondary);
  font-size: 0.875rem;
  line-height: 1.4;
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  top: -4rem;
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  left: var(--tp-gutter);
  z-index: 30;
  padding: 0.5rem 1rem;
  border-radius: var(--tp-radius-full);
  background: var(--tp-glass-bright);
  color: var(--tp-text-primary);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

/* ---------- Floating header: a glass pill over the content, no bar behind it (DESIGN.md section 11) ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0.75rem var(--tp-gutter) 0;
  pointer-events: none;
}

@media (min-width: 48rem) {
  .site-header {
    padding-inline: 2rem;
  }
}

/* On a phone the nav wraps to two rows; a sticky block that tall covers the scroll, so it scrolls away. */
@media (max-width: 47.99rem) {
  .site-header {
    position: static;
  }
}

.site-nav {
  position: relative;
  isolation: isolate;
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 0.5rem;
  max-width: 72rem;
  margin-inline: auto;
  padding: 0.25rem 0.25rem 0.25rem 0.5rem;
  border: 1px solid var(--tp-rim);
  border-top-color: var(--tp-rim-top);
  border-radius: var(--tp-radius-full);
  background: var(--tp-glass);
  -webkit-backdrop-filter: blur(var(--tp-blur-card)) saturate(var(--tp-saturate));
  backdrop-filter: blur(var(--tp-blur-card)) saturate(var(--tp-saturate));
  box-shadow: var(--tp-shadow-contact);
}

.site-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--tp-glass-sheen);
  pointer-events: none;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-nav {
    background: var(--tp-glass-higher);
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding-right: 0.5rem;
  color: var(--tp-text-primary);
  font-family: var(--tp-font-display);
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  list-style: none;
}

.nav-links a {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 0.625rem;
  border-radius: var(--tp-radius-full);
  color: var(--tp-text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

/* A halo behind each link (DESIGN.md section 11, R4). No pill: the current page gets a brighter halo and a bolder label. */
.nav-links a::before {
  content: "";
  position: absolute;
  inset: -0.25rem -0.125rem;
  z-index: -1;
  border-radius: inherit;
  background: var(--tp-halo);
  pointer-events: none;
  opacity: 0;
}

/* Inactive links show no halo at rest; hover, focus and the current page show it (DESIGN.md section 11). */
.nav-links a:hover::before,
.nav-links a:focus-visible::before {
  opacity: 1;
}

.nav-links a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.nav-links a[aria-current="page"] {
  color: var(--tp-tab-label-active);
  font-weight: 700;
}

.nav-links a[aria-current="page"]::before {
  background: var(--tp-halo-active);
  opacity: 1;
}

/* ---------- Glass pane: thickness from rim, gloss and lift (DESIGN.md section 4) ---------- */

.pane {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 1.5rem;
  border: 1px solid var(--tp-rim);
  border-top-color: var(--tp-rim-top);
  border-radius: var(--tp-radius-lg);
  background: var(--tp-glass);
  box-shadow: var(--tp-shadow-card);
}

.pane::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--tp-glass-sheen);
  pointer-events: none;
}

@media (min-width: 40rem) {
  .pane {
    padding: 2.25rem;
  }
}

.pane--quiet {
  background: var(--tp-glass-low);
  box-shadow: var(--tp-shadow-contact);
}

/* A quiet pane nested in a pane is a tier of glass, not a second lit card (DESIGN.md section 4). */
.pane .pane--quiet {
  box-shadow: none;
}

.pane > * + * {
  margin-top: 0.875rem;
}

/* ---------- Metallic glass button (DESIGN.md section 5) ---------- */

.metal {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tp-touch-min);
  padding: 0.75rem 1.5rem;
  border: 0;
  border-radius: var(--tp-radius-md);
  background: var(--tp-metal-accent);
  color: var(--tp-on-accent);
  font: 600 1rem/1.25 var(--tp-font-body);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 14px -5px var(--tp-metal-glow-accent), 0 2px 4px -2px var(--tp-metal-glow-accent);
  transition:
    transform var(--tp-dur-quick) var(--tp-ease-out),
    filter var(--tp-dur-quick) var(--tp-ease-out);
}

.metal::before,
.metal::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
}

.metal::before {
  background: var(--tp-metal-specular);
}

.metal::after {
  background: var(--tp-metal-caustic);
  border: 1px solid var(--tp-metal-rim-side);
  border-top-color: var(--tp-metal-rim-top);
}

.metal > span {
  position: relative;
  z-index: 1;
}

.metal:not([aria-disabled="true"]):hover {
  filter: brightness(1.06);
}

.metal:not([aria-disabled="true"]):active {
  transform: scale(var(--tp-press-scale));
}

.metal:not([aria-disabled="true"]):active::before {
  opacity: var(--tp-metal-pressed-gloss);
}

.metal[aria-disabled="true"] {
  cursor: default;
}

/* A plain status chip: a glass pill with a readable label. It is not a button, so it is not metal (DESIGN.md section 5). */
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  margin: 0;
  padding: 0.5rem 1.125rem;
  border: 1px solid var(--tp-rim);
  border-top-color: var(--tp-rim-top);
  border-radius: var(--tp-radius-full);
  background: var(--tp-glass-bright);
  color: var(--tp-text-primary);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  gap: 2.5rem;
  align-items: center;
  padding-block: 2.5rem;
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero-media .shot {
  max-width: 18rem;
}

@media (min-width: 60rem) {
  .hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 3rem;
    padding-block: 4rem 4.5rem;
  }
}

/* ---------- Phone frame and screenshot figures (CSS phone frame, lazy, sized) ---------- */

.shot {
  width: 100%;
  max-width: 16.5rem;
  margin: 0;
  display: grid;
  gap: 0.875rem;
  align-content: start;
}

.shots {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 40rem) {
  .shots--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.phone {
  position: relative;
  isolation: isolate;
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--tp-rim);
  border-top-color: var(--tp-rim-top);
  border-radius: 2.625rem;
  background: linear-gradient(180deg, var(--tp-glass-bright), var(--tp-glass-high));
  box-shadow: var(--tp-shadow-float);
}

.phone img {
  width: 100%;
  height: auto;
  aspect-ratio: var(--shot-ratio);
  object-fit: cover;
  object-position: top center;
  border-radius: 2.125rem;
  background: var(--tp-bg);
}

.shot figcaption {
  color: var(--tp-text-secondary);
  font-size: 0.875rem;
  line-height: 1.4;
}

/* ---------- Feature sections ---------- */

.feature-grid {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.feature-text > * + * {
  margin-top: 0.875rem;
}

.feature-text h2 {
  margin-bottom: 0.25rem;
}

.feature-text p {
  color: var(--tp-text-primary);
  line-height: 1.6;
}

.feature-media {
  min-width: 0;
}

@media (min-width: 60rem) {
  .feature-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3.5rem;
  }

  .feature--flip .feature-grid {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .feature--flip .feature-media {
    order: -1;
  }
}

/* The companion still, shown large in its own glass plate above the heading. */
.still-plate {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 0.5rem;
  padding: 1rem;
}

.still-plate img {
  display: block;
  width: 15rem;
  max-width: 100%;
  height: auto;
}

/* Labelled points under small caps labels (used where a section has several short items). */
.spike-points dt {
  margin-top: 1.25rem;
  color: var(--tp-text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.spike-points dt:first-child {
  margin-top: 0;
}

.spike-points dd {
  margin: 0.375rem 0 0;
  color: var(--tp-text-primary);
  line-height: 1.6;
}

/* ---------- Bulleted lists with a plain accent dot ---------- */

.bullets {
  display: grid;
  gap: 0.625rem;
  list-style: none;
}

.bullets li {
  position: relative;
  padding-left: 1.125rem;
}

.bullets li::before {
  content: "";
  position: absolute;
  top: 0.55em;
  left: 0;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--tp-tab-label-active);
}

.plans {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 52rem) {
  .plans {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.plans h3 {
  margin-bottom: 0.25rem;
}

/* ---------- FAQ ---------- */

.section-title {
  margin-bottom: 1.25rem;
}

.faq {
  display: grid;
  gap: 0.875rem;
}

.pane.faq-item {
  padding: 0;
}

.faq-item summary {
  position: relative;
  padding: 1.125rem 3rem 1.125rem 1.5rem;
  border-radius: var(--tp-radius-lg);
  color: var(--tp-text-primary);
  font-family: var(--tp-font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
}

/* The summary's own ring, drawn inside the pane so the overflow clip does not cut it (WCAG 2.4.7). */
.faq-item summary:focus-visible {
  outline-offset: -4px;
  box-shadow: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 1.25rem;
  transform: translateY(-50%);
  color: var(--tp-tab-label-active);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-item .answer {
  padding: 0 1.5rem 1.25rem;
  color: var(--tp-text-secondary);
  line-height: 1.6;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 2rem 3rem;
}

.footer-lead {
  font-family: var(--tp-font-display);
  font-size: 1.0625rem;
  font-weight: 600;
}

.footer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
}

.footer-list a {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding-inline: 0.5rem;
  margin-inline: -0.5rem;
}

.footer-small {
  color: var(--tp-text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ---------- Legal pages and support: one readable column with a contents pane ---------- */

.legal-head {
  padding-block: 2.5rem 1.5rem;
}

.legal-head h1 {
  max-width: 22ch;
  font-size: clamp(2rem, 1.4rem + 2.2vw, 2.875rem);
}

.meta {
  margin-top: 1rem;
  color: var(--tp-text-secondary);
  font-size: 0.875rem;
}

.legal {
  max-width: 46rem;
  padding-bottom: 2rem;
}

.legal-section {
  margin-top: 2.5rem;
}

.legal-section h2 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);
}

.legal-section h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.0625rem;
}

.legal code,
.table-wrap code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.legal p,
.legal li {
  line-height: 1.65;
}

.legal ul {
  padding-left: 1.25rem;
  list-style: disc;
}

.legal ul li + li {
  margin-top: 0.5rem;
}

.toc {
  margin-top: 1.5rem;
}

.toc h2 {
  font-size: 1.125rem;
}

.toc ol {
  margin-top: 0.75rem;
  list-style: none;
  columns: 2 16rem;
  column-gap: 2rem;
}

.toc li {
  break-inside: avoid;
  margin-bottom: 0.5rem;
}

.toc a {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding-inline: 0.5rem;
  margin-inline: -0.5rem;
  color: var(--tp-text-primary);
}

/* Section links in running text get the same wider target, with no change to the line. */
.legal p a[href^="#"],
.legal li a[href^="#"] {
  padding-inline: 0.5rem;
  margin-inline: -0.5rem;
}

.callout {
  margin-top: 1.25rem;
  background: var(--tp-glass-high);
}

.cards {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 40rem) {
  .cards {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.cards h3 {
  font-size: 1rem;
}

.cards p {
  color: var(--tp-text-secondary);
  font-size: 0.9375rem;
}

.table-wrap {
  margin-top: 1rem;
  overflow-x: auto;
  border: 1px solid var(--tp-rim);
  border-radius: var(--tp-radius-md);
  background: var(--tp-glass-low);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.5;
}

th,
td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--tp-ghost);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--tp-text-primary);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: 0;
}

.notice {
  margin-top: 1.5rem;
  background: var(--tp-glass-bright);
}

.notice h2 {
  font-size: 1.25rem;
}

.page-head {
  padding-block: 2.5rem 1.5rem;
}

.page-head h1 {
  max-width: 20ch;
  font-size: clamp(2rem, 1.4rem + 2.2vw, 2.875rem);
}

.share-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 2rem;
}

.link-list {
  list-style: none;
}

.link-list li + li {
  margin-top: 0.5rem;
}

/* ---------- Motion: durations are 0 under reduced motion in tokens.css; drop transforms and loops too ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }

  .metal:not([aria-disabled="true"]):active {
    transform: none;
  }
}
