/* Cloak — design system. Restrained palette, hairline borders, real typography. */

:root {
  /* Surfaces — almost-black ink with a hint of warmth */
  --bg:        #0a0a0c;
  --bg-elev-1: #111114;
  --bg-elev-2: #17171c;
  --bg-elev-3: #1c1c22;
  --surface:   #131317;

  /* Borders — alpha-based so they sit on any surface */
  --line:      rgba(255,255,255,0.06);
  --line-2:    rgba(255,255,255,0.10);
  --line-3:    rgba(255,255,255,0.16);

  /* Text */
  --text:      #f5f5f6;
  --text-2:    #c8c8cd;
  --text-3:    #8a8a93;
  --text-4:    #5e5e66;

  /* One accent. Use sparingly. */
  --accent:    #b3a585;   /* warm sand — Anthropic-ish */
  --accent-2:  #c8b899;
  --accent-d:  #8a7d62;
  --accent-bg: rgba(179,165,133,0.10);

  /* States */
  --good:      #7ec891;
  --good-bg:   rgba(126,200,145,0.10);
  --warn:      #e8c87f;
  --warn-bg:   rgba(232,200,127,0.10);
  --danger:    #e57c7c;
  --danger-bg: rgba(229,124,124,0.10);

  /* Geometry */
  --r-xs: 4px; --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-xl: 16px;

  /* Type */
  --font-sans: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Source Serif 4', 'Charter', 'Georgia', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg); color: var(--text);
  line-height: 1.5; letter-spacing: -0.005em;
  font-feature-settings: 'cv11','ss01';
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }
a { color: var(--accent-2); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent); }
::selection { background: var(--accent-bg); color: var(--accent-2); }

/* ============ icons (16px / 18px / 20px) ================================= */
.icn { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icn-18 { width: 18px; height: 18px; }
.icn-20 { width: 20px; height: 20px; }
.icn-24 { width: 24px; height: 24px; }
.icn-28 { width: 28px; height: 28px; }

/* ============ layout containers ========================================== */
.wrap-narrow { max-width: 680px;  margin: 0 auto; padding: 0 24px; }
.wrap        { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.wrap-wide   { max-width: 1320px; margin: 0 auto; padding: 0 24px; }

.row { display: flex; gap: 16px; align-items: center; }
.row-between { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.muted { color: var(--text-3); }
.muted-2 { color: var(--text-4); }
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); }
.serif { font-family: var(--font-serif); font-weight: 400; }

/* ============ topbar (marketing) ========================================= */
.topbar {
  position: sticky; top: 0; z-index: 50;
  padding: 14px 0;
  background: rgba(10,10,12,0.78);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; }
.brand {
  font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: -0.02em;
  display: inline-flex; align-items: center; gap: 8px;
}
.brand .mark {
  width: 22px; height: 22px; border-radius: 5px;
  background: var(--text); color: var(--bg);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; letter-spacing: -0.04em;
}
.topbar nav { display: flex; gap: 4px; align-items: center; font-size: 14px; }
.topbar nav > a:not(.btn) {
  color: var(--text-2); padding: 6px 12px; border-radius: var(--r-sm); transition: color .12s, background .12s;
}
.topbar nav > a:not(.btn):hover, .topbar nav > a.on { color: var(--text); background: var(--line); }
@media (max-width: 700px) { .topbar nav > a:not(.btn):not(.cta) { display: none; } }

/* ============ buttons ==================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--r-sm); border: 1px solid transparent;
  font-size: 14px; font-weight: 500; transition: all .12s ease; user-select: none;
  text-decoration: none; white-space: nowrap; line-height: 1; height: 36px;
  letter-spacing: -0.005em;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: var(--text); color: var(--bg);
  border-color: var(--text);
}
.btn-primary:hover:not(:disabled) { background: var(--text-2); border-color: var(--text-2); }
.btn-accent {
  background: var(--accent); color: var(--bg); border-color: var(--accent);
}
.btn-accent:hover:not(:disabled) { background: var(--accent-2); }
.btn-ghost {
  background: transparent; color: var(--text); border-color: var(--line-3);
}
.btn-ghost:hover:not(:disabled) { background: var(--line); border-color: var(--line-3); }
.btn-soft {
  background: var(--bg-elev-2); color: var(--text); border-color: var(--line-2);
}
.btn-soft:hover:not(:disabled) { background: var(--bg-elev-3); border-color: var(--line-3); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--line-3); }
.btn-danger:hover:not(:disabled) { background: var(--danger-bg); border-color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 13px; height: 30px; }
.btn-lg { padding: 12px 22px; font-size: 15px; height: 44px; }

/* ============ cards & surfaces =========================================== */
.card {
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); padding: 24px;
}
.card-lg { padding: 32px; }
.card-sm { padding: 16px; }

