/* TailsUp site shell, shared by every page: tokens, type scale, grid, buttons and links, reveals, screen recordings,
   then the header, page switcher, invite dialog, cookie banner and footer. Load after tokens.css (fonts); behaviour
   comes from /assets/js/site.js. Light-led: warm paper is the ground, ink the type and the dark sections. Marcellus
   only where the brand speaks (wordmark, H1, the invite line, the dialog title); Inter for the rest; Geist Mono for figures.
   Mobile first; desktop from 900 px. The markup to copy is in runtime/shell-notes.md. */

:root {
  --paper: #F2F1EC;
  --paper-2: #E9E7E0;          /* the deeper stock */
  --paper-3: #DEDBD2;
  --ink: #0B0B0C;
  --ink-soft: #3F3E3A;
  --ink-mute: #64625C;         /* 4.7:1 on paper */
  --rule: rgba(11, 11, 12, .15);
  --rule-2: rgba(11, 11, 12, .08);
  --on-ink: #F2F1EC;
  --on-ink-soft: #AAA79F;
  --on-ink-mute: #7B7972;
  --rule-ink: rgba(242, 241, 236, .14);
  /* data colour, in figures only: on paper the darker steps keep 4.5:1 */
  --gain: #0B7A57;
  --loss: #B8322B;
  --gain-ink: #2BC08F;
  --loss-ink: #F2554D;

  --serif: "Marcellus", "Cormorant Garamond", Georgia, serif;

  /* type scale (390 → 1440) */
  --t-h1: clamp(40px, 13.4vw, 72px);
  --t-h2: clamp(34px, 4.5vw, 64px);
  --t-h3: clamp(19px, 1.5vw, 22px);
  --t-lead: clamp(18px, 1.45vw, 21px);
  --t-body: clamp(16px, 1.15vw, 17px);
  --t-small: 14px;
  --t-micro: 12px;

  --m: 16px;                   /* side gutter */
  --gap: 16px;                 /* column gap */
  --hdr: 56px;
  --r-s: 8px;
  --r-m: 14px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --sec: clamp(88px, 11vw, 168px);   /* section padding */
}
@media (min-width: 900px) { :root { --m: clamp(32px, 4.45vw, 64px); --gap: 24px; --hdr: 68px; --t-h1: min(10.4vw, 158px); } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--paper); scroll-padding-top: calc(var(--hdr) + 16px); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--t-body)/1.55 var(--sans); letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
body.is-locked { overflow: hidden; }
h1, h2, h3, p, figure, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
img, svg, video, canvas { display: block; max-width: 100%; }
table { border-collapse: collapse; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.is-gain { color: var(--gain); }
.is-loss { color: var(--loss); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--ink); color: var(--paper); border-radius: var(--r-s); }
.skip:focus { top: 12px; }

/* grid: one column on phones, 12 from 900 px (repeat(12, 1fr) with column-gap: var(--gap) inside .wrap) */
.wrap { width: 100%; max-width: 1568px; margin-inline: auto; padding-inline: var(--m); }

/* type */
.h2 { font-weight: 500; font-size: var(--t-h2); line-height: 1.02; letter-spacing: -.038em; text-wrap: balance; }
.lead { font-size: var(--t-lead); line-height: 1.45; letter-spacing: -.012em; color: var(--ink-soft); text-wrap: pretty; }
.note { font-size: var(--t-micro); line-height: 1.55; color: var(--ink-mute); letter-spacing: 0; }
.sec-head { display: grid; gap: 14px; }
@media (min-width: 900px) { .sec-head { gap: 18px; } }

/* buttons: pills; solid ink on paper (the header turns them paper over ink) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px;
  border-radius: 999px; font-size: 15px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap;
  transition: background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn-s { height: 36px; padding: 0 16px; font-size: 14px; }
.btn-l { height: 52px; font-size: 16px; }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: #2A2926; }
.btn-ghost { box-shadow: inset 0 0 0 1px var(--rule); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }

/* text link with an arrow that moves on hover */
.link { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; letter-spacing: -.01em; padding-bottom: 3px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; transition: background-size .35s var(--ease); }
.link svg { width: 15px; height: 15px; transition: transform .35s var(--ease); }
.link:hover svg { transform: translateX(4px); }

/* reveals (site.js adds .is-in); nothing moves under reduced motion */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease) var(--d, 0s), transform 1.1s var(--ease) var(--d, 0s); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.rm [data-reveal] { transform: none; transition: opacity .4s linear; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }

/* a card on paper (12 px corners): box-shadow 0 1px 0 rgba(255, 255, 255, .5), 0 30px 60px -34px rgba(11, 11, 12, .55),
   baked into a nine-slice image because Firefox repaints a box-shadow on scroll (design/ui/bake-card-shadow.mjs sets
   the outsets and the slice) */
.card-shadow { position: relative; isolation: isolate; }
.card-shadow::before { content: ""; position: absolute; z-index: -1; inset: -26px -56px -86px; pointer-events: none;
  border: 0 solid transparent; border-image: url(/assets/img/cards/shadow.png) 360 fill / 180px; }

/* screen recordings (initRec in site.js): full-frame, no device around them; set the frame's aspect-ratio per film */
.rec-frame { position: relative; overflow: hidden; border-radius: var(--r-s); background: #000; isolation: isolate; }
.rec-v { width: 100%; height: 100%; object-fit: cover; }
.rec-btn {
  position: absolute; left: 12px; bottom: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px 0 11px;
  border-radius: 999px; background: rgba(20, 20, 20, .62); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #fff;
  font-size: 12.5px; font-weight: 500; opacity: .9; transition: opacity .2s, background-color .2s;
}
.rec-btn:hover { opacity: 1; background: rgba(20, 20, 20, .8); }
.rec-btn svg { width: 12px; height: 12px; }
.rec-btn .i-b, .rec.is-paused .rec-btn .i-a { display: none; }
.rec.is-paused .rec-btn .i-b { display: block; }
.rec-snd { left: auto; right: 12px; }
.rec-snd .s-on, .rec.is-voiced .rec-snd .s-off { display: none; }
.rec.is-voiced .rec-snd .s-on { display: block; }
.rec-bar { position: absolute; inset: auto 0 0; z-index: 2; height: 2px; background: rgba(255, 255, 255, .16); }
.rec-bar i { display: block; height: 100%; background: rgba(255, 255, 255, .9); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* ---------- header: paper type over ink, ink type over sections marked data-tone="light" ---------- */
.hdr {
  position: fixed; inset: 0 0 auto; z-index: 60; height: var(--hdr);
  display: flex; align-items: center; gap: 10px;
  padding-inline: max(var(--m), calc((100vw - 1568px) / 2 + var(--m)));
  color: var(--on-ink); transition: background-color .35s var(--ease), color .35s var(--ease), box-shadow .35s var(--ease);
}
/* solid, with no backdrop blur: re-blurring what scrolls under the header every frame halves Firefox's frame rate */
.hdr.is-solid { background: var(--ink); box-shadow: 0 1px 0 var(--rule-ink); }
.hdr.is-light { color: var(--ink); }
.hdr.is-light.is-solid { background: var(--paper); box-shadow: 0 1px 0 var(--rule-2); }
.hdr:not(.is-light) .btn-solid { background: var(--on-ink); color: var(--ink); }
.hdr:not(.is-light) .btn-solid:hover { background: #fff; }

.brand { display: flex; align-items: flex-end; height: 24px; flex: none; }
.brand-cat { height: 100%; aspect-ratio: 532.31 / 1000; }
.brand-cat svg { width: 100%; height: 100%; }
.brand-word { height: 100%; width: auto; aspect-ratio: 2664.87 / 1000; }

.sw-trigger { order: 3; position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; margin-right: -8px; }
.sw-trigger-l, .sw-trigger-i { display: none; }
.sw-trigger-m { width: 20px; height: 20px; }
.hdr-right { order: 2; margin-left: auto; display: flex; align-items: center; gap: 22px; }
.hdr-login { display: none; font-size: 14px; font-weight: 500; opacity: .78; transition: opacity .2s; }
.hdr-login:hover { opacity: 1; }

@media (min-width: 900px) {
  .hdr { gap: 28px; }
  .brand { height: 28px; }
  .sw-trigger {
    order: 0; display: inline-flex; gap: 8px; width: auto; height: 36px; padding: 0 12px 0 16px; margin: 0;
    font-size: 14px; font-weight: 500; letter-spacing: -.01em; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 20%, transparent);
    transition: box-shadow .2s var(--ease);
  }
  .sw-trigger:hover, .sw-trigger[aria-expanded="true"] { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 60%, transparent); }
  .sw-trigger-l { display: inline; }
  .sw-trigger-i { display: block; width: 14px; height: 14px; transition: transform .3s var(--ease); }
  .sw-trigger[aria-expanded="true"] .sw-trigger-i { transform: rotate(180deg); }
  .sw-trigger-m { display: none; }
  .hdr-login { display: inline; }
}

/* ---------- page switcher: a paper sheet on phones, a dropdown under the trigger from 900 px ---------- */
.sw-scrim { position: fixed; inset: 0; z-index: 68; background: rgba(11, 11, 12, .22); opacity: 0; visibility: hidden; transition: opacity .25s linear, visibility 0s .25s; }
.sw-open .sw-scrim { opacity: 1; visibility: visible; transition: opacity .25s linear; }
.sw { position: fixed; z-index: 70; color: var(--ink); background: var(--paper); visibility: hidden; opacity: 0; }
.sw-open .sw { visibility: visible; opacity: 1; }
.sw-name { font-weight: 500; letter-spacing: -.03em; line-height: 1.05; }
.sw-pitch { color: var(--ink-mute); line-height: 1.35; letter-spacing: -.005em; }
.sw-vis { position: relative; overflow: hidden; display: block; border-radius: 10px; background: var(--paper-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule-2); }
.sw-vis canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sw-item a[aria-current="page"] .sw-vis { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.sw-item a { display: grid; position: relative; outline-offset: 2px; }
.sw-top { display: flex; align-items: center; justify-content: space-between; }
.sw-x { width: 40px; height: 40px; margin-right: -8px; border-radius: 999px; display: grid; place-items: center; }
.sw-x svg { width: 16px; height: 16px; }
.sw-foot { display: flex; gap: 10px; }
.sw-item { opacity: 0; transform: translateY(10px); transition: transform .5s var(--ease), opacity .3s linear; }
.sw-open .sw-item { opacity: 1; transform: none; }
.sw-open .sw-item:nth-child(2) { transition-delay: .035s; }
.sw-open .sw-item:nth-child(3) { transition-delay: .07s; }
.sw-open .sw-item:nth-child(4) { transition-delay: .105s; }
.sw-open .sw-item:nth-child(5) { transition-delay: .14s; }
.sw-open .sw-item:nth-child(6) { transition-delay: .175s; }

@media (max-width: 899.98px) {
  .sw { inset: 0; display: flex; flex-direction: column; padding: 0 var(--m) calc(16px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; transition: opacity .25s var(--ease), visibility 0s .25s; }
  .sw-open .sw { transition: opacity .25s var(--ease); }
  .sw-top { height: var(--hdr); flex: none; }
  .sw-list { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 8px 0 20px; }
  .sw-item a { grid-template-columns: 1fr 104px; column-gap: 18px; row-gap: 6px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--rule-2); }
  .sw-item:last-child a { border-bottom: 0; }
  .sw-name { grid-column: 1; font-size: 30px; }
  .sw-pitch { grid-column: 1; font-size: 14px; }
  .sw-vis { grid-column: 2; grid-row: 1 / span 2; aspect-ratio: 4 / 3; }
  .sw-foot { flex: none; }
  .sw-foot .btn { flex: 1; }
}
@media (min-width: 900px) {
  .sw {
    top: calc(var(--hdr) - 6px); left: var(--sw-left, 24px); width: min(1100px, 100vw - 48px); padding: 8px;
    border-radius: 18px; box-shadow: 0 0 0 1px var(--rule-2), 0 32px 80px -28px rgba(11, 11, 12, .38);
    transform: translateY(-8px); transition: opacity .2s linear, transform .4s var(--ease), visibility 0s .2s;
  }
  .sw-open .sw { transform: none; transition: opacity .2s linear, transform .4s var(--ease); }
  .sw-top, .sw-foot { display: none; }
  .sw-list { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; }
  .sw-item a { padding: 10px 10px 14px; border-radius: 12px; gap: 5px; align-content: start; transition: background-color .2s var(--ease); }
  .sw-item a:hover, .sw-item a:focus-visible { background: var(--paper-2); }
  .sw-item a:hover .sw-vis { box-shadow: inset 0 0 0 1px var(--rule); }
  .sw-vis { aspect-ratio: 4 / 3; margin-bottom: 9px; }
  .sw-name { font-size: 17px; }
  .sw-pitch { font-size: 13.5px; }
}

/* ---------- invite dialog ---------- */
.dlg { width: min(440px, 100vw - 32px); max-width: none; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible; }
.dlg::backdrop { background: rgba(11, 11, 12, .52); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.dlg-card { position: relative; display: grid; padding: 40px 32px 28px; border-radius: 22px; background: var(--paper); box-shadow: 0 48px 120px -36px rgba(0, 0, 0, .55); }
.dlg[open] .dlg-card { animation: dlg-in .5s var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.rm .dlg[open] .dlg-card { animation: none; }
.dlg-seal { width: 21px; height: 40px; margin-bottom: 26px; }
.dlg-seal svg { width: 100%; height: 100%; }
.dlg-h { font-family: var(--serif); font-weight: 400; font-size: 42px; line-height: 1; letter-spacing: -.01em; }
.dlg-line { margin-top: 12px; color: var(--ink-soft); }
.dlg-l { margin-top: 30px; font-size: 13px; font-weight: 500; color: var(--ink-mute); }
.dlg-in {
  margin-top: 8px; height: 58px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--rule); background: #FAF9F6; outline: 0;
  font-family: var(--mono); font-size: 21px; letter-spacing: .08em; text-transform: uppercase; transition: border-color .2s, box-shadow .2s;
}
.dlg-in::placeholder { color: #B3B0A8; }
.dlg-in:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(11, 11, 12, .07); }
.dlg-in[aria-invalid="true"] { border-color: var(--loss); box-shadow: 0 0 0 4px rgba(184, 50, 43, .1); }
.dlg-err { min-height: 26px; padding-top: 8px; font-size: 13px; color: var(--loss); }
.dlg-err.is-info { color: var(--ink-mute); }
.dlg-alt { margin-top: 18px; font-size: 14px; color: var(--ink-mute); text-align: center; }
.dlg-alt a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.dlg-x { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; transition: background-color .2s; }
.dlg-x:hover { background: var(--paper-2); }
.dlg-x svg { width: 16px; height: 16px; }
@media (min-width: 900px) { .dlg-card { padding: 48px 44px 32px; } .dlg-h { font-size: 48px; } }

/* ---------- cookie banner ---------- */
.ck {
  position: fixed; z-index: 80; left: var(--m); right: var(--m); bottom: calc(16px + env(safe-area-inset-bottom));
  display: grid; gap: 14px; padding: 18px; border-radius: 16px; background: var(--paper); color: var(--ink);
  box-shadow: 0 0 0 1px var(--rule-2), 0 24px 64px -24px rgba(11, 11, 12, .35);
  opacity: 0; transform: translateY(14px); transition: opacity .3s linear, transform .5s var(--ease);
}
.ck[hidden] { display: none; }
.ck.is-in { opacity: 1; transform: none; }
.ck p { font-size: 14px; line-height: 1.45; }
.ck-row { display: flex; gap: 8px; }
.ck-row .btn { flex: 1; }
@media (min-width: 900px) { .ck { right: auto; width: 372px; bottom: 24px; } }

/* ---------- footer ---------- */
.ftr { background: var(--ink); color: var(--on-ink); padding: clamp(72px, 9vw, 136px) 0 calc(28px + env(safe-area-inset-bottom)); }
.ftr-top { display: grid; gap: 56px; }
.ftr-brand { display: flex; align-items: flex-end; height: 44px; width: max-content; }
.ftr-cat { height: 100%; aspect-ratio: 532.31 / 1000; }
.ftr-cat svg { width: 100%; height: 100%; }
.ftr-line { margin-top: 20px; font-size: 15px; color: var(--on-ink-soft); }
.ftr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 36px 16px; }
.ftr-col h2 { margin-bottom: 14px; font-size: 14px; font-weight: 500; letter-spacing: -.01em; }
.ftr-col li + li { margin-top: 9px; }
.ftr-col li a { font-size: 14px; color: var(--on-ink-soft); transition: color .2s; }
.ftr-col a:hover { color: var(--on-ink); }
.risk { margin-top: 72px; padding-top: 24px; padding-right: max(0px, calc(100% - 72ch)); border-top: 1px solid var(--rule-ink); font-size: 13px; line-height: 1.55; color: var(--on-ink-soft); }
.ftr-base { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; font-size: 13px; color: var(--on-ink-mute); }
.ftr-legal { display: flex; gap: 20px; }
.ftr-legal a, .ftr-legal button { color: var(--on-ink-soft); font-size: 13px; transition: color .2s; }
.ftr-legal a:hover, .ftr-legal button:hover { color: var(--on-ink); }
.ftr-social { display: flex; gap: 8px; margin-left: auto; }
.ftr-social a { width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--rule-ink); color: var(--on-ink-soft); transition: color .2s, box-shadow .2s; }
.ftr-social a:hover { color: var(--on-ink); box-shadow: inset 0 0 0 1px rgba(242, 241, 236, .4); }
.ftr-social svg { width: 16px; height: 16px; }
@media (min-width: 900px) {
  .ftr-top { grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); }
  .ftr-id { grid-column: 1 / span 3; }
  .ftr-cols { grid-column: 5 / span 8; grid-template-columns: repeat(6, 1fr); }
  .ftr-brand { height: 52px; }
  .risk { margin-top: 112px; }
}
