/* my-x.ai shared design system — light + dark, MSP-grade.
   Theme: html[data-theme="dark"] / html[data-theme="light"], set by theme.js
   before first paint (system preference default, localStorage override). */

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

:root {
  --ink: #102a43;
  --ink-soft: #45607a;
  --bg: #fbfdff;
  --bg-alt: #f1f6fa;
  --card: #ffffff;
  --line: #dbe6ef;
  --blue: #0b6bcb;
  --blue-strong: #084a8f;
  --on-blue: #ffffff;
  --band: #084a8f;
  --band-ink: #ffffff;
  --band-soft: #cfe2f5;
  --teal: #0d8a8a;
  --teal-bg: #e7f4f4;
  --teal-line: #c4e4e4;
  --green: #157f3d;
  --green-bg: #e8f6ee;
  --amber: #92610a;
  --amber-bg: #fdf3df;
  --neutral-bg: #eef2f6;
  --shadow: 0 1px 3px rgba(16, 42, 67, 0.06);
  --radius: 10px;
}

html[data-theme="dark"] {
  --ink: #e8eef5;
  --ink-soft: #9fb3c8;
  --bg: #0e1726;
  --bg-alt: #121e31;
  --card: #172439;
  --line: #26364e;
  --blue: #58a6ff;
  --blue-strong: #7cb8ff;
  --on-blue: #0b1524;
  --band: #0c2f55;
  --band-ink: #e8eef5;
  --band-soft: #9fc3e8;
  --teal: #46c6c6;
  --teal-bg: #102b33;
  --teal-line: #1d4a52;
  --green: #4ade80;
  --green-bg: #10301f;
  --amber: #fbbf24;
  --amber-bg: #33270c;
  --neutral-bg: #1c2a40;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ── Header ── */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { font-size: 1.25rem; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; white-space: nowrap; }
.brand span { color: var(--blue); }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--ink-soft); font-size: 0.95rem; font-weight: 500; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a.active { color: var(--blue); font-weight: 600; }

.btn {
  display: inline-block; padding: 10px 20px; border-radius: 8px;
  font-weight: 600; font-size: 0.95rem; border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--blue); color: var(--on-blue); }
.btn-primary:hover { background: var(--blue-strong); color: var(--on-blue); text-decoration: none; }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }

.theme-toggle {
  background: transparent; border: 1px solid var(--line); color: var(--ink-soft);
  border-radius: 8px; width: 38px; height: 38px; cursor: pointer;
  font-size: 1.05rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { border-color: var(--blue); color: var(--blue); }
html[data-theme="dark"] .theme-toggle .sun { display: inline; }
html[data-theme="dark"] .theme-toggle .moon { display: none; }
html[data-theme="light"] .theme-toggle .sun { display: none; }
html[data-theme="light"] .theme-toggle .moon { display: inline; }

/* ── Hero / page head ── */
.hero { padding: 84px 0 68px; }
.page-head { padding: 72px 0 40px; }
.page-head h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); letter-spacing: -0.03em; line-height: 1.15; max-width: 760px; }
.page-head p.lead { margin-top: 16px; font-size: 1.15rem; color: var(--ink-soft); max-width: 680px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--teal);
  background: var(--teal-bg); border: 1px solid var(--teal-line);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.3rem);
  line-height: 1.12; letter-spacing: -0.03em; font-weight: 800; max-width: 800px;
}
.hero h1 em { font-style: normal; color: var(--blue); }
.hero p.lead { margin: 22px 0 34px; font-size: 1.2rem; color: var(--ink-soft); max-width: 680px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-note { margin-top: 18px; font-size: 0.9rem; color: var(--ink-soft); }
.hero-note strong { color: var(--green); }

/* ── Sections ── */
section { padding: 68px 0; }
section.alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head h2 { font-size: 1.9rem; letter-spacing: -0.02em; line-height: 1.2; }
.section-head p { margin-top: 12px; color: var(--ink-soft); font-size: 1.05rem; }
.section-link { margin-top: 28px; font-weight: 600; }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.card p { color: var(--ink-soft); font-size: 0.97rem; }
.card .k {
  display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--blue); margin-bottom: 12px;
}
.card ul { margin: 12px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: 0.95rem; }
.card li { margin-bottom: 7px; }

