/* ============================================================
   ChargeStack — shared design system
   ------------------------------------------------------------
   One stylesheet for every public page. Built on the existing
   brand colors (blue + gold from the logo, purple from ArcOrb).
   ============================================================ */

/* -------- Design tokens ------------------------------------- */
:root {
  /* Brand */
  --brand-blue: #38b6ff;
  --brand-blue-deep: #1d8fd6;
  --brand-gold: #d4973b;
  --brand-gold-soft: #e6b15a;
  --arc-purple: #7040d8;
  --arc-purple-light: #c89aff;
  --arc-purple-deep: #2a0870;

  /* Surfaces */
  --ink: #0b1020;
  --ink-2: #0e1426;
  --surface-1: #121a2e;
  --surface-2: #1a2440;
  --surface-3: #232f50;
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.14);

  /* Text */
  --white: #f6f8fd;
  --ink-soft: #c8d2e3;
  --ink-dim: #8290ab;
  --ink-faint: #6a7691;

  /* Status */
  --danger-bg: #2a0f12;
  --danger-fg: #ff8b8b;
  --success: #22c55e;
  --warning: #ffc107;

  /* Type scale */
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Spacing scale (4-based) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;

  /* Shadows */
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-cta: 0 8px 24px rgba(56, 182, 255, 0.22);
  --shadow-cta-gold: 0 8px 24px rgba(212, 151, 59, 0.22);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Content width */
  --w-content: 1120px;
  --w-prose: 720px;
}

/* -------- Reset --------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

body {
  font-family: var(--font-sans);
  background: var(--ink);
  color: var(--ink-soft);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Faint ambient background — subtle gradient + grain feel */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 80% -10%, rgba(112, 64, 216, 0.10), transparent 60%),
    radial-gradient(50% 40% at 0% 0%, rgba(56, 182, 255, 0.08), transparent 60%),
    radial-gradient(40% 30% at 100% 100%, rgba(212, 151, 59, 0.05), transparent 60%);
  pointer-events: none;
}

/* -------- Typography ---------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--white);
  font-weight: 500;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  letter-spacing: -0.015em;
  line-height: 1.08;
  margin: 0;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.25rem); font-weight: 500; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.35rem; line-height: 1.25; }
h4 { font-size: 1.05rem; line-height: 1.3; }

p { margin: 0 0 var(--s-4); }
p:last-child { margin-bottom: 0; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-blue);
}

.lede {
  font-size: 1.18rem;
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 60ch;
}

.muted { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }

a.inline {
  color: var(--brand-blue);
  text-underline-offset: 3px;
}
a.inline:hover { text-decoration: underline; }

code {
  font-family: var(--font-mono);
  background: var(--surface-2);
  color: var(--ink-soft);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.92em;
}

/* -------- Layout helpers ------------------------------------ */
.wrap {
  width: 100%;
  max-width: var(--w-content);
  margin: 0 auto;
  padding-left: var(--s-5);
  padding-right: var(--s-5);
}

.prose {
  width: 100%;
  max-width: var(--w-prose);
  margin: 0 auto;
  padding-left: var(--s-5);
  padding-right: var(--s-5);
}

.section {
  padding-top: var(--s-9);
  padding-bottom: var(--s-9);
}
.section--tight { padding-top: var(--s-7); padding-bottom: var(--s-7); }

@media (max-width: 720px) {
  .section { padding-top: var(--s-7); padding-bottom: var(--s-7); }
}

.divider {
  border: 0;
  height: 1px;
  background: var(--hairline);
  margin: 0;
}

/* -------- Nav ----------------------------------------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 16, 32, 0.72);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--hairline);
}

.site-nav__inner {
  max-width: var(--w-content);
  margin: 0 auto;
  padding: var(--s-3) var(--s-5);
  display: flex;
  align-items: center;
  gap: var(--s-5);
}

.site-nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.site-nav__brand .mark {
  height: 42px;
  width: auto;
  flex: none;
}
.site-nav__brand .wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.site-nav__brand .wordmark__name {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--white);
}
.site-nav__brand .wordmark__sub {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.66rem;
  letter-spacing: 0.20em;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 5px;
  text-transform: uppercase;
}

/* Footer brand uses the same primitives, bigger */
.site-footer__brand .brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-footer__brand .mark { height: 44px; width: auto; flex: none; }
.site-footer__brand .wordmark { display: flex; flex-direction: column; line-height: 1; }
.site-footer__brand .wordmark__name {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: var(--white);
}
.site-footer__brand .wordmark__sub {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 5px;
  text-transform: uppercase;
}

