@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap');

:root {
  --bg: #000000;
  --bg-2: #050505;
  --surface: #0A0A0A;
  --surface-2: #111114;
  --surface-3: #17171B;
  --surface-4: #1F1F23;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-bright: rgba(255, 255, 255, 0.28);
  --text: #FAFAFA;
  --text-muted: #A1A1AA;
  --text-dim: #71717A;
  --text-faint: #52525B;
  --halo: rgba(255, 120, 130, 0.06);
  --halo-2: rgba(120, 140, 255, 0.04);
  --success: #4ADE80;
  --warning: #FACC15;
  --danger: #F87171;
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
  --font-serif: 'Instrument Serif', Georgia, serif;
}

* { box-sizing: border-box; }
*::selection { background: var(--text); color: var(--bg); }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01' on, 'cv11' on;
}

body {
  min-height: 100vh;
  position: relative;
  background-image:
    radial-gradient(1200px circle at 50% -200px, var(--halo) 0%, transparent 60%),
    radial-gradient(800px circle at 100% 200px, var(--halo-2) 0%, transparent 60%);
  background-attachment: fixed;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: center;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 1200px 800px at center 200px, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 1200px 800px at center 200px, #000 30%, transparent 80%);
}

main, header, footer { position: relative; z-index: 1; }

/* ===== Typography ===== */
.font-mono { font-family: var(--font-mono); }
.font-serif { font-family: var(--font-serif); }
.serif-italic { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 1px;
  background: var(--text-dim);
}

.display {
  letter-spacing: -0.035em;
  font-weight: 500;
  line-height: 1;
  color: var(--text);
}

h1, h2, h3, h4 { color: var(--text); letter-spacing: -0.02em; }

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

/* ===== Header / brand ===== */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
  font-size: 0.98rem;
  letter-spacing: -0.018em;
  color: var(--text);
  text-decoration: none;
  border: none;
}
.brand:hover { color: var(--text); text-decoration: none; }
.brand .brand-mark { color: var(--text); flex-shrink: 0; }

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.35rem;
  background: var(--surface);
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  border: none;
  padding: 0.4rem 0.6rem;
  transition: color 140ms ease;
  letter-spacing: -0.005em;
}
.nav-link:hover { color: var(--text); }

/* ===== Surfaces ===== */
.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  position: relative;
}
.surface-2 {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* Resend-style gradient-ring border (1px highlight on top edge) */
.surface-edge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  position: relative;
}
.surface-edge::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.02) 22%, transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

.surface-hover {
  transition: border-color 200ms ease, background 200ms ease, transform 200ms ease;
}
.surface-hover:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.62rem 1.1rem;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.88rem;
  letter-spacing: -0.008em;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.btn-primary:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.07);
}
.btn-primary:disabled {
  background: var(--surface-3);
  color: var(--text-dim);
  border-color: var(--border);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-accent { /* now monochrome — same as primary, kept for compat */
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 600;
}
.btn-accent:hover {
  background: #fff; color: #000; border-color: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.07);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--border-bright);
}

.btn-sm { padding: 0.45rem 0.78rem; font-size: 0.78rem; }

/* ===== Inputs ===== */
input.field, textarea.field, select.field {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.78rem 0.95rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 160ms, background 160ms, box-shadow 160ms;
}
input.field::placeholder { color: var(--text-dim); }
input.field:hover { border-color: var(--border-strong); }
input.field:focus,
textarea.field:focus,
select.field:focus {
  border-color: var(--border-bright);
  background: var(--surface-2);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

label.lbl {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  transition: all 160ms;
}
input[type="checkbox"]:checked {
  background: var(--text);
  border-color: var(--text);
}
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ===== Links ===== */
a {
  color: var(--text);
  text-decoration: none;
  transition: color 140ms;
}
a:hover { color: var(--text-muted); }

a.link {
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 1px;
}
a.link:hover { color: var(--text); border-bottom-color: var(--border-bright); }

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.6rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid;
  vertical-align: middle;
}
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.badge-ok    { color: var(--success); border-color: rgba(74,222,128,0.30); background: rgba(74,222,128,0.05); }
.badge-warn  { color: var(--warning); border-color: rgba(250,204,21,0.30); background: rgba(250,204,21,0.05); }
.badge-off   { color: var(--danger);  border-color: rgba(248,113,113,0.30); background: rgba(248,113,113,0.05); }

/* ===== Spinner ===== */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.18);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Dividers ===== */
.divider { border-top: 1px solid var(--border); margin: 1.5rem 0; }
.divider-mono {
  display: flex; align-items: center; gap: 0.85rem;
  margin: 1.75rem 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.divider-mono::before, .divider-mono::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ===== Tariff chips ===== */
.tariff-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 180ms, background 180ms;
  font-family: var(--font-sans);
  color: var(--text);
}
.tariff-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.tariff-card.selected {
  border-color: var(--text);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--text);
}

