/* Zip Mail — zipmail.app. System fonts only; no external requests. */

:root {
  color-scheme: light dark;
  --navy-950: #020d24;
  --navy-900: #031a41;
  --navy-800: #0a2656;
  --blue-500: #1c9cff;
  --blue-400: #4db4ff;
  --blue-300: #8fd0ff;

  /* Light theme (default tokens) */
  --bg: #f4f7fc;
  --bg-alt: #e9eff8;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --text: #0b1a36;
  --text-2: #3d4b66;
  --text-3: #5a6782;
  --border: #d5deec;
  --accent: #0058c4;
  --accent-hover: #00449a;
  --accent-soft: #e2eeff;
  --on-accent: #ffffff;
  --warn-bg: #fff5d6;
  --warn-border: #e7c35a;
  --warn-text: #4a3500;
  --shadow: 0 1px 2px rgb(11 26 54 / 0.06), 0 8px 24px rgb(11 26 54 / 0.06);
  --radius: 18px;
  --radius-sm: 12px;
  --max: 1120px;
  --prose: 44rem;
  --gutter: clamp(16px, 4vw, 32px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system-headline, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #030f28;
    --bg-alt: #061834;
    --surface: #0a1f45;
    --surface-2: #0c2450;
    --text: #edf3ff;
    --text-2: #b9c8e3;
    --text-3: #9aabcb;
    --border: #1c3566;
    --accent: #5cbcff;
    --accent-hover: #8fd0ff;
    --accent-soft: #0f2d5e;
    --on-accent: #021130;
    --warn-bg: #2d2408;
    --warn-border: #8a6d1d;
    --warn-text: #f7e2a4;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px rgb(0 0 0 / 0.25);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; }
svg { flex-shrink: 0; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--blue-400); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5.4vw, 3.6rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); letter-spacing: -0.02em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
code, kbd { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--accent-soft); padding: 0.1em 0.35em; border-radius: 6px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--surface); color: var(--text); padding: 10px 14px; border-radius: 10px;
  box-shadow: var(--shadow);
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.12rem; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-nav ul { display: flex; gap: 4px 6px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  color: var(--text-2); text-decoration: none; font-size: 0.95rem; font-weight: 500;
}
.site-nav a:hover { color: var(--text); background: var(--accent-soft); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--accent-soft); }