.site-nav__links {
  display: flex;
  gap: var(--s-5);
  margin-left: auto;
  align-items: center;
}

.site-nav__link {
  font-size: 0.92rem;
  color: var(--ink-soft);
  font-weight: 500;
  padding: var(--s-2) 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s var(--ease);
}
.site-nav__link:hover { color: var(--white); }

@media (max-width: 640px) {
  .site-nav__links .site-nav__link { display: none; }
  /* keep just the login CTA visible */
  .site-nav__links .site-nav__link.site-nav__link--cta { display: inline-flex; }
}

/* -------- Buttons ------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 14px 22px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.97rem;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease),
              box-shadow 0.15s var(--ease),
              background 0.15s var(--ease),
              border-color 0.15s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--brand-blue);
  color: #06121f;
  box-shadow: var(--shadow-cta);
}
.btn--primary:hover {
  background: #54c2ff;
  box-shadow: 0 10px 28px rgba(56, 182, 255, 0.35);
}

.btn--gold {
  background: var(--brand-gold);
  color: #1f1404;
  box-shadow: var(--shadow-cta-gold);
}
.btn--gold:hover {
  background: var(--brand-gold-soft);
}

.btn--ghost {
  background: transparent;
  color: var(--white);
  border-color: var(--hairline-strong);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn--link {
  background: transparent;
  color: var(--brand-blue);
  padding: 6px 0;
  border-radius: 0;
}
.btn--link:hover { color: #6ec5ff; }

.btn--sm { padding: 9px 14px; font-size: 0.88rem; }
.btn--lg { padding: 16px 26px; font-size: 1.02rem; }

.btn--block { width: 100%; }

/* -------- Cards --------------------------------------------- */
.card {
  background: linear-gradient(180deg, var(--surface-1), var(--ink-2));
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  box-shadow: var(--shadow-card);
}

.card--hover {
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.card--hover:hover {
  transform: translateY(-2px);
  border-color: var(--hairline-strong);
}

/* Small icon-glyph sized for value-prop cards */
.glyph {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  margin-bottom: var(--s-4);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--hairline);
}
.glyph--blue   { box-shadow: 0 0 0 1px rgba(56, 182, 255, 0.18) inset; }
.glyph--gold   { box-shadow: 0 0 0 1px rgba(212, 151, 59, 0.18) inset; }
.glyph--purple { box-shadow: 0 0 0 1px rgba(192, 154, 255, 0.20) inset; }

