:root {
  color-scheme: dark;
  --bg: #14160f;
  --bg-2: #1c1f16;
  --bg-3: #262a1d;
  --ink: #f4f0e4;
  --muted: #b4ad9a;
  --line: #343828;
  --brass: #e2a23a;
  --brass-ink: #1a1408;
  --good: #8fce7a;
  --pool: #8eb6ff;
  --bad: #e07a5f;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --sans: "Segoe UI", "Helvetica Neue", Helvetica, sans-serif;
  --serif: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4efe4;
  --bg-2: #fffaf1;
  --bg-3: #efe6d4;
  --ink: #1c1914;
  --muted: #5e584c;
  --line: #ddd2bc;
  --brass: #9a5b12;
  --brass-ink: #fffaf1;
  --good: #2f7d32;
  --pool: #1d4e89;
  --bad: #9d3b2c;
  --shadow: 0 16px 40px rgba(80, 50, 10, 0.08);
}

body.site,
body.access {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  background:
    radial-gradient(1200px 520px at 8% -12%, rgba(226, 162, 58, 0.16), transparent 55%),
    var(--bg);
  color: var(--ink);
}

body.site *,
body.access * { box-sizing: border-box; }

body.site a,
body.access a { color: inherit; }

body.site :focus-visible,
body.access :focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 0.8rem;
  top: -4rem;
  background: var(--brass);
  color: var(--brass-ink);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  z-index: 5;
}
.skip:focus { top: 0.8rem; }

.shell { max-width: 1120px; margin: 0 auto; padding: 1.2rem 1.2rem 4rem; }

.nav, .hero-actions, .cta-row, .topbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.brand strong { font-family: var(--serif); font-size: 1.7rem; font-weight: 560; letter-spacing: -0.03em; }
.nav-links, .hero-actions, .cta-row { display: flex; gap: 0.55rem; flex-wrap: wrap; }
.nav-links a { text-decoration: none; }

.btn, body.access button.tab, body.access button.submit, body.access .back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary, body.access button.submit {
  background: var(--brass);
  color: var(--brass-ink);
  border-color: transparent;
  font-weight: 650;
}
.btn.ghost { background: transparent; }

.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr); gap: 1.5rem; align-items: center; padding: 1.4rem 0 0.4rem; }
.hero > *, .grid > *, .install > *, .card, pre { min-width: 0; max-width: 100%; }
body.site p, body.site a, body.site code { overflow-wrap: anywhere; }
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; margin: 0 0 0.55rem; }
h1, h2, h3 { font-family: var(--serif); font-weight: 560; letter-spacing: -0.03em; margin: 0; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.6rem); line-height: 0.96; max-width: 11ch; }
.lede, .section p, .card p, .faq p, .step p { color: var(--muted); line-height: 1.55; }
.lede { font-size: 1.08rem; max-width: 38rem; margin: 0.9rem 0 1.1rem; }
.points { display: grid; gap: 0.7rem; margin: 1.1rem 0 0; padding: 0; list-style: none; }
.points li { padding-top: 0.7rem; border-top: 1px solid var(--line); }
.points strong { display: block; margin-bottom: 0.15rem; }

.panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.1rem;
}
.panel h2 { font-size: 1.7rem; margin-bottom: 0.4rem; }
.fact { display: grid; gap: 0.65rem; margin-top: 0.9rem; }
.fact div { padding: 0.75rem 0.8rem; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.fact b { display: block; font-size: 0.95rem; }
.fact span { color: var(--muted); font-size: 0.92rem; line-height: 1.45; }

.section { margin-top: 3.4rem; }
.section h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); margin: 0.3rem 0 0.8rem; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 1rem 1.05rem 1.1rem; }
.card h3 { font-size: 1.35rem; margin: 0.2rem 0 0.4rem; }
.steps { display: grid; gap: 0.7rem; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.step { display: grid; grid-template-columns: auto 1fr; gap: 0.8rem; align-items: start; background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 0.9rem 1rem; }
.step::before { counter-increment: step; content: counter(step); font-family: var(--serif); font-size: 1.4rem; color: var(--brass); }
.install { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
pre {
  margin: 0.7rem 0 0;
  padding: 0.8rem;
  overflow: auto;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.5;
}
.faq { display: grid; gap: 0.55rem; }
details { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 0.85rem 1rem; }
summary { cursor: pointer; font-weight: 650; }
details p { margin: 0.55rem 0 0; }
.cta {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 1.1rem;
}
.footer { margin-top: 1.4rem; color: var(--muted); font-size: 0.88rem; }
.footer a { color: var(--ink); }

body.access { min-height: 100vh; display: grid; place-items: center; padding: 4.5rem 1rem 2rem; }
body.access .topbar { position: fixed; top: 1rem; left: 1rem; right: 1rem; display: flex; justify-content: space-between; gap: 0.6rem; }
body.access .card { width: min(460px, 100%); padding: 1.5rem; }
body.access h1 { font-size: 2.3rem; }
body.access .tabs { display: flex; gap: 0.45rem; margin: 1rem 0; }
body.access .tab { flex: 1; }
body.access .tab.active { border-color: var(--brass); color: var(--brass); }
body.access .panel-form { display: none; }
body.access .panel-form.active { display: block; }
body.access input {
  width: 100%;
  margin: 0 0 0.7rem;
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}
body.access button.submit { width: 100%; }
body.access .error { min-height: 1.2rem; margin-top: 0.55rem; color: var(--bad); }
body.access label.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 860px) {
  .hero, .grid, .install { grid-template-columns: 1fr; }
  .hero h1 { max-width: 14ch; }
}
@media (max-width: 640px) {
  .shell { padding: 1rem 0.9rem 3rem; }
  .nav, .cta { align-items: stretch; }
  .nav-links, .hero-actions, .cta-row { width: 100%; }
  .hero-actions .btn, .cta-row .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: no-preference) {
  body.site .rise { animation: rise 480ms ease both; }
  body.site .rise:nth-child(2) { animation-delay: 60ms; }
  body.site .card, body.site .step, body.site details { transition: transform 160ms ease, border-color 160ms ease; }
  body.site .card:hover, body.site .step:hover { transform: translateY(-2px); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Polish layer v2: same palette; tactile buttons, card glow, scroll reveal (CSS only, no JS). */
body.site { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.btn { transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease, box-shadow 220ms ease, filter 120ms ease; }
.btn:hover { filter: brightness(1.06); }
.btn.primary:hover { box-shadow: 0 8px 22px rgba(226, 162, 58, 0.25); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
body.site .card, body.site .step { position: relative; }
@media (prefers-reduced-motion: no-preference) {
  body.site .card:hover, body.site .step:hover {
    border-color: rgba(226, 162, 58, 0.55);
    box-shadow: 0 0 0 1px rgba(226, 162, 58, 0.25), 0 18px 40px rgba(0, 0, 0, 0.25);
  }
  @supports (animation-timeline: view()) {
    body.site .section .card, body.site .section .step, body.site .faq details {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}

/* Account home (axeai.site after login) */
.home-tabs { display: flex; gap: 0.45rem; flex-wrap: wrap; margin: 0.6rem 0 0.9rem; }
.home-tabs .btn[aria-selected="true"] { border-color: var(--brass); color: var(--brass); }
.steps { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.55rem; line-height: 1.55; }
.steps code { font-size: 0.86em; }
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; margin-bottom: 0.8rem; }
.legacy-link { font-size: 0.82rem; color: var(--muted); }
@media (max-width: 760px) { .home-grid { grid-template-columns: 1fr; } }
