/* ─────────────────────────────────────────────────────────
   ATOMIC · Public Pages CSS
   Home landing page + Auth pages (login / register / forgot)
   All values reference tokens from tokens.css - no raw px or
   hardcoded colours.
   ───────────────────────────────────────────────────────── */

/* ── Reset for public pages ── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
h1,h2,h3,h4,p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { text-decoration: none; color: inherit; }

body {
  font-family: var(--ff);
  background: var(--canvas);
  color: var(--t1);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizelegibility;
}

/* Suppress transitions on theme swap */
.theme-switching, .theme-switching *, .theme-switching *::before, .theme-switching *::after {
  transition: none !important;
}

/* ── Public wrapper ── */
.pub-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ══════════════════════════════════════════════════════════
   NAV BAR
   ══════════════════════════════════════════════════════════ */
.pub-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 4rem;
  background: color-mix(in oklch, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 0.0625rem solid var(--line);
}

.pub-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--t1);
}

.pub-nav-brand .brand-mark {
  width: 2.125rem; height: 2.125rem;
  border-radius: 0.5625rem;
  background: var(--ac);
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 0.9375rem;
  color: var(--ac-ink);
  flex: 0 0 2.125rem;
}

.pub-nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pub-nav-link {
  padding: 0.4375rem 0.875rem;
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--t2);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.pub-nav-link:hover { background: var(--surface-2); color: var(--t1); }

.pub-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ══════════════════════════════════════════════════════════
   HOME - HERO
   Asymmetric split: copy left, orbit mark right. No centered
   gradient-blob-and-pill-badge template.
   ══════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  padding: 5.5rem 2rem 4.5rem;
  max-width: 75rem;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 3rem;
}

.hero-copy { position: relative; }

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--mono);
  font-size: 0.78125rem;
  font-weight: 500;
  color: var(--t3);
  margin-bottom: 1.25rem;
}
.hero-eyebrow .path { color: var(--ac-hi); }

.hero-title {
  font-size: clamp(2.25rem, 4.4vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: var(--t1);
  max-width: 30rem;
  margin-bottom: 1.25rem;
}

.hero-title .accent {
  color: var(--ac);
  position: relative;
}

.hero-subtitle {
  font-size: 1.0625rem;
  color: var(--t2);
  line-height: 1.65;
  max-width: 30rem;
  margin-bottom: 2.25rem;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

/* Extend core .btn for public hero */
.btn-hero {
  padding: 0.875rem 1.75rem;
  font-size: 0.9375rem;
  border-radius: var(--r-fld);
}

/* Stats bar - left aligned, mono values, reads like a spec sheet */
.hero-stats {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
}

.hero-stat .sv {
  font-family: var(--mono);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--t1);
}

.hero-stat .sl {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-stat-div {
  width: 0.0625rem;
  height: 2rem;
  background: var(--line-2);
}

/* ── Orbit mark - literal atom, the signature element ── */
.hero-orbit {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.hero-orbit svg { width: 100%; height: 100%; max-width: 24rem; overflow: visible; }

.hero-orbit .nucleus {
  fill: var(--ac);
  filter: drop-shadow(0 0 0.75rem color-mix(in oklch, var(--ac) 55%, transparent));
}

.hero-orbit .ring {
  fill: none;
  stroke: var(--line-2);
  stroke-width: 0.5;
}

.hero-orbit .e1, .hero-orbit .e2, .hero-orbit .e3 {
  fill: var(--ac-hi);
}

.hero-orbit .orbit-a { transform-origin: 50% 50%; animation: spin-orbit 14s linear infinite; }
.hero-orbit .orbit-b { transform-origin: 50% 50%; animation: spin-orbit 10s linear infinite reverse; }
.hero-orbit .orbit-c { transform-origin: 50% 50%; animation: spin-orbit 18s linear infinite; }

@keyframes spin-orbit {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-orbit .orbit-a, .hero-orbit .orbit-b, .hero-orbit .orbit-c { animation: none; }
}

/* ══════════════════════════════════════════════════════════
   HOME - SECTIONS
   ══════════════════════════════════════════════════════════ */
.pub-section {
  padding: 5rem 2rem;
  max-width: 75rem;
  margin: 0 auto;
  width: 100%;
}

.pub-section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.71875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ac-hi);
  margin-bottom: 0.75rem;
}

.pub-section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--t1);
  margin-bottom: 0.75rem;
}

.pub-section-desc {
  font-size: 1rem;
  color: var(--t2);
  line-height: 1.65;
  max-width: 36rem;
  margin: 0 auto;
}

