/* ──────────────────────────────────────────────────────────────────
   Pretty Inbox — landing page

   Typography
   ----------
   Headlines and the large statistics are set in Source Serif 4
   (self-hosted, SIL OFL). Chosen because it is a text serif with
   genuine *tabular lining figures* — the stats band is the hero of
   this page, and tabular numerals keep "1,906 / 11,551 / 2.1 GB"
   sitting on a shared rhythm instead of wobbling like proportional
   figures would. It reads bookish and calm, which matches the tone:
   a precise instrument, not a launch announcement.

   Everything UI-adjacent (body copy, labels, the app mock, buttons)
   uses the system stack. The app itself is a native Mac app, so its
   surroundings on this page should feel native too.

   Color
   -----
   Near-monochrome on warm paper. One accent: a deep bottle green,
   used only for the download button, links, and active states.
   ────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f6f4ef;
  --paper-raised: #fdfcf9;
  --ink: #1c1b17;
  --ink-soft: #55524a;
  --ink-faint: #8b8779;
  --rule: #d9d5c9;
  --rule-soft: #e6e3d9;
  --green: #1e5c3c;
  --green-deep: #164930;
  --green-wash: #eaefe8;

  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --rail: 11.5rem;
  --pad: 2.25rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--green-wash); }

/* ── Ledger frame ─────────────────────────────────────────────── */

.ledger {
  max-width: 68rem;
  margin: 0 auto;
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}

.row {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  border-bottom: 1px solid var(--rule);
}

.rail {
  border-right: 1px solid var(--rule);
  padding: var(--pad) 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}

.cell {
  padding: var(--pad);
  max-width: 38rem;   /* measure stays readable; deliberately not centered */
  min-width: 0;
}

/* rail typography — small caps-ish labels, quiet */
.rail-index {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.rail-label,
.rail-note {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ── Hero ─────────────────────────────────────────────────────── */

.hero {
  border-bottom: 1px solid var(--rule);
  padding: 3.5rem var(--pad) 4.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 2.4rem;
}

.brand-icon { border-radius: 10px; }

.brand-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1;
}

h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 8.2vw, 4.1rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.2rem;
  text-wrap: balance;
}
.h1-accent { color: var(--green); }

.lede {
  font-size: 1.1875rem;
  color: var(--ink-soft);
  margin-bottom: 1.9rem;
  max-width: 34rem;
}