/* ── Steps ── */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; counter-reset: step; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.step::before {
  counter-increment: step; content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue); color: var(--on-blue); font-weight: 700; margin-bottom: 14px;
}
.step h3 { font-size: 1.05rem; margin-bottom: 6px; }
.step p { color: var(--ink-soft); font-size: 0.95rem; }

/* ── Flow rail (numbered narrative, deep pages) ── */
.rail { position: relative; padding-left: 40px; max-width: 760px; }
.rail::before {
  content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px;
  width: 2px; background: var(--line);
}
.rail-item { position: relative; padding-bottom: 40px; }
.rail-item:last-child { padding-bottom: 0; }
.rail-item::before {
  content: ""; position: absolute; left: -31px; top: 8px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--blue); border: 3px solid var(--bg);
}
.rail-item h3 { font-size: 1.2rem; margin-bottom: 8px; }
.rail-item p { color: var(--ink-soft); }
.rail-item .tag {
  display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--teal); margin-bottom: 6px;
}

/* ── Tiers ── */
.tier { display: flex; flex-direction: column; }
.tier .who { font-size: 0.85rem; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
.tier h3 { font-size: 1.25rem; margin-bottom: 10px; }
.tier .domain { margin-top: auto; padding-top: 18px; font-size: 0.85rem; color: var(--ink-soft); }
.tier .domain code, code.chip { background: var(--neutral-bg); padding: 2px 8px; border-radius: 6px; color: var(--blue-strong); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; }

/* ── Badges + trust table ── */
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
.badge.done { background: var(--green-bg); color: var(--green); }
.badge.progress { background: var(--amber-bg); color: var(--amber); }
.badge.planned { background: var(--neutral-bg); color: var(--ink-soft); }

.trust-wrap { overflow-x: auto; border-radius: var(--radius); }
.trust-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.trust-table th, .trust-table td { text-align: left; padding: 16px 20px; border-bottom: 1px solid var(--line); font-size: 0.97rem; vertical-align: top; }
.trust-table th { background: var(--bg-alt); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.trust-table tr:last-child td { border-bottom: none; }
.trust-table td.desc { color: var(--ink-soft); }

.sdvosb {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--green);
  border-radius: var(--radius); padding: 20px 24px; margin-bottom: 28px; box-shadow: var(--shadow);
}
.sdvosb .seal {
  width: 46px; height: 46px; border-radius: 50%; background: var(--green-bg); color: var(--green);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.sdvosb h3 { font-size: 1.05rem; }
.sdvosb p { color: var(--ink-soft); font-size: 0.92rem; }

/* ── Ecosystem mesh ── */
.mesh { display: flex; flex-wrap: wrap; gap: 10px; }
.mesh span {
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 16px; font-size: 0.9rem; color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.mesh span.hub { border-color: var(--blue); color: var(--blue-strong); font-weight: 600; }

/* ── CTA band ── */
.cta-band { background: var(--band); color: var(--band-ink); }
.cta-band h2 { font-size: 1.8rem; letter-spacing: -0.02em; }
.cta-band p { color: var(--band-soft); margin: 12px 0 26px; max-width: 640px; }
.cta-band .btn-primary { background: #fff; color: #084a8f; }
.cta-band .btn-primary:hover { background: #e8f1fa; color: #084a8f; }

/* ── Footer ── */
footer.site { padding: 36px 0; border-top: 1px solid var(--line); }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--ink-soft); font-size: 0.9rem; }
.foot nav { display: flex; gap: 18px; }
.foot a { color: var(--ink-soft); }

@media (max-width: 680px) {
  .nav-links a:not(.btn):not(.theme-toggle) { display: none; }
  section { padding: 50px 0; }
  .hero { padding: 56px 0 44px; }
}
