/* Tokens, reset, type, buttons, nav, footer, legal prose. Shared by every page. */

:root {
  color-scheme: light dark;

  --bg: #f4f5f8;
  --bg-2: #eaecf1;
  --card: #ffffff;
  --card-2: #f7f8fb;
  --ink: #1d1d1f;
  --ink-2: #555b66;
  --ink-3: #6e7480;
  --hair: rgba(20, 24, 40, 0.1);
  --hair-2: rgba(20, 24, 40, 0.06);
  --accent: #0a6fe8;
  --link: #0a62cf;
  --glass: rgba(255, 255, 255, 0.66);
  --window-shadow: 0 40px 70px -28px rgba(20, 30, 80, 0.45), 0 14px 28px -14px rgba(20, 30, 80, 0.3);
  --nav-shadow: 0 14px 34px -14px rgba(20, 30, 80, 0.32), 0 2px 8px rgba(20, 30, 80, 0.06);

  /* The app's own icon-badge palette (UI/AppSection.swift). DeX has no page of its own there: indigo. */
  --c-green: #34c759;
  --c-red: #ff3b30;
  --c-blue: #007aff;
  --c-sky: #32ade6;
  --c-teal: #30b0c7;
  --c-purple: #af52de;
  --c-orange: #ff9500;
  --c-gray: #8e8e93;
  --c-indigo: #5e5ce6;

  /* Colors the CSS-drawn placeholder art (assets/placeholders.svg) reads. */
  --ph-win: #ffffff;
  --ph-win2: #f0f2f6;
  --ph-line: rgba(20, 24, 40, 0.1);
  --ph-bar: rgba(20, 24, 40, 0.18);
  --ph-bar2: rgba(20, 24, 40, 0.09);
  --ph-bubble: #e6e8ee;
  --ph-w1: #dbe6ff;
  --ph-w2: #ecdcfb;

  /* Apple-style easing: a fast start that settles softly. Nothing bounces. */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI Variable", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", var(--font);
  --gutter: clamp(16px, 4vw, 32px);
  --r-card: 28px;
  --r-win: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131417;
    --bg-2: #191a1f;
    --card: #1e2025;
    --card-2: #24262c;
    --ink: #f3f3f5;
    --ink-2: #a9adb8;
    --ink-3: #8b909c;
    --hair: rgba(255, 255, 255, 0.11);
    --hair-2: rgba(255, 255, 255, 0.06);
    --link: #6cb1ff;
    --glass: rgba(34, 36, 43, 0.66);
    --window-shadow: 0 40px 80px -24px rgba(0, 0, 0, 0.8), 0 14px 28px -14px rgba(0, 0, 0, 0.6);
    --nav-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.3);

    --ph-win: #25272d;
    --ph-win2: #2d3037;
    --ph-line: rgba(255, 255, 255, 0.1);
    --ph-bar: rgba(255, 255, 255, 0.26);
    --ph-bar2: rgba(255, 255, 255, 0.12);
    --ph-bubble: #353840;
    --ph-w1: #1f2a4f;
    --ph-w2: #35224f;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { width: min(1200px, calc(100% - 2 * var(--gutter))); margin-inline: auto; }

h1, h2, h3 { font-weight: 700; letter-spacing: -0.03em; text-wrap: balance; }
h1 { font-size: clamp(2.75rem, 1.2rem + 6vw, 5.25rem); line-height: 1.02; letter-spacing: -0.045em; }
h2 { font-size: clamp(2rem, 1.2rem + 2.8vw, 3.25rem); line-height: 1.06; }
h3 { font-size: 1.3125rem; line-height: 1.2; font-weight: 650; letter-spacing: -0.02em; }
.lead { font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem); line-height: 1.45; color: var(--ink-2); max-width: 38em; text-wrap: pretty; }
.muted { color: var(--ink-2); }
.small { font-size: 0.9375rem; color: var(--ink-2); }

