/*
 * getmailroom.app — one stylesheet for both pages.
 *
 * The faces are the application's own, copied from `apps/desktop/src/renderer/fonts` and served
 * from this host: Geist for the interface, Newsreader for display. Self-hosted rather than
 * loaded from a font CDN, because a page whose argument is that your mail never leaves your
 * computer should not open a connection to Google to draw its own headline. `fonts/LICENSE.md`
 * carries the SIL Open Font Licence both arrive under.
 *
 * The palette is the application's accent (#2f5fd0) against a cool paper and a near-black with a
 * blue bias, so the site and the product are visibly the same object. Both themes are defined at
 * token level: the bare :root is light, and the dark values are repeated under the media query
 * and under [data-theme="dark"] so a stamped choice wins either way.
 */

/* ------------------------------------------------------------------ faces */

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/geist-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/geist-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/geist-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/newsreader-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ----------------------------------------------------------------- tokens */

:root {
  color-scheme: light dark;

  --ink: #0f1319;
  --ink-2: #39414d;
  --ink-3: #697283;
  --paper: #f4f6f9;
  --surface: #ffffff;
  --sunken: #eceff4;
  --line: #dce1e9;
  --line-soft: #e8ecf2;

  --blue: #2f5fd0;
  --blue-deep: #1c3f96;
  --blue-wash: #eaf0ff;

  --night: #0c1016;
  --night-2: #141b25;
  --night-line: #232c39;
  --night-ink: #e6eaf1;
  --night-ink-2: #a3aebf;
  --blue-lit: #86a9ff;

  --measure: 34rem;
  --wide: 70rem;
  --narrow: 48rem;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;

  --shadow: 0 1px 2px rgb(15 19 25 / 6%), 0 12px 32px -12px rgb(15 19 25 / 18%);
  --shadow-lift: 0 2px 4px rgb(5 8 14 / 24%), 0 40px 80px -28px rgb(5 8 14 / 58%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ink: #e7eaf0;
    --ink-2: #aeb7c4;
    --ink-3: #828c9c;
    --paper: #0c1016;
    --surface: #141a23;
    --sunken: #11161e;
    --line: #242d3a;
    --line-soft: #1c232e;
    --blue: #86a9ff;
    --blue-deep: #a8c2ff;
    --blue-wash: #16203a;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 12px 32px -12px rgb(0 0 0 / 60%);
  }
}

:root[data-theme='dark'] {
  --ink: #e7eaf0;
  --ink-2: #aeb7c4;
  --ink-3: #828c9c;
  --paper: #0c1016;
  --surface: #141a23;
  --sunken: #11161e;
  --line: #242d3a;
  --line-soft: #1c232e;
  --blue: #86a9ff;
  --blue-deep: #a8c2ff;
  --blue-wash: #16203a;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 12px 32px -12px rgb(0 0 0 / 60%);
}

/* ------------------------------------------------------------------ base */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
  font-feature-settings: 'cv11';
}

h1, h2, h3 {
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.012em;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0; }

a {
  color: var(--blue-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { text-decoration-thickness: 2px; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

code, kbd, .path {
  font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

code, .path {
  background: var(--sunken);
  padding: 0.12em 0.4em;
  border-radius: var(--r-sm);
}

kbd {
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
  padding: 0.1em 0.42em;
  font-size: 0.8em;
  white-space: nowrap;
}

img { display: block; max-width: 100%; height: auto; }

/* --------------------------------------------------------------- scaffold */

.wrap {
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.wrap--narrow { max-width: var(--narrow); }

.band { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
[id] { scroll-margin-top: 4.5rem; }
.band--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.band--surface { background: var(--surface); }
.band--sunken { background: var(--sunken); }

.band--night {
  position: relative;
  isolation: isolate;
  background: var(--night);
  color: var(--night-ink);
}
/* A single soft light behind the picture, so the ground reads as lit rather than flat. */
.band--night::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(60rem 34rem at 62% 18%, rgb(47 95 208 / 20%), transparent 70%);
  pointer-events: none;
}
.band--night h1,
.band--night h2,
.band--night h3 { color: #fff; }
/*
 * `:not(.btn)` is load-bearing. `.band--night a` outranks `.btn--primary` on specificity, so
 * without it the night bands repainted every button's label blue — including the white one on
 * the blue fill, which came out at about 2:1 against its own background.
 */
.band--night a:not(.btn) { color: var(--blue-lit); }

.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.9rem;
}
.band--night .eyebrow { color: var(--blue-lit); }

.lede {
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  color: var(--ink-2);
  max-width: var(--measure);
}
.band--night .lede { color: var(--night-ink-2); }

.stack { display: flex; flex-direction: column; gap: 1.1rem; }
.stack--wide { gap: 1.8rem; }

/* --------------------------------------------------------------- masthead */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--night) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--night-line);
}
.masthead .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-block: 0.85rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 1.0625rem;
}
.wordmark img { width: 26px; height: 26px; border-radius: 6px; }
.wordmark small {
  display: block;
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--night-ink-2);
  line-height: 1.2;
}

