/* Mail~ website. Colours come from the app: the Tide icon (docs/design/icon,
   TideMark.swift) and ReaderPalette (EmailCore). System fonts only. */

:root {
  color-scheme: light dark;
  --tide-sky: #6FB1FF;
  --tide-sea: #1F5FD6;
  --quote-bar: #2E6CF2;

  --bg: #FFFFFF;
  --bg-grouped: #F2F2F7;   /* iOS systemGroupedBackground */
  --card: #FFFFFF;
  --text: #000000;
  --text-2: #575757;       /* primary at 0.66 over white, ReaderPalette.secondaryTextOpacity */
  --hairline: #D8D8DE;
  --link: #1F5FD6;         /* Tide sea: 5.9:1 on white */
  --badge-bg: #000000;
  --badge-text: #FFFFFF;
  --shadow: 0 1px 2px rgb(0 0 0 / 6%), 0 8px 28px rgb(0 0 0 / 8%);

  --radius: 14px;
  --gutter: 16px;
  --measure: 40rem;
  --wide: 68rem;
  --font: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-grouped: #000000;
    --card: #1C1C1E;        /* iOS secondarySystemBackground, dark */
    --text: #FFFFFF;
    --text-2: #A8A8A8;      /* white at 0.66 over black */
    --hairline: #38383A;
    --link: #6FB1FF;        /* Tide sky: 9.6:1 on black */
    --badge-bg: #FFFFFF;
    --badge-text: #000000;
    --shadow: 0 0 0 1px #2C2C2E;
  }
}

@media (min-width: 40rem) { :root { --gutter: 24px; } }

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  min-height: 100vh; display: flex; flex-direction: column;
}
body > main { flex: 1 0 auto; }

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

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--quote-bar); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 6vw + 0.5rem, 3.25rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.375rem, 2vw + 0.75rem, 1.75rem); font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 600; }
p, ul, ol { margin: 0 0 1em; }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 2;
}
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: var(--measure); }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--hairline); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 56px; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.1875rem;
}
.brand img { width: 32px; height: 32px; }
.tilde { color: var(--link); }
.site-nav { display: flex; gap: 20px; }
.site-nav a { color: var(--text-2); text-decoration: none; font-size: 0.9375rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }

.site-footer {
  border-top: 1px solid var(--hairline); margin-top: 72px; padding: 28px 0 40px;
  color: var(--text-2); font-size: 0.875rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.site-footer nav { display: flex; gap: 20px; }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.site-footer p { margin: 0; }

/* Landing page */
.hero { text-align: center; padding: 56px 0 32px; }
.hero-icon { width: 112px; height: 112px; margin: 0 auto 24px; filter: drop-shadow(0 6px 18px rgb(31 95 214 / 28%)); }
.hero h1 { margin-bottom: 0.15em; }
.subtitle { font-size: clamp(1.25rem, 2vw + 0.8rem, 1.625rem); color: var(--text-2); font-weight: 500; margin-bottom: 1.25em; }
.lead { font-size: 1.1875rem; max-width: 34rem; margin: 0 auto 0.75em; }
.platforms { color: var(--text-2); max-width: 34rem; margin: 0 auto 1.75em; }

.badge {
  display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center;
  min-width: 168px; height: 54px; padding: 0 20px; border-radius: 12px;
  background: var(--badge-bg); color: var(--badge-text); text-decoration: none; line-height: 1.1;
}
.badge small { font-size: 0.6875rem; letter-spacing: 0.02em; }
.badge span { font-size: 1.3125rem; font-weight: 600; letter-spacing: -0.01em; }
.badge:hover { opacity: 0.88; }
.badge-note { display: block; margin-top: 10px; font-size: 0.875rem; color: var(--text-2); }

.shots { padding: 32px 0 8px; }
.shots-phones {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
  max-width: 560px; margin: 0 auto;
}
.shots-wide { display: grid; gap: 24px; margin-top: 32px; }
@media (min-width: 60rem) {
  .shots-layout { display: grid; grid-template-columns: 5fr 7fr; gap: 40px; align-items: center; }
  .shots-phones { max-width: none; }
  .shots-wide { margin-top: 0; }
}
figure { margin: 0; }
figcaption { margin-top: 10px; font-size: 0.875rem; color: var(--text-2); text-align: center; }
.phone img {
  border-radius: 11% / 5.1%;           /* the device's screen corners */
  box-shadow: var(--shadow);
  background: var(--card);
}
.window img { border-radius: 10px; box-shadow: var(--shadow); }
.vision img { border-radius: 12px; }

.features { padding-top: 56px; }
.features > .wrap > h2 { text-align: center; margin-bottom: 28px; }
.feature-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
/* Five cards: two columns with the last one full width, then two over three. */
@media (min-width: 36rem) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-grid li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 60rem) {
  .feature-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .feature-grid li, .feature-grid li:last-child:nth-child(odd) { grid-column: span 2; }
  .feature-grid li:nth-child(-n+2) { grid-column: span 3; }
}
.feature-grid li {
  background: var(--bg-grouped); border-radius: var(--radius); padding: 22px 22px 6px;
}
@media (prefers-color-scheme: dark) { .feature-grid li { background: var(--card); } }
.feature-grid h3 { margin-bottom: 0.4em; }
.feature-grid p { color: var(--text-2); font-size: 1rem; }

.facts { padding-top: 56px; }
.facts-box {
  border: 1px solid var(--hairline); border-radius: var(--radius); padding: 24px 22px 8px;
  max-width: 48rem; margin: 0 auto;
}
.facts-box h2 { font-size: 1.25rem; }
.facts-box ul { padding-left: 1.2em; }
.facts-box li { margin-bottom: 0.35em; }

/* Text pages: privacy and support */
.page { padding-top: 48px; }
.page h1 { font-size: clamp(2rem, 4vw + 0.75rem, 2.75rem); }
.page h2 { margin-top: 1.75em; }
.meta { color: var(--text-2); font-size: 0.9375rem; margin-bottom: 2em; }
.page li { margin-bottom: 0.35em; }
.contact {
  background: var(--bg-grouped); border-radius: var(--radius); padding: 20px 22px 4px; margin: 8px 0 8px;
}
@media (prefers-color-scheme: dark) { .contact { background: var(--card); } }
.contact .address { font-size: 1.25rem; font-weight: 600; }
.faq h2 { font-size: 1.25rem; }
.note { color: var(--text-2); font-size: 0.9375rem; }

/* 404 */
.notfound { text-align: center; padding: 80px 0 24px; }
.notfound img { width: 80px; height: 80px; margin: 0 auto 24px; }
.notfound ul { list-style: none; padding: 0; display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; }

.contact h2 { margin-top: 0; }

.soon { display: inline-block; margin: 0; padding: 10px 18px; border-radius: 999px; border: 1px solid currentColor; color: var(--text-2); font-size: 1rem; }
