/* Mailbase — mailbase.co. Tokens from design/HANDOFF.md. Labels are
   sentence case by the owner's rule: no all-caps letter-spaced text. */

:root {
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", Monaco, Menlo, monospace;

  --text: #1a202c;
  --text-2: #4a5568;
  --muted: #718096;
  --faint: #a0aec0;
  --hairline: #e2e8f0;
  --card: #f7fafc;
  --blue: #3182ce;
  --blue-hover: #2b6cb0;
  --blue-light: #90cdf4;
  --blue-mid: #63b3ed;

  --ui-base: #12181f;
  --ui-list: #151c25;
  --ui-rail: #161d26;
  --ui-title: #171e26;
  --ui-card: #171f29;
  --page-dark: #171923;
  --ui-text: #e2e8f0;
  --ui-text-2: #cbd5e0;
  --ui-text-3: #b7c2ce;
  --ui-text-4: #8b99ab;
  --ui-snippet: #5d6b7d;
  --ui-line: rgba(255, 255, 255, 0.08);
  --ui-line-soft: rgba(255, 255, 255, 0.06);

  --green: #48bb78;
  --green-light: #68d391;
  --red: #fc8181;
  --yellow: #ecc94b;
  --select: #4299e1;

  --gutter: 64px;
  /* Content width; sections add their gutters outside it, as in the
     reference (content-box max-width + 64px padding). */
  --max: 1280px;
  --max-outer: calc(var(--max) + 2 * var(--gutter));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
.mono { font-family: var(--mono); }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  white-space: nowrap;
  transition: background-color 0.12s ease;
}
.btn:hover { background: var(--blue-hover); color: #fff; text-decoration: none; }
.btn-lg { font-size: 15px; padding: 13px 24px; }
.btn-secondary {
  background: #fff;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.btn-secondary:hover { background: var(--card); color: var(--text); }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--gutter);
  border-bottom: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
}
.brand:hover { color: var(--text); text-decoration: none; }
.brand img { width: 24px; height: 24px; }
.nav-links { display: flex; align-items: center; gap: 30px; font-size: 13.5px; }
.nav-links a:not(.btn) { color: var(--text-2); }
.nav-links a:not(.btn):hover { color: var(--blue-hover); }

/* ---------- shared section pieces ---------- */

.wrap { max-width: var(--max-outer); margin: 0 auto; }
.eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 14px;
}
.h2 { font-size: 32px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; }
.body { font-size: 16px; line-height: 1.6; color: var(--text-2); margin-top: 14px; }

/* ---------- hero ---------- */

