/* ==========================================================================
   UNDER ONE SUN — design system
   One bold element (the crimson sun); everything else quiet and editorial.
   ========================================================================== */

:root {
  /* Colour */
  --paper: #FBF8F4;        /* warm white page */
  --linen: #F3EDE4;        /* secondary surface */
  --line: #E3D9CC;         /* hairlines, input borders */
  --ink: #2B2724;          /* charcoal text */
  --ink-soft: #5F5750;     /* secondary text (AA on paper) */
  --sun: #A8142C;          /* deep crimson */
  --sun-deep: #860E22;
  --clay: #A9573A;         /* muted terracotta (AA for text) */
  --ember: #D48A3E;        /* warm orange accent, never for text */
  --ok: #3F6E55;
  --warn: #8A5A12;

  /* Type */
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --step--1: .875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.65rem;
  --step-3: clamp(1.9rem, 1.4rem + 1.8vw, 2.6rem);
  --step-4: clamp(2.4rem, 1.6rem + 3.4vw, 4rem);
  --step-5: clamp(3rem, 1.6rem + 6vw, 6.4rem);

  /* Space (based on 8px) */
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem;
  --s6: 2rem; --s7: 3rem; --s8: 4.5rem; --s9: 7rem;

  --measure: 66ch;
  --wide: 1240px;
  --radius: 3px;
  --focus: 0 0 0 3px var(--paper), 0 0 0 5px var(--sun);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--sans);
  font-feature-settings: "kern", "liga";
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--sun); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 2px; }
::selection { background: color-mix(in srgb, var(--sun) 22%, transparent); }

/* ---------- Typography ---------- */
h1, h2, h3, .display { font-family: var(--serif); font-weight: 400; line-height: 1.08; letter-spacing: -.015em; margin: 0 0 var(--s4); text-wrap: balance; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.25; letter-spacing: 0; }
p { margin: 0 0 var(--s4); max-width: var(--measure); }
.lede { font-family: var(--serif); font-size: var(--step-1); line-height: 1.5; color: var(--ink-soft); max-width: 46ch; }
.prose { font-family: var(--serif); font-size: 1.15rem; line-height: 1.7; }
.prose p, .prose li { max-width: 64ch; }
.prose h2 { margin-top: var(--s7); font-size: var(--step-2); }
.prose h3 { margin-top: var(--s6); font-family: var(--sans); font-weight: 600; font-size: 1rem; }
.small { font-size: var(--step--1); color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Layout ---------- */
.wrap { width: min(100% - 2.5rem, var(--wide)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, 760px); margin-inline: auto; }
.section { padding-block: var(--s8); }
.section + .section { padding-top: 0; }
.stack > * + * { margin-top: var(--s4); }
.row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.split { display: grid; gap: var(--s7); grid-template-columns: 1fr; }
@media (min-width: 900px) { .split { grid-template-columns: 5fr 7fr; align-items: start; } .split--even { grid-template-columns: 1fr 1fr; } }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* ---------- Brand logo (aspect ratio is always 1:1) ---------- */
.mark { display: block; flex: none; line-height: 0; }
.mark img { display: block; max-width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; }

/* ---------- Header / nav ---------- */
.skip { position: absolute; left: -999px; top: var(--s2); background: var(--ink); color: var(--paper); padding: var(--s2) var(--s4); z-index: 50; }
.skip:focus { left: var(--s4); }
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid transparent; }
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: var(--s5); min-height: 72px; }
.brand { display: flex; align-items: center; gap: var(--s3); text-decoration: none; }
.brand-word { font-family: var(--serif); font-size: 1.15rem; letter-spacing: .14em; white-space: nowrap; }
@media (max-width: 420px) { .site-header .mark img { width: 44px; } .site-header .brand-word { font-size: 1rem; letter-spacing: .1em; } }
.nav { margin-left: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--s5); align-items: center; }
.nav a { text-decoration: none; font-size: .95rem; padding: var(--s2) 0; white-space: nowrap; }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--sun); }
.nav a.btn { padding: 0 1.1rem; white-space: nowrap; }
.site-header .nav-toggle { display: none; margin-left: auto; }
@media (max-width: 1100px) {
  .site-header .nav-toggle { display: inline-flex; }
  .nav { position: fixed; inset: 72px 0 auto 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: var(--s4) 1.25rem var(--s6); display: none; }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; align-items: flex-start; gap: var(--s2); }
  .nav a { font-family: var(--serif); font-size: 1.5rem; }
  .js .nav:not(.open) { display: none; }
}
@media (max-width: 1100px) { html:not(.js) .nav { position: static; display: block; border: 0; padding: 0; } html:not(.js) .site-header .wrap { flex-wrap: wrap; } html:not(.js) .nav ul { flex-direction: row; flex-wrap: wrap; } html:not(.js) .nav a { font-size: 1rem; font-family: var(--sans); } }

