/* TurboMail v2 design system, shared by the subpages.
   The homepage (index) keeps its own inline copy of these tokens. */

:root {
  --bg: #08090a;
  --surface: #101113;
  --surface-2: #16171a;
  --text: #f7f8f8;
  --text-2: #8a8f98;
  --text-3: #62666d;
  --border: rgba(255,255,255,0.08);
  --border-2: rgba(255,255,255,0.14);
  --accent: #6e79d6;
  --btn: #e8e8e8;
  --btn-ink: #0a0a0b;
  --f: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  --maxw: 1024px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--f); font-size: 15.5px; line-height: 1.6;
  font-feature-settings: "cv05","cv08";
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
::selection { background: rgba(110,121,214,.28); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

h1, h2 { font-weight: 590; letter-spacing: -0.022em; line-height: 1.08; text-wrap: balance; }
h3 { font-weight: 560; letter-spacing: -0.012em; }
.dim { color: var(--text-2); }
.sub { color: var(--text-2); font-size: 1.02rem; line-height: 1.62; max-width: 58ch; }
.label { font-size: .8rem; font-weight: 560; color: var(--text-3); margin-bottom: 14px; }
.arrow-link { color: var(--text-2); font-size: .92rem; font-weight: 520; transition: color .15s; }
.arrow-link:hover { color: var(--text); }
.arrow-link::after { content: " \2192"; }

/* Nav */
nav.tm { position: sticky; top: 0; z-index: 60; background: rgba(8,9,10,.8); backdrop-filter: blur(20px) saturate(1.4); border-bottom: 1px solid transparent; transition: border-color .25s; }
nav.tm.on { border-bottom-color: var(--border); }
.nav-in { height: 64px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 590; font-size: .98rem; letter-spacing: -.01em; }
.brand img { width: 22px; height: 22px; }
.nav-links { display: flex; gap: 26px; flex: 1; }
.nav-links a { color: var(--text-2); font-size: .88rem; font-weight: 520; transition: color .15s; }
.nav-links a:hover, .nav-links a.here { color: var(--text); }
.btn {
  font-family: var(--f); font-weight: 560; font-size: .88rem; cursor: pointer;
  height: 34px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-w { background: var(--btn); color: var(--btn-ink); }
.btn-w:hover { background: #fff; }
.btn-g { background: transparent; color: var(--text-2); }
.btn-g:hover { color: var(--text); }
.btn-o { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn-o:hover { border-color: rgba(255,255,255,.26); }
.btn-lg { height: 44px; padding: 0 22px; font-size: .95rem; border-radius: 9px; }
.btn[disabled] { opacity: .5; cursor: default; }
@media (max-width: 760px) { .nav-links { display: none; } }
@media (max-width: 420px) {
  .nav-in { gap: 14px; }
  nav.tm .btn-g { display: none; }   /* brand + Download still fit on small phones */
}

/* Page hero (subpages, left-aligned) */
.page-hero { padding: 88px 0 24px; }
.page-hero h1 { font-size: clamp(2rem, 4.6vw, 2.9rem); margin-bottom: 14px; max-width: 24ch; }
.page-hero .sub { margin-bottom: 0; }

/* Sections and layout */
section.s { padding: 72px 0; }
.h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); max-width: 26ch; margin-bottom: 14px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 32px; } }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
@media (max-width: 880px) { .grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 580px) { .grid3 { grid-template-columns: 1fr; } }
.cell { background: var(--bg); padding: 24px; transition: background .18s; }
.cell:hover { background: var(--surface); }
.cell .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .8; margin-bottom: 14px; }
.cell h3 { font-size: .96rem; color: var(--text); margin-bottom: 6px; }
.cell p { font-size: .87rem; color: var(--text-2); line-height: 1.58; }

