/* PIVOT website — tokens and rules from DESIGN.md. No new colours; no shadows. */
:root {
  --ink: #0f2a2a;
  --ink-raised: #15393a;
  --paper: #f6f5ef;
  --paper-raised: #fbfaf3;
  --sand: #e2b660;
  --line: #e4e1d4;
  --rule: #d8d4c3;
  --muted: #5a6e6f;
  --on-dark-strong: #e9efed;
  --on-dark: #d3e0dd;
  --on-dark-muted: #adc4c0;
  --gutter: clamp(20px, 5vw, 64px);
  --section-y: clamp(72px, 9vw, 128px);
  --font-head: 'Lexend', system-ui, sans-serif;
  --font-body: 'Source Sans 3', system-ui, sans-serif;
  /* Focus ring colour follows the nearest background: sand on ink, ink on paper/sand. */
  --focus: var(--ink);
}
.on-dark, .site-header, .featured { --focus: var(--sand); }
.on-paper, .on-sand, .related { --focus: var(--ink); }

*, *::before, *::after { box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 18px; line-height: 1.6; text-wrap: pretty; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ol, ul { margin: 0; }
h1, h2, h3 { overflow-wrap: break-word; hyphens: none; text-wrap: balance; }
.hero-grid > *, .grid-2 > *, .featured > *, .papers > *, .related > *, .team-grid > * { min-width: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 4px; }
a:hover { opacity: 0.8; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
#main:focus { outline: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { max-width: 1280px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.on-dark { background: var(--ink); color: var(--paper); }
.on-paper { background: var(--paper); color: var(--ink); }

.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--sand); color: var(--ink); padding: 12px 18px; border-radius: 999px; font-family: var(--font-head); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 16px; --focus: var(--sand); }

/* Type */
.h1 { font-family: var(--font-head); font-weight: 700; font-size: clamp(44px, 6vw, 80px); line-height: 1.08; letter-spacing: -0.01em; }
.h2-xl { font-family: var(--font-head); font-weight: 700; font-size: clamp(40px, 6vw, 88px); line-height: 1.08; letter-spacing: -0.01em; }
.h2 { font-family: var(--font-head); font-weight: 700; font-size: clamp(36px, 5vw, 64px); line-height: 1.1; letter-spacing: -0.01em; }
.h2-card { font-family: var(--font-head); font-weight: 700; font-size: 40px; line-height: 1.15; letter-spacing: -0.005em; }
.h3-feature { font-family: var(--font-head); font-weight: 700; font-size: clamp(32px, 4.5vw, 56px); line-height: 1.1; letter-spacing: -0.01em; }
.h3-card { font-family: var(--font-head); font-weight: 600; font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; }
.h3-list { font-family: var(--font-head); font-weight: 600; font-size: clamp(20px, 2.2vw, 28px); }
.lead { font-size: 21px; line-height: 1.45; max-width: 36ch; }
.body-sm { font-size: 16px; line-height: 1.6; }
.meta { font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--muted); }
.on-dark .meta, .on-dark .muted { color: var(--on-dark-muted); }
.muted { color: var(--muted); }
.prose p + p { margin-top: 1em; }
.prose { max-width: 70ch; }

/* Buttons, tags, links */
.btn { display: inline-block; font-family: var(--font-head); font-size: 16px; padding: 16px 26px; border-radius: 999px; text-decoration: none; border: 0; cursor: pointer; line-height: 1.2; }
.btn-primary { background: var(--sand); color: var(--ink); font-weight: 600; }
.btn-outline { background: transparent; color: var(--paper); border: 1.5px solid var(--paper); padding: 15px 26px; font-weight: 500; }
.btn-dark { background: var(--ink); color: var(--paper); font-weight: 600; }
.btn-dark-lg { padding: 18px 30px; font-size: 17px; }
.tag { display: inline-block; background: var(--sand); color: var(--ink); font-family: var(--font-head); font-weight: 600; font-size: 15px; padding: 4px 14px; border-radius: 999px; }
.tag-outline { background: transparent; border: 1px solid var(--on-dark-muted); color: var(--on-dark-muted); }
.text-link { font-family: var(--font-head); font-weight: 600; font-size: 15px; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }

/* Header */
.site-header { background: var(--ink); color: var(--paper); position: relative; z-index: 10; }
.site-header .wrap { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding-top: 24px; padding-bottom: 24px; }
.brand-logo { display: block; height: 34px; width: auto; }
.footer-brand { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.footer-brand img { height: 22px; width: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-head); font-weight: 700; font-size: 22px; letter-spacing: 0.08em; }
.nav { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; font-family: var(--font-head); font-size: 15px; }
.nav a { text-decoration: none; }
.nav a[aria-current='page'] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.nav-menu { display: none; }
.nav-menu summary { list-style: none; cursor: pointer; font-family: var(--font-head); font-weight: 600; font-size: 16px; padding: 10px 20px; border-radius: 999px; border: 1.5px solid var(--paper); }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu[open] summary { background: var(--paper); color: var(--ink); }
.nav-menu summary:focus-visible { outline: 3px solid var(--sand); outline-offset: 3px; }
.nav-menu .nav-panel { position: absolute; left: var(--gutter); right: var(--gutter); top: 100%; display: flex; flex-direction: column; gap: 4px; padding: 12px; background: var(--ink-raised); border-radius: 24px; font-family: var(--font-head); font-size: 18px; }
.nav-menu .nav-panel a { padding: 14px 16px; border-radius: 14px; text-decoration: none; }
.nav-menu .nav-panel a[aria-current='page'] { background: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.nav-menu .nav-panel .nav-cta { background: var(--sand); color: var(--ink); font-weight: 600; text-align: center; margin-top: 4px; }
.nav-menu .nav-panel .nav-cta[aria-current='page'] { background: var(--sand); color: var(--ink); }
@media (max-width: 720px) { .nav-inline { display: none; } .nav-menu { display: block; } .site-header .wrap { flex-wrap: nowrap; } }
.nav .nav-cta { background: var(--paper); color: var(--ink); padding: 10px 18px; border-radius: 999px; font-weight: 600; }

/* Hero */
.hero { position: relative; overflow: hidden; padding-top: clamp(48px, 8vw, 120px); padding-bottom: clamp(56px, 8vw, 120px); }
.hero-grid { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 48px; align-items: center; }
.stack-32 { display: flex; flex-direction: column; gap: 32px; }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-mark { width: 100%; max-width: 560px; height: auto; display: block; margin: 0 auto; }
.spiral-deco { position: absolute; pointer-events: none; color: currentColor; }
.spiral-hero { width: min(900px, 120vw); right: -18%; bottom: -35%; color: var(--ink-raised); }
.page-hero { position: relative; overflow: hidden; }
.page-hero > .wrap { position: relative; }
.spiral-page { width: min(560px, 90vw); right: -6%; top: -30%; color: var(--ink-raised); }
.spiral-cta { width: min(520px, 55vw); right: -4%; top: -40%; opacity: 0.14; }
.page-hero { padding-top: clamp(40px, 6vw, 88px); padding-bottom: clamp(48px, 6vw, 88px); }
.page-hero p { margin-top: 24px; font-size: 21px; line-height: 1.45; max-width: 46ch; color: var(--on-dark); }

/* Cards and grids */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 24px; }
.card { border-radius: 28px; padding: 40px; display: flex; flex-direction: column; gap: 16px; }
.card-light { background: var(--paper-raised); border: 1px solid var(--line); }
.card-accent { background: var(--sand); color: var(--ink); }
.card-dark { background: var(--ink-raised); padding: 36px; gap: 14px; }
.card-pending { background: transparent; border: 1.5px dashed var(--muted); }
.card-num { font-family: var(--font-head); font-weight: 600; font-size: 16px; color: var(--muted); }
.card-accent .card-num { color: var(--ink); }
.featured { background: var(--ink); color: var(--paper); border-radius: 28px; padding: clamp(28px, 4vw, 48px); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px 48px; align-items: end; }
.featured .stack { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.featured p { color: var(--on-dark-strong); }
.section-title { margin-bottom: 32px; }
.audience-list { margin-top: 12px; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.audience-row { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px 40px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.audience-row p { font-size: 16px; line-height: 1.5; color: var(--muted); }
@media (max-width: 560px) { .audience-row { grid-template-columns: 1fr; } }
.row-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 24px; margin-bottom: 48px; }
.row-head-stack { flex-direction: column; align-items: flex-start; gap: 20px; }
.row-head-stack .note { font-size: 18px; max-width: 52ch; }
.paper-head, .paper-body { display: contents; }
.paper-feature { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px 56px; align-items: start; padding: clamp(28px, 4vw, 48px); }
.paper-feature .h3-card { font-size: clamp(26px, 3vw, 36px); }
.paper-feature .paper-head { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.paper-feature .paper-body { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.who-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 24px 64px; align-items: start; }
.who-layout > * { min-width: 0; }
.who-layout .who-intro { position: sticky; top: 24px; }
@media (min-width: 900px) { .who-layout { grid-template-columns: 1fr 2fr; } }
.row-head .note { font-size: 15px; color: var(--on-dark-muted); max-width: 38ch; }
.papers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 20px; }
.paper-authors { font-size: 16px; color: var(--on-dark-muted); }
.paper-summary { font-size: 16px; line-height: 1.6; color: var(--on-dark-strong); }
.paper-card .text-link { margin-top: auto; align-self: flex-start; }
.related { margin-top: 20px; background: var(--paper); color: var(--ink); border-radius: 28px; padding: 36px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px 48px; }
.related .kicker { font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--muted); text-transform: none; }
.related .stack { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.references { margin-top: 64px; }
.references h3 { font-family: var(--font-head); font-weight: 600; font-size: 18px; margin-bottom: 16px; }
.references ol { padding-left: 1.4em; font-size: 16px; line-height: 1.7; color: var(--on-dark); max-width: 100ch; display: flex; flex-direction: column; gap: 10px; }
.references a { color: var(--paper); text-decoration: underline; text-underline-offset: 4px; }
.team-grid { list-style: none; padding: 0; margin: 0; max-width: 960px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 240px)); justify-content: start; gap: 24px; }
.member { display: flex; flex-direction: column; gap: 6px; }
.photo { aspect-ratio: 1; border-radius: 28px; background: var(--line); object-fit: cover; width: 100%; margin-bottom: 14px; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 700; font-size: 64px; color: var(--muted); }
.member .role { font-size: 15px; color: var(--muted); }
.member-contact { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.contact-btn { display: flex; flex-direction: column; justify-content: center; min-height: 44px; padding: 10px 16px; border: 1.5px solid var(--ink); border-radius: 16px; color: var(--ink); text-decoration: none; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.contact-btn:hover { background: var(--ink); color: var(--paper); }
.contact-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.contact-btn-label { font-family: var(--font-head); font-weight: 600; }
.contact-btn-value { font-size: 15px; opacity: 0.8; }
.qr-wrap { display: none; margin: 8px 0 0; }
.qr-wrap figcaption { margin-top: 8px; font-size: 15px; color: var(--muted); }
.member-contact .qr { width: 160px; height: 160px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--paper-raised); }
.member-contact .qr svg { display: block; width: 100%; height: 100%; }
@media (min-width: 768px) { .qr-wrap { display: block; } }
.contact-people { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 24px; align-items: start; }
.contact-person { display: flex; flex-direction: column; gap: 8px; }
.contact-login { margin-top: 32px; font-size: 17px; }
.member .bio { margin-top: 8px; font-size: 16px; line-height: 1.6; }

/* Contact */
.cta-block { position: relative; overflow: hidden; background: var(--sand); color: var(--ink); border-radius: 36px; padding: clamp(28px, 6vw, 80px); display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 32px; margin-bottom: 40px; }
.cta-block .h2-cta { font-family: var(--font-head); font-weight: 700; font-size: clamp(36px, 5.5vw, 76px); line-height: 1.1; letter-spacing: -0.01em; max-width: 14ch; }
.cta-block > * { position: relative; }
.cta-block > .spiral-deco { position: absolute; }
.cta-slim { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 24px 40px; border-top: 1.5px solid var(--ink); padding: 40px 0; margin-bottom: 24px; }
.cta-slim .h3-feature { font-size: clamp(28px, 3.6vw, 44px); }
.cta-slim p { margin-top: 10px; max-width: 46ch; }
.cta-block p { margin-top: 20px; max-width: 46ch; }

.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 16px; color: var(--muted); padding-bottom: 40px; }