/* ---------- Buttons ---------- */
.btn {
  --bg: transparent; --fg: var(--ink); --bd: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 46px; padding: 0 1.4rem; border-radius: 999px;
  border: 1px solid var(--bd); background: var(--bg); color: var(--fg);
  font: 500 .98rem/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn:hover { --bg: var(--ink); --fg: var(--paper); color: var(--paper); }
.btn-sun { --bg: var(--sun); --fg: #fff; --bd: var(--sun); }
.btn-sun:hover { --bg: var(--sun-deep); --bd: var(--sun-deep); color: #fff; }
.btn-quiet { --bd: var(--line); }
.btn-quiet:hover { --bg: var(--linen); --fg: var(--ink); --bd: var(--ink); color: var(--ink); }
.btn-small { min-height: 36px; padding: 0 1rem; font-size: .9rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-soft); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.link-btn:hover { color: var(--sun); }

/* ---------- Sun dots & feeling labels ---------- */
.sun-dot { display: inline-block; width: var(--s); height: var(--s); border-radius: 50%; background: var(--hue); flex: none; }
.feel { display: inline-flex; align-items: center; gap: .45em; font-size: .9rem; text-decoration: none; padding: .15rem 0; }
.feel:hover { color: var(--ink); text-decoration: underline; }
.feel-list { display: flex; flex-wrap: wrap; gap: .25rem 1rem; list-style: none; padding: 0; margin: 0; }
.feel-pill { display: inline-flex; align-items: center; gap: .5em; padding: .35rem .85rem; border: 1px solid var(--line); border-radius: 999px; font-size: .92rem; text-decoration: none; background: var(--paper); }
a.feel-pill:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- Badges / notices ---------- */
.badge { display: inline-flex; align-items: center; gap: .35em; font-size: .78rem; font-weight: 600; letter-spacing: .02em; padding: .2rem .55rem; border-radius: 999px; border: 1px dashed var(--ink-soft); color: var(--ink-soft); background: var(--paper); }
.badge-sim { border-color: var(--warn); color: var(--warn); }
.badge-pending { border-style: solid; border-color: var(--warn); color: var(--warn); }
.badge-approved { border-style: solid; border-color: var(--ok); color: var(--ok); }
.badge-rejected, .badge-removed { border-style: solid; border-color: var(--sun); color: var(--sun); }
.notice { border-left: 3px solid var(--ember); background: var(--linen); padding: var(--s4) var(--s5); font-size: .95rem; max-width: 72ch; }
.notice p:last-child { margin-bottom: 0; }
.notice-sun { border-left-color: var(--sun); }
.alert { padding: var(--s4) var(--s5); border-radius: var(--radius); margin-bottom: var(--s5); }
.alert-ok { background: color-mix(in srgb, var(--ok) 10%, var(--paper)); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); }
.alert-error { background: color-mix(in srgb, var(--sun) 8%, var(--paper)); border: 1px solid color-mix(in srgb, var(--sun) 40%, transparent); }

/* ---------- Forms ---------- */
.field { display: grid; gap: var(--s2); margin-bottom: var(--s5); }
.field label, .legend { font-weight: 600; font-size: .95rem; }
.field .hint { font-size: .88rem; color: var(--ink-soft); margin: 0; }
.optional { font-weight: 400; color: var(--ink-soft); }
input[type=text], input[type=email], input[type=search], input[type=password], input[type=month], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .85rem; min-height: 46px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--ink); }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
[aria-invalid="true"] { border-color: var(--sun) !important; }
.error-text { color: var(--sun); font-size: .9rem; margin: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 var(--s5); min-width: 0; }
legend { padding: 0; margin-bottom: var(--s3); }
.check { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: .15rem; accent-color: var(--sun); flex: none; }
.check span { max-width: 62ch; }
.choice-grid { display: flex; flex-wrap: wrap; gap: var(--s2); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice > span { display: inline-flex; align-items: center; gap: .5em; padding: .5rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.choice > input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.choice > input:focus-visible + span { box-shadow: var(--focus); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: var(--s7) var(--s8); }
.hero .wrap { display: grid; gap: var(--s6); align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 6fr 5fr; min-height: min(78vh, 720px); } }
.hero h1 { font-size: var(--step-5); line-height: .98; letter-spacing: -.025em; margin-bottom: var(--s5); }
.hero .lede { margin-bottom: var(--s6); }
.hero-art { position: relative; justify-self: center; width: min(100%, 560px); }
.hero-art .mark img { width: 100%; height: auto; }
@media (prefers-reduced-motion: no-preference) {
  .hero-art .mark img { animation: rise 1.4s cubic-bezier(.2,.7,.2,1) both; }
  @keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}
.about-mark { max-width: 420px; }
.about-mark .mark img { width: 100%; height: auto; }

/* ---------- Gallery wall ---------- */
.wall { columns: 1; column-gap: var(--s6); }
@media (min-width: 560px) { .wall { columns: 2; } }
@media (min-width: 980px) { .wall { columns: 3; } }
.piece { break-inside: avoid; margin: 0 0 var(--s7); }
.piece a { text-decoration: none; display: block; }
.piece img { width: 100%; height: auto; background: var(--linen); border-radius: 2px; }
.piece a:hover img { outline: 1px solid var(--ink); outline-offset: 4px; }
.piece figcaption { padding-top: var(--s3); display: grid; gap: .2rem; }
.piece .title { font-family: var(--serif); font-size: 1.15rem; line-height: 1.3; }
.piece .meta { font-size: .85rem; color: var(--ink-soft); }
.piece .excerpt { font-family: var(--serif); font-size: 1rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.piece .feel-list { margin-top: .2rem; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 280px); gap: var(--s5); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--s3); }
.strip .piece { scroll-snap-align: start; margin: 0; }
.strip .piece img { aspect-ratio: 4 / 5; object-fit: cover; }

