/* Thermals shared styles: the elements and components the brand guide defines.
   Every colour, size and radius comes from tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: var(--t-body); line-height: var(--lh-body); letter-spacing: var(--tr-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
p, h1, h2, h3, ol, ul { margin: 0; }
::selection { background: color-mix(in srgb, var(--action) 24%, transparent); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--action) 60%, transparent); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: calc(var(--page) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.center { text-align: center; }

/* ---- Type ---- */
.t-hero { font-size: var(--t-hero); line-height: var(--lh-hero); letter-spacing: var(--tr-hero); font-weight: 600; text-wrap: balance; }
.t-title { font-size: var(--t-title); line-height: var(--lh-title); letter-spacing: var(--tr-title); font-weight: 600; text-wrap: balance; }
.t-tile { font-size: var(--t-tile); line-height: var(--lh-tile); letter-spacing: var(--tr-tile); font-weight: 600; text-wrap: balance; }
.t-lede { font-size: var(--t-lede); line-height: var(--lh-lede); letter-spacing: var(--tr-lede); color: var(--ink-2); text-wrap: pretty; }
.t-small { font-size: var(--t-small); line-height: var(--lh-small); letter-spacing: var(--tr-small); }
.t-caption { font-size: var(--t-caption); line-height: var(--lh-caption); letter-spacing: var(--tr-caption); color: var(--ink-3); }
.quiet { color: var(--ink-2); }
.ember { background: var(--ember-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- Button: a capsule in system blue. One primary action per view. ---- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px; border: 0; border-radius: var(--r-control);
  background: var(--action); color: #fff;
  font: inherit; font-size: var(--t-body); line-height: 1; letter-spacing: var(--tr-body); white-space: nowrap;
  transition: background var(--fast) var(--ease), transform 120ms var(--ease), opacity var(--fast) var(--ease);
}
.button:hover { background: var(--action-hover); text-decoration: none; }
.button:active { transform: scale(.97); }
.button.compact { min-height: 28px; padding: 0 14px; font-size: var(--t-small); letter-spacing: var(--tr-small); }
.button.quiet { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.button.quiet:hover { background: color-mix(in srgb, var(--ink) 12%, transparent); }
.button[aria-disabled="true"] { background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink-3); pointer-events: none; }
.button:disabled { opacity: .6; }
button.button { cursor: pointer; }

/* ---- Email, then download: one capsule holding the field and its button. ---- */
.getform { display: grid; gap: var(--s-3); }
.getform .row {
  display: flex; align-items: center; gap: var(--s-1); padding: 5px;
  background: var(--field); border-radius: var(--r-control); box-shadow: var(--shadow-field);
  transition: box-shadow var(--fast) var(--ease);
}
.getform .row:focus-within { box-shadow: 0 0 0 1.5px var(--action), 0 0 0 5px color-mix(in srgb, var(--action) 22%, transparent), 0 12px 32px -16px rgba(0, 0, 0, .22); }
.field {
  flex: 1; min-width: 0; height: 46px; padding: 0 var(--s-2) 0 18px; border: 0; border-radius: var(--r-control);
  background: transparent; color: var(--ink);
  font: inherit; font-size: var(--t-body); letter-spacing: var(--tr-body);
}
.field::placeholder { color: var(--ink-3); }
.field:focus { outline: 0; }
.getform .button { min-height: 46px; }
.getform .error { color: var(--throttling); }
.getform .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
@media (max-width: 480px) {
  .getform .row { flex-direction: column; align-items: stretch; border-radius: 26px; padding: 6px; }
  .getform .field { flex: none; width: 100%; text-align: center; padding: 0 var(--s-4); }
  .getform .button { width: 100%; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Sent: what replaces the form once the link has been emailed. ---- */
.got { background: var(--tile); border-radius: var(--r-tile); box-shadow: var(--shadow-card); padding: var(--s-6) var(--s-5) var(--s-5); display: grid; justify-items: center; gap: var(--s-2); text-align: center; }
.got .mark { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin-bottom: var(--s-2); background: color-mix(in srgb, var(--action) 12%, transparent); color: var(--action); }
.got .mark svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.got .to { overflow-wrap: anywhere; }
.got .to strong { color: var(--ink); font-weight: 600; }
.got .actions { margin-top: var(--s-3); display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); }
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: var(--s-2); }
.steps li { counter-increment: step; display: flex; align-items: center; gap: var(--s-3); text-align: left; font-size: var(--t-small); line-height: var(--lh-small); letter-spacing: var(--tr-small); color: var(--ink-2); }
.steps li::before { content: counter(step); flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); font-size: var(--t-caption); font-weight: 600; letter-spacing: 0; }
.got .steps { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); width: 100%; max-width: 19rem; }
.got .t-caption { margin-top: var(--s-3); }
@media (prefers-reduced-motion: no-preference) {
  .got:not([hidden]) { animation: arrive 520ms var(--ease-out) both; }
  .got:not([hidden]) .mark { animation: pop 620ms var(--ease-out) 120ms both; }
  .got:not([hidden]) .mark .flap { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw 520ms var(--ease) 420ms forwards; }
}
@keyframes arrive { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* ---- Navigation bar: translucent, like a macOS toolbar. ---- */
.nav { position: sticky; top: 0; z-index: 10; background: var(--nav); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-size: 1.1875rem; font-weight: 600; letter-spacing: .012em; }
.wordmark:hover { text-decoration: none; }
.wordmark img { width: 26px; height: 26px; }

/* ---- The verdict: a status dot and the app's own word for the state. ---- */
.verdict { display: inline-flex; align-items: center; gap: .5em; font-weight: 600; }
.dot { width: .62em; height: .62em; border-radius: 50%; background: var(--status, var(--ink-3)); flex: none; }
.is-relaxed { --status: var(--relaxed); }
.is-busy { --status: var(--busy); }
.is-near { --status: var(--near); }
.is-throttling { --status: var(--throttling); }

/* ---- Product imagery: real captures only. A module's corner radius is 26 px of a 325 px capture,
        so the vertical radius depends on how tall the crop is. ---- */
.window { border-radius: var(--r-window); box-shadow: var(--shadow-window); }
.module { width: 100%; max-width: 325px; border-radius: 8% / var(--ry, 12.5%); box-shadow: var(--shadow-module); }
.module.h208 { --ry: 12.5%; }
.module.h149 { --ry: 17.45%; }
.module.h117 { --ry: 22.2%; }
.module.h100 { --ry: 26%; }

/* ---- Tile: one idea per tile, like a macOS widget. ---- */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--gap); }
.tile { grid-column: span 3; background: var(--tile); border-radius: var(--r-tile); padding: clamp(24px, 3.4vw, 40px); display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; overflow: hidden; }
.tile.wide { grid-column: span 6; }
.tile.third { grid-column: span 2; }
/* The capture sits in a recess at the foot of the tile, so the tile reads as a surface with depth. */
.tile .art { flex: 1; margin-top: var(--s-5); padding: clamp(20px, 3vw, 32px) var(--s-4); border-radius: 20px; background: var(--inset); display: flex; justify-content: center; align-items: center; }
@media (max-width: 760px) { .tile, .tile.third { grid-column: span 6; } }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

