/* calorific.co. Palette and direction follow the app (Calorific/DesignSystem/Theme.swift):
   a deep ink base, a slow aurora of colour behind it, glass cards, rounded display type. */

:root {
  --ink: #080913;
  --bg: #080913;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-line: rgba(255, 255, 255, 0.1);
  --text: #f3f3f9;
  --text-mid: #b9bacb;
  --text-dim: #8587a0;
  --violet: #8066ff;
  --cyan: #1ad9fa;
  --magenta: #ff409e;
  --coral: #ff6b5c;
  --amber: #ffb833;
  --lime: #8cf266;
  --link: #9fe9fb;
  --track: rgba(255, 255, 255, 0.07);
  --aurora: 0.34;
  --btn-bg: #f3f3f9;
  --btn-text: #080913;
  --pad: clamp(20px, 5vw, 56px);
  --max: 1120px;
  --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7fb;
    --surface: rgba(255, 255, 255, 0.75);
    --surface-line: rgba(8, 9, 19, 0.1);
    --text: #0c0d1a;
    --text-mid: #41435a;
    --text-dim: #666881;
    --link: #0a6c86;
    --track: rgba(8, 9, 19, 0.07);
    --aurora: 0.2;
    --btn-bg: #0c0d1a;
    --btn-text: #ffffff;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: var(--aurora);
  background:
    radial-gradient(60vw 50vh at 12% -5%, var(--coral), transparent 70%),
    radial-gradient(55vw 55vh at 95% 10%, var(--violet), transparent 70%),
    radial-gradient(50vw 40vh at 55% 105%, var(--cyan), transparent 72%);
  filter: saturate(1.1);
  pointer-events: none;
}
main { flex: 1; width: 100%; }

a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--round); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
img { display: block; }

.skip { position: absolute; left: -999px; top: 8px; padding: 8px 14px; background: var(--btn-bg); color: var(--btn-text); border-radius: 10px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header and footer */
.top, .foot-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top { width: 100%; max-width: var(--max); margin: 0 auto; padding: 18px var(--pad); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 600 18px/1 var(--round); letter-spacing: -0.01em; }
.brand img { border-radius: 22.5%; }
.top nav, .foot nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.top nav a, .foot nav a { color: var(--text-mid); text-decoration: none; font-size: 15px; }
.top nav a:hover, .foot nav a:hover { color: var(--text); }

.foot { width: 100%; max-width: var(--max); margin: 0 auto; padding: 36px var(--pad) 44px; border-top: 1px solid var(--surface-line); }
.foot .brand { font-size: 16px; }
.foot-note { margin-top: 18px; font-size: 13.5px; color: var(--text-dim); }

/* Shared pieces */
.kicker { font: 600 13px/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 14px; }
.lede { font-size: clamp(18px, 2vw, 21px); line-height: 1.55; color: var(--text-mid); max-width: 56ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 999px; background: var(--btn-bg); color: var(--btn-text); font: 600 16px/1 var(--round); text-decoration: none; border: 1px solid transparent; transition: transform 0.15s ease, opacity 0.15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--surface-line); }
.ember { background: linear-gradient(100deg, var(--amber), var(--coral) 55%, var(--magenta)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Hero */
.hero { max-width: var(--max); margin: 0 auto; padding: clamp(28px, 6vw, 80px) var(--pad) clamp(48px, 8vw, 104px); display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(24px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(40px, 6.4vw, 76px); letter-spacing: -0.035em; line-height: 1.02; margin-bottom: 22px; }
.pill { display: inline-flex; align-items: center; gap: 9px; padding: 7px 14px 7px 12px; margin-bottom: 26px; border: 1px solid var(--surface-line); border-radius: 999px; background: var(--surface); font-size: 14px; color: var(--text-mid); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 22%, transparent); }
.hero-note { margin-top: 22px; font-size: 14.5px; color: var(--text-dim); max-width: 48ch; }
.hero-art { justify-self: center; width: min(100%, 400px); }
.rings { width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 18px 60px rgba(255, 107, 92, 0.22)); }
.rings .track { stroke: var(--track); }
.rings .arc { stroke-dasharray: 100; stroke-dashoffset: var(--to); animation: fill 1.4s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
.rings .a1 { --to: 24; animation-delay: 0.1s; }
.rings .a2 { --to: 38; animation-delay: 0.25s; }
.rings .a3 { --to: 52; animation-delay: 0.4s; }
@keyframes fill { from { stroke-dashoffset: 100; } }

/* Bands */
.band { max-width: var(--max); margin: 0 auto; padding: clamp(40px, 7vw, 88px) var(--pad); }
.band > h2, .split h2 { font-size: clamp(30px, 4.2vw, 48px); margin-bottom: 18px; }
.band.narrow > p:not(.kicker), .band .more { max-width: 68ch; color: var(--text-mid); }
.band .more { margin-top: 28px; }

.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.card { position: relative; padding: 28px 26px 26px; border: 1px solid var(--surface-line); border-radius: 26px; background: var(--surface); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); overflow: hidden; }
.card::before { content: ""; position: absolute; left: 26px; top: 0; width: 44px; height: 4px; border-radius: 0 0 4px 4px; background: var(--hue); }
.hue-coral { --hue: var(--coral); }
.hue-lime { --hue: var(--lime); }
.hue-cyan { --hue: var(--cyan); }
.card h3 { font-size: 23px; margin: 10px 0 12px; }
.card p { color: var(--text-mid); font-size: 16px; }
.card ul, .sources ul { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.card li { position: relative; padding-left: 20px; font-size: 15px; line-height: 1.5; color: var(--text-mid); }
.card li::before { content: ""; position: absolute; left: 2px; top: 0.58em; width: 7px; height: 7px; border-radius: 50%; background: var(--hue); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 6vw, 80px); }
.split h2 { font-size: clamp(26px, 3.2vw, 36px); }
.split p:not(.kicker) { color: var(--text-mid); }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 30px; border-top: 1px solid var(--surface-line); }
.facts > div { padding: 24px 22px 6px 0; }
.facts > div + div { padding-left: 22px; border-left: 1px solid var(--surface-line); }
.facts h3 { font-size: 18px; margin-bottom: 8px; }
.facts p { font-size: 15px; line-height: 1.55; color: var(--text-mid); }