/* ---------- Filters ---------- */
.filters { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; padding: var(--s5); background: var(--linen); border-radius: var(--radius); margin-bottom: var(--s7); }
.filters .field { margin: 0; }
.filters label { font-size: .85rem; }
.filters .actions { display: flex; gap: var(--s3); align-items: center; }

/* ---------- Emotion library ---------- */
.emotion-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.emotion-tile { display: grid; grid-template-columns: auto 1fr; gap: var(--s4); padding: var(--s5) var(--s4) var(--s5) 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.emotion-tile:hover { color: var(--ink); background: linear-gradient(90deg, transparent, var(--linen)); }
.emotion-tile .sun-dot { margin-top: .3rem; }
.emotion-tile h3 { margin: 0 0 var(--s1); font-family: var(--serif); font-size: 1.45rem; }
.emotion-tile p { margin: 0; font-size: .95rem; color: var(--ink-soft); }
.emotion-tile .count { font-size: .82rem; color: var(--ink-soft); margin-top: var(--s2); display: block; }
.emotion-hero { display: grid; gap: var(--s6); align-items: center; padding-block: var(--s7); }
@media (min-width: 800px) { .emotion-hero { grid-template-columns: 1fr auto; } }
.emotion-sun { width: clamp(140px, 22vw, 260px); aspect-ratio: 1; border-radius: 50%; background: var(--hue); }

/* ---------- Steps (how it works / express) ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s6); grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); counter-reset: step; }
.steps li { counter-increment: step; border-top: 1px solid var(--ink); padding-top: var(--s4); }
.steps li::before { content: counter(step); font-family: var(--serif); font-size: 2.2rem; line-height: 1; display: block; margin-bottom: var(--s3); color: var(--sun); }
.steps h3 { margin-bottom: var(--s2); }
.steps p { color: var(--ink-soft); font-size: .98rem; }

.flow-progress { list-style: none; padding: 0; margin: 0 0 var(--s7); display: flex; gap: var(--s2); flex-wrap: wrap; }
.flow-progress li { flex: 1 1 110px; font-size: .85rem; color: var(--ink-soft); border-top: 3px solid var(--line); padding-top: var(--s2); }
.flow-progress li[aria-current="step"] { color: var(--ink); border-top-color: var(--sun); font-weight: 600; }
.flow-progress li.done { border-top-color: var(--ink); }
.flow-step[hidden] { display: none; }
.flow-nav { display: flex; gap: var(--s3); justify-content: space-between; margin-top: var(--s6); padding-top: var(--s5); border-top: 1px solid var(--line); }

/* Breathing guide */
.breath { display: grid; place-items: center; gap: var(--s5); padding: var(--s6) 0; text-align: center; }
.breath-circle { width: 220px; height: 220px; border-radius: 50%; background: var(--sun); transform: scale(.55); transition: transform 4s ease-in-out; }
.breath-circle.in { transform: scale(1); }
.breath-circle.hold { transform: scale(1); }
.breath-circle.out { transform: scale(.55); transition-duration: 6s; }
@media (prefers-reduced-motion: reduce) { .breath-circle { transition: opacity 1s; transform: none !important; opacity: .5; } .breath-circle.in, .breath-circle.hold { opacity: 1; } }
.breath-cue { font-family: var(--serif); font-size: var(--step-2); min-height: 1.3em; }
.timer { font-variant-numeric: tabular-nums; font-size: 1.1rem; color: var(--ink-soft); }

/* Drawing pad */
.pad { border: 1px solid var(--line); background: #fff; border-radius: var(--radius); touch-action: none; width: 100%; height: auto; aspect-ratio: 4 / 5; max-height: 70vh; cursor: crosshair; }
.pad-tools { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; margin-bottom: var(--s3); }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--paper) inset; }
.dropzone { border: 1px dashed var(--ink-soft); border-radius: var(--radius); padding: var(--s6); text-align: center; background: #fff; }
.dropzone.drag { background: var(--linen); border-color: var(--ink); }
.preview-img { max-height: 420px; width: auto; margin: 0 auto; }
.tabs { display: flex; gap: var(--s2); margin-bottom: var(--s5); }

/* ---------- Artwork detail ---------- */
.artwork { display: grid; gap: var(--s7); padding-block: var(--s6) var(--s8); }
@media (min-width: 960px) { .artwork { grid-template-columns: 7fr 4fr; align-items: start; } .artwork aside { position: sticky; top: 96px; } }
.artwork-frame { background: var(--linen); padding: clamp(1rem, 4vw, 3.5rem); display: grid; place-items: center; }
.artwork-frame img { max-height: 80vh; width: auto; box-shadow: 0 1px 0 rgba(43,39,36,.12), 0 20px 40px -24px rgba(43,39,36,.35); }
.label-card dl { display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s5); margin: var(--s5) 0; font-size: .95rem; }
.label-card dt { color: var(--ink-soft); }
.label-card dd { margin: 0; }
.connect[aria-pressed="true"] { --bg: var(--sun); --fg: #fff; --bd: var(--sun); }
details.report summary { cursor: pointer; color: var(--ink-soft); font-size: .92rem; }
details.report[open] summary { margin-bottom: var(--s4); }

/* ---------- Atlas ---------- */
.atlas-sky { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.atlas-sky svg { width: 100%; height: auto; }
.atlas-sky .edge { stroke: var(--line); stroke-width: 1.2; }
.atlas-sky .edge.on { stroke: var(--ink); }
.atlas-sky .node { cursor: pointer; }
.atlas-sky .node text { font-family: var(--serif); font-size: 15px; fill: var(--ink); }
.atlas-sky .node:focus-visible { outline: none; }
.atlas-sky .node:focus-visible circle.disc, .atlas-sky .node.on circle.disc { stroke: var(--ink); stroke-width: 2; }
.atlas-layout { display: grid; gap: var(--s6); }
@media (min-width: 1000px) { .atlas-layout { grid-template-columns: 8fr 4fr; } }
.atlas-panel { border-top: 1px solid var(--ink); padding-top: var(--s4); }
.timeline { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: var(--s4); border-bottom: 1px solid var(--ink); }
.timeline .bar { flex: 1; display: flex; flex-direction: column-reverse; min-width: 14px; }
.timeline .bar span { display: block; }
.timeline .real { background: var(--sun); }
.timeline .demo { background: repeating-linear-gradient(45deg, var(--line) 0 4px, transparent 4px 8px); border: 1px solid var(--ink-soft); }
.timeline-labels { display: flex; gap: 6px; font-size: .75rem; color: var(--ink-soft); }
.timeline-labels span { flex: 1; min-width: 14px; text-align: center; overflow: hidden; }
.legend-row { display: flex; gap: var(--s5); flex-wrap: wrap; font-size: .88rem; color: var(--ink-soft); margin-top: var(--s3); }
.legend-row i { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: .4em; }
.stat-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s2); }
.stat-list li { display: grid; grid-template-columns: 1fr auto; gap: var(--s3); border-bottom: 1px solid var(--line); padding-block: var(--s2); }