/* ===== Flash messages ===== */
.flash {
  padding: 0.7rem 0.95rem;
  border-radius: 8px;
  font-size: 0.84rem;
  font-family: var(--font-mono);
  letter-spacing: -0.005em;
  border: 1px solid;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}
.flash::before {
  content: '!';
  width: 18px; height: 18px;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 1px;
}
.flash-error {
  background: rgba(248,113,113,0.08);
  color: #FCA5A5;
  border-color: rgba(248,113,113,0.28);
}
.flash-error::before { background: rgba(248,113,113,0.18); color: #FCA5A5; }
.flash-success {
  background: rgba(74,222,128,0.08);
  color: #86EFAC;
  border-color: rgba(74,222,128,0.28);
}
.flash-success::before { content: '✓'; background: rgba(74,222,128,0.18); color: #86EFAC; }

/* ===== Hero glow ===== */
.hero-section { position: relative; padding: 6rem 0 4rem; }
.hero-glow {
  position: absolute;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 1400px; max-width: 120%;
  height: 700px;
  background: radial-gradient(ellipse at center top, rgba(255,120,130,0.08) 0%, rgba(255,120,130,0.02) 30%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  filter: blur(20px);
}

/* ===== Codeblock ===== */
.codeblock {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  color: var(--text-muted);
  overflow-x: auto;
  white-space: pre;
  letter-spacing: -0.005em;
  line-height: 1.6;
}
.codeblock .c-key { color: var(--text-dim); }
.codeblock .c-val { color: var(--text); }
.codeblock .c-sig { color: #86EFAC; }

/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 720ms cubic-bezier(0.16, 1, 0.3, 1) backwards; }
.fade-in-1 { animation-delay: 60ms; }
.fade-in-2 { animation-delay: 180ms; }
.fade-in-3 { animation-delay: 300ms; }
.fade-in-4 { animation-delay: 420ms; }
.fade-in-5 { animation-delay: 540ms; }
.fade-in-6 { animation-delay: 660ms; }

/* ===== Stat rows ===== */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; padding-bottom: 0; }
.stat-row:first-child { padding-top: 0; }
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}
.stat-value {
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  text-align: right;
}

/* ===== Feature card ===== */
.feature-card {
  position: relative;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 240ms, background 240ms;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.02) 30%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.feature-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.feature-card .feature-num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  margin-bottom: 2rem;
  display: block;
  text-transform: uppercase;
}
.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}
.feature-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* ===== How-it-works step ===== */
.step {
  position: relative;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.step-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.step-title {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.step-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 28ch;
}

/* ===== Prose (legal docs) ===== */
.prose-doc h1 {
  font-size: 2.75rem;
  font-weight: 500;
  letter-spacing: -0.035em;
  color: var(--text);
  line-height: 1.02;
}
.prose-doc h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 2.5rem;
  margin-bottom: 0.7rem;
  letter-spacing: -0.005em;
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
}
.prose-doc h2::before {
  content: attr(data-num);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  font-weight: 500;
}
.prose-doc p {
  color: var(--text-muted);
  margin: 0.65rem 0;
  line-height: 1.75;
  font-size: 0.92rem;
}
.prose-doc ul {
  color: var(--text-muted);
  padding-left: 1.3rem;
  margin: 0.65rem 0;
  font-size: 0.92rem;
  line-height: 1.85;
}
.prose-doc ul li { list-style: disc; padding-left: 0.2rem; }
.prose-doc a { color: var(--text); border-bottom: 1px solid var(--border-strong); padding-bottom: 1px; }
.prose-doc a:hover { color: var(--text); border-bottom-color: var(--text); }
.prose-doc b, .prose-doc strong { color: var(--text); font-weight: 600; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 4rem 0 3rem;
  margin-top: 6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: var(--text-dim);
}
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer h4 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1rem;
  font-weight: 500;
}

/* ===== Section heading ===== */
.section-head {
  display: flex; flex-direction: column; gap: 0.6rem;
  margin-bottom: 2.5rem;
}
.section-head h2 {
  font-size: 2.25rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.section-head p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 52ch;
}

/* ===== Utility ===== */
.hairline { background: var(--border); height: 1px; width: 100%; }
.text-balance { text-wrap: balance; }

@media (max-width: 640px) {
  .hero-section { padding: 3.5rem 0 2rem; }
  .prose-doc h1 { font-size: 2rem; }
  .section-head h2 { font-size: 1.75rem; }
  .step-title { font-size: 1.25rem; }
}