/* Icons: stroke symbols from assets/icons.svg */
.ico { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* The app's icon badge: a white symbol on a colored rounded square */
.badge {
  --c: var(--c-gray);
  display: inline-grid; place-items: center; flex: none;
  width: var(--s, 40px); height: var(--s, 40px);
  border-radius: calc(var(--s, 40px) * 0.27);
  color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 84%, #fff), var(--c));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 1px 2px rgba(0, 0, 0, 0.18);
}
.badge .ico { width: 54%; height: 54%; stroke-width: 2; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  padding: 0.85em 1.5em; border-radius: 999px; border: 1px solid transparent;
  font: 600 1rem/1.1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 10px 22px -10px rgba(10, 111, 232, 0.7); }
.btn--primary:hover { background: #0b62cf; }
.btn--glass { background: var(--glass); border-color: var(--hair); color: var(--ink); backdrop-filter: blur(16px); }
.btn--glass:hover { background: var(--card); }
.btn--sm { padding: 0.6em 1.1em; font-size: 0.9375rem; }
.btn--lg { padding: 1em 1.8em; font-size: 1.0625rem; }
.btn--block { width: 100%; }

/* Nav: a glass pill, floating */
.nav { position: sticky; top: 12px; z-index: 50; padding-top: 12px; }
.nav__bar {
  position: relative; isolation: isolate;
  display: flex; align-items: center; gap: 12px;
  padding: 7px 7px 7px 14px; border-radius: 999px;
}
/* The glass is a layer of its own so it can fade: shown by default, hidden at the very top of the page by main.js (.is-top). */
.nav__bar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: var(--glass); border: 1px solid var(--hair);
  backdrop-filter: blur(22px) saturate(1.7); -webkit-backdrop-filter: blur(22px) saturate(1.7);
  box-shadow: var(--nav-shadow);
  transition: opacity 0.5s var(--ease);
}
.nav.is-top .nav__bar::before { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .nav__bar::before { transition: none; } }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 650; letter-spacing: -0.015em; text-decoration: none; margin-right: auto; min-width: 0; }
.brand img { width: 30px; height: 30px; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav__links { display: none; gap: 2px; }
.nav__links a { color: var(--ink-2); text-decoration: none; padding: 0.5em 0.9em; border-radius: 999px; font-size: 0.9375rem; font-weight: 500; }
.nav__links a:hover { color: var(--ink); background: var(--hair-2); }
@media (min-width: 900px) { .nav__links { display: flex; } }
@media (max-width: 380px) { .brand span { display: none; } }

/* Footer */
.footer { background: var(--bg-2); border-top: 1px solid var(--hair); padding-block: 56px 40px; font-size: 0.9375rem; color: var(--ink-2); }
.footer__grid { display: grid; gap: 40px; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); }
.footer h3 { font-size: 0.9375rem; letter-spacing: 0; color: var(--ink); margin-bottom: 12px; }
.footer ul { display: grid; gap: 8px; }
.footer a { color: var(--ink-2); text-decoration: none; }
.footer a:hover { color: var(--ink); text-decoration: underline; }
.footer .brand { margin: 0 0 14px; }
.footer__fine { margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--hair); display: grid; gap: 12px; font-size: 0.8125rem; color: var(--ink-3); max-width: 70em; }
.footer__fine a { color: var(--ink-2); }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__grid > :first-child { grid-column: 1 / -1; } }

/* Legal pages */
.legal { padding-block: clamp(40px, 7vw, 88px) clamp(64px, 9vw, 120px); }
.legal__body { max-width: 44rem; }
.legal h1 { font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.75rem); margin-bottom: 12px; }
.legal h2 { font-size: 1.5rem; letter-spacing: -0.02em; margin: 2.2em 0 0.5em; }
.legal p, .legal li { color: var(--ink-2); margin-top: 0.8em; max-width: 40em; }
.legal ul { list-style: disc; padding-left: 1.3em; }
.legal li::marker { color: var(--ink-3); }
.draft {
  display: flex; gap: 12px; align-items: flex-start; margin: 20px 0 8px; padding: 14px 16px;
  border-radius: 16px; border: 1px solid color-mix(in srgb, var(--c-orange) 55%, transparent);
  background: color-mix(in srgb, var(--c-orange) 12%, var(--card)); color: var(--ink); font-size: 0.9375rem;
}
.draft strong { white-space: nowrap; }
.ph { background: color-mix(in srgb, var(--c-orange) 22%, transparent); border-radius: 4px; padding: 0 0.25em; color: var(--ink); }
