/*
  pages.css: the one stylesheet for every page that is not the landing page.
  Served unhashed at /assets/pages.css (copied from public/ by Vite), so the Worker's own pages
  (/confirm, /delete/confirm, the error and 403 pages) can link it by a stable URL.
  The look is the form's: black on white (DESIGN.md "Colour", Loïs's direction).

  Class contract with worker/pages/layout.ts: body.wp, .wp-header, .wp-home, .wp-main, .wp-title,
  .wp-line, .wp-ticket, .wp-invite, .wp-invite-title, .wp-invite-link, .wp-form, .wp-label,
  .wp-input, .wp-turnstile, .btn, .wp-back, .wp-toast, .wp-error. Keep those names stable.
  Everything else (.wp-foot, .wp-prose, .fd-*) is used by the Vite pages only.
  No inline styles anywhere: the CSP has style-src 'self'.
*/

@font-face {
  font-family: 'Geist';
  src: url('/fonts/geist.woff2') format('woff2-variations'), url('/fonts/geist.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/geist-mono.woff2') format('woff2-variations'), url('/fonts/geist-mono.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #FFFFFF;
  --ink: #000000;
  --body: #1F1F1F;
  --muted: #595959;      /* 7:1 on white, fine at any size */
  --field: #F3F3F3;
  --line: #E3E3E3;
  --line-strong: #C9C9C9;
  --error: #C4001A;      /* 6.3:1 on white */
  --ease-ui: cubic-bezier(.2, .8, .2, 1);
  --ease-cinema: cubic-bezier(.16, 1, .3, 1);
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --margin: 16px;
  --measure: 640px;
  color-scheme: light;
}

@media (min-width: 900px) {
  :root { --margin: clamp(32px, 4.45vw, 64px); }
}

*, *::before, *::after { box-sizing: border-box; }

.wp [hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body.wp {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--body);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.wp a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.wp a:hover { text-decoration-thickness: 2px; }

.wp :focus { outline: none; }
.wp :focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.wp-skip {
  position: absolute;
  left: var(--margin);
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper) !important;
  text-decoration: none !important;
}
.wp-skip:focus-visible { top: 12px; outline-color: var(--ink); }

/* ---------- Header ---------- */

.wp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 0 var(--margin);
  border-bottom: 1px solid var(--line);
}

/* The Worker's header is a text link "Frameless": the CSS swaps it for the black logo. */
.wp-home {
  display: inline-block;
  width: 83px;    /* 16 px tall at the lockup's 3013 x 582 ratio (src/brand/lockup.ts) */
  height: 16px;
  overflow: hidden;
  white-space: nowrap;
  text-indent: 110%;
  background: url('/brand/logo-lockup-black.svg') left center / contain no-repeat;
}
.wp-home img { display: block; width: 100%; height: 100%; }
.wp-home:has(img) { text-indent: 0; background: none; }

@media (min-width: 900px) {
  .wp-header { min-height: 80px; }
  .wp-home { width: 104px; height: 20px; }
}

/* ---------- Main ---------- */

.wp-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--margin));
  margin: 0 auto;
  padding: clamp(40px, 9vh, 96px) var(--margin) 72px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.wp-main > * { margin: 0; max-width: 100%; }

.wp-title {
  font-family: var(--font);
  font-size: clamp(36px, calc(36px + 20 * (100vw - 360px) / 1080), 56px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.035em;
  color: var(--ink);
  text-wrap: balance;
}

.wp-line { max-width: 34em; font-size: 18px; line-height: 1.55; }

.wp-meta {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--muted);
}

.wp-back { margin-top: 12px; }
.wp-back, p > .wp-back { font-size: 16px; }

/* ---------- Form ---------- */

.wp-form {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 440px;
  margin-top: 8px;
}

.wp-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

.wp-input {
  display: block;
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  -webkit-appearance: none;
  appearance: none;
  transition: box-shadow 180ms var(--ease-ui);
}
.wp-input:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ink); border-radius: 12px; }
.wp-input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--error); }
.wp-input[aria-invalid="true"]:focus-visible { box-shadow: inset 0 0 0 2px var(--error); }