.cta {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.button {
  display: inline-block;
  background: var(--green);
  color: var(--paper-raised);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.8rem 1.6rem;
  border-radius: 7px;
}
.button:hover { background: var(--green-deep); }
.button:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

.cta-note { font-size: 0.875rem; color: var(--ink-faint); }

/* ── Stats band ───────────────────────────────────────────────── */

.band {
  border-bottom: 1px solid var(--rule);
  padding: 3.25rem var(--pad) var(--pad);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  column-gap: clamp(2.5rem, 8vw, 6.5rem);
}

.stat dd {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
}
.stat .unit { font-size: 0.45em; font-weight: 400; color: var(--ink-soft); }
.stat dt {
  margin-top: 0.55rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.band-caption {
  margin-top: 1.6rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
  font-style: italic;
  font-family: var(--serif);
}

/* ── App window mock ──────────────────────────────────────────── */

.appwindow {
  width: 100%;
  max-width: 55rem;
  margin: 3.5rem auto 0;
  background: var(--paper-raised);
  border: 1px solid rgba(28, 27, 23, 0.12);
  border-radius: 12px;
  box-shadow:
    0 1px 1px rgba(28, 27, 23, 0.06),
    0 8px 20px -8px rgba(22, 73, 48, 0.18),
    0 44px 88px -32px rgba(22, 73, 48, 0.35);
  overflow: hidden;
  font-size: 0.9375rem;
  text-align: left;
}

.titlebar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 3.1rem;
  padding: 0 0.9rem;
  border-bottom: 1px solid rgba(28, 27, 23, 0.12);
  background: linear-gradient(#eeebe2, #e7e3d9);
}
.lights { display: flex; gap: 8px; justify-self: start; }
.lights i {
  width: 12px; height: 12px; border-radius: 50%;
  display: block;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.16);
}
.lights i:nth-child(1) { background: #ff5f57; }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }
.titlebar-title {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  white-space: nowrap;
}
.account-picker {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(28, 27, 23, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.75);
  padding: 0.3rem 0.7rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.chev { color: var(--ink-faint); font-size: 0.7em; }

.summarybar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.875rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.summarybar-sort { color: var(--ink-faint); opacity: 0.75; }

.senderlist { list-style: none; }

.sender {
  display: grid;
  grid-template-columns: 1.7rem 1fr 4.5rem 5rem;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.sender-count, .sender-size { text-align: right; color: var(--ink-soft); }
.sender-count { font-weight: 600; color: var(--ink); }
.sender--fade { opacity: 0.45; }

.sender.is-selected { background: #e4ede4; }

.check {
  width: 20px; height: 20px;
  border: 1.5px solid #d2cdbe;
  border-radius: 6px;
  background: var(--paper-raised);
}
.check--on {
  background: var(--green);
  border-color: var(--green);
  position: relative;
}
.check--on::after {
  content: "";
  position: absolute;
  left: 5.5px; top: 1.5px;
  width: 5px; height: 10px;
  border: solid var(--paper-raised);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.actionbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  padding: 0.9rem 1.25rem;
  background: #f2efe6;
  border-top: 1px solid var(--rule-soft);
}
.actionbar-note { color: var(--ink-soft); font-size: 0.9375rem; }
.actionbar-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.actionbar-button {
  background: var(--green);
  color: var(--paper-raised);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.actionbar-button--ghost {
  background: var(--paper-raised);
  color: var(--ink);
  font-weight: 500;
  border: 1px solid #dcd7c8;
  padding: calc(0.6rem - 1px) 1.1rem;
}

/* ── Content sections ─────────────────────────────────────────── */

h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1.2;
  margin-bottom: 0.9rem;
}

.cell p + p { margin-top: 0.9rem; }
.cell p { color: var(--ink-soft); }

/* ── FAQ ──────────────────────────────────────────────────────── */

.cell--faq { padding-top: 1.4rem; padding-bottom: 1.4rem; }

details { border-bottom: 1px solid var(--rule-soft); }
details:last-child { border-bottom: none; }

summary {
  cursor: pointer;
  padding: 0.9rem 0;
  font-weight: 600;
  font-size: 1rem;
  list-style: none;
  position: relative;
  padding-right: 2rem;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--ink-faint);
}
details[open] summary::after { content: "−"; color: var(--green); }
details[open] summary { color: var(--green); }

details p {
  padding-bottom: 1rem;
  color: var(--ink-soft);
  max-width: 34rem;
}

/* ── Footer ───────────────────────────────────────────────────── */

.row--footer { border-bottom: none; }
.row--footer .rail, .cell--footer { padding-top: 1.5rem; padding-bottom: 1.5rem; }

.footer-icon { border-radius: 5px; opacity: 0.75; }

.cell--footer nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.cell--footer a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}
.cell--footer a:hover { color: var(--green); border-bottom-color: var(--green); }

.footer-note {
  margin-top: 0.8rem;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

/* ── Small screens: rail folds above content ──────────────────── */

@media (max-width: 44rem) {
  :root { --pad: 1.4rem; }

  .ledger { border-left: none; border-right: none; }

  .row { grid-template-columns: 1fr; }

  .rail {
    border-right: none;
    border-bottom: 1px solid var(--rule-soft);
    flex-direction: row;
    align-items: baseline;
    gap: 0.7rem;
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
  }
  .rail-index { font-size: 1.1rem; }

  .hero { padding-top: 2.5rem; padding-bottom: 3rem; }
  .hero-brand { margin-bottom: 1.8rem; }
  .brand-icon { width: 34px; height: 34px; }
  .brand-name { font-size: 1.05rem; }
  .hero .lede { font-size: 1.0625rem; }
  .appwindow { margin-top: 2.5rem; }

  .stats { grid-template-columns: 1fr; row-gap: 1.4rem; }

  .appwindow { font-size: 0.875rem; }
  .sender { grid-template-columns: 1.5rem 1fr 3.6rem; padding: 0.75rem 1rem; gap: 0.6rem; }
  .summarybar-sort { display: none; }
  .titlebar { grid-template-columns: auto 1fr; }
  .titlebar-title { display: none; }
  .actionbar { justify-content: center; }
  .actionbar-buttons { justify-content: center; width: 100%; }
  .sender-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sender-size { display: none; }
  .account-picker { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