/* ---- Footer and plain document pages (privacy, license). ---- */
.foot { border-top: 1px solid var(--line); padding: var(--s-4) 0 var(--s-7); }
.foot p + p { margin-top: var(--s-2); }
.foot .links a { margin-left: var(--s-3); }
.doc { max-width: 42em; margin: 0 auto; padding: var(--s-8) 0 var(--s-9); }
.doc .t-title { margin-bottom: var(--s-2); }
.doc .t-title + .t-lede { margin-top: var(--s-3); }
.doc .lead { margin-top: var(--s-5); }
.doc .act { margin-top: var(--s-6); }
.doc h2 { font-size: var(--t-tile); line-height: var(--lh-tile); letter-spacing: var(--tr-tile); font-weight: 600; margin: var(--s-7) 0 var(--s-3); }
.doc p + p, .doc ul + p, .doc p + ul { margin-top: var(--s-3); }
.doc ul { margin: 0; padding-left: 1.2em; }
.doc li + li { margin-top: var(--s-2); }
.doc pre { margin: var(--s-4) 0 0; padding: var(--s-5); background: var(--band); border-radius: 14px; font-family: var(--font-mono); font-size: var(--t-caption); line-height: 1.5; white-space: pre-wrap; color: var(--ink-2); }
@media (prefers-color-scheme: dark) { .doc pre { background: var(--tile); } }

/* ---- Single-purpose pages (download, unsubscribe, not found): one card on the page glow. ---- */
.solo { min-height: calc(100vh - 53px); display: grid; align-items: center; padding: var(--s-7) 0 var(--s-9); background: var(--glow) no-repeat top center / 100% 520px; }
.card { width: 100%; max-width: 30rem; margin: 0 auto; background: var(--tile); border-radius: var(--r-stage); box-shadow: var(--shadow-card); padding: clamp(32px, 6vw, 48px) clamp(24px, 5vw, 44px); display: grid; justify-items: center; gap: var(--s-3); text-align: center; }
.card .icon { width: 88px; height: 88px; margin-bottom: var(--s-2); filter: drop-shadow(0 10px 20px rgba(190, 70, 20, .24)); }
.card .t-lede { font-size: var(--t-body); line-height: var(--lh-body); letter-spacing: var(--tr-body); }
.card .button { margin-top: var(--s-4); min-height: 50px; padding: 0 28px; }
.card .steps { margin-top: var(--s-4); padding-top: var(--s-5); border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); width: 100%; gap: var(--s-3); }
.card .steps li { font-size: var(--t-body); line-height: 1.35; letter-spacing: var(--tr-body); color: var(--ink); }
.card .steps li::before { width: 26px; height: 26px; font-size: var(--t-small); }
.card .steps img { display: inline-block; height: 20px; width: auto; vertical-align: -5px; margin: 0 3px; }
.card .t-caption { margin-top: var(--s-3); }
@media (prefers-color-scheme: dark) { .card, .got { background: #161617; } }
@media (prefers-reduced-motion: no-preference) { .card { animation: arrive 640ms var(--ease-out) both; } }
