/* 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; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
p, h1, h2, h3 { margin: 0; }
: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);
}
.button:hover { background: var(--action-hover); text-decoration: none; }
.button.compact { min-height: 28px; padding: 0 14px; font-size: var(--t-small); letter-spacing: var(--tr-small); }
.button[aria-disabled="true"] { background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink-3); pointer-events: none; }

/* ---- 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. ---- */
.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); }

/* ---- 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; }
.tile .art { flex: 1; padding-top: var(--s-6); 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; } }

/* ---- 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 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); } }