/* -------- Footer -------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  margin-top: var(--s-9);
  padding: var(--s-7) 0 var(--s-6);
  color: var(--ink-dim);
  font-size: 0.92rem;
}

.site-footer__inner {
  max-width: var(--w-content);
  margin: 0 auto;
  padding: 0 var(--s-5);
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--s-7);
}

.site-footer__brand .tagline {
  margin-top: var(--s-3);
  max-width: 36ch;
  color: var(--ink-dim);
  font-size: 0.92rem;
  line-height: 1.5;
}

.site-footer h5 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 var(--s-3);
}

.site-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer__col li {
  margin: 0 0 var(--s-2);
}
.site-footer__col a {
  color: var(--ink-dim);
  font-size: 0.92rem;
}
.site-footer__col a:hover { color: var(--white); }

.site-footer__legal {
  max-width: var(--w-content);
  margin: var(--s-7) auto 0;
  padding: var(--s-5) var(--s-5) 0;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3) var(--s-5);
  justify-content: space-between;
  align-items: flex-start;
  font-size: 0.82rem;
  color: var(--ink-faint);
}
.site-footer__legal p { margin: 0; max-width: 78ch; }

@media (max-width: 820px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .site-footer__inner { grid-template-columns: 1fr; gap: var(--s-5); }
}

/* -------- Modal (used by auth) ------------------------------ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(4, 7, 16, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  background: linear-gradient(180deg, var(--surface-1), var(--ink-2));
  color: var(--white);
  margin: 6vh auto;
  padding: var(--s-6);
  border-radius: var(--r-lg);
  border: 1px solid var(--hairline-strong);
  width: calc(100% - 32px);
  max-width: 440px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.close {
  position: absolute;
  right: var(--s-4);
  top: var(--s-3);
  color: var(--ink-dim);
  font-size: 26px;
  font-weight: 400;
  cursor: pointer;
  background: transparent;
  border: 0;
  line-height: 1;
}
.close:hover { color: var(--white); }

.auth-form h2 {
  text-align: center;
  margin: 0 0 var(--s-5);
  color: var(--white);
  font-size: 1.6rem;
}

.form-group { margin-bottom: var(--s-4); }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.form-group input:not([type="checkbox"]) {
  width: 100%;
  padding: 12px 14px;
  background: var(--ink);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  color: var(--white);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.form-group input:focus {
  outline: none;
  border-color: var(--brand-blue);
  background: var(--ink-2);
}

.form-group.checkbox-row input[type="checkbox"],
.form-group input[type="checkbox"] {
  width: auto;
  margin: 0;
  vertical-align: middle;
  accent-color: var(--brand-blue);
}
.form-group.checkbox-row label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0;
  cursor: pointer;
}
.form-group.checkbox-row a {
  color: var(--brand-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-btn {
  width: 100%;
  padding: 14px;
  background: var(--brand-blue);
  color: #06121f;
  border: 0;
  border-radius: var(--r-md);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s var(--ease), box-shadow 0.15s var(--ease);
  margin-bottom: var(--s-3);
}
.auth-btn:hover {
  background: #54c2ff;
  box-shadow: var(--shadow-cta);
}

.switch-auth {
  text-align: center;
  color: var(--ink-dim);
  font-size: 0.92rem;
}
.switch-auth a {
  color: var(--brand-blue);
  font-weight: 600;
  text-decoration: none;
}
.switch-auth a:hover { text-decoration: underline; }

.tiny-link {
  color: var(--brand-blue);
  font-size: 0.88rem;
  text-decoration: none;
}
.tiny-link:hover { text-decoration: underline; }

.error-message {
  background: var(--danger-bg);
  color: var(--danger-fg);
  border: 1px solid rgba(255, 139, 139, 0.25);
  padding: 10px 14px;
  border-radius: var(--r-sm);
  margin-bottom: var(--s-4);
  font-size: 0.9rem;
}

.auth-info {
  background: rgba(56, 182, 255, 0.08);
  color: var(--ink-soft);
  border: 1px solid rgba(56, 182, 255, 0.22);
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
}

/* -------- Prose / long-form pages --------------------------- */
.page-header {
  padding-top: var(--s-8);
  padding-bottom: var(--s-5);
}
.page-header h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: var(--s-3);
}
.page-header .lede {
  color: var(--ink-soft);
}
.page-header .effective-date {
  color: var(--ink-faint);
  font-size: 0.88rem;
  margin-top: var(--s-2);
}

.prose-body h2 {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  color: var(--white);
  margin: var(--s-7) 0 var(--s-3);
  letter-spacing: -0.01em;
}
.prose-body h3 {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-blue);
  margin: var(--s-5) 0 var(--s-2);
}
.prose-body p { color: var(--ink-soft); }
.prose-body ul, .prose-body ol {
  padding-left: 22px;
  margin: 0 0 var(--s-4);
}
.prose-body li {
  margin-bottom: var(--s-2);
  color: var(--ink-soft);
}
.prose-body a {
  color: var(--brand-blue);
  text-underline-offset: 3px;
}
.prose-body a:hover { text-decoration: underline; }
.prose-body strong { color: var(--white); }
.prose-body blockquote {
  margin: var(--s-5) 0;
  padding: var(--s-4) var(--s-5);
  background: var(--surface-1);
  border-left: 3px solid var(--brand-blue);
  border-radius: var(--r-sm);
  color: var(--ink-soft);
}

.callout-warning {
  background: rgba(255, 193, 7, 0.06);
  border-left: 4px solid var(--warning);
  padding: var(--s-4) var(--s-5);
  margin: var(--s-5) 0;
  border-radius: var(--r-sm);
}
.callout-warning p { color: var(--white); margin: 0; }

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--s-7);
  color: var(--ink-dim);
  font-size: 0.92rem;
}
.page-back:hover { color: var(--white); }

/* -------- Utility ------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