.compare { display: grid; gap: var(--s6); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: var(--s6); }
.compare h3 { border-top: 1px solid var(--ink); padding-top: var(--s3); }
.compare .piece { margin-bottom: var(--s6); }

/* ---------- Bands ---------- */
.band { background: var(--linen); }
.band-ink { background: var(--ink); color: var(--paper); }
.band-ink a { color: var(--paper); }
.band-ink .btn { --fg: var(--paper); --bd: var(--paper); }
.band-ink .btn:hover { --bg: var(--paper); --fg: var(--ink); color: var(--ink); }
.band-ink .muted, .band-ink .lede { color: #CFC6BB; }
.featured { display: grid; gap: var(--s6); align-items: center; }
@media (min-width: 860px) { .featured { grid-template-columns: auto 1fr; } }
.featured .emotion-sun { width: clamp(120px, 16vw, 200px); }

/* ---------- Values ---------- */
.values { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s5) var(--s6); }
.values li { border-left: 2px solid var(--clay); padding-left: var(--s4); }
.values strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.3rem; margin-bottom: var(--s1); }

/* ---------- Feeling pattern (EEG prototype) ---------- */
.sim-banner { display: flex; gap: var(--s3); align-items: flex-start; border: 2px dashed var(--warn); background: color-mix(in srgb, var(--ember) 10%, var(--paper)); padding: var(--s4) var(--s5); border-radius: var(--radius); }
.pattern-stage { position: relative; background: var(--ink); border-radius: var(--radius); overflow: hidden; }
.pattern-stage canvas { width: 100%; height: auto; display: block; aspect-ratio: 1; }
.pattern-stage .stamp { position: absolute; left: var(--s3); top: var(--s3); background: rgba(0,0,0,.55); color: #fff; font-size: .8rem; padding: .25rem .6rem; border-radius: 999px; }
.features { display: grid; gap: var(--s2); }
.features .meter { display: grid; grid-template-columns: 7rem 1fr 3rem; gap: var(--s3); align-items: center; font-size: .9rem; }
.features .meter b { height: 6px; background: var(--line); border-radius: 3px; position: relative; overflow: hidden; }
.features .meter b i { position: absolute; inset: 0 auto 0 0; background: var(--clay); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: var(--s7) var(--s6); margin-top: var(--s8); font-size: .92rem; }
.site-footer .wrap { display: grid; gap: var(--s6); }
@media (min-width: 800px) { .site-footer .wrap { grid-template-columns: 1fr auto; } }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- Admin ---------- */
.admin-shell { display: grid; min-height: 100vh; }
@media (min-width: 900px) { .admin-shell { grid-template-columns: 230px 1fr; } }
.admin-side { background: var(--ink); color: var(--paper); padding: var(--s5); }
.admin-side a { color: var(--paper); text-decoration: none; display: flex; justify-content: space-between; padding: var(--s2) var(--s3); border-radius: var(--radius); }
.admin-side a[aria-current="page"], .admin-side a:hover { background: rgba(255,255,255,.1); color: #fff; }
.admin-side nav { display: grid; gap: 2px; margin-top: var(--s6); }
.admin-main { padding: var(--s6) clamp(1rem, 3vw, 2.5rem); min-width: 0; }
.count-pill { background: var(--sun); color: #fff; border-radius: 999px; font-size: .75rem; padding: 0 .5rem; line-height: 1.6; align-self: center; flex: none; margin-left: var(--s2); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s4); margin-bottom: var(--s7); }
.metric { border-top: 2px solid var(--ink); padding-top: var(--s3); }
.metric b { display: block; font-family: var(--serif); font-weight: 400; font-size: 2.2rem; line-height: 1.1; }
.queue-item { display: grid; gap: var(--s5); padding-block: var(--s6); border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .queue-item { grid-template-columns: 260px 1fr; } }
.queue-item img { max-height: 320px; width: auto; background: var(--linen); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: var(--s3); border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-weight: 600; color: var(--ink-soft); }
.table-wrap { overflow-x: auto; }
.inline-form { display: inline-flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.inline-form select, .inline-form input { min-height: 36px; padding: .3rem .6rem; width: auto; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media print { .site-header, .site-footer, .flow-nav { display: none; } }

/* ==========================================================================
   Themes (LOVE first): contribute flow and the collective artwork
   ========================================================================== */
.theme-kicker { display: flex; align-items: center; gap: .55em; color: var(--ink-soft); margin-bottom: var(--s4); }
.theme-lines p { margin: 0; }
.theme-lines { margin-bottom: 0; }
.btn-large { min-height: 56px; padding: 0 2rem; font-size: 1.05rem; }
.key-text { font-family: var(--serif); font-size: 1.6rem; letter-spacing: .06em; }

/* A real sequence, so the steps are numbered */
.contribute-steps { list-style: none; padding: 0; margin: 0; counter-reset: cstep; }
.contribute-steps > li { counter-increment: cstep; position: relative; padding: var(--s6) 0 var(--s5) 3.25rem; border-top: 1px solid var(--line); }
.contribute-steps > li::before { content: counter(cstep); position: absolute; left: 0; top: var(--s6); font-family: var(--serif); font-size: 2rem; line-height: 1; color: var(--sun); }
.contribute-steps h2 { font-size: var(--step-2); margin-bottom: var(--s3); }
@media (max-width: 560px) { .contribute-steps > li { padding-left: 0; padding-top: calc(var(--s6) + 2.4rem); } }
.terms-list { margin: 0 0 var(--s5); padding-left: 1.2rem; display: grid; gap: var(--s2); max-width: 64ch; }
.terms-list li::marker { color: var(--sun); }
.upload-preview { margin: var(--s5) 0 0; }
.upload-preview img { max-height: 360px; width: auto; margin: 0 auto var(--s2); border-radius: 2px; }
.upload-progress { display: grid; gap: var(--s2); margin-top: var(--s4); max-width: 420px; }
.upload-progress progress { width: 100%; height: 8px; appearance: none; border: 0; border-radius: 4px; background: var(--line); overflow: hidden; accent-color: var(--sun); }
.upload-progress progress::-webkit-progress-bar { background: var(--line); }
.upload-progress progress::-webkit-progress-value { background: var(--sun); }
.upload-progress progress::-moz-progress-bar { background: var(--sun); }
.status-line { margin-bottom: var(--s4); }

/* Collective */
.collective-stats { display: flex; flex-wrap: wrap; gap: var(--s4) var(--s6); margin: var(--s5) 0 0; }
.collective-stats div { border-top: 2px solid var(--ink); padding-top: var(--s2); min-width: 9rem; }
.collective-stats dt { font-size: .85rem; color: var(--ink-soft); }
.collective-stats dd { margin: 0; font-family: var(--serif); font-size: 1.6rem; line-height: 1.2; }
.collective-layout { display: grid; gap: var(--s6); align-items: start; }
@media (min-width: 1000px) { .collective-layout { grid-template-columns: minmax(0, 8fr) minmax(280px, 4fr); } .collective-panel { position: sticky; top: 96px; } }
.collective-stage { position: relative; aspect-ratio: 1 / 1; width: 100%; max-width: min(100%, 82vh); margin-inline: auto; overflow: hidden; border-radius: 2px; background: var(--paper); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.collective-stage.is-zoomed { touch-action: none; cursor: grab; background: var(--linen); }
.collective-stage:focus-visible { box-shadow: var(--focus); }
.collective-world { position: absolute; inset: 0; transform-origin: 0 0; will-change: transform; }
.collective-sun { position: absolute; inset: 0; border-radius: 50%; background: var(--sun); }
.tile { position: absolute; display: block; -webkit-user-drag: none; }
.tile img { position: absolute; inset: 4%; width: 92%; height: 92%; object-fit: cover; background: var(--paper); pointer-events: none; -webkit-user-drag: none; }
.tile-demo img { opacity: .82; }
.tile-demo::after { content: ""; position: absolute; inset: 4%; outline: 1px dashed rgba(255,255,255,.85); outline-offset: -3px; pointer-events: none; }
a.tile:hover img, a.tile:focus-visible img { outline: 2px solid #fff; outline-offset: 0; }
a.tile:focus-visible { box-shadow: none; }
.tile.is-selected img, .tile.is-focus img { outline: 3px solid #fff; outline-offset: 0; box-shadow: 0 0 0 5px var(--ink); z-index: 1; }
.tile.is-selected, .tile.is-focus { z-index: 2; }
.stage-controls { position: absolute; right: var(--s3); bottom: var(--s3); display: flex; gap: 6px; z-index: 3; }
.ctl { min-width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: 500 1.25rem/1 var(--sans); cursor: pointer; padding: 0 .8rem; }
.ctl-text { font-size: .9rem; }
.ctl:hover { border-color: var(--ink); }
.stage-veil { position: absolute; left: var(--s3); top: var(--s3); z-index: 3; }
.stage-veil span { display: inline-block; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .75rem; font-size: .85rem; color: var(--ink-soft); }
.stage-hint { text-align: center; margin-top: var(--s3); }
.collective-panel h2 { font-size: var(--step-2); }
.panel-img { width: 100%; height: auto; max-height: 52vh; object-fit: contain; background: var(--linen); margin-bottom: var(--s4); }
.access-steps { padding-left: 1.3rem; display: grid; gap: var(--s2); margin: 0 0 var(--s5); }
.access-steps li::marker { color: var(--sun); font-family: var(--serif); }

/* Homepage: the first theme */
.love-band { padding-block: var(--s8); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.love-band .wrap { display: grid; gap: var(--s7); align-items: center; }
@media (min-width: 900px) { .love-band .wrap { grid-template-columns: 6fr 5fr; } }
.love-band h2 { font-size: var(--step-5); line-height: 1; letter-spacing: -.02em; margin-bottom: var(--s5); }
.love-band .lede p { margin: 0; }
.love-preview { display: block; text-decoration: none; }
.love-preview .collective-stage { max-width: 520px; }
.love-preview figcaption { text-align: center; margin-top: var(--s3); font-size: .9rem; color: var(--ink-soft); }
.badge-theme { border-style: solid; border-color: var(--sun); color: var(--sun); }
.tile-check { display: flex; gap: var(--s3); align-items: center; margin: 0 0 var(--s4); }
.tile-check img { width: 96px; height: 96px; object-fit: cover; border: 3px solid var(--sun); }
.panel-download { border-top: 1px solid var(--line); margin-top: var(--s6); padding-top: var(--s4); }
.panel-download h3 { margin-bottom: var(--s2); }
.collective-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 22%; text-align: center; color: #fff; font-family: var(--serif); font-size: clamp(1rem, 2.4vw, 1.5rem); line-height: 1.35; max-width: none; }
.eu-question { font-family: var(--serif); font-size: var(--step-2); line-height: 1.25; margin-bottom: var(--s4); }
.eu-principles { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--line); font-family: var(--serif); font-size: 1.1rem; color: var(--ink-soft); }
.eu-principles p { margin: 0 0 var(--s2); }
.history { margin: 0 0 var(--s4); font-size: .9rem; }
.history summary { cursor: pointer; color: var(--ink-soft); }
.history ol { margin: var(--s2) 0 0; padding-left: 1.2rem; display: grid; gap: var(--s1); }

/* =========================================================================== Redesign: philosophy, invitation, accounts */
.kicker { font-size: var(--step--1); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--sun); margin-bottom: var(--s4); }
.philo { padding-block: var(--s7); border-top: 1px solid var(--line); }
.philo-grid { display: grid; gap: var(--s6); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.philo-grid h3 { font-family: var(--serif); font-size: var(--step-2); font-weight: 400; margin-bottom: var(--s3); }
.philo-grid p { color: var(--ink-soft); max-width: 38ch; }
.wall-roomy { column-gap: var(--s7); }
.wall-roomy > * { margin-bottom: var(--s7); }
.steps-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: var(--s6); }
.steps-stacked { grid-template-columns: 1fr; margin-top: 0; }
.invitation { text-align: center; padding-block: var(--s9); }
.invitation .mark { display: inline-block; margin-bottom: var(--s5); }
.invitation h2 { max-width: 22ch; margin-inline: auto; }
.invitation .lede { margin: 0 auto var(--s6); }

.auth { display: grid; place-items: center; padding-inline: 1.25rem; }
.auth-card { width: 100%; max-width: 30rem; }
.auth-card h1 { font-size: var(--step-3); }
.auth-mark { display: inline-block; margin-bottom: var(--s5); }
.auth-form { margin-top: var(--s5); }
.auth-form input[type="email"], .auth-form input[type="password"], .auth-form input[type="text"] { width: 100%; }
.auth-alt { margin-top: var(--s6); padding-top: var(--s5); border-top: 1px solid var(--line); }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.gate { max-width: 40rem; }
.account-block { padding-block: var(--s6); border-top: 1px solid var(--line); }
.account-block:first-of-type { border-top: 0; }
.account-artwork { display: grid; gap: var(--s5); align-items: start; }
@media (min-width: 640px) { .account-artwork { grid-template-columns: minmax(0, 220px) 1fr; } }
.account-art { width: 100%; height: auto; border: 1px solid var(--line); background: var(--linen); }
.account-links { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s4); }
.account-links li { display: grid; gap: .15rem; }
/* Tinted bands keep their own breathing room even when they follow another section. */
.section.band { padding-block: var(--s8); }
.section.band + .section, .section.love-band + .section { padding-top: var(--s8); }
.section.invitation { padding-block: var(--s9); }

/* =========================================================================== Collective Art: homepage teaser and page */
.collective-teaser { padding-block: var(--s8); border-top: 1px solid var(--line); }
.collective-teaser .wrap { display: grid; gap: var(--s6); align-items: center; }
@media (min-width: 900px) { .collective-teaser .wrap { grid-template-columns: 1.1fr 1fr; gap: var(--s8); } }
.teaser-stage { display: block; position: relative; border-radius: 50%; overflow: hidden; max-width: 560px; width: 100%; justify-self: center; }
.teaser-veil { filter: blur(14px) saturate(1.08); transform: scale(1.06); transition: filter .6s ease; }
.teaser-veil .collective-empty { display: none; }
.teaser-stage::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 50% 50%, transparent 35%, color-mix(in srgb, var(--paper) 55%, transparent) 72%, var(--paper) 100%); }
.teaser-stage:hover .teaser-veil { filter: blur(10px) saturate(1.1); }
@media (prefers-reduced-motion: reduce) { .teaser-veil { transition: none; } }
.teaser-copy .lede { margin-bottom: var(--s4); }
.teaser-copy .small { max-width: 52ch; margin-bottom: var(--s3); }
.teaser-copy .btn { margin-top: var(--s4); }
.collective-headline { font-family: var(--serif); font-size: var(--step-1); color: var(--ink-soft); max-width: 30ch; margin-bottom: var(--s5); }
.collective-status .status-row { display: grid; gap: var(--s3); grid-template-columns: auto 1fr; align-items: start; padding-block: var(--s4); border-top: 1px solid var(--line); }
.collective-status .status-row .badge { margin-top: .2rem; white-space: nowrap; }

/* =========================================================================== The Gallery: virtual museum */
.museum { position: relative; }
.museum-stage { position: relative; height: calc(100svh - 72px); min-height: 480px; max-height: 920px; background: #F6F2EC; overflow: hidden; }
.museum-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; outline: none; }
.museum-canvas:active { cursor: grabbing; }
.museum-canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--sun); }
/* The vignette is drawn by the WebGL shader. On this page the header is solid, so it doesn't re-blur the moving view every frame. */
.page-museum .site-header { backdrop-filter: none; background: var(--paper); }
.museum-fade { position: absolute; inset: 0; background: #F6F2EC; opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 2; }
.museum-fade.on { opacity: 1; }
.museum-intro, .museum-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 1.25rem; z-index: 3;
  background: color-mix(in srgb, var(--paper) 62%, transparent); backdrop-filter: blur(3px); }
.museum-intro-card { max-width: 36rem; background: var(--paper); padding: clamp(1.5rem, 4vw, 2.75rem); border: 1px solid var(--line); box-shadow: 0 30px 80px -40px rgba(43, 39, 36, .45); }
.museum-intro-card h1 { font-size: var(--step-4); margin-bottom: var(--s4); }
.museum-intro-card .lede { margin-bottom: var(--s4); }
.museum-intro-card .row { margin-block: var(--s5) var(--s4); }
.museum-howto { border-top: 1px solid var(--line); padding-top: var(--s4); }
.museum-hint { position: absolute; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; align-items: center; gap: .75rem; max-width: min(94%, 36rem);
  background: color-mix(in srgb, var(--paper) 94%, transparent); border: 1px solid var(--line); border-radius: 999px; padding: .35rem .4rem .35rem 1.1rem; }
.museum-hint-text { margin: 0; font-family: var(--serif); font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.museum-hint .btn { flex: none; }
.museum-hud { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 2; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .5rem;
  width: max-content; max-width: calc(100% - 1.5rem); background: color-mix(in srgb, var(--paper) 92%, transparent); border: 1px solid var(--line); border-radius: 14px; padding: .5rem .6rem; }
.museum-where { margin: 0 .4rem; min-width: 7.5em; text-align: center; }
.museum-walk { position: absolute; left: 1rem; bottom: 6.5rem; z-index: 2; display: grid; gap: .5rem; }
.museum-walk .ctl { width: 3.2rem; height: 3.2rem; font-size: 1.1rem; touch-action: none; user-select: none; -webkit-user-select: none; }
.museum-help { position: absolute; right: 1rem; bottom: 5.5rem; z-index: 2; width: min(24rem, calc(100% - 2rem)); background: var(--paper); border: 1px solid var(--line); padding: 1.25rem; box-shadow: 0 20px 50px -30px rgba(43, 39, 36, .5); }
.museum-help h2 { font-size: var(--step-1); margin-bottom: .75rem; }
.museum-help dl { margin: 0; display: grid; gap: .6rem; font-size: .92rem; }
.museum-help dt { font-weight: 600; }
.museum-help dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 640px) {
  .museum-hud { bottom: .6rem; gap: .35rem; }
  .museum-hud .btn-quiet { display: none; }
  .museum-where { order: -1; flex-basis: 100%; }
}

.museum-viewer { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: clamp(.75rem, 3vw, 2.5rem); }
.museum-viewer-backdrop { position: absolute; inset: 0; background: rgba(246, 242, 236, .96); opacity: 0; transition: opacity .35s ease; }
.museum-viewer.open .museum-viewer-backdrop { opacity: 1; }
.museum-viewer.closing .museum-viewer-backdrop, .museum-viewer.closing .museum-viewer-caption { opacity: 0; }
.museum-viewer-figure { position: relative; margin: 0; display: grid; gap: clamp(1rem, 3vw, 2.5rem); align-items: center; width: 100%; max-width: 1400px; max-height: 100%; }
@media (min-width: 900px) { .museum-viewer-figure { grid-template-columns: minmax(0, 1fr) 18rem; } }
.museum-viewer-frame { justify-self: center; overflow: hidden; background: #fff;
  box-shadow: 0 0 0 1px rgba(43, 39, 36, .08), 0 30px 70px -35px rgba(43, 39, 36, .55); cursor: zoom-in; will-change: transform; }
.museum-viewer-frame img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform .3s ease; user-select: none; }
.museum-viewer-frame.zoomed { cursor: zoom-out; }
.museum-viewer-frame.zoomed img { transform: scale(2.4); }
.museum-viewer-caption { transition: opacity .3s ease; }
.museum-viewer-caption h2 { font-size: var(--step-2); margin: .25rem 0 .35rem; }
.museum-viewer-caption .row { margin-top: 1rem; }
.museum-viewer-nav { border-top: 1px solid var(--line); padding-top: 1rem; }
@media (prefers-reduced-motion: reduce) { .museum-viewer-frame img, .museum-viewer-backdrop, .museum-fade, .museum-viewer-caption { transition: none; } }
.museum-list { columns: 1; column-gap: var(--s7); padding-left: 1.4rem; margin-top: var(--s5); }
@media (min-width: 760px) { .museum-list { columns: 2; } }
@media (min-width: 1100px) { .museum-list { columns: 3; } }
.museum-list li { break-inside: avoid; margin-bottom: .5rem; }