/* Section headers inside cards */
.section-h {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin: 0 0 14px;
}

/* ============ form fields ================================================ */
.field { margin-bottom: 18px; }
.field label, .field-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 7px;
}
.field .help { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }
.field .err  { font-size: 12px; color: var(--danger); margin-top: 6px; }

.input,
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=url], .field input[type=number], .field textarea, .field select {
  width: 100%; padding: 10px 14px;
  background: var(--bg-elev-1); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font-size: 14px; line-height: 1.4; transition: border-color .12s, background .12s;
  letter-spacing: -0.005em;
}
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--text-4); }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--text-3); background: var(--bg-elev-2);
}
.field textarea { resize: vertical; min-height: 80px; font-family: var(--font-mono); font-size: 13px; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .row-2, .row-3 { grid-template-columns: 1fr; } }

/* Toggle switch */
.toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px; background: var(--bg-elev-1);
  border: 1px solid var(--line-2); border-radius: var(--r);
  margin-bottom: 8px; transition: border-color .12s;
}
.toggle:hover { border-color: var(--line-3); }
.toggle .lbl { font-size: 14px; font-weight: 500; color: var(--text); }
.toggle .lbl-help { font-size: 12px; color: var(--text-3); margin-top: 3px; line-height: 1.4; }
.toggle input[type=checkbox] {
  appearance: none; width: 36px; height: 20px;
  background: var(--bg-elev-3); border: 1px solid var(--line-3); border-radius: 99px;
  position: relative; cursor: pointer; transition: background .15s; flex-shrink: 0;
}
.toggle input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
.toggle input[type=checkbox]::after {
  content: ''; position: absolute; top: 1px; left: 1px;
  width: 16px; height: 16px; background: var(--text); border-radius: 50%;
  transition: left .15s;
}
.toggle input[type=checkbox]:checked::after { left: 17px; background: var(--bg); }

/* Pills */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  padding: 6px 12px; background: transparent; color: var(--text-2);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font-size: 13px; cursor: pointer; user-select: none;
  transition: all .12s; display: inline-flex; align-items: center; gap: 6px;
}
.pill:hover { border-color: var(--line-3); color: var(--text); }
.pill.on {
  background: var(--text); color: var(--bg); border-color: var(--text);
}
.pill .icn { width: 14px; height: 14px; stroke-width: 1.75; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.01em;
  padding: 3px 8px; border-radius: var(--r-xs);
  border: 1px solid transparent;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-good   { background: var(--good-bg);   color: var(--good); }
.badge-warn   { background: var(--warn-bg);   color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted  { background: var(--bg-elev-2); color: var(--text-3); }
.badge-info   { background: var(--accent-bg); color: var(--accent-2); }

/* ============ tables ===================================================== */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3);
  padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.tbl td { padding: 16px 18px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: var(--bg-elev-1); }

/* ============ tabs ======================================================= */
.tabs {
  display: flex; gap: 2px; padding: 4px;
  background: var(--bg-elev-1); border: 1px solid var(--line-2);
  border-radius: var(--r); margin-bottom: 24px; width: fit-content;
}
.tab {
  padding: 7px 14px; cursor: pointer; color: var(--text-3);
  font-size: 13px; font-weight: 500; border-radius: var(--r-sm); transition: all .12s;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--text-2); }
.tab.on { color: var(--text); background: var(--bg-elev-3); }

/* ============ toast ====================================================== */
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 100;
  background: var(--bg-elev-3); border: 1px solid var(--line-3);
  padding: 11px 16px; border-radius: var(--r); font-size: 13px;
  opacity: 0; transform: translateY(8px); transition: all .18s; pointer-events: none;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5); max-width: 340px;
  display: inline-flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { border-color: var(--danger); color: var(--danger); }