.how-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.how-layout > * { min-width: 0; }
.demo-chart { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.demo-chart img { width: 100%; height: auto; max-width: 560px; border-radius: 20px; background: var(--paper-raised); border: 1px solid var(--line); }
.demo-chart figcaption { font-size: 15px; line-height: 1.5; color: var(--muted); max-width: 560px; }
.demo-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 32px; margin-top: 48px; max-width: 800px; }
@media (max-width: 800px) { .how-layout { grid-template-columns: 1fr; } }

.measure-num { font-family: var(--font-head); font-weight: 700; font-size: 15px; color: var(--ink); background: var(--sand); width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

.dg-label { margin-bottom: 16px; }
.dg-sectors { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px 20px; }
.dg-sector { position: relative; display: flex; flex-direction: column; gap: 28px; background: var(--ink-raised); border-radius: 24px; padding: 24px 20px; min-width: 0; }
.dg-sector:not(:last-child)::after { content: "\2192"; position: absolute; right: -19px; top: 30px; width: 18px; text-align: center; color: var(--sand); font-family: var(--font-head); font-weight: 700; line-height: 1; }
.dg-dims { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.dg-dim { display: flex; align-items: center; gap: 14px; background: var(--ink-raised); border-radius: 24px; padding: 24px 20px; min-width: 0; }
.dg-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--sand); }
.dg-total { margin-top: 32px; color: var(--on-dark); }
.dg-total .text-link { margin-left: 8px; }
@media (max-width: 900px) {
  .dg-sectors { grid-template-columns: 1fr; gap: 28px; }
  .dg-sector { flex-direction: row; align-items: center; gap: 16px; padding: 16px 20px; }
  .dg-sector:not(:last-child)::after { content: "\2193"; right: auto; left: 31px; top: auto; bottom: -26px; }
  .dg-dims { grid-template-columns: 1fr; gap: 12px; }
  .dg-dim { padding: 16px 20px; }
}
.dg-steps { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; }
.dg-step { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 20px; padding-bottom: 28px; }
.dg-step:not(:last-child)::before { content: ""; position: absolute; left: 17px; top: 40px; bottom: 4px; width: 2px; background: var(--rule); }
.dg-step .measure-num { position: relative; }
.dg-step .stack { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dg-step p { font-size: 16px; line-height: 1.5; color: var(--muted); }
.dg-loop { align-self: flex-start; margin-top: 4px; background: var(--ink); color: var(--paper); font-family: var(--font-head); font-size: 14px; font-weight: 600; padding: 4px 14px; border-radius: 999px; }