.sources li { font-size: 14.5px; color: var(--text-dim); max-width: 78ch; }

/* Documents: legal pages and support */
.doc { max-width: var(--max); margin: 0 auto; padding: clamp(28px, 5vw, 64px) var(--pad) clamp(56px, 8vw, 104px); }
.doc-head h1 { font-size: clamp(36px, 5.4vw, 60px); letter-spacing: -0.03em; margin-bottom: 16px; }
.doc-meta { margin-top: 16px; font-size: 14px; color: var(--text-dim); }
.doc-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); margin-top: clamp(32px, 5vw, 56px); align-items: start; }
.doc-toc { position: sticky; top: 24px; font-size: 14.5px; }
.doc-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; border-left: 1px solid var(--surface-line); padding-left: 16px; }
.doc-toc a { color: var(--text-dim); text-decoration: none; }
.doc-toc a:hover { color: var(--text); }
.doc-body { max-width: 68ch; }
.doc-body.wide { margin-top: clamp(32px, 5vw, 56px); }
.doc-body section { scroll-margin-top: 24px; }
.doc-body section + section { margin-top: 36px; }
.doc-body h2 { font-size: 24px; margin-bottom: 12px; }
.doc-body p { color: var(--text-mid); }
.doc-body p + p { margin-top: 12px; }
.doc-body strong { color: var(--text); font-weight: 600; }
.doc-also { margin-top: 44px !important; padding-top: 22px; border-top: 1px solid var(--surface-line); font-size: 15px; }

details { border-top: 1px solid var(--surface-line); }
details:last-of-type { border-bottom: 1px solid var(--surface-line); }
summary { cursor: pointer; padding: 15px 28px 15px 0; position: relative; list-style: none; font-weight: 600; color: var(--text); }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font: 400 22px/1.2 var(--round); color: var(--text-dim); }
details[open] summary::after { content: "–"; }
details p { padding: 0 0 18px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { order: -1; width: min(62vw, 260px); justify-self: start; }
  .trio { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts > div, .facts > div + div { padding: 22px 18px 6px 0; border-left: 0; }
  .doc-grid { grid-template-columns: 1fr; }
  .doc-toc { position: static; }
}
@media (max-width: 520px) {
  body { font-size: 16.5px; }
  .top nav { gap: 6px 16px; }
  .top nav a { font-size: 14.5px; }
  .facts { grid-template-columns: 1fr; }
  .actions .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rings .arc { animation: none; }
  .btn { transition: none; }
}