.toast.ok  { border-color: var(--good); color: var(--good); }

/* ============ dashboard layout =========================================== */
.app-layout { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--bg-elev-1); border-right: 1px solid var(--line);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 6px 10px; }
.sidebar .nav-section { display: flex; flex-direction: column; gap: 1px; }
.sidebar .nav-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
  color: var(--text-4); text-transform: uppercase; padding: 12px 12px 6px;
}
.sidebar a {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  border-radius: var(--r-sm); color: var(--text-2); font-size: 13.5px;
  font-weight: 500; transition: background .1s, color .1s;
}
.sidebar a:hover { background: var(--line); color: var(--text); }
.sidebar a.on { background: var(--bg-elev-3); color: var(--text); }
.sidebar a .icn { color: var(--text-3); }
.sidebar a:hover .icn, .sidebar a.on .icn { color: var(--text); }

.sidebar .footer { margin-top: auto; padding: 12px;
  border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.sidebar .footer .who { display: flex; flex-direction: column; gap: 2px; }
.sidebar .footer .name { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.3; }
.sidebar .footer .email { color: var(--text-3); font-size: 11px; word-break: break-all; line-height: 1.3; }

.main { padding: 36px 40px; min-width: 0; max-width: 1180px; }
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 32px; flex-wrap: wrap;
}
.page-head h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.page-head .sub { font-size: 13.5px; color: var(--text-3); margin-top: 6px; max-width: 560px; line-height: 1.5; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

@media (max-width: 800px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 20px; }
}

/* ============ stat tiles ================================================= */
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 24px; }
.stat-tile {
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); padding: 18px;
}
.stat-tile .lbl { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.stat-tile .val { font-size: 26px; font-weight: 600; color: var(--text); margin-top: 8px;
  letter-spacing: -0.025em; font-feature-settings: 'tnum'; line-height: 1; }
.stat-tile .delta { font-size: 12px; margin-top: 4px; color: var(--text-3); }

/* ============ marketing hero ============================================= */
.hero { padding: 120px 0 100px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 6px; border: 1px solid var(--line-2); border-radius: 99px;
  font-size: 12px; color: var(--text-2); margin-bottom: 28px;
}
.hero-eyebrow .pill-tag {
  background: var(--accent-bg); color: var(--accent-2);
  padding: 2px 8px; border-radius: 99px; font-weight: 600; font-size: 11px;
}
.hero h1 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(40px, 5.5vw, 68px); line-height: 1.05;
  letter-spacing: -0.025em; margin: 0 0 24px; color: var(--text);
}
.hero h1 em { font-style: italic; color: var(--accent-2); font-family: var(--font-serif); }
.hero p.lead { font-size: 18px; color: var(--text-3); max-width: 580px; margin: 0 0 36px; line-height: 1.55; }
.hero .ctas { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 64px; }

.hero-stats {
  display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  padding-top: 36px; border-top: 1px solid var(--line);
}
.hero-stat .n { font-size: 26px; font-weight: 500; color: var(--text); letter-spacing: -0.02em; font-feature-settings: 'tnum'; }
.hero-stat .l { font-size: 12px; color: var(--text-4); margin-top: 4px; }

/* ============ section ==================================================== */
.section { padding: 96px 0; border-top: 1px solid var(--line); }
.section-eyebrow {
  font-size: 12px; color: var(--accent-2); text-transform: uppercase;
  letter-spacing: 0.1em; font-weight: 600; margin-bottom: 14px;
}
.section h2 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: 34px; color: var(--text); margin: 0 0 16px;
  letter-spacing: -0.02em; line-height: 1.15;
}
.section .sub { color: var(--text-3); font-size: 16px; max-width: 600px; margin: 0 0 56px; line-height: 1.55; }
.section.center { text-align: center; }
.section.center h2, .section.center .sub, .section.center .section-eyebrow { margin-left: auto; margin-right: auto; }

/* ============ feature grid =============================================== */
.feat-grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.feat { background: var(--bg); padding: 28px; transition: background .12s; }
.feat:hover { background: var(--bg-elev-1); }
.feat .icn-wrap {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  background: var(--bg-elev-2); display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px; color: var(--text-2);
}
.feat h3 { color: var(--text); font-size: 15px; font-weight: 600; margin: 0 0 8px; letter-spacing: -0.01em; }
.feat p { color: var(--text-3); font-size: 14px; margin: 0; line-height: 1.55; }