/* ── Feature grid - mono index tag, no icon-in-rounded-square ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1rem;
}

.feature-card {
  position: relative;
  background: var(--surface);
  background-image: var(--panel-sheen);
  border: 0.0625rem solid var(--line);
  border-radius: var(--r-card);
  padding: 1.5rem 1.625rem;
  box-shadow: var(--shadow-sm), var(--ring-top);
  transition: border-color var(--dur-med), box-shadow var(--dur-med);
}

.feature-card:hover {
  box-shadow: var(--shadow-md), var(--ring-top);
  border-color: var(--ac-dim);
}

.feature-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.71875rem;
  font-weight: 500;
  color: var(--ac-hi);
  margin-bottom: 0.875rem;
}

.feature-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: -0.015em;
  margin-bottom: 0.375rem;
}

.feature-desc {
  font-size: 0.84375rem;
  color: var(--t2);
  line-height: 1.6;
}

/* ── Tech stack - rendered as a real code window, not a badge cloud ── */
.tech-window {
  max-width: 40rem;
  margin: 0 auto;
  background: var(--inset);
  border: 0.0625rem solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.tech-window-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border-bottom: 0.0625rem solid var(--line);
}

.tech-window-dot {
  width: 0.625rem; height: 0.625rem;
  border-radius: 50%;
  background: var(--line-2);
}

.tech-window-label {
  margin-left: 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--t3);
}

.tech-window-body {
  padding: 1.25rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.9;
}

.tech-line { white-space: pre; color: var(--t2); }
.tech-line .kw   { color: var(--ac-hi); }
.tech-line .str  { color: var(--t1); }
.tech-line .cm   { color: var(--t3); }

/* ── Divider line ── */
.pub-divider {
  height: 0.0625rem;
  background: var(--line);
  margin: 0 2rem;
}

/* ── CTA section ── */
.cta-section {
  padding: 5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 70% at 50% 50%, color-mix(in oklch, var(--ac) 6%, transparent) 0%, transparent 70%);
  pointer-events: none;
}

.cta-box {
  position: relative;
  max-width: 40rem;
  margin: 0 auto;
}

.cta-title {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--t1);
  margin-bottom: 1rem;
}

.cta-desc {
  font-size: 1rem;
  color: var(--t2);
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* ── Footer ── */
.pub-footer {
  border-top: 0.0625rem solid var(--line);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.pub-footer-copy {
  font-size: 0.8125rem;
  color: var(--t3);
}

.pub-footer-links {
  display: flex;
  gap: 1.25rem;
}

.pub-footer-links a {
  font-size: 0.8125rem;
  color: var(--t3);
  transition: color var(--dur-fast);
}

.pub-footer-links a:hover { color: var(--t1); }

/* ══════════════════════════════════════════════════════════
   AUTH PAGES - SPLIT LAYOUT
   ══════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}

/* ── Centered card layout (sign in / sign up) - mirrors the dashboard panel ── */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.25rem;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 25rem;
  background: var(--surface);
  background-image: var(--panel-sheen);
  border: 0.0625rem solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-md), var(--ring-top);
  padding: 2rem;
}

.auth-card-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1.75rem;
}

.auth-card-brand .brand-mark {
  width: 2rem; height: 2rem;
  flex: 0 0 2rem;
  border-radius: 0.5rem;
  background: var(--ac);
  color: var(--ac-ink);
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 0.875rem;
}

.auth-card-brand .brand-name {
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
  color: var(--t1);
}

.auth-card .auth-form-top { margin-bottom: 1.5rem; }
.auth-card .auth-title { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.03em; }
.auth-card .auth-foot { margin-top: 1.25rem; }

@media (max-width: 30rem) {
  .auth-shell { padding: 1.5rem 1rem; }
  .auth-card { padding: 1.5rem 1.25rem; border-radius: var(--r-md); }
}

/* ── Left panel (brand art) ── */
.auth-panel {
  flex: 0 0 44%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem;
  background: var(--inset);
  border-right: 0.0625rem solid var(--line);
}

/* Layered gradient backdrop on the left panel */
.auth-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 60% at 20% 10%, color-mix(in oklch, var(--ac) 12%, transparent) 0%, transparent 60%),
    radial-gradient(50% 40% at 90% 90%, color-mix(in oklch, oklch(0.55 0.16 240) 8%, transparent) 0%, transparent 55%);
  pointer-events: none;
}

.auth-panel-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.auth-panel-brand .brand-mark {
  width: 2.125rem; height: 2.125rem;
  border-radius: 0.5625rem;
  background: var(--ac);
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 0.9375rem;
  color: var(--ac-ink);
  flex: 0 0 2.125rem;
}

.auth-panel-brand-name {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--t1);
}

.auth-panel-hero {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 0;
}

.auth-panel-title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--t1);
  margin-bottom: 0.875rem;
}

.auth-panel-subtitle {
  font-size: 0.9375rem;
  color: var(--t2);
  line-height: 1.65;
  max-width: 22rem;
}

/* Boot-log panel - reads like a session initializing, not a feature checklist */
.auth-log {
  position: relative;
  margin-top: 2.5rem;
  padding: 1.125rem 1.25rem;
  background: color-mix(in oklch, var(--bg) 60%, transparent);
  border: 0.0625rem solid var(--line);
  border-radius: var(--r-pan);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.95;
  max-width: 24rem;
}