.wp-field-error { margin: 0; min-height: 0; font-size: 15px; color: var(--error); }
.wp-field-error:empty { display: none; }

/* Turnstile, managed mode: its space is reserved so nothing jumps when it renders. */
.wp-turnstile { min-height: 65px; max-width: 100%; overflow: hidden; }

.wp-error {
  max-width: 34em;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--error);
  color: var(--error);
  font-size: 16px;
}
.wp-error[hidden] { display: none; }

.wp-done {
  max-width: 34em;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  font-size: 18px;
}

.wp-toast { font-size: 15px; color: var(--ink); }

/* ---------- Buttons ---------- */

.wp .btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  justify-self: start;
}
/* A sheen band sweeps across once on hover (DESIGN.md, 0.9 s). */
.wp .btn::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%);
  transform: translateX(-110%);
  pointer-events: none;
}
.wp .btn:hover::after { transform: translateX(110%); transition: transform 900ms var(--ease-cinema); }
.wp .btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 999px; }
.wp .btn[aria-disabled="true"], .wp .btn:disabled { cursor: progress; opacity: .55; }

.wp .btn--ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.wp .btn--ghost::after { display: none; }
.wp .btn--ghost:hover { background: var(--ink); color: var(--paper); }

.wp .btn--small { min-height: 40px; padding: 0 16px; font-size: 14px; }

/* ---------- Ticket and invite (Worker /confirm page) ---------- */