/* ============ steps ====================================================== */
.steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { padding: 24px; border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface); }
.step .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-bg); color: var(--accent-2);
  font-size: 13px; font-weight: 600; margin-bottom: 14px;
  font-feature-settings: 'tnum';
}
.step h3 { color: var(--text); font-size: 15px; font-weight: 600; margin: 0 0 6px; }
.step p { color: var(--text-3); font-size: 14px; margin: 0; line-height: 1.55; }

/* ============ FAQ ======================================================== */
.faq { display: flex; flex-direction: column; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.faq details { background: var(--bg); padding: 22px 24px; cursor: pointer; transition: background .12s; }
.faq details:hover { background: var(--bg-elev-1); }
.faq summary {
  font-weight: 500; color: var(--text); font-size: 15px; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+'; font-size: 22px; color: var(--text-3); font-weight: 300;
  transition: transform .15s; line-height: 1;
}
.faq details[open] summary::after { content: '−'; }
.faq p { margin: 14px 0 0; color: var(--text-3); font-size: 14px; line-height: 1.65; max-width: 600px; }

/* ============ comparison table =========================================== */
.cmp { width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; }
.cmp th, .cmp td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
.cmp tr:last-child td { border-bottom: 0; }
.cmp th { font-weight: 600; color: var(--text); background: var(--bg-elev-1);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.cmp td.yes { color: var(--good); }
.cmp td.no  { color: var(--text-4); }
.cmp .we, .cmp th.we { background: var(--accent-bg); }
.cmp th.we { color: var(--accent-2); }

/* ============ pricing toggle ============================================= */
.bill-toggle { display: inline-flex; background: var(--bg-elev-1);
  border: 1px solid var(--line-2); border-radius: 99px; padding: 4px;
  margin: 0 auto 36px; }
.bill-toggle button {
  padding: 8px 18px; border-radius: 99px; border: 0; background: transparent; color: var(--text-3);
  font-weight: 500; font-size: 13px; transition: all .12s;
  display: inline-flex; align-items: center; gap: 8px;
}
.bill-toggle button.on { background: var(--text); color: var(--bg); }
.bill-save { font-size: 11px; padding: 1px 6px; border-radius: 4px;
  background: var(--good-bg); color: var(--good); font-weight: 600; }
.bill-toggle button.on .bill-save { background: rgba(0,0,0,0.12); color: var(--bg); }

/* ============ footer ===================================================== */
.footer { padding: 48px 0; border-top: 1px solid var(--line); color: var(--text-4); font-size: 13px; }
.footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer .links a { color: var(--text-3); margin-left: 24px; }
.footer .links a:hover { color: var(--text); }

/* ============ helpers ==================================================== */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; padding: 1px 6px; border-radius: 3px;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-2);
  background: var(--bg-elev-2); border: 1px solid var(--line-2);
}
.code-block {
  background: var(--bg-elev-1); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 14px 16px; font-family: var(--font-mono);
  font-size: 12.5px; color: var(--text-2); line-height: 1.65; white-space: pre-wrap; word-break: break-all;
  position: relative;
}
.code-block .copy-btn {
  position: absolute; top: 8px; right: 8px; padding: 4px 8px;
  background: var(--bg-elev-3); border: 1px solid var(--line-3); color: var(--text-3);
  border-radius: var(--r-xs); font-size: 11px; cursor: pointer; transition: color .12s;
  font-family: var(--font-sans);
}
.code-block .copy-btn:hover { color: var(--text); }

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

/* Empty state */
.empty {
  text-align: center; padding: 56px 24px;
  border: 1px dashed var(--line-3); border-radius: var(--r-lg);
}
.empty .icn-wrap {
  width: 44px; height: 44px; border-radius: var(--r); margin: 0 auto 16px;
  background: var(--bg-elev-2); display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.empty h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--text); }
.empty p { margin: 0 0 20px; color: var(--text-3); font-size: 14px; max-width: 400px; margin-left: auto; margin-right: auto; }
