/* ALi3 fonts: self-hosted variable WOFF2 files, Latin subset. Each app serves the files listed
   in fonts.json at these /assets/fonts/ paths (the site build fingerprints them). */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/assets/fonts/inter-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;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url('/assets/fonts/space-grotesk-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;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url('/assets/fonts/jetbrains-mono-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;
}

/* ALi3 design tokens: colors for light, dark and system ("auto") themes, plus fonts.
   Set data-theme="light|dark|auto" on <html>. Values come from the ALi3 design (Main.dc.html). */

:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-alt: #F4F6F8;
  --surface-subtle: #F7F9FB;
  --ink: #0E1726;
  --text-2: #3D4A5C;
  --muted: #536173;
  --border: #DCE1E7;
  --border-soft: #EEF1F4;
  --border-strong: #B7C1CD;
  --arrow: #7A8798;
  --accent: #0B5CAD;
  --accent-hover: #08427C;
  --accent-bg: #0B5CAD;
  --inverse: #0E1726;
  --blue-bg: #E6F0FB;
  --blue-fg: #0B4F96;
  --green-bg: #E5F4EC;
  --green-fg: #17603A;
  --amber-bg: #FDF3DC;
  --amber-fg: #6E4A00;
  --orange-bg: #FDE9DD;
  --orange-fg: #933708;
  --warn-row: #FFF8F3;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1220;
  --bg-alt: #101A2A;
  --surface-subtle: #131E2F;
  --ink: #E8EDF3;
  --text-2: #B4C0CE;
  --muted: #95A3B5;
  --border: #243247;
  --border-soft: #1B273A;
  --border-strong: #3A4A60;
  --arrow: #6E7E93;
  --accent: #8CB9F2;
  --accent-hover: #B5D2F7;
  --accent-bg: #2B6CB8;
  --inverse: #16233A;
  --blue-bg: #13294A;
  --blue-fg: #9CC4F5;
  --green-bg: #0F2E20;
  --green-fg: #8FD3AE;
  --amber-bg: #33270B;
  --amber-fg: #F0C96B;
  --orange-bg: #3A1E10;
  --orange-fg: #F5A97A;
  --warn-row: #1E1612;
}

@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    color-scheme: dark;
    --bg: #0B1220;
    --bg-alt: #101A2A;
    --surface-subtle: #131E2F;
    --ink: #E8EDF3;
    --text-2: #B4C0CE;
    --muted: #95A3B5;
    --border: #243247;
    --border-soft: #1B273A;
    --border-strong: #3A4A60;
    --arrow: #6E7E93;
    --accent: #8CB9F2;
    --accent-hover: #B5D2F7;
    --accent-bg: #2B6CB8;
    --inverse: #16233A;
    --blue-bg: #13294A;
    --blue-fg: #9CC4F5;
    --green-bg: #0F2E20;
    --green-fg: #8FD3AE;
    --amber-bg: #33270B;
    --amber-fg: #F0C96B;
    --orange-bg: #3A1E10;
    --orange-fg: #F5A97A;
    --warn-row: #1E1612;
  }
}

:root {
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  /* Fixed colors for the bands that stay dark in both themes */
  --on-dark: #ffffff;
  --on-dark-2: #C3CFDD;
  --on-dark-3: #DCE4EE;
  --on-dark-kicker: #8FA3BC;
  --on-dark-accent: #8FB8EC;
}

/* ALi3 base styles and shared components: type, chips, buttons, theme switch, form fields,
   form status. Needs tokens.css. App-specific layout and overrides belong in each app. */

/* ---------- Base ---------- */

/* No global border-box: the design's flex and grid sizing assumes the default content-box. */

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
img, svg { flex-shrink: 0; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

[id] { scroll-margin-top: 16px; }

.nocase { text-transform: none; }
.mono { font-family: var(--font-mono); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  padding: 10px 16px; border-radius: 8px;
  background: var(--ink); color: var(--bg);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 16px; color: var(--bg); }

/* ---------- Type ---------- */

.eyebrow {
  margin: 0 0 16px;
  font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
}

.display {
  font-family: var(--font-display);
  font-size: clamp(42px, 5.6vw, 68px); line-height: 1.04; letter-spacing: -0.025em;
}

.h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.6vw, 44px); line-height: 1.12; letter-spacing: -0.02em;
}