.auth-log-line { color: var(--t3); }
.auth-log-line .ok  { color: var(--ac-hi); }
.auth-log-line .val { color: var(--t1); }
.auth-log-caret {
  display: inline-block;
  width: 0.5rem; height: 1em;
  background: var(--ac-hi);
  margin-left: 0.125rem;
  vertical-align: -0.15em;
  animation: caret-blink 1.1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .auth-log-caret { animation: none; } }

/* Bottom tagline */
.auth-panel-footer {
  position: relative;
  font-size: 0.78125rem;
  color: var(--t3);
  line-height: 1.5;
}

/* ── Right panel (form) ── */
.auth-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  overflow-y: auto;
}

.auth-form-box {
  width: 100%;
  max-width: 26rem;
}

.auth-form-top {
  margin-bottom: 2rem;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--t1);
  margin-bottom: 0.375rem;
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--t2);
}

/* Social login buttons */
.auth-social {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.6875rem 1rem;
  border: 0.0625rem solid var(--line);
  border-radius: var(--r-fld);
  background: var(--surface);
  color: var(--t1);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.btn-social:hover {
  background: var(--surface-2);
  border-color: var(--line-2);
  box-shadow: var(--shadow-sm);
}

.btn-social svg {
  width: 1.125rem; height: 1.125rem;
  flex: 0 0 1.125rem;
}

/* Auth divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 0.0625rem;
  background: var(--line);
}

.auth-divider span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--t3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Auth form fields */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.auth-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--t1);
}

/* Auth inputs - use the .input token-based class from components */
.auth-input {
  width: 100%;
  background: var(--inset);
  border: 0.0625rem solid var(--line);
  border-radius: var(--r-fld);
  padding: 0.75rem 0.875rem;
  font-size: 0.875rem;
  color: var(--t1);
  box-shadow: var(--well-inset);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  outline: none;
  font-family: inherit;
}

.auth-input::placeholder { color: var(--t3); }
.auth-input:focus {
  border-color: var(--ac-dim);
  box-shadow: var(--well-inset), 0 0 0 0.1875rem var(--ac-softer);
}
.auth-input.err {
  border-color: var(--danger);
  box-shadow: 0 0 0 0.1875rem var(--danger-soft);
}

/* Password field wrapper (for show/hide toggle) */
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrap .auth-input {
  padding-right: 2.75rem;
}

.auth-input-eye {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--t3);
  cursor: pointer;
  display: grid; place-items: center;
  padding: 0;
  transition: color var(--dur-fast);
}
.auth-input-eye:hover { color: var(--t1); }
.auth-input-eye svg { width: 1rem; height: 1rem; }

/* Password hint list */
.pwd-hints {
  margin-top: 0.375rem;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.1875rem;
}

.pwd-hint {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--t3);
}

.pwd-hint svg {
  width: 0.75rem; height: 0.75rem;
  flex: 0 0 0.75rem;
}

.pwd-hint.ok { color: var(--ac-hi); }

/* Row: remember me + forgot password */
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Checkbox label */
.auth-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--t2);
  cursor: pointer;
  user-select: none;
}

.auth-check input[type="checkbox"] {
  width: 1rem; height: 1rem;
  accent-color: var(--ac);
  cursor: pointer;
}

.auth-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ac-hi);
  transition: color var(--dur-fast);
}
.auth-link:hover { color: var(--ac); }

/* Submit button */
.btn-auth {
  width: 100%;
  padding: 0.875rem;
  font-size: 0.9375rem;
  margin-top: 0.25rem;
}

/* Footer nav (sign in / sign up toggle) */
.auth-foot {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--t2);
}

/* Error / success alert bar */
.auth-alert {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
  border-radius: var(--r-md);
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 1rem;
}
.auth-alert svg { width: 1rem; height: 1rem; flex: 0 0 1rem; }
.auth-alert.err  { background: var(--danger-soft); color: var(--danger); border: 0.0625rem solid color-mix(in oklch, var(--danger) 25%, transparent); }
.auth-alert.ok   { background: var(--ac-soft);     color: var(--ac-hi);  border: 0.0625rem solid var(--ac-soft); }

/* Terms checkbox section */
.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--t2);
  cursor: pointer;
  user-select: none;
  line-height: 1.5;
}

.auth-terms input[type="checkbox"] {
  width: 1rem; height: 1rem;
  accent-color: var(--ac);
  margin-top: 0.125rem;
  cursor: pointer;
  flex: 0 0 1rem;
}

/* ── Responsive ── */
@media (max-width: 52rem) {
  .auth-panel { display: none; }
  .auth-form-side { padding: 2rem 1.25rem; }

  .pub-nav { padding: 0 1rem; }
  .pub-nav-links { display: none; }

  .hero { grid-template-columns: 1fr; padding: 4rem 1.25rem 3.5rem; gap: 2rem; text-align: left; }
  .hero-orbit { max-width: 16rem; margin: 0 auto; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.5rem; }

  .pub-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}