.hero { padding: 88px var(--gutter) 48px; }
.hero .eyebrow { margin-bottom: 20px; }
.hero h1 {
  font-size: 60px;
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.022em;
  max-width: 880px;
}
.hero h1 .second { display: block; color: var(--faint); }
.hero .lede { font-size: 18px; line-height: 1.55; color: var(--text-2); margin-top: 24px; max-width: 600px; }
.cta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; margin-top: 34px; }
.cta-note { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

/* ---------- dark UI mocks (shared) ---------- */

.ui { background: var(--ui-base); color: var(--ui-text); }
.ui-mono { font-family: var(--mono); }
.chip-urgent {
  font-size: 9px;
  font-weight: 700;
  color: var(--red);
  background: rgba(254, 178, 178, 0.16);
  padding: 1px 5px;
  border-radius: 2px;
}
.ui-label { font-size: 11px; font-weight: 600; color: var(--muted); }

/* hero product shot */
.shot { padding: 8px var(--gutter) 88px; }
.window {
  border-radius: 10px;
  border: 1px solid var(--hairline);
  box-shadow: 0 32px 80px -28px rgba(23, 25, 35, 0.45);
  overflow: hidden;
}
.titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  background: var(--ui-title);
  border-bottom: 1px solid var(--ui-line);
}
.light { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.light.r { background: #ff5f57; }
.light.y { background: #febc2e; }
.light.g { background: #28c840; }
.titlebar .title { margin-left: 12px; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.app { display: flex; min-height: 420px; }
.rail {
  /* 158px plus its padding, as in the reference. */
  box-sizing: content-box;
  width: 158px;
  flex-shrink: 0;
  background: var(--ui-rail);
  border-right: 1px solid var(--ui-line);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 12.5px;
  color: var(--faint);
}
.rail-item { display: flex; justify-content: space-between; padding: 6px 9px; border-radius: 5px; }
.rail-item kbd { font-family: var(--mono); font-size: 10px; opacity: 0.5; }
.rail-item.active { background: rgba(66, 153, 225, 0.16); color: var(--blue-light); }
.rail-item.active kbd { opacity: 0.6; }
.list { width: 440px; flex-shrink: 0; background: var(--ui-list); border-right: 1px solid var(--ui-line); }
.list-head {
  padding: 10px 16px;
  border-bottom: 1px solid var(--ui-line);
  background: var(--ui-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.list-head .name { font-size: 12.5px; font-weight: 600; color: var(--ui-text-2); }
.list-head .filter { font-size: 10.5px; font-family: var(--mono); color: var(--text-2); }
.row { padding: 11px 16px 11px 13px; border-left: 3px solid transparent; border-bottom: 1px solid var(--ui-line-soft); }
.row:last-child { border-bottom: 0; }
.row.selected { border-left-color: var(--select); background: rgba(66, 153, 225, 0.14); }
.row-top { display: flex; justify-content: space-between; margin-bottom: 2px; }
.row .from { font-size: 13px; font-weight: 700; color: var(--ui-text); }
.row.read .from { font-weight: 400; color: var(--ui-text-4); }
.row .meta { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--muted); }
.row .star { font-size: 10px; color: var(--yellow); }
.row .count { font-size: 9px; background: rgba(255, 255, 255, 0.1); color: var(--faint); padding: 1px 4px; border-radius: 3px; font-family: var(--mono); }
.row .subj { font-size: 12.5px; color: var(--ui-text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.read .subj { color: var(--ui-text-4); }
.row .subj b { font-weight: 600; }
.row .snip { color: var(--ui-snippet); }
.row .why { font-size: 11px; color: var(--muted); font-style: italic; margin-top: 3px; }
.row .why .rank { font-style: normal; font-weight: 700; font-family: var(--mono); }
.brief { flex: 1; min-width: 0; background: var(--ui-base); padding: 18px 20px; }
.brief .ui-label { margin-bottom: 10px; }
.card-dark {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  background: var(--ui-card);
  padding: 13px 15px;
  margin-bottom: 10px;
}
.card-dark h3 { font-size: 13px; font-weight: 600; color: var(--ui-text); margin-bottom: 4px; }
.card-dark p { font-size: 12px; line-height: 1.55; color: var(--ui-text-4); }
.keys { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--mono); font-size: 10px; color: var(--text-2); }
.keys span { border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 3px; padding: 2px 6px; }
.status {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 28px;
  padding: 0 14px;
  background: var(--ui-rail);
  border-top: 1px solid var(--ui-line);
  font-size: 11px;
  color: var(--muted);
}
.status .spacer { flex: 1; }
.dot { display: inline-flex; align-items: center; gap: 5px; }
.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

/* ---------- feature sections ---------- */

.feature {
  max-width: var(--max-outer);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  padding: 72px var(--gutter);
  border-top: 1px solid var(--hairline);
  align-items: center;
}
.mock { border: 1px solid var(--hairline); border-radius: 8px; overflow: hidden; }

/* triage */
.mock-triage { font-size: 12.5px; }
.mock-head { padding: 9px 16px; border-bottom: 1px solid var(--ui-line); }
.rank-row { padding: 10px 16px; border-bottom: 1px solid var(--ui-line-soft); display: flex; gap: 11px; align-items: baseline; }
.rank-row:last-child { border-bottom: 0; }
.rank-row .n { font-family: var(--mono); font-weight: 700; color: var(--blue-light); }
.rank-row .t { flex: 1; min-width: 0; }
.rank-row .t div:first-child { color: var(--ui-text); font-weight: 600; }
.rank-row .t div:last-child { color: var(--muted); font-style: italic; font-size: 11.5px; }

/* search */
.ask { padding: 11px 16px; border-bottom: 1px solid var(--ui-line); font-family: var(--mono); font-size: 12.5px; color: var(--ui-text-2); }
.answer { padding: 14px 16px; }
.answer p { font-size: 12.5px; line-height: 1.6; color: var(--ui-text-3); }
.answer b { color: var(--ui-text); }
.sources { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.sources span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--blue-light);
  border: 1px solid rgba(144, 205, 244, 0.3);
  border-radius: 3px;
  padding: 2px 6px;
}

/* people */
.mock-person { padding: 16px 18px; }
.person-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.person-name strong { font-size: 19px; font-weight: 700; color: var(--ui-text); }
.tier { font-size: 10px; font-weight: 600; background: rgba(255, 255, 255, 0.1); color: var(--faint); padding: 2px 6px; border-radius: 3px; }
.person-id { font-family: var(--mono); font-size: 10px; color: var(--text-2); }
.person-email { font-family: var(--mono); font-size: 11.5px; color: var(--ui-text-4); margin-top: 2px; }
.person-summary { font-size: 12.5px; line-height: 1.55; color: var(--ui-text-3); margin-top: 10px; }
.person-summary .link { color: var(--blue-mid); }
.stats { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ui-line); }
.stats .ui-label { font-size: 10px; }
.stats .v { font-family: var(--mono); font-size: 16px; color: var(--ui-text); margin-top: 2px; }

/* calendar */
.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--ui-line); }
.cal-range { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.cal-range span { color: var(--blue-light); }
.seg { display: flex; font-size: 10.5px; color: var(--muted); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 4px; overflow: hidden; white-space: nowrap; }
.seg span { padding: 2px 7px; }
.seg .on { background: rgba(66, 153, 225, 0.25); color: var(--blue-light); }
.cal-grid { display: grid; grid-template-columns: 36px 1fr 1fr 1fr; font-size: 11px; }
.hours { padding: 8px 5px; color: var(--text-2); font-family: var(--mono); border-right: 1px solid var(--ui-line-soft); display: flex; flex-direction: column; gap: 28px; text-align: right; }
.day { padding: 5px; border-right: 1px solid var(--ui-line-soft); min-width: 0; }
.day:last-child { border-right: 0; }
.day-name { font-size: 10.5px; font-weight: 600; color: var(--muted); padding: 2px 4px; }
.ev { border-left: 2px solid var(--select); background: rgba(148, 163, 184, 0.14); color: var(--ui-text-2); padding: 4px 7px; margin: 2px 0; border-radius: 2px; overflow: hidden; }
.ev.now { background: rgba(66, 153, 225, 0.28); color: var(--ui-text); }
.ev small { display: block; color: var(--muted); font-size: 10px; }

/* ---------- privacy strip ---------- */

.privacy { background: var(--page-dark); color: var(--ui-text); }
.privacy .inner {
  max-width: var(--max-outer);
  margin: 0 auto;
  padding: 80px var(--gutter);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 56px;
  align-items: center;
}
.privacy .body { color: var(--faint); }
.ledger { font-family: var(--mono); font-size: 13px; line-height: 2.2; color: var(--faint); }
.ledger div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.ledger div:last-child { border-bottom: 0; }
.ledger .ok { color: var(--green-light); }
.ledger .v { text-align: right; }

/* ---------- team ---------- */

.team { border-top: 0; }
.roster { border: 1px solid var(--hairline); border-radius: 8px; padding: 18px 20px; background: var(--card); }
.roster .ui-label { margin-bottom: 10px; font-size: 12px; }
.member { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--hairline); font-size: 14px; }
.member:last-child { border-bottom: 0; }
.member > span:first-child { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badge { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 3px; background: #ebf8ff; color: var(--blue); }
.badge.principal { background: #edf2f7; color: var(--muted); }
.member .scope { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-align: right; }

/* ---------- footer ---------- */

.footer { border-top: 1px solid var(--hairline); padding: 88px var(--gutter); text-align: center; }
.footer img { width: 44px; height: 44px; margin-bottom: 18px; }
.footer .h2 { font-size: 34px; }
.footer .sub { font-size: 16px; color: var(--muted); margin-top: 8px; }
.footer .cta { margin-top: 28px; }
.legal { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-top: 32px; }

/* ---------- onboarding pages (/i/<code>) ---------- */

.onboard { max-width: 720px; margin: 0 auto; padding: 72px var(--gutter) 96px; }
.onboard h1 { font-size: 44px; line-height: 1.08; font-weight: 700; letter-spacing: -0.02em; }
.onboard .lede { font-size: 17px; line-height: 1.6; color: var(--text-2); margin-top: 16px; }
.steps { list-style: none; padding: 0; margin: 48px 0 0; counter-reset: step; }
.step { position: relative; padding: 0 0 36px 48px; counter-increment: step; }
.step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--hairline);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  display: grid;
  place-items: center;
}
.step::after { content: ""; position: absolute; left: 13.5px; top: 34px; bottom: 6px; width: 1px; background: var(--hairline); }
.step:last-child::after { display: none; }
.step h2 { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.step p { font-size: 15px; line-height: 1.6; color: var(--text-2); margin-top: 8px; }
.step p + p { margin-top: 10px; }
.step code { font-family: var(--mono); font-size: 13px; background: var(--card); padding: 1px 5px; border-radius: 4px; }
.download {
  margin-top: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 18px;
  padding: 16px 18px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--card);
}
.download img { width: 40px; height: 40px; }
.download .what { flex: 1; min-width: 180px; }
.download .what strong { display: block; font-size: 15px; }
.download .what span { display: block; font-family: var(--mono); font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.step .checksum { font-family: var(--mono); font-size: 11px; line-height: 1.5; color: var(--faint); margin-top: 10px; word-break: break-all; }
.note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 6px;
  background: #fffaf0;
  box-shadow: inset 0 0 0 1px #feebc8;
  font-size: 14px;
  line-height: 1.55;
  color: #744210;
}
.unavailable { color: var(--muted); font-size: 14px; }

/* ---------- 404 ---------- */

.lost { max-width: 640px; margin: 0 auto; padding: 120px var(--gutter); }
.lost h1 { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; }
.lost p { font-size: 17px; line-height: 1.6; color: var(--text-2); margin-top: 14px; }

/* ---------- small screens ---------- */

@media (max-width: 900px) {
  :root { --gutter: 20px; }
  .nav { padding: 12px var(--gutter); }
  .nav-links a:not(.btn) { display: none; }
  .hero { padding-top: 56px; }
  .hero h1 { font-size: 40px; }
  .hero .lede { font-size: 17px; }
  .shot { padding-bottom: 56px; }
  .rail, .brief { display: none; }
  .list { width: 100%; border-right: 0; }
  .app { min-height: 0; }
  .feature, .privacy .inner { grid-template-columns: 1fr; gap: 28px; padding-top: 56px; padding-bottom: 56px; }
  .feature .text { order: -1; }
  .h2 { font-size: 27px; }
  .footer { padding: 64px var(--gutter); }
  .footer .h2 { font-size: 28px; }
  .onboard { padding-top: 48px; }
  .onboard h1 { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
