/* MailGrit landing site — hand-written CSS, no framework, no build step.
   Dark-first design that mirrors the app's dark/light theming. */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --bg: #0b1020;
  --bg-elev: #131a30;
  --bg-elev-2: #1b2444;
  --surface-border: rgba(255, 255, 255, 0.08);
  --text: #e8ecf6;
  --text-muted: #a6b0c8;
  --accent: #5b8cff;
  --accent-2: #7cf2c8;
  --accent-grad: linear-gradient(135deg, #5b8cff 0%, #7cf2c8 100%);
  --danger: #ff6b6b;
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1120px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.65);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f8fd;
    --bg-elev: #ffffff;
    --bg-elev-2: #f0f3fb;
    --surface-border: rgba(15, 23, 42, 0.10);
    --text: #0f172a;
    --text-muted: #51607a;
    --accent: #2f6bff;
    --accent-2: #12b886;
    --accent-grad: linear-gradient(135deg, #2f6bff 0%, #12b886 100%);
    --shadow: 0 18px 50px -28px rgba(31, 51, 102, 0.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--surface-border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--accent-grad);
  display: grid; place-items: center;
  color: #04122b;
  font-weight: 800;
  font-size: 0.92rem;
}
.nav-actions { display: flex; align-items: center; gap: 16px; }
.lang-switch {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.lang-switch .cur { color: var(--text); }
.lang-switch .sep { opacity: 0.4; margin: 0 4px; }
.nav-cta {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
  color: var(--text);
}
.nav-cta:hover { background: var(--bg-elev); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 92px 0 76px;
  border-bottom: 1px solid var(--surface-border);
  background:
    radial-gradient(900px 460px at 82% -8%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%),
    radial-gradient(760px 420px at 8% 0%, color-mix(in srgb, var(--accent-2) 18%, transparent), transparent 70%);
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid var(--surface-border);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5.4vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  margin: 0 0 18px;
  font-weight: 800;
  max-width: 16ch;
}
.hero h1 .grad {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: 1.16rem;
  color: var(--text-muted);
  max-width: 62ch;
  margin: 0 0 30px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--accent-grad);
  color: #04122b;
  box-shadow: var(--shadow);
}
.btn-ghost {
  background: var(--bg-elev);
  color: var(--text);
  border-color: var(--surface-border);
}
.btn-ghost:hover { background: var(--bg-elev-2); }

.hero-meta {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.86rem;
  color: var(--text-muted);
}
.hero-meta .dot { opacity: 0.4; }
.legal-microcopy {
  margin-top: 18px;
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.85;
  max-width: 60ch;
}
.trademark-note {
  margin-top: 14px;
  font-size: 0.74rem;
  color: var(--text-muted);
  opacity: 0.75;
  line-height: 1.5;
}

/* ---------- Sections ---------- */
.section { padding: 76px 0; border-bottom: 1px solid var(--surface-border); }
.section-head { max-width: 60ch; margin-bottom: 42px; }
.section-head h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  letter-spacing: -0.025em;
  margin: 0 0 12px;
  font-weight: 700;
}
.section-head p { color: var(--text-muted); font-size: 1.05rem; margin: 0; }
.section-num {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  display: block;
  margin-bottom: 10px;
  letter-spacing: 0.06em;
}

/* ---------- Feature grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.card {
  background: var(--bg-elev);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--surface-border)); }
.card .icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  margin-bottom: 14px;
  font-size: 1.15rem;
}
.card h3 { margin: 0 0 8px; font-size: 1.08rem; font-weight: 700; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

/* ---------- Security / architecture ---------- */
.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  align-items: start;
}
.panel {
  background: var(--bg-elev);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 28px;
}
.panel h3 { margin: 0 0 14px; font-size: 1.1rem; font-weight: 700; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  position: relative;
  padding: 9px 0 9px 30px;
  border-bottom: 1px dashed var(--surface-border);
  font-size: 0.97rem;
}
.checklist li:last-child { border-bottom: none; }
.checklist li::before {
  content: "\2713";
  position: absolute;
  left: 0; top: 9px;
  color: var(--accent-2);
  font-weight: 800;
  font-family: var(--mono);
}
.code-window {
  background: #05080f;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.code-window .bar {
  display: flex;
  gap: 7px;
  padding: 12px 14px;
  background: #0b1020;
  border-bottom: 1px solid var(--surface-border);
}
.code-window .bar i {
  width: 12px; height: 12px; border-radius: 50%;
  display: inline-block;
}
.code-window .bar i:nth-child(1) { background: #ff5f56; }
.code-window .bar i:nth-child(2) { background: #ffbd2e; }
.code-window .bar i:nth-child(3) { background: #27c93f; }
.code-window .bar .title {
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #6b7a99;
}
.code-window pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.65;
  color: #d6deeb;
}
.code-window pre .c { color: #6b7a99; }       /* comment */
.code-window pre .p { color: #7cf2c8; }       /* prompt */
.code-window pre .k { color: #5b8cff; }       /* keyword/cmd */

/* ---------- Languages ---------- */
.langs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.lang-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.93rem;
}
.lang-chip code {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  padding: 2px 8px;
  border-radius: 6px;
}
.lang-chip .end { color: var(--text-muted); }

/* ---------- Stats strip ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 6px;
}
.stat .num {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat .label { color: var(--text-muted); font-size: 0.88rem; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 46px 0 60px;
  background: var(--bg-elev);
  border-top: 1px solid var(--surface-border);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 30px;
}
.footer-grid h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { padding: 4px 0; font-size: 0.93rem; }
.footer-grid p { color: var(--text-muted); font-size: 0.93rem; max-width: 38ch; margin: 10px 0 0; }
.footer-bottom {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--surface-border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.86rem;
}

/* ---------- Skip link / a11y ---------- */
.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--bg-elev);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}
.skip:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Support / donate ---------- */
.support {
  padding: 76px 0;
  border-bottom: 1px solid var(--surface-border);
  text-align: center;
}
.support .container { max-width: 56ch; }
.support h2 {
  font-size: clamp(1.7rem, 1rem + 2.6vw, 2.4rem);
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}
.support p { color: var(--text-muted); font-size: 1.05rem; margin: 0 0 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 52px; }
  .section { padding: 54px 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .nav-cta { display: none; }
}
