/* DayLoft website. Light only, system fonts, colors from the app's Daylight tokens (DLColor.swift).
   Nothing is loaded from anywhere else. Every product view is rebuilt from the app's own sizes. */

:root {
  color-scheme: light;
  --page: #FFFFFF;      /* surfaceElevated */
  --surface: #F8F9FC;   /* surface */
  --sunken: #EFF1F6;    /* surfaceSunken */
  --ink: #1B1E2B;       /* content */
  --muted: #69707F;     /* contentSecondary */
  --line: #E7E9F0;      /* hairline */
  --grid: #EBEDF3;      /* grid */
  --weekend: #F1F3F9;   /* weekendTint */
  --accent: #3A66F0;    /* accent */
  --deep: #0F7E9E;      /* accentDeep */
  --warm: #F08C00;      /* mailUnread */
  --approve: #3F9142;   /* mailApprove */
  --now: #E8483D;       /* now */

  --sans: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
button { font: inherit; color: inherit; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

::selection { background: rgba(58, 102, 240, 0.16); }

.wrap { width: 100%; max-width: 1024px; margin: 0 auto; padding: 0 32px; }

/* ---------- Header: sticky, frosted ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.top { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { display: block; width: 28px; height: 28px; border-radius: 6.5px; }
.brand span { font: 700 19px/1 var(--rounded); letter-spacing: -0.01em; }

.topnav { display: flex; gap: 24px; }
.navlink { display: inline-flex; align-items: center; min-height: 44px; font: 600 15px/1.3 var(--sans); color: var(--muted); }
.navlink:hover { color: var(--ink); text-decoration: none; }
/* The language switch: a quiet pill, tinted only when the browser asks for that language. */
.lang-switch span { display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; font: 600 12px/1 var(--sans); letter-spacing: 0.06em; transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease; }
.lang-switch:hover span { border-color: #C9CEDA; }
.lang-switch.suggest span { color: var(--accent); border-color: rgba(58, 102, 240, 0.35); background: rgba(58, 102, 240, 0.06); }

/* ---------- Type ---------- */

.kicker { font: 500 15px/1.4 var(--sans); color: var(--muted); }

h1 { font: 700 64px/1.04 var(--sans); letter-spacing: -0.04em; text-wrap: balance; }
h2 { font: 650 28px/1.25 var(--sans); letter-spacing: -0.02em; text-wrap: balance; }
h3 { font: 600 21px/1.3 var(--sans); letter-spacing: -0.01em; text-wrap: balance; }
p { text-wrap: pretty; }

.lead { font-size: 20px; line-height: 1.55; color: var(--muted); }

.grad {
  background: linear-gradient(100deg, var(--accent) 15%, var(--deep) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow { margin-bottom: 12px; font: 600 14px/1.4 var(--sans); color: var(--accent); }
h2.big { max-width: 780px; margin: 0 auto; font-size: 44px; line-height: 1.12; letter-spacing: -0.032em; font-weight: 700; }

.key {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 5px;
  font: 700 11px/1.5 var(--rounded);
  color: var(--muted);
  text-align: center;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: 4px;
  vertical-align: 0.15em;
}

.link { padding: 0; border: 0; background: none; font: 600 13px/1.4 var(--sans); color: var(--accent); cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Tooltip (a small white bubble, like the app's in-app tooltips) ---------- */

.tip { position: relative; }
.tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 5;
  transform: translate(-50%, 4px);
  white-space: nowrap;
  padding: 7px 11px;
  font: 500 13px/1.3 var(--sans);
  color: var(--ink);
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(27, 30, 43, 0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.tip:hover::after, .tip:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.tip:focus-visible { outline-offset: 4px; }

/* ---------- Hero ---------- */

.hero { padding-top: 64px; }
.hero-text { text-align: center; }
.hero-text > * { margin-left: auto; margin-right: auto; }
.badge { margin-bottom: 22px; }
.hero h1 { max-width: 820px; }
.hero .lead { max-width: 620px; margin-top: 24px; }
.platforms { margin-top: 14px; font: 500 14px/1.4 var(--sans); color: var(--muted); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  font: 500 14px/1.4 var(--sans);
  color: var(--ink);
  background: var(--sunken);
  border-radius: 999px;
  cursor: help;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warm); animation: breathe 3.2s ease-in-out infinite; }

.js .hero-text > * { animation: rise 0.9s var(--ease) both; }
.js .hero-text > :nth-child(2) { animation-delay: 0.08s; }
.js .hero-text > :nth-child(3) { animation-delay: 0.16s; }
.js .hero-text > :nth-child(4) { animation-delay: 0.22s; }
.js .window-wrap { animation: rise 1.1s 0.25s var(--ease) both; }

/* ---------- The app window (hero) ---------- */

.window-wrap { position: relative; max-width: 1184px; margin: 56px auto 0; padding: 0 32px; perspective: 2200px; }

.glow {
  position: absolute;
  left: 4%;
  right: 4%;
  top: -60px;
  height: 78%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(38% 46% at 28% 42%, rgba(58, 102, 240, 0.20), transparent 70%),
    radial-gradient(30% 40% at 74% 30%, rgba(240, 140, 0, 0.13), transparent 70%),
    radial-gradient(40% 50% at 58% 72%, rgba(15, 126, 158, 0.13), transparent 70%);
  filter: blur(24px);
  animation: drift 20s ease-in-out infinite alternate;
}

.window {
  --p: 1;
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(27, 30, 43, 0.04),
    0 24px 60px -16px rgba(27, 30, 43, 0.16),
    0 70px 120px -50px rgba(58, 102, 240, 0.22);
  overflow: hidden;
  transform-origin: 50% 0;
  transform: rotateX(calc((1 - var(--p)) * 16deg)) scale(calc(0.93 + var(--p) * 0.07));
}

.win-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 56px; padding: 0 18px; }
.lights { display: flex; gap: 8px; }
.lights i { display: block; width: 12px; height: 12px; border-radius: 50%; background: #E1E4EB; }

/* ModeSwitcher: envelope · calendar, the active one circled by pen, then the wordmark. */
.switcher { display: flex; align-items: center; gap: 6px; padding: 7px 14px; }
.mode-btn { position: relative; display: block; width: 26px; height: 26px; padding: 0; border: 0; background: none; color: rgba(27, 30, 43, 0.4); cursor: pointer; transition: color 0.15s ease, transform 0.15s ease; }
.mode-btn:hover { color: rgba(27, 30, 43, 0.7); transform: scale(1.08); }
.mode-btn[aria-pressed="true"] { color: var(--accent); transform: none; }
.mode-btn .glyph { display: block; width: 18px; height: 18px; margin: 4px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mring { position: absolute; left: 50%; top: 50%; width: 31px; height: 28px; margin: -14px 0 0 -15.5px; overflow: visible; transform: rotate(-7deg); fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.mring path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.5s var(--ease); }
.mode-btn[aria-pressed="true"] .mring path { stroke-dashoffset: 0; }
.mode-btn:focus-visible { outline-offset: 5px; }
.sdot { width: 3px; height: 3px; border-radius: 50%; background: rgba(27, 30, 43, 0.22); }
.wordmark { margin-left: 6px; font: 800 16px/1 var(--rounded); }
.chev-down { width: 11px; height: 8px; margin-left: 4px; fill: none; stroke: rgba(27, 30, 43, 0.5); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.bar-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.window[data-mode="mail"] .for-cal, .window[data-mode="calendar"] .for-mail { display: none; }

.compose {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font: 600 14px/1.2 var(--rounded);
  color: #FFFFFF;
  background: var(--accent);
  border-radius: 999px;
  white-space: nowrap;
}
.compose svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.toggle { display: inline-flex; gap: 2px; padding: 3px; background: var(--sunken); border: 1px solid var(--line); border-radius: 999px; }
.toggle span { padding: 4px 12px; font: 600 13px/1.2 var(--rounded); color: var(--muted); border-radius: 999px; }
.toggle .on { color: var(--ink); background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--line); }
.navbtns { display: inline-flex; gap: 6px; }
.navbtns i { display: grid; place-items: center; width: 28px; height: 28px; font: 600 15px/1 var(--rounded); font-style: normal; color: var(--surface); background: var(--ink); border-radius: 50%; }

.win-body { display: grid; }
.pane { grid-area: 1 / 1; min-width: 0; transition: opacity 0.35s ease, transform 0.35s var(--ease), visibility 0s 0s; }
.window[data-mode="mail"] .pane-cal,
.window[data-mode="calendar"] .pane-mail { opacity: 0; transform: translateY(8px); visibility: hidden; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s 0.25s; }

/* The inbox (MailInboxView / MailInboxRow), column plus margin hint, centered as a group. */

.inbox { display: grid; grid-template-columns: 1fr minmax(0, 580px) 360px 1fr; padding: 10px 0 96px; outline: none; }
.inbox:focus-visible { box-shadow: inset 0 0 0 2px rgba(58, 102, 240, 0.3); }
.ib-col { grid-column: 2; position: relative; min-width: 0; }

.ib-title { padding-left: 16px; font: 800 33px/1.1 var(--rounded); letter-spacing: -0.01em; }

.ib-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  margin-top: 18px;
  padding: 0 16px;
  font: 400 15px/1 var(--sans);
  color: var(--muted);
  background: var(--sunken);
  border-radius: 999px;
}
.ib-search svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

.ib-knock { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 16px; font: 600 14px/1.35 var(--sans); color: var(--accent); }
.ib-knock svg { flex: none; width: 17px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.ib-knock svg .fill { fill: currentColor; stroke: var(--surface); stroke-width: 1.4; }

.chev { width: 7px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0.7; }

.ib-label { margin: 16px 16px 4px; font: 600 13px/1.4 var(--sans); color: var(--muted); }
.ib-label span { margin-left: 6px; font-weight: 500; opacity: 0.7; }
.ib-list { list-style: none; padding: 0; }

.mail { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 8px; cursor: default; transition: opacity 0.15s ease, background-color 0.15s ease; }
.mail:hover { background: rgba(58, 102, 240, 0.06); }
.mail.sel { background: rgba(58, 102, 240, 0.13); }
.mail.leaving { opacity: 0; }
.mail.gone { display: none; }
.mail.arrived { animation: arrive 0.5s var(--ease) both; }

.av { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font: 700 15px/1 var(--rounded); }
.av-coral { color: #E8563F; background: rgba(232, 86, 63, 0.16); }
.av-green { color: #2B9E5E; background: rgba(43, 158, 94, 0.16); }
.av-blue { color: #4263EB; background: rgba(66, 99, 235, 0.16); }
.av-amber { color: #E8890B; background: rgba(232, 137, 11, 0.16); }
.av-magenta { color: #D6336C; background: rgba(214, 51, 108, 0.16); }
.av-teal { color: #0CA678; background: rgba(12, 166, 120, 0.16); }
.av-violet { color: #7048E8; background: rgba(112, 72, 232, 0.16); }

.mtext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.l1 { display: flex; align-items: baseline; gap: 8px; }
.who { flex: 1; min-width: 0; font: 600 17px/1.25 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.when { flex: none; font: 500 13px/1.25 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.l2 { display: block; font: 400 14px/1.35 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv { margin-left: 0.5em; color: rgba(105, 112, 127, 0.6); }

/* MailMarginHint: pale, passive details beside the highlighted mail. */
.hint { position: absolute; top: 2px; left: calc(100% + 40px); width: 320px; display: none; flex-direction: column; pointer-events: none; }
.mail.sel .hint { display: flex; animation: fade 0.25s ease both; }
.h-day { font: 600 34px/1.15 var(--sans); color: rgba(27, 30, 43, 0.2); white-space: nowrap; }
.h-time { margin-top: 2px; font: 500 22px/1.2 var(--sans); color: rgba(27, 30, 43, 0.26); white-space: nowrap; }
.h-cap { margin-top: 16px; margin-bottom: 2px; font: 600 11px/1.4 var(--sans); color: rgba(27, 30, 43, 0.28); }
.h-bul { position: relative; margin-top: 4px; padding-left: 13px; font: 400 14px/1.45 var(--sans); color: rgba(27, 30, 43, 0.35); }
.h-bul::before { content: "\2022"; position: absolute; left: 0; }
.h-event { display: flex; align-items: center; gap: 6px; margin-top: 14px; font: 400 13px/1.4 var(--sans); color: rgba(27, 30, 43, 0.35); }
.h-event svg { flex: none; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }

.ib-seen { display: flex; align-items: center; gap: 6px; margin: 14px 16px 0; font: 600 13px/1.4 var(--sans); color: var(--muted); }
.ib-seen .chev { opacity: 0.55; }

/* MailCaughtUpCard */
.ib-caught { padding: 40px 16px 30px; text-align: center; animation: fade 0.3s ease both; }
.ib-caught[hidden] { display: none; }
.ib-caught .ring { width: 70px; height: 62px; transform: rotate(-7deg); fill: none; stroke: var(--accent); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.ib-caught .check { stroke-width: 2.2; transform: rotate(7deg); transform-origin: 35px 31px; }
.c-title { margin-top: 14px; font: 600 21px/1.3 var(--rounded); }
.c-body { margin-top: 6px; font: 400 15px/1.4 var(--rounded); color: var(--muted); }

/* The calendar (WeekView): title, day headings, "MO 2" headers, events on a time axis, the now line. */

.pane-cal { padding: 6px 28px 28px; }
.cal-head { padding: 0 6px 14px; }
.cal-title { font: 800 28px/1.15 var(--rounded); }
.cal-year { color: var(--muted); font-weight: 700; }
.cal-sub { margin-top: 2px; font: 500 12px/1.4 var(--rounded); color: var(--muted); }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--page); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.col { min-width: 0; padding: 14px 6px 12px; border-left: 1px solid var(--grid); }
.col:first-child { border-left: 0; }
.col.weekend { background: var(--weekend); }

.heading { height: 18px; padding: 0 6px; font: 700 13px/18px var(--rounded); color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dh { position: relative; display: inline-flex; align-items: baseline; gap: 5px; margin: 6px 0 8px; padding: 5px 6px; white-space: nowrap; }
.wd { font: 800 12px/1 var(--rounded); color: var(--muted); }
.dn { font: 800 20px/1 var(--rounded); color: var(--ink); }
.col.today .dh { padding: 5px 10px; margin-left: 2px; }
.col.today .wd, .col.today .dn { color: var(--accent); }
.dh .ring { position: absolute; inset: -3px -6px; width: calc(100% + 12px); height: calc(100% + 6px); overflow: visible; transform: rotate(-7deg); fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dh .ring path { vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 0; }
.window[data-mode="calendar"] .dh .ring path { animation: draw 0.7s 0.15s var(--ease) both; }

.canvas { position: relative; height: 340px; }
.ev { position: absolute; left: 0; right: 0; display: flex; flex-direction: column; gap: 1px; padding: 6px 8px 7px; color: #FFFFFF; border-radius: 10px; overflow: hidden; }
.ev .t { font: 600 11px/1.2 var(--rounded); font-variant-numeric: tabular-nums; opacity: 0.85; }
.ev .n { font: 600 13px/1.25 var(--rounded); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev[hidden] { display: none; }
/* Apple's calendar colors, softened the way the app does it (ColorSupport.softenedRGB). */
.ev-blue { background: #2CA0DB; }
.ev-green { background: #6DDA45; color: #291F17; }
.ev-red { background: #DB3264; }
.ev-purple { background: #C879DB; }
.ev-orange { background: #DB922C; }
/* Time axis 08:00 to 22:00 over the canvas height. */
.at-0930 { top: 10.7%; }
.at-1000 { top: 14.3%; }
.at-1230 { top: 32.1%; }
.at-1630 { top: 60.7%; }
.at-1800 { top: 71.4%; }
.at-1900 { top: 78.6%; }

.nowline { position: absolute; left: -6px; right: -6px; z-index: 2; height: 2px; background: var(--now); border-radius: 2px; pointer-events: none; }
.nowline::before { content: ""; position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--now); }

.window-note { margin: 22px auto 0; max-width: 640px; text-align: center; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* ---------- Section intros ---------- */

.section-intro { margin-top: 150px; text-align: center; }

/* ---------- Story: sticky stage, steps scroll past ---------- */

.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 540px); gap: 72px; }
.steps { padding: 12vh 0 18vh; }
.step { max-width: 420px; min-height: 64vh; display: flex; flex-direction: column; justify-content: center; opacity: 0.25; transition: opacity 0.45s ease; }
.step.on { opacity: 1; }
.num { margin-bottom: 10px; font: 700 13px/1 var(--rounded); letter-spacing: 0.06em; color: var(--accent); }
.step h3 { font-size: 30px; line-height: 1.18; letter-spacing: -0.025em; font-weight: 650; }
.step p:not(.num) { margin-top: 12px; font-size: 18px; color: var(--muted); }

.stage-col { position: relative; }
.stage { position: sticky; top: calc(50vh - 250px); height: 500px; }

.letter {
  position: absolute;
  top: 0;
  left: 0;
  right: 44px;
  padding: 24px 26px 20px;
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 48px -18px rgba(27, 30, 43, 0.18);
  transition: transform 0.7s var(--ease), opacity 0.7s ease, filter 0.7s ease;
}
.lt-head { display: flex; align-items: center; gap: 12px; }
.lt-head .av { width: 40px; height: 40px; font-size: 14px; }
.lt-who { display: flex; flex-direction: column; line-height: 1.3; }
.lt-who b { font: 600 15px/1.3 var(--sans); }
.lt-who span { font-size: 13px; color: var(--muted); }
.lt-subject { margin: 16px 0 14px; font: 700 22px/1.25 var(--sans); letter-spacing: -0.015em; }

.sum { padding: 13px 16px 14px; background: rgba(58, 102, 240, 0.06); border-radius: 12px; }
.sum-cap { display: flex; align-items: center; gap: 6px; font: 600 12px/1.4 var(--sans); color: var(--accent); }
.sum-cap svg { width: 13px; height: 13px; fill: currentColor; }
.sum-list { margin-top: 6px; padding-left: 1.1em; font-size: 14px; line-height: 1.5; }
.sum-list li::marker { color: rgba(58, 102, 240, 0.6); }
.sum-list li + li { margin-top: 3px; }
.sum-skel { display: none; margin-top: 10px; }
.sum-skel i { display: block; height: 10px; margin-top: 8px; border-radius: 5px; background: linear-gradient(90deg, rgba(58, 102, 240, 0.10) 0%, rgba(58, 102, 240, 0.22) 50%, rgba(58, 102, 240, 0.10) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.sum-skel i:nth-child(1) { width: 92%; }
.sum-skel i:nth-child(2) { width: 76%; }
.sum-skel i:nth-child(3) { width: 58%; margin-bottom: 4px; }
.js .stage:not(.streamed) .sum-skel { display: block; }
.js .stage:not(.streamed) .sum-list { display: none; }
.js .stage.streamed .sum-list li { animation: fadeup 0.45s var(--ease) both; }
.js .stage.streamed .sum-list li:nth-child(2) { animation-delay: 0.14s; }
.js .stage.streamed .sum-list li:nth-child(3) { animation-delay: 0.28s; }

.lt-body {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.found {
  position: absolute;
  right: 0;
  top: 236px;
  width: 252px;
  padding: 16px 18px;
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 60px -16px rgba(27, 30, 43, 0.28);
  opacity: 0;
  transform: translateX(28px) scale(0.96);
  transition: transform 0.7s var(--ease), opacity 0.5s ease;
}
.f-cap { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font: 600 11px/1.4 var(--sans); color: var(--muted); }
.f-cap svg, .f-add svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.f-title { font: 600 15px/1.35 var(--sans); }
.f-when { margin-top: 2px; font-size: 13px; line-height: 1.45; }
.f-where { font-size: 12px; line-height: 1.45; color: var(--muted); }
.f-free { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; line-height: 1.4; }
.f-free i { width: 7px; height: 7px; border-radius: 50%; background: var(--approve); }
.f-add { display: flex; align-items: center; gap: 6px; margin-top: 10px; font: 500 12px/1.4 var(--sans); color: var(--accent); }
.f-add .key { margin-left: 2px; transition: background-color 0.15s ease, color 0.15s ease; }

.mini-week {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  padding: 12px 10px 14px;
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 48px -18px rgba(27, 30, 43, 0.2);
  opacity: 0;
  transform: translateY(28px);
  transition: transform 0.7s var(--ease), opacity 0.5s ease;
}
.mw-col { display: flex; flex-direction: column; align-items: center; min-width: 0; gap: 2px; min-height: 66px; }
.mw-col:nth-child(n+6) { background: var(--weekend); border-radius: 8px; }
.mw-wd { margin-top: 4px; font: 800 10px/1.2 var(--rounded); color: var(--muted); }
.mw-dn { font: 800 17px/1.2 var(--rounded); }
.chip { display: block; width: 100%; margin-top: 5px; padding: 3px 4px; font: 600 10.5px/1.3 var(--rounded); color: #FFFFFF; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 5px; }
.c-blue { background: #2CA0DB; }
.c-green { background: #6DDA45; color: #291F17; }
.c-red { background: #DB3264; }
.c-purple { background: #C879DB; }
.c-orange { background: #DB922C; }
.landing { position: relative; display: block; width: 100%; padding: 0 3px; }
.landing .chip { opacity: 0; transform: scale(0.5); transition: transform 0.45s var(--ease), opacity 0.3s ease; }
.loop { position: absolute; left: -6px; right: -6px; top: -1px; width: calc(100% + 12px); height: 30px; overflow: visible; transform: rotate(-7deg); fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.loop path { vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.6s var(--ease); }

/* Step 2: the appointment card arrives beside the letter. */
.stage[data-step="2"] .found { opacity: 1; transform: none; }
/* Step 3: K is pressed, the card flies into Saturday, the week rises, the pen circles the new entry. */
.stage[data-step="3"] .letter { opacity: 0.55; transform: translateY(-14px) scale(0.96); filter: saturate(0.6); }
.stage[data-step="3"] .found { opacity: 0; transform: translate(70px, 190px) scale(0.22); transition: transform 0.75s 0.25s cubic-bezier(0.55, 0, 0.25, 1), opacity 0.35s 0.6s ease; }
.stage[data-step="3"] .f-add .key { color: #FFFFFF; background: var(--accent); border-color: var(--accent); }
.stage[data-step="3"] .mini-week { opacity: 1; transform: none; transition-delay: 0.15s; }
.stage[data-step="3"] .landing .chip { opacity: 1; transform: none; transition-delay: 0.85s; }
.stage[data-step="3"] .loop path { stroke-dashoffset: 0; transition-delay: 1.15s; }

/* ---------- Bento ---------- */

.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 48px; }
.card {
  --mx: 50%;
  --my: 0%;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  padding: 28px;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(58, 102, 240, 0.07), transparent 60%), var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  transition: border-color 0.2s ease;
}
.card:hover { border-color: #DCE0EA; }
.card-wide { grid-column: span 2; }
.card h3 { font-size: 21px; }
.card-text p { margin-top: 6px; font-size: 15px; line-height: 1.55; color: var(--muted); }
.demo { margin-top: auto; }

/* Screener */
.screener { padding: 8px; background: var(--page); border: 1px solid var(--line); border-radius: 16px; }
.sc-head { padding: 6px 12px 4px; font: 600 13px/1.4 var(--sans); color: var(--muted); }
.sc-list { list-style: none; padding: 0; }
.sc-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; transition: transform 0.45s var(--ease), opacity 0.35s ease, filter 0.35s ease; }
.sc-row .av { width: 40px; height: 40px; font-size: 14px; }
.sc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.sc-text b { font: 600 15px/1.35 var(--sans); }
.sc-text span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-actions { display: flex; gap: 8px; }
.dec { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; transition: transform 0.15s ease, background-color 0.15s ease; }
.dec svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dec:hover { transform: scale(1.08); }
.dec-yes { color: var(--approve); background: rgba(63, 145, 66, 0.14); }
.dec-yes:hover { background: rgba(63, 145, 66, 0.22); }
.dec-no { color: var(--now); background: rgba(232, 72, 61, 0.12); }
.dec-no:hover { background: rgba(232, 72, 61, 0.2); }
.sc-row.go-in { opacity: 0; transform: translateX(48px); }
.sc-row.go-out { opacity: 0; transform: scale(0.96); filter: grayscale(1); }
.sc-row.gone { display: none; }
.sc-log { min-height: 1.5em; padding: 2px 12px 6px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.sc-done { padding: 18px 12px 14px; font: 600 15px/1.4 var(--sans); text-align: center; animation: fade 0.3s ease both; }
.sc-done[hidden] { display: none; }
.sc-done .link { margin-left: 6px; }

/* Tracking pixels */
.pixel { position: relative; }
.nl { position: relative; padding: 14px; background: var(--page); border: 1px solid var(--line); border-radius: 14px; }
.nl-head { font: 600 13px/1.4 var(--sans); }
.nl-img { height: 74px; margin-top: 10px; border-radius: 8px; background: repeating-linear-gradient(135deg, #EEF0F5 0 7px, #F6F7FA 7px 14px); transition: background 0.5s ease; }
.pixel.loaded .nl-img { background: linear-gradient(120deg, #FFD8A8, #FCA5A5 45%, #A5B4FC); }
.nl-lines i { display: block; height: 7px; margin-top: 8px; border-radius: 4px; background: var(--sunken); }
.nl-lines i:last-child { width: 64%; }
.px { position: absolute; top: 50%; right: -10px; width: 6px; height: 6px; border-radius: 1.5px; background: rgba(27, 30, 43, 0.45); opacity: 0; }
.pixel.play .px { animation: knock 1.9s ease-in-out both; }
.pixel.play .px2 { top: 34%; animation-delay: 0.45s; }
.pixel.play .px3 { top: 68%; animation-delay: 0.9s; }
.nl-bar { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.nl-bar svg { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.nl-bar span { flex: 1; }

/* Keys */
.keys { display: flex; flex-direction: column; gap: 8px; }
.keyrow { display: flex; gap: 8px; }
.cap {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  font: 600 16px/1 var(--rounded);
  color: var(--ink);
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 2px 0 #DDE1EA;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.12s ease, color 0.12s ease;
}
.cap.down { color: var(--accent); background: rgba(58, 102, 240, 0.09); border-color: rgba(58, 102, 240, 0.3); box-shadow: 0 0 0 transparent; transform: translateY(2px); }
.key-label { min-height: 1.5em; margin-top: 6px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.key-label b { color: var(--ink); font-weight: 600; }

/* Places (MailDropdownPanel tiles) */
.places { display: flex; flex-direction: column; gap: 12px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 14px 0 12px;
  color: var(--accent);
  background: rgba(58, 102, 240, 0.10);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.tile:hover { transform: translateY(-1px); }
.tile svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.t-label { font: 600 13px/1 var(--rounded); color: var(--ink); }
.t-num { position: absolute; top: 5px; right: 6px; font: 700 10px/1 var(--rounded); color: rgba(105, 112, 127, 0.55); }
.t-count { position: absolute; top: 4px; left: 4px; padding: 2px 5px; font: 700 10px/1 var(--rounded); color: #FFFFFF; background: var(--accent); border-radius: 999px; }
.tile.on { color: #FFFFFF; background: var(--accent); }
.tile.on .t-label { color: #FFFFFF; }
.tile.on .t-num { color: rgba(255, 255, 255, 0.55); }
.tile.on .t-count { color: var(--accent); background: #FFFFFF; }
.pl-list { list-style: none; padding: 6px; background: var(--page); border: 1px solid var(--line); border-radius: 14px; animation: fadeup 0.3s var(--ease) both; }
.pl-list[hidden] { display: none; }
.pl-list li { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; font-size: 14px; line-height: 1.4; }
.pl-list .av { width: 32px; height: 32px; font-size: 12px; }
.pl-list b { flex: none; font-weight: 600; }
.pl-list li span:last-child { min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Privacy: a flow with nothing in between ---------- */

.privacy { margin-top: 150px; text-align: center; }
.flow { display: grid; grid-template-columns: auto minmax(100px, 340px) auto; align-items: start; justify-content: center; gap: 18px; margin-top: 52px; }
.node { display: flex; flex-direction: column; align-items: center; gap: 12px; font: 600 14px/1.3 var(--sans); }
.node svg { width: 88px; height: 76px; padding: 16px 18px; background: var(--page); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 18px 40px -20px rgba(58, 102, 240, 0.35); fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.wire { position: relative; height: 2px; margin-top: 37px; background-image: linear-gradient(90deg, #D9DDE7 50%, transparent 0); background-size: 10px 2px; }
.pk { position: absolute; top: -3px; left: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); opacity: 0; animation: travel 3.6s linear infinite; }
.pk2 { animation-delay: 1.2s; animation-direction: reverse; background: var(--deep); }
.pk3 { animation-delay: 2.4s; }
.ghost-row { margin-top: 26px; }
.ghost { display: inline-block; padding: 8px 16px; font-size: 14px; line-height: 1.4; color: var(--muted); border: 1.5px dashed #D5D9E3; border-radius: 12px; cursor: help; }
.ghost s { text-decoration-thickness: 1.5px; color: rgba(105, 112, 127, 0.7); }
.privacy-text { max-width: 620px; margin: 30px auto 0; color: var(--muted); }

/* ---------- AI: the Settings choice, and where the text goes ---------- */

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

.ai { margin-top: 150px; }
.ai-intro { text-align: center; }
.ai-lead { max-width: 640px; margin: 22px auto 0; font-size: 18px; color: var(--muted); }
.ai-box { margin-top: 52px; }

/* The four choices, like the backend picker in Settings. Native radios, so arrow keys just work. */
.ai-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.ai-opt { position: relative; display: block; cursor: pointer; }
.ai-opt input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; }
.ai-face { display: flex; flex-direction: column; gap: 5px; height: 100%; padding: 16px 18px 17px; background: var(--page); border: 1px solid var(--line); border-radius: 16px; transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.25s ease; }
.ai-opt:hover .ai-face { border-color: #D5DAE6; }
.ai-name { display: flex; align-items: center; gap: 8px; font: 650 15px/1.3 var(--sans); }
.ai-name::before { content: ""; flex: none; width: 16px; height: 16px; border: 1.5px solid #C9CEDA; border-radius: 50%; background: var(--page); transition: border-color 0.2s ease, background 0.2s ease; }
.ai-tag { align-self: flex-start; margin: auto 0 0 24px; transform: translateY(3px); padding: 2px 8px; font: 600 11px/1.35 var(--sans); color: var(--muted); background: var(--sunken); border-radius: 999px; }
.ai-sub { padding-left: 24px; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.ai-opt input:checked + .ai-face { border-color: rgba(58, 102, 240, 0.5); background: rgba(58, 102, 240, 0.045); box-shadow: 0 12px 30px -20px rgba(58, 102, 240, 0.6); }
.ai-opt input:checked + .ai-face .ai-name::before { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 3.6px, var(--page) 4.2px); }
.ai-opt input:focus-visible + .ai-face { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Variants of one line stacked in one grid cell: the box keeps its height, and they crossfade. */
.stack { display: grid; }
.stack > * { grid-area: 1 / 1; }
.ai-box [data-for] { opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s; }
.ai-box[data-ai="off"] [data-for~="off"],
.ai-box[data-ai="device"] [data-for~="device"],
.ai-box[data-ai="apple"] [data-for~="apple"],
.ai-box[data-ai="eu"] [data-for~="eu"] { opacity: 1; visibility: visible; transform: none; transition: opacity 0.35s ease 0.12s, transform 0.35s var(--ease) 0.12s, visibility 0s; }

.ai-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "letter route" "letter uses";
  gap: 30px 44px;
  margin-top: 16px;
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
}

/* Where the text goes: the nodes that aren't on the way fold away to nothing. */
.ai-route { grid-area: route; }
.route { display: flex; justify-content: center; align-items: flex-start; height: 112px; }
.r-node { flex: none; display: flex; flex-direction: column; align-items: center; width: 104px; padding-top: 8px; overflow: hidden; text-align: center; transition: width 0.6s var(--ease), opacity 0.45s ease; }
.r-node b { margin-top: 10px; font: 600 13px/1.3 var(--sans); white-space: nowrap; }
.r-node small { font-size: 12px; line-height: 1.3; color: var(--muted); white-space: nowrap; }
.r-icon { position: relative; display: grid; place-items: center; width: 64px; height: 56px; background: var(--page); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 14px 30px -18px rgba(58, 102, 240, 0.35); transition: box-shadow 0.4s ease; }
.r-icon svg { width: 38px; height: 32px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.4s ease; }
.r-wire { flex: none; position: relative; width: 52px; height: 12px; margin-top: 30px; overflow: hidden; background: linear-gradient(90deg, #D3D8E3 50%, transparent 0) 0 50% / 8px 2px repeat-x; transition: width 0.6s var(--ease), opacity 0.45s ease; }
.r-wire .pk { top: 2px; animation-duration: 2.4s; }
.r-w2 .pk1 { animation-delay: 0.8s; }
.r-w2 .pk2 { animation-delay: 0.4s; }
.r-w1, .r-w2, .r-hop, .r-apple, .r-mistral { width: 0; opacity: 0; }
.ai-box[data-ai="apple"] .r-w1, .ai-box[data-ai="eu"] .r-w1, .ai-box[data-ai="eu"] .r-w2 { width: 52px; opacity: 1; }
.ai-box[data-ai="apple"] .r-apple, .ai-box[data-ai="eu"] .r-hop, .ai-box[data-ai="eu"] .r-mistral { width: 104px; opacity: 1; }

.r-device { overflow: visible; }
.r-spark { fill: var(--accent); stroke: none; opacity: 0; transition: opacity 0.4s ease; }
.ai-box[data-ai="device"] .r-spark { opacity: 1; }
.r-moon { position: absolute; top: -8px; right: -8px; display: grid; place-items: center; width: 24px; height: 24px; background: var(--page); border: 1px solid var(--line); border-radius: 50%; opacity: 0; transform: scale(0.6); transition: opacity 0.35s ease, transform 0.45s var(--ease); }
.r-moon svg { width: 13px; height: 13px; fill: var(--muted); stroke: none; }
.ai-box[data-ai="off"] .r-moon { opacity: 1; transform: none; }
.ai-box[data-ai="off"] .r-device svg { stroke: #A6ADBC; }
.ai-stage.thinking .r-device .r-icon { animation: think 1s ease-in-out infinite; }
.ai-box[data-ai="apple"] .ai-stage.thinking .r-device .r-icon,
.ai-box[data-ai="eu"] .ai-stage.thinking .r-device .r-icon { animation: none; }
.ai-box[data-ai="apple"] .ai-stage.thinking .r-apple .r-icon,
.ai-box[data-ai="eu"] .ai-stage.thinking .r-mistral .r-icon { animation: think 1s ease-in-out 0.5s infinite; }
.r-cap { margin-top: 6px; text-align: center; font: 600 15px/1.4 var(--sans); }

/* The mail: its summary folds away when the AI is off, and builds up again when it comes back. */
.ai-letter { grid-area: letter; align-self: start; padding: 24px 26px 20px; background: var(--page); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 48px -18px rgba(27, 30, 43, 0.18); }
.ai-sum-wrap { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.55s var(--ease), opacity 0.4s ease; }
.ai-sum-in { min-height: 0; overflow: hidden; }
.ai-box[data-ai="off"] .ai-sum-wrap { grid-template-rows: 0fr; opacity: 0; }
.sum-origin { display: inline-grid; font-weight: 500; color: rgba(58, 102, 240, 0.72); }
.sum-origin > span::before { content: "· "; }
.ai-stage.thinking .sum-skel { display: block; }
.ai-stage.thinking .sum-list { display: none; }
.ai-letter .sum-list li { animation: fadeup 0.45s var(--ease) both; }
.ai-letter .sum-list li:nth-child(2) { animation-delay: 0.14s; }
.ai-letter .sum-list li:nth-child(3) { animation-delay: 0.28s; }

/* What runs where. Anything that leaves the device is set in the accent. */
.ai-uses { grid-area: uses; align-self: start; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.ai-uses li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.u-name { font: 600 14.5px/1.35 var(--sans); }
.u-name small, .u-val small { display: block; font: 400 12.5px/1.35 var(--sans); color: var(--muted); }
.u-val { justify-items: end; text-align: right; font-size: 14px; line-height: 1.35; }
.u-out { font-weight: 600; color: var(--accent); }
.u-off { color: var(--muted); }

.ai-notes { max-width: 680px; margin: 30px auto 0; text-align: center; color: var(--muted); }
.ai-more { margin-top: 14px; text-align: center; font-size: 15px; color: var(--muted); }

/* ---------- Closing ---------- */

.closing { margin-top: 150px; text-align: center; }
.closing p:not(:last-child) { max-width: 560px; margin: 16px auto 0; font-size: 18px; color: var(--muted); }

/* ---------- Footer ---------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 120px;
  padding-top: 24px;
  padding-bottom: 32px;
  background: linear-gradient(var(--line), var(--line)) top center / calc(100% - 64px) 1px no-repeat;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
/* The 404 page wraps each language's footer in a div; its lines still sit in the footer row. */
.foot > div { display: contents; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--ink); }
.foot .sep { margin: 0 8px; opacity: 0.6; }
.foot .tip { white-space: nowrap; cursor: help; }
.foot .tip::after { left: auto; right: 0; transform: translateY(4px); }
.foot .tip:hover::after, .foot .tip:focus-visible::after { transform: translateY(0); }

/* ---------- Privacy page ---------- */

.doc-page > * { max-width: 680px; }

.doc-title { padding-top: 56px; }
.doc-title h1 { margin-top: 12px; font-size: 40px; line-height: 1.15; letter-spacing: -0.025em; }

.summary { margin-top: 24px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.summary-label { margin-bottom: 6px; font: 600 13px/1.4 var(--sans); color: var(--muted); }

.toc { margin-top: 32px; }
.toc h2 { font: 600 13px/1.4 var(--sans); letter-spacing: 0; color: var(--muted); }
.toc ol { list-style: none; padding: 0; margin: 4px 0 0; }
.toc li a { display: flex; align-items: center; gap: 10px; min-height: 40px; color: var(--ink); font-size: 16px; line-height: 1.35; }
.toc li a:hover { color: var(--accent); text-decoration: none; }
.toc .tn { min-width: 1.4em; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (min-width: 640px) {
  .toc ol { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
}

.doc { margin-top: 40px; }
.doc h2 { font-size: 24px; line-height: 1.3; }
.doc h2 .n { margin-right: 10px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.doc h3 { margin-top: 22px; font-size: 18px; }
.doc h2 + p, .doc h2 + ul, .doc h3 + p { margin-top: 12px; }
.doc p + p, .doc ul + p, .doc p + ul { margin-top: 12px; }
.doc ul { padding-left: 1.2em; }
.doc li + li { margin-top: 8px; }
.doc li::marker { color: var(--muted); }
.doc a { overflow-wrap: anywhere; }
.doc .aside { margin-top: 12px; font-size: 15px; color: var(--muted); }

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

.missing { padding-top: 96px; }
.missing > * { max-width: 640px; }
.missing .code { font: 600 16px/1.4 var(--sans); color: var(--muted); }
.missing h1 { margin-top: 12px; font-size: 40px; line-height: 1.15; letter-spacing: -0.025em; }
.missing .lead { margin-top: 16px; font-size: 18px; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-top: 24px;
  padding: 0 18px;
  font: 600 15px/1 var(--rounded);
  color: #FFFFFF;
  background: var(--accent);
  border-radius: 10px;
  box-shadow: 0 10px 24px -10px rgba(58, 102, 240, 0.6);
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.button:hover { text-decoration: none; background: #2F59E0; transform: translateY(-1px); }

/* ---------- Undo toast (MailUndoToast) and shortcut legend ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 8px 8px 8px 18px;
  font: 500 14px/1.3 var(--sans);
  color: var(--surface);
  background: var(--ink);
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast svg { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; opacity: 0.75; }
.toast button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; font: 600 14px/1.2 var(--sans); color: var(--surface); background: rgba(248, 249, 252, 0.14); border: 0; border-radius: 999px; cursor: pointer; }
.toast button:hover { background: rgba(248, 249, 252, 0.22); }
.toast button .k { font: 600 11px/1 var(--rounded); opacity: 0.6; }

.legend {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 29;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 6px 10px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.legend .key { justify-self: end; }
.legend.show { opacity: 1; }

/* ---------- Scroll reveal ---------- */

.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.8s ease, transform 0.8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .bento .card.reveal:nth-child(2) { transition-delay: 0.08s; }
.js .bento .card.reveal:nth-child(3) { transition-delay: 0.04s; }
.js .bento .card.reveal:nth-child(4) { transition-delay: 0.12s; }

/* ---------- Keyframes ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeup { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes arrive { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes drift { from { transform: translate3d(-2%, 0, 0) scale(1); } to { transform: translate3d(2%, 3%, 0) scale(1.06); } }
@keyframes think { 0%, 100% { box-shadow: 0 14px 30px -18px rgba(58, 102, 240, 0.35), 0 0 0 0 rgba(58, 102, 240, 0.28); } 60% { box-shadow: 0 14px 30px -18px rgba(58, 102, 240, 0.35), 0 0 0 8px rgba(58, 102, 240, 0); } }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(240, 140, 0, 0.4); } 50% { box-shadow: 0 0 0 5px rgba(240, 140, 0, 0); } }
@keyframes travel { 0% { left: 0; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { left: calc(100% - 8px); opacity: 0; } }
@keyframes knock {
  0% { opacity: 0; transform: translateX(70px); }
  20% { opacity: 1; }
  55% { opacity: 1; transform: translateX(0); }
  70% { opacity: 1; transform: translateX(18px); }
  100% { opacity: 0; transform: translateX(46px); }
}

/* ---------- Narrower windows ---------- */

@media (max-width: 1060px) {
  .inbox { grid-template-columns: 1fr minmax(0, 620px) 1fr; padding-bottom: 28px; }
  .mail.sel .hint { display: none; }
}

@media (max-width: 900px) {
  .story { display: flex; flex-direction: column; }
  .stage-col { order: -1; position: sticky; top: 64px; z-index: 3; height: 424px; margin: 0 -8px; padding: 14px 8px 0; background: linear-gradient(var(--page) 90%, rgba(255, 255, 255, 0)); }
  .stage { position: relative; top: 0; height: 396px; max-width: 540px; margin: 0 auto; }
  .steps { padding: 0 0 34vh; }
  .step { min-height: 40vh; }
  .bento { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .card-wide { grid-column: span 2; }
  .ai-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "route" "letter" "uses"; padding: 30px; }
  .ai-letter, .ai-uses { width: 100%; max-width: 540px; justify-self: center; }
}

@media (max-width: 700px) {
  .lights, .bar-right { display: none; }
  .win-bar { grid-template-columns: 1fr; justify-items: center; height: 52px; }
  .window-wrap { padding: 0 16px; margin-top: 44px; }
  .window { transform: rotateX(calc((1 - var(--p)) * 10deg)) scale(calc(0.96 + var(--p) * 0.04)); }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .card-wide { grid-column: auto; }
}

@media (max-width: 600px) {
  .wrap { padding: 0 24px; }
  .foot { background-size: calc(100% - 48px) 1px; }
  .topnav { gap: 16px; }
  .hero { padding-top: 40px; }
  h1 { font-size: 42px; }
  .lead { font-size: 18px; }
  h2 { font-size: 25px; }
  h3 { font-size: 20px; }
  h2.big { font-size: 31px; }
  .section-intro, .privacy, .ai, .closing { margin-top: 104px; }
  .ai-lead { font-size: 17px; }
  .ai-box { margin-top: 40px; }
  .ai-choices { gap: 10px; }
  .ai-face { padding: 13px 14px 14px; }
  .ai-name { font-size: 14.5px; }
  .ai-sub { padding-left: 0; font-size: 13px; }
  .ai-tag { margin-left: 0; }
  .ai-stage { gap: 24px; padding: 22px 16px 16px; }
  .route { height: 100px; }
  .r-device { width: 84px; }
  .ai-box[data-ai="apple"] .r-apple, .ai-box[data-ai="eu"] .r-hop, .ai-box[data-ai="eu"] .r-mistral { width: 84px; }
  .ai-box[data-ai="apple"] .r-w1, .ai-box[data-ai="eu"] .r-w1, .ai-box[data-ai="eu"] .r-w2 { width: 24px; }
  .r-icon { width: 52px; height: 46px; border-radius: 15px; }
  .r-icon svg { width: 32px; height: 27px; }
  .r-wire { margin-top: 25px; }
  .r-node b { margin-top: 8px; font-size: 12.5px; }
  .r-node small { font-size: 11.5px; }
  .r-cap { font-size: 14px; }
  .ai-letter { padding: 18px 18px 16px; }
  .ai-letter .sum-cap { flex-wrap: wrap; }
  .sum-origin { flex-basis: 100%; padding-left: 19px; }
  .sum-origin > span::before { content: none; }
  .ai-uses li { padding: 10px 0; }
  .ai-notes { margin-top: 24px; font-size: 16px; text-align: left; }
  .ai-more { text-align: left; }
  .step h3 { font-size: 24px; }
  .step p:not(.num) { font-size: 17px; }
  .inbox { padding: 6px 4px 18px; }
  .ib-title { padding-left: 12px; font-size: 28px; }
  .ib-search, .ib-knock { margin-left: 4px; margin-right: 4px; padding-left: 12px; padding-right: 12px; }
  .ib-knock { font-size: 13px; }
  .mail { padding: 14px 10px; }
  .ib-label, .ib-seen { margin-left: 10px; }
  .card { padding: 22px; }
  .letter { right: 24px; padding: 18px 18px 16px; }
  .lt-subject { margin: 12px 0 10px; font-size: 19px; }
  .lt-body { -webkit-line-clamp: 2; }
  .found { top: 176px; width: 214px; padding: 14px 15px; }
  .stage[data-step="3"] .found { transform: translate(40px, 160px) scale(0.22); }
  .flow { grid-template-columns: auto minmax(40px, 1fr) auto; gap: 10px; }
  .node svg { width: 64px; height: 56px; padding: 12px 13px; border-radius: 18px; }
  .wire { margin-top: 28px; }
  .doc-title { padding-top: 40px; }
  .doc-title h1, .missing h1 { font-size: 30px; }
  .summary { padding: 20px; }
  .missing { padding-top: 64px; }
  .legend { display: none; }

  /* The week as on the iPhone (ChipWeekCanvas): narrow days, title chips, no time axis. */
  .pane-cal { padding: 2px 10px 16px; }
  .cal-title { font-size: 24px; }
  .col { padding: 10px 2px 8px; text-align: center; }
  .heading { display: none; }
  .dh { flex-direction: column; align-items: center; gap: 3px; margin: 0 0 8px; padding: 5px 4px; }
  .col.today .dh { padding: 5px 7px; margin-left: 0; }
  .wd { font-size: 10px; }
  .dn { font-size: 17px; }
  .canvas { height: auto; min-height: 300px; }
  .ev { position: static; margin-top: 4px; padding: 3px 4px; border-radius: 5px; text-align: left; }
  .ev .t { display: none; }
  .ev .n { font-size: 10.5px; line-height: 1.3; }
  .nowline { display: none; }
}

@media (hover: none) {
  .kbd-only { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .window { transform: none; }
  .js .reveal { opacity: 1; transform: none; }
  .pk { opacity: 1; }
  .pk1 { left: 20%; } .pk2 { left: 50%; } .pk3 { left: 80%; }
  .r-wire .pk1 { left: 18%; } .r-wire .pk2 { left: 62%; }
}

/* With the language switch the top bar runs out of room on phones: the section anchor goes first,
   the wordmark on the smallest screens. */
@media (max-width: 440px) {
  .nav-features { display: none; }
}
@media (max-width: 350px) {
  .brand span { display: none; }
}

@media print {
  .topbar { position: static; }
  .toast, .legend, .navlink, .glow { display: none; }
  .window { transform: none; box-shadow: none; }
  .js .reveal { opacity: 1; transform: none; }
  .ai-choices, .ai-route { display: none; }
  a { color: inherit; }
}