/* ---------- Hero (always midnight navy, like the icon) ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(60rem 36rem at 78% 18%, rgb(28 156 255 / 0.22), transparent 60%),
    radial-gradient(40rem 30rem at 10% 90%, rgb(28 156 255 / 0.10), transparent 60%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: #eef4ff;
  padding: clamp(56px, 9vw, 112px) 0 clamp(56px, 8vw, 96px);
}
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(32px, 6vw, 72px); align-items: center; }
.hero-mark { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.hero-mark img {
  width: 96px; height: 96px; border-radius: 22px;
  box-shadow: 0 0 0 1px rgb(143 208 255 / 0.18), 0 18px 50px rgb(0 120 255 / 0.35);
}
.wordmark { font-family: var(--font-display); font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; color: #fff; }
.hero h1 { color: #fff; max-width: 15ch; }
.hero .lede { font-size: clamp(1.1rem, 2vw, 1.28rem); color: #bcd0ee; max-width: 36rem; margin-bottom: 32px; }
.hero .lede strong { color: #e7f0ff; font-weight: 600; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 1rem; text-decoration: none;
  border: 1px solid transparent;
}
.btn-primary { background: linear-gradient(180deg, #3fb0ff, #0a84ff); color: #021130; box-shadow: 0 8px 24px rgb(10 132 255 / 0.35); }
.btn-primary:hover { color: #021130; background: linear-gradient(180deg, #62c0ff, #2893ff); }
.btn-ghost { color: #dbe8ff; border-color: rgb(143 208 255 / 0.35); }
.btn-ghost:hover { color: #fff; border-color: rgb(143 208 255 / 0.7); background: rgb(143 208 255 / 0.08); }
.hero-note { margin-top: 18px; font-size: 0.92rem; color: #9fb5d8; }

/* Illustration: lock-screen notifications (pure HTML/CSS). */
.demo { position: relative; display: grid; gap: 12px; justify-items: stretch; max-width: 380px; margin-left: auto; width: 100%; }
.demo-time { text-align: center; color: #e9f1ff; margin-bottom: 8px; }
.demo-time .clock { display: block; font-family: var(--font-display); font-size: clamp(3.4rem, 7vw, 4.6rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.demo-time .date { font-size: 0.95rem; color: #a9bfe2; }
.notif {
  display: grid; grid-template-columns: 38px 1fr; gap: 4px 12px; align-items: start;
  padding: 14px 16px; border-radius: 22px;
  background: rgb(214 230 255 / 0.12);
  border: 1px solid rgb(214 230 255 / 0.16);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  color: #eef4ff; font-size: 0.92rem; line-height: 1.35;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.25);
}
.notif img { width: 38px; height: 38px; border-radius: 9px; grid-row: span 3; }
.notif .top { display: flex; justify-content: space-between; gap: 8px; }
.notif .from { font-weight: 650; }
.notif .when { color: #a9bfe2; font-size: 0.82rem; white-space: nowrap; }
.notif .subj { font-weight: 500; }
.notif .body { color: #c3d3ee; }
.notif.dim { opacity: 0.72; transform: scale(0.97); }
.code-pill { display: inline-block; margin-top: 4px; font-family: var(--mono); letter-spacing: 0.12em; background: rgb(143 208 255 / 0.18); padding: 2px 8px; border-radius: 8px; color: #fff; }
.demo-caption { text-align: center; font-size: 0.8rem; color: #8fa6cc; margin: 4px 0 0; }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section.alt { background: var(--bg-alt); }
.section-head { max-width: 46rem; margin-bottom: clamp(32px, 5vw, 56px); }
.eyebrow { display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.section-head p { color: var(--text-2); font-size: 1.12rem; }

.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 18px; list-style: none; margin: 0; padding: 0; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.feature.wide { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; gap: 0 20px; align-items: start; }
.feature.wide .icon { grid-row: span 3; }
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--text-2); margin: 0; font-size: 1rem; }
.feature p + p { margin-top: 10px; }
.feature .small { font-size: 0.9rem; color: var(--text-3); }
.icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 16px;
  background: linear-gradient(160deg, #1f97ff, #0a5fd6); color: #fff;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25);
}
.icon svg { width: 24px; height: 24px; }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; padding: 0; list-style: none; }
.pill-row li { font-size: 0.85rem; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--text-2); }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.split.four { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card h3 { margin-bottom: 10px; }
.card p, .card li { color: var(--text-2); font-size: 1rem; }
.card ul { margin: 0; padding-left: 1.2em; }
.card li + li { margin-top: 6px; }
.card .more { display: inline-block; margin-top: 12px; font-weight: 600; }

.privacy-band {
  background:
    radial-gradient(50rem 30rem at 85% 0%, rgb(28 156 255 / 0.18), transparent 60%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: #e9f1ff;
}
.privacy-band h2 { color: #fff; }
.privacy-band .section-head p { color: #b9cbea; }
.privacy-band .eyebrow { color: var(--blue-300); }
.privacy-band .card { background: rgb(214 230 255 / 0.06); border-color: rgb(214 230 255 / 0.14); box-shadow: none; }
.privacy-band .card h3 { color: #fff; }
.privacy-band .card p, .privacy-band .card li { color: #c1d1ec; }
.privacy-band a { color: var(--blue-300); }
.privacy-band a:hover { color: #fff; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.plan h3 { display: flex; align-items: baseline; gap: 10px; }
.plan .tag { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }

.beta { text-align: center; }
.beta .section-head { margin-left: auto; margin-right: auto; }
.beta .btn-primary[aria-disabled="true"] { cursor: default; }
.beta-status { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; background: var(--accent-soft); color: var(--text); font-weight: 600; }
.beta-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #f5a623; box-shadow: 0 0 0 4px rgb(245 166 35 / 0.2); }

/* ---------- Document pages (security, privacy, terms, support) ---------- */
.page-head {
  background:
    radial-gradient(50rem 26rem at 90% 0%, rgb(28 156 255 / 0.20), transparent 60%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: #e9f1ff; padding: clamp(48px, 7vw, 88px) 0 clamp(40px, 6vw, 64px);
}
.page-head h1 { color: #fff; font-size: clamp(2rem, 4.6vw, 3rem); max-width: 22ch; }
.page-head p { color: #bcd0ee; font-size: 1.15rem; max-width: 42rem; margin-bottom: 0; }
.page-head a { color: var(--blue-300); }
.page-head a:hover { color: #fff; }
.page-head .meta { margin-top: 18px; font-size: 0.9rem; color: #95abd0; }

.doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); padding-top: clamp(40px, 6vw, 64px); padding-bottom: clamp(64px, 9vw, 112px); }
.toc { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; font-size: 0.92rem; }
.toc h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--text-2); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--text); border-left-color: var(--accent); }

.prose { max-width: var(--prose); }
.prose h2 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); margin-top: 2.4em; padding-top: 0.2em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.8em; font-size: 1.12rem; }
.prose p, .prose li { color: var(--text-2); }
.prose strong { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li + li { margin-top: 0.4em; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 3em 0; }

.callout {
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
  background: var(--surface); border-radius: var(--radius-sm); padding: 18px 20px; margin: 0 0 2em;
}
.callout p:last-child { margin-bottom: 0; }
.callout h2, .callout h3 { margin-top: 0 !important; font-size: 1.1rem; }
.callout.warn { background: var(--warn-bg); border-color: var(--warn-border); border-left-color: var(--warn-border); }
.callout.warn, .callout.warn p, .callout.warn strong, .callout.warn h2 { color: var(--warn-text); }


.table-wrap { overflow-x: auto; margin: 0 0 1.6em; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }
th { font-weight: 650; color: var(--text); background: var(--surface-2); }
td { color: var(--text-2); }
caption { text-align: left; padding: 12px 14px 0; font-weight: 600; color: var(--text); }

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; margin: 0 0 1.6em; }
.two-col .card { padding: 20px; }
.two-col .card h3 { margin-top: 0; font-size: 1.05rem; }
.two-col .card ul { padding-left: 1.1em; margin: 0; }

.placeholder { background: var(--warn-bg); color: var(--warn-text); padding: 0 0.3em; border-radius: 4px; font-weight: 600; }

/* FAQ */
.faq details { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin: 0 0 12px; }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 48px 16px 20px; font-weight: 600; color: var(--text); position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 20px; top: 50%; width: 9px; height: 9px; margin-top: -6px;
  border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg);
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -1px; }
.faq details > div { padding: 0 20px 6px; }
.faq h2 { margin-top: 2em; }
.faq h2:first-child { margin-top: 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 48px 0 40px; font-size: 0.95rem; color: var(--text-2); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.site-footer h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: 8px; }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.footer-brand p { max-width: 26rem; margin-top: 12px; }
.legal-line { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--text-3); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* ---------- 404 ---------- */
.notfound { min-height: 60vh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; text-align: center; padding-top: 80px; padding-bottom: 80px; }
.notfound img { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 24px; }
.notfound p { color: var(--text-2); }
.notfound > div { max-width: 36rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .demo { margin: 8px auto 0; }
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; max-height: none; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; background: var(--surface); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  .site-header .wrap { padding-top: 8px; padding-bottom: 8px; gap: 6px; }
  .site-nav { width: 100%; }
  .site-nav ul { justify-content: flex-start; margin-left: -10px; }
  .site-nav a { padding: 6px 10px; }
  .hero-mark img { width: 72px; height: 72px; border-radius: 17px; }
  .wordmark { font-size: 1.6rem; }
  .feature.wide { display: block; }
  .btn { width: 100%; justify-content: center; }
}

@media (prefers-contrast: more) {
  :root { --text-2: var(--text); --text-3: var(--text); }
  .notif { background: rgb(10 30 70 / 0.95); }
}
@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .notif { background: #122a58; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media print {
  .site-header, .site-footer, .toc, .skip-link { display: none; }
  .page-head { background: none; color: #000; }
  .page-head h1, .page-head p { color: #000; }
}