.wp-ticket {
  --stub: 76px;
  position: relative;
  width: min(100%, 380px);
  padding: 26px calc(var(--stub) + 24px) 26px 24px;
  border-radius: 14px;
  background: #000;
  color: #FFF;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  -webkit-mask: radial-gradient(circle at calc(100% - var(--stub)) 0, transparent 10px, #000 11px) top / 100% 51% no-repeat,
    radial-gradient(circle at calc(100% - var(--stub)) 100%, transparent 10px, #000 11px) bottom / 100% 51% no-repeat;
  mask: radial-gradient(circle at calc(100% - var(--stub)) 0, transparent 10px, #000 11px) top / 100% 51% no-repeat,
    radial-gradient(circle at calc(100% - var(--stub)) 100%, transparent 10px, #000 11px) bottom / 100% 51% no-repeat;
}
.wp-ticket::before {
  content: '';
  position: absolute;
  top: 14px;
  bottom: 14px;
  right: var(--stub);
  border-left: 1px dashed rgba(255, 255, 255, .35);
}
.wp-ticket::after {
  content: '';
  position: absolute;
  right: calc(var(--stub) / 2 - 9px);
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border-radius: 50%;
  border: 1.5px solid #FFF;
}

.wp-invite {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 440px;
  margin-top: 20px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.wp-invite > * { margin: 0; }
.wp-invite-title { font-size: 24px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); line-height: 1.2; }
.wp-invite-link { font-family: var(--mono); font-size: 15px; text-overflow: ellipsis; }

/* ---------- Legal pages ---------- */

.wp-prose { width: 100%; }
.wp-prose > * { margin: 0; }
.wp-prose > * + * { margin-top: 14px; }
.wp-prose h2 {
  margin-top: 40px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.015em;
  color: var(--ink);
}
.wp-prose ul { padding-left: 1.2em; }
.wp-prose li + li { margin-top: 6px; }
.wp-prose address { font-style: normal; }
.wp-placeholder {
  font-family: var(--mono);
  font-size: .88em;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
}

/* ---------- Footer ---------- */

.wp-foot {
  padding: 32px var(--margin) calc(32px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--muted);
}
.wp-foot-inner { display: grid; gap: 12px; max-width: 1440px; margin: 0 auto; }
.wp-foot p { margin: 0; }
.wp-foot ul { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; }
.wp-foot a { color: var(--ink); }
.wp-foot-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.wp-foot-contact .btn { min-height: 36px; }
@media (min-width: 900px) {
  .wp-foot-inner { grid-template-columns: 1fr auto; align-items: start; column-gap: 48px; }
  .wp-foot-inner > :nth-child(even) { justify-self: end; text-align: right; }
}

.wp-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Founders' page ---------- */

body.wp.fd .wp-main { max-width: calc(1280px + 2 * var(--margin)); gap: 28px; }

.fd-section { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.fd-h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); line-height: 1.25; }
.fd-note { margin: 0; font-size: 15px; color: var(--muted); }
.fd-status { margin: 0; font-size: 15px; color: var(--muted); }
.fd-status:empty { display: none; }

.fd-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
@media (min-width: 900px) { .fd-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.fd-tile {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.fd-tile dt { order: 1; font-size: 14px; color: var(--muted); line-height: 1.35; }
.fd-tile dd { margin: 0; }
.fd-value {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.fd-of { font-size: .45em; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.fd-meter { display: block; width: 100%; height: 6px; margin-top: 6px; border-radius: 3px; background: var(--field); overflow: hidden; }
.fd-meter rect.fd-meter-bar { fill: var(--ink); }

.fd-chart { width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 8px; }
.fd-chart svg { display: block; width: 100%; height: auto; }
.fd-chart .bar { fill: #BDBDBD; }
.fd-chart .bar-c { fill: var(--ink); }
.fd-chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.fd-chart .grid { stroke: var(--line); stroke-width: 1; }
.fd-chart text { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.fd-legend { display: flex; gap: 18px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.fd-legend li::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; background: #BDBDBD; vertical-align: -1px; }
.fd-legend li.c::before { background: var(--ink); }

.fd-lists { display: grid; gap: 16px; width: 100%; }
@media (min-width: 900px) { .fd-lists { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fd-list { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; }
.fd-list ol { margin: 10px 0 0; padding: 0; list-style: none; max-height: 340px; overflow: auto; }
.fd-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 15px; }
.fd-list li:first-child { border-top: 0; }
.fd-list .k { min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.fd-list .n { flex: none; font-family: var(--mono); font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.fd-list .sub { display: block; font-size: 13px; color: var(--muted); }

.fd-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.fd-filters { position: relative; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.fd-filters input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.fd-filters label {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.fd-filters input:checked + label { background: var(--ink); color: var(--paper); box-shadow: none; }
.fd-filters input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 3px; }
.fd-search { display: flex; align-items: center; gap: 10px; flex: 1 1 260px; max-width: 420px; }
.fd-search .wp-input { height: 44px; font-size: 16px; }
.fd-toolbar .fd-export { margin-left: auto; }

.fd-tablewrap { position: relative; width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.fd-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.4; }
.fd-table caption { text-align: left; padding: 12px 14px 0; font-size: 14px; color: var(--muted); }
.fd-table th, .fd-table td { padding: 10px 14px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.fd-table thead th { border-top: 0; font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.fd-table td { color: var(--ink); }
.fd-table .num { font-family: var(--mono); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fd-table .email, .fd-table .nowrap { white-space: nowrap; }
.fd-table .muted { color: var(--muted); }
.fd-table .act { text-align: right; white-space: nowrap; }
.fd-table tr.fd-confirm td { background: var(--field); }
.fd-confirm-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 14px; }
.fd-confirm-box p { margin: 0; color: var(--ink); font-weight: 500; }
.fd-tag { display: inline-block; margin: 0 4px 4px 0; padding: 1px 8px; border-radius: 999px; background: var(--field); font-size: 12px; white-space: nowrap; }
.fd-tag.on { background: var(--ink); color: var(--paper); }

.fd-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.fd-pager p { margin: 0; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 404 ---------- */

.wp-404 .wp-main { justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .wp *, .wp *::before, .wp *::after { transition: none !important; animation: none !important; }
  .wp .btn:hover::after { transform: translateX(-110%); }
}