.rows { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.rows .r { display: grid; grid-template-columns: 200px 1fr; gap: 20px; padding: 18px 22px; border-top: 1px solid var(--border); }
.rows .r:first-child { border-top: 0; }
.rows .r b { font-weight: 560; color: var(--text); font-size: .92rem; }
.rows .r span { color: var(--text-2); font-size: .92rem; }
@media (max-width: 640px) { .rows .r { grid-template-columns: 1fr; gap: 5px; } }

.loc { display: inline-flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--text-2); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; }
.loc i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* Inputs */
.input {
  /* 16px minimum so iOS Safari doesn't auto-zoom the page on focus */
  font-family: var(--f); font-size: 16px; color: var(--text);
  height: 44px; width: 100%; padding: 0 14px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--border-2);
  transition: border-color .15s;
}
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: rgba(255,255,255,.3); }
.hint { font-size: .8rem; color: var(--text-3); }
.err { font-size: .84rem; color: #e5807b; }

/* OS tabs with real platform marks */
.os-tabs { display: inline-flex; gap: 6px; border: 1px solid var(--border); border-radius: 10px; padding: 4px; background: var(--surface); }
.os-tab {
  font-family: var(--f); font-size: .88rem; font-weight: 560; color: var(--text-2);
  border: 0; background: transparent; border-radius: 7px; height: 36px; padding: 0 16px;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; transition: background .15s, color .15s;
}
.os-tab.on { background: var(--surface-2); color: var(--text); }
.os-ic { width: 14px; height: 14px; fill: currentColor; display: block; }

/* Docs prose */
.doc { max-width: 700px; }
.doc h2 { font-size: 1.3rem; margin: 56px 0 12px; padding-top: 24px; border-top: 1px solid var(--border); }
.doc h2:first-of-type { margin-top: 24px; border-top: 0; padding-top: 0; }
.doc h3 { font-size: 1rem; color: var(--text); margin: 26px 0 8px; }
.doc p, .doc li { color: var(--text-2); font-size: .95rem; line-height: 1.65; }
.doc p { margin-bottom: 12px; }
.doc ul, .doc ol { margin: 0 0 14px 20px; }
.doc li { margin-bottom: 6px; }
.doc b, .doc strong { color: var(--text); font-weight: 560; }
.doc code, .doc kbd {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .82em;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; color: var(--text);
}
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.toc a { font-size: .84rem; color: var(--text-2); border: 1px solid var(--border); border-radius: 999px; padding: 6px 13px; transition: color .15s, border-color .15s; }
.toc a:hover { color: var(--text); border-color: var(--border-2); }

/* Changelog */
.cl { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cl-item { padding: 18px 22px; border-top: 1px solid var(--border); }
.cl-item:first-child { border-top: 0; }
.cl-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.cl-v { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .82rem; color: var(--text); font-weight: 600; }
.cl-d { font-size: .8rem; color: var(--text-3); }
.cl-tag { font-size: .68rem; font-weight: 600; color: var(--accent); border: 1px solid rgba(110,121,214,.4); border-radius: 5px; padding: 1px 7px; }
.cl-item li { color: var(--text-2); font-size: .89rem; margin: 0 0 4px 18px; }

/* Final CTA */
.cta { text-align: center; border-top: 1px solid var(--border); }
.cta h2 { font-size: clamp(1.7rem, 3.6vw, 2.3rem); margin-bottom: 12px; }
.cta .sub { margin: 0 auto 26px; }

/* Footer */
footer.tm { border-top: 1px solid var(--border); padding: 48px 0 36px; margin-top: 40px; }
.f-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.f-brand p { color: var(--text-3); font-size: .85rem; margin-top: 10px; max-width: 260px; }
.f-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.f-col h4 { font-size: .78rem; font-weight: 560; color: var(--text-3); margin-bottom: 12px; }
.f-col a { display: block; color: var(--text-2); font-size: .88rem; margin-bottom: 8px; transition: color .15s; }
.f-col a:hover { color: var(--text); }
.f-legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: .78rem; color: var(--text-3); }

/* Motion */
.rv { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.rv.in { opacity: 1; transform: none; }
.lv { opacity: 0; transform: translateY(16px); filter: blur(6px); transition: opacity .8s var(--ease), transform .8s var(--ease), filter .8s var(--ease); }
.lv.in { opacity: 1; transform: none; filter: blur(0); }
@media (prefers-reduced-motion: reduce) {
  .rv, .lv { opacity: 1; transform: none; filter: none; transition: none; }
  html { scroll-behavior: auto; }
}