.lede { margin-top: 20px; font-size: 18px; color: var(--text-2); }

.kicker {
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}

.card-title { font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.6; }

/* ---------- Chips ---------- */

.chip {
  display: inline-block;
  font-size: 12px; font-weight: 600; line-height: 1.6;
  border-radius: 999px; padding: 2px 10px;
  white-space: nowrap;
}
.chip--neutral { background: var(--border-soft); color: var(--text-2); }
.chip--blue { background: var(--blue-bg); color: var(--blue-fg); }
.chip--green { background: var(--green-bg); color: var(--green-fg); }
.chip--amber { background: var(--amber-bg); color: var(--amber-fg); }
.chip--orange { background: var(--orange-bg); color: var(--orange-fg); }
.chip--illustrative {
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted); border: 1px dashed var(--border-strong);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 8px;
  font: inherit; font-size: 16px; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer;
}
.btn--primary { background: var(--accent-bg); color: #ffffff; border: 0; }
.btn--primary:hover { background: var(--accent-hover); color: #ffffff; }
[data-theme="dark"] .btn--primary:hover { background: #1F5A9E; }
@media (prefers-color-scheme: dark) { [data-theme="auto"] .btn--primary:hover { background: #1F5A9E; } }
.btn--secondary { border: 1px solid var(--border-strong); color: var(--ink); background: transparent; }
.btn--secondary:hover { color: var(--ink); background: var(--bg-alt); }
.btn[disabled] { opacity: 0.7; cursor: progress; }

/* ---------- Theme switch ---------- */

.theme-switch {
  display: flex; padding: 3px; gap: 2px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg-alt);
}
.theme-switch button {
  width: 40px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 7px; cursor: pointer;
  background: transparent; color: var(--muted);
}
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] {
  background: var(--bg); color: var(--ink);
  box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(14, 23, 38, 0.08);
}

/* ---------- Form fields ---------- */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 600; }
.field .optional { font-weight: 400; color: var(--muted); }
.field input,
.field select,
.field textarea {
  min-height: 44px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  font: inherit; font-weight: 400; font-size: 16px;
  background: var(--bg); color: var(--ink);
}
.field input { padding: 0 12px; }
.field select { padding: 0 10px; }
.field textarea { padding: 10px 12px; resize: vertical; }
.field ::placeholder { color: var(--muted); opacity: 1; }
.field [aria-invalid="true"] { border-color: var(--orange-fg); border-width: 2px; }
.field-error { font-size: 13px; font-weight: 600; color: var(--orange-fg); }
.field-error:empty { display: none; }

.form-status { grid-column: 1 / -1; font-size: 15px; border-radius: 8px; }
.form-status:empty { display: none; }
.form-status.is-success { padding: 12px 14px; background: var(--green-bg); color: var(--green-fg); }
.form-status.is-error { padding: 12px 14px; background: var(--orange-bg); color: var(--orange-fg); }
.form-status:focus { outline: none; }
.form-status:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Placeholder page for portal.ali3.io. Builds on @ali3/ui (fonts, tokens, base). */

body { min-height: 100vh; display: flex; flex-direction: column; }

.ph-header { padding: 20px 24px; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand .mark-line { stroke: var(--ink); }
.brand .mark-core { fill: var(--accent); }
.wordmark { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.01em; line-height: 1; }
.brand-product { padding-left: 10px; border-left: 1px solid var(--border-strong); font-size: 15px; font-weight: 600; color: var(--text-2); line-height: 1.2; }

.ph-main { flex: 1 0 auto; width: 100%; max-width: 720px; margin: 0 auto; padding: 96px 24px 104px; }
.ph-main .display { font-size: clamp(38px, 5vw, 58px); }
.ph-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.ph-note { margin-top: 28px; font-size: 15px; color: var(--muted); }

.ph-footer { padding: 24px; border-top: 1px solid var(--border); text-align: center; font-size: 14px; color: var(--muted); }
.ph-footer a { color: var(--text-2); }

@media (max-width: 480px) {
  .ph-main { padding-top: 56px; padding-bottom: 72px; }
}