.navlinks {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: 0.9375rem;
}
.navlinks a {
  color: var(--night-ink-2);
  text-decoration: none;
}
.navlinks a:hover { color: #fff; text-decoration: underline; }

@media (max-width: 46rem) {
  .navlinks { gap: 1rem; font-size: 0.875rem; }
  .navlinks .nav-hide { display: none; }
}

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

.btnrow { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.3rem;
  border-radius: var(--r);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 550;
  font-size: 0.9375rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: #3a6ae0; }

.btn--ghost {
  background: transparent;
  border-color: var(--night-line);
  color: var(--night-ink);
}
.btn--ghost:hover { border-color: #3a4756; background: #141b25; }

.btn[aria-disabled='true'] {
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
}

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

.hero { padding-top: clamp(3rem, 7vw, 5.5rem); padding-bottom: 0; }

.hero h1 {
  font-size: clamp(2.4rem, 6.6vw, 4.9rem);
  max-width: 19ch;
}
.hero h1 em {
  font-style: normal;
  color: var(--blue-lit);
  display: block;
}

.hero .lede { font-size: clamp(1.0625rem, 1.9vw, 1.3125rem); margin-top: 1.4rem; }

.hero-note {
  margin-top: 1.1rem;
  font-size: 0.875rem;
  color: var(--night-ink-2);
}

.ticks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
  margin-top: 2rem;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  color: var(--night-ink-2);
}
.ticks li { display: flex; align-items: center; gap: 0.5rem; }
.ticks svg { flex: none; color: var(--blue-lit); }

/* ------------------------------------------------------- the window frame */

.shot {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.shot--lift {
  border-color: #27313f;
  box-shadow: var(--shadow-lift);
}

.shot__bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.85rem;
  height: 34px;
  background: var(--sunken);
  border-bottom: 1px solid var(--line);
}
.shot--lift .shot__bar { background: #1b222c; border-bottom-color: #27313f; }

.shot__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.shot--lift .shot__dot { background: #39434f; }

.shot__title {
  margin-left: 0.6rem;
  font-size: 0.75rem;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.shot--lift .shot__title { color: #8a95a5; }

.shot img { width: 100%; }

figure { margin: 0; }

figcaption {
  margin-top: 0.85rem;
  font-size: 0.8125rem;
  color: var(--ink-3);
  max-width: 52ch;
}
.band--night figcaption { color: #7f8b9c; }

/* The hero's picture crosses the band boundary into the section below it. */
.hero-figure {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: clamp(-7rem, -9vw, -4rem);
}

.after-hero { padding-top: clamp(8.5rem, 14vw, 11rem); }

/* ------------------------------------------------------------- feature row */

.feature {
  display: grid;
  gap: clamp(1.8rem, 4vw, 3.5rem);
  align-items: center;
}
@media (min-width: 60rem) {
  .feature { grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); }
  .feature--flip > figure { order: -1; }
}

.feature + .feature { margin-top: clamp(3rem, 7vw, 5.5rem); }

.feature h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }

.pointlist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.pointlist li { display: flex; gap: 0.6rem; }
.pointlist li::before {
  content: '';
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
  margin-top: 0.62em;
}

/* ---------------------------------------------------------------- gallery */

.gallery {
  display: grid;
  gap: 1.6rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

.gallery figcaption strong {
  display: block;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

/* ------------------------------------------------------------------ cards */

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.3rem;
}
.band--night .card {
  background: var(--night-2);
  border-color: var(--night-line);
}

.card h3 {
  font-family: 'Geist', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0;
  margin-bottom: 0.45rem;
}
.card p { font-size: 0.9375rem; color: var(--ink-2); }
.band--night .card p { color: var(--night-ink-2); }

/* ------------------------------------------------------------------ table */

.tablewrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  text-align: left;
}
th, td {
  padding: 0.7rem 0.9rem 0.7rem 0;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
th {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  white-space: nowrap;
}
td:first-child { white-space: nowrap; padding-right: 1.6rem; }
tbody tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------------------------ prose */

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1rem; }
.prose h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-top: 2.6rem; }
.prose h3 {
  font-family: 'Geist', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  margin-top: 1.9rem;
}
.prose ul, .prose ol { padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; }
.prose li { color: var(--ink-2); }
.prose p { color: var(--ink-2); }
.prose > h2 + p, .prose > h3 + p { margin-top: 0.6rem; }

.callout {
  border-left: 3px solid var(--blue);
  background: var(--blue-wash);
  padding: 1rem 1.2rem;
  border-radius: 0 var(--r) var(--r) 0;
  font-size: 0.9375rem;
}

.draft {
  border: 1px solid #c58b1a;
  background: #fff7e6;
  color: #5c4208;
  padding: 1rem 1.2rem;
  border-radius: var(--r);
  font-size: 0.9375rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .draft { background: #2a2109; color: #f0d79a; border-color: #6d4f10; }
}

.placeholder {
  font-family: 'Geist Mono', monospace;
  font-size: 0.8125rem;
  background: var(--blue-wash);
  border: 1px dashed var(--blue);
  color: var(--blue-deep);
  padding: 0.3em 0.6em;
  border-radius: var(--r-sm);
  display: inline-block;
}

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

.footer {
  background: var(--night);
  color: var(--night-ink-2);
  padding-block: 3rem;
  font-size: 0.9375rem;
}
.footer a { color: var(--night-ink); }
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem 2.5rem;
  align-items: baseline;
}
.footer-fine {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--night-line);
  font-size: 0.8125rem;
  max-width: 62ch;
  color: #7f8b9c;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 50;
  background: var(--surface);
  color: var(--ink);
  padding: 0.6rem 1rem;
  border-radius: var(--r-sm);
}
