/* KONGSI: The Underworld. Lamp-black night, one vermilion seal. */

@property --r {
  syntax: "<length>";
  inherits: false;
  initial-value: 27vmax;
}

:root {
  --bg: #0c0b09;
  --surface: #15130f;
  --ink: #ece4d4;
  --muted: #a39a88;
  --hair: rgba(236, 228, 212, 0.08);
  --control: rgba(236, 228, 212, 0.24);
  --seal: #c43d26;
  --seal-text: #e2694f;
  --paper: #e7dcc3;
  --paper-ink: #2a221a;
  --radius: 2px;
  --font-display: "Im Fell English", "Iowan Old Style", Georgia, serif;
  --font-body: "Figtree", "Avenir Next", system-ui, sans-serif;
}

@font-face {
  font-family: "Im Fell English";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/im-fell-english-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Im Fell English";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/im-fell-english-latin-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/figtree-latin-wght-normal.woff2") format("woff2");
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
}

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }

::selection { background: var(--seal); color: #fff; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  z-index: 100;
  background: var(--bg);
  border: 1px solid var(--control);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
}
.skip:focus-visible { left: 1rem; }

/* ---------- type ---------- */

.h2, .hero-title, .wordmark, .footer-wordmark, .taiko-name, .oath-name, .form-status .stamp-msg strong {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.h2 {
  font-size: clamp(2rem, 3.2vw + 1rem, 3.4rem);
  line-height: 1.08;
  max-width: 22ch;
  text-wrap: balance;
}
.oath-title { max-width: 16ch; }

.h2 .word { display: inline-block; }
.h2 .wmask { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: 0.12em; margin-bottom: -0.12em; }

.lede { font-size: clamp(1.125rem, 0.6vw + 1rem, 1.375rem); line-height: 1.55; color: var(--ink); }
.body { color: var(--muted); max-width: 62ch; }

/* ---------- header ---------- */

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 3vw, 2.5rem);
  background: transparent;
  transition: background 0.35s ease;
}
.topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: var(--hair);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.topbar.is-solid { background: var(--bg); }
.topbar.is-solid::after { opacity: 1; }

.wordmark {
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--ink);
}
.topbar-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--seal);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.topbar-cta:hover { color: var(--seal-text); border-color: var(--seal-text); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
}
.hero-media { position: absolute; inset: 0; }
.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-lantern {
  position: absolute;
  inset: 0;
  -webkit-mask-image: radial-gradient(circle var(--r) at var(--x, 68%) var(--y, 48%), #000 0%, rgba(0, 0, 0, 0.88) 52%, rgba(0, 0, 0, 0) 100%);
  mask-image: radial-gradient(circle var(--r) at var(--x, 68%) var(--y, 48%), #000 0%, rgba(0, 0, 0, 0.88) 52%, rgba(0, 0, 0, 0) 100%);
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(84deg, rgba(12, 11, 9, 0.82) 0%, rgba(12, 11, 9, 0.55) 34%, rgba(12, 11, 9, 0) 62%),
    linear-gradient(to top, rgba(12, 11, 9, 0.85) 0%, rgba(12, 11, 9, 0) 38%);
}
.hero-veil {
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0.72;
  pointer-events: none;
}
.hero-rain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.75;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.15) 18%, #000 38%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.15) 18%, #000 38%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding:
    clamp(5.5rem, 12vh, 8rem)
    clamp(1.25rem, 3vw, 2.5rem)
    clamp(2.75rem, 7vh, 5rem);
  max-width: min(620px, 92vw);
}
@media (max-width: 767px) {
  .hero-copy { max-width: min(560px, 88vw); }
  .hero-title { font-size: clamp(2.35rem, 10.5vw, 3.2rem); }
  /* frame the photo on the lit village so the top half is not a black band */
  .hero-media img { object-position: 75% 40%; }
  .hero-scrim {
    background:
      linear-gradient(to top, rgba(12, 11, 9, 0.94) 0%, rgba(12, 11, 9, 0.74) 24%, rgba(12, 11, 9, 0.2) 46%, rgba(12, 11, 9, 0) 62%),
      linear-gradient(84deg, rgba(12, 11, 9, 0.5) 0%, rgba(12, 11, 9, 0.22) 42%, rgba(12, 11, 9, 0) 72%);
  }
}
.hero-eyebrow {
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.hero-title {
  font-size: clamp(2.6rem, 5.6vw + 0.5rem, 5.4rem);
  line-height: 1.04;
  letter-spacing: 0.01em;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.hero-title .line > span { display: inline-block; will-change: transform; }
.hero-sub {
  margin-top: 1.5rem;
  font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.25rem);
  color: var(--muted);
  max-width: 44ch;
}
.hero-ctas {
  margin-top: 2.25rem;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  flex-wrap: wrap;
}

/* ---------- anchored sections clear the fixed header ---------- */
#port, #taiko, #oath, #ledger, #council, #join { scroll-margin-top: 96px; }

/* ---------- buttons + links ---------- */

.btn {
  position: relative;
  display: inline-block;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
}
.btn-seal {
  background: var(--seal);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.9rem 1.6rem;
  isolation: isolate;
}
.btn-seal::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #a53320;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s ease;
}
.btn-seal:hover::before, .btn-seal:focus-visible::before { transform: scaleX(1); }
.btn-seal:active { transform: scale(0.97); }
.btn-arrow {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.12em;
  margin-left: 0.45rem;
  transition: transform 0.22s ease;
}
.btn-seal:hover .btn-arrow, .btn-seal:focus-visible .btn-arrow { transform: translateX(4px); }

.link-quiet {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--control);
  text-underline-offset: 0.3em;
  font-size: 0.9375rem;
}
.link-quiet:hover { color: var(--seal-text); }

:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--seal-text);
  outline-offset: 3px;
}

/* ---------- frames (photos) ---------- */

.frame { position: relative; overflow: hidden; border-radius: var(--radius); }
.frame img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.frame img[data-parallax] { height: 116%; } /* headroom for the ±8% parallax drift */

/* ---------- premise ---------- */

.premise { padding: clamp(7rem, 16vh, 12rem) clamp(1.25rem, 3vw, 2.5rem); }
.premise-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
.premise-figure {
  grid-column: 1;
  aspect-ratio: 1;
  max-width: 620px;
  margin-top: 0;
}
.premise-copy { grid-column: 1; max-width: 40ch; }
.premise-copy .body {
  margin-top: 1.5rem;
  font-size: 1.0625rem;
}
.lede + .body { margin-top: 1.25rem; }
@media (min-width: 768px) {
  .premise-grid {
    grid-template-columns: 2fr minmax(20rem, 1fr);
    gap: clamp(3rem, 5vw, 6rem);
  }
  .premise-figure { grid-column: 1; margin-top: clamp(4rem, 9vh, 8rem); }
  .premise-copy { grid-column: 2; margin-bottom: clamp(3rem, 8vh, 7rem); align-self: end; }
}

/* ---------- taiko pan ---------- */

.taiko { padding: clamp(7rem, 16vh, 12rem) 0; }
.taiko-head {
  padding: 0 clamp(1.25rem, 3vw, 2.5rem);
  max-width: 1280px;
  margin: 0 auto 3.5rem;
}
.taiko-note { margin-top: 1.25rem; }
.taiko-track {
  display: grid;
  gap: 3.5rem;
  padding: 0 clamp(1.25rem, 3vw, 2.5rem);
}
.taiko-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: end;
}
.taiko-figure { aspect-ratio: 3 / 4; max-width: 560px; }
.taiko-name { font-size: clamp(2rem, 2.6vw + 1rem, 3.1rem); line-height: 1.05; }
.taiko-line { margin-top: 0.75rem; color: var(--ink); font-size: 1.0625rem; }
.taiko-facts {
  margin-top: 1.5rem;
  display: grid;
  gap: 0.75rem;
}
.taiko-facts div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; align-items: baseline; }
.taiko-facts dt {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.taiko-facts dd { color: var(--muted); font-size: 0.95rem; }

@media (min-width: 1024px) {
  html.js .taiko-pan { height: 100dvh; display: flex; align-items: center; }
  html.js .taiko-track {
    display: flex;
    align-items: center;
    gap: clamp(3rem, 5vw, 6rem);
    padding: 0 clamp(1.25rem, 3vw, 2.5rem);
    padding-left: max(clamp(1.25rem, 3vw, 2.5rem), 0px);
    will-change: transform;
  }
  html.js .taiko-head { margin-bottom: 0; }
  /* Panels are pinned at "top top" for a while, so every card must fit the
     viewport below the header: photo and text sit side by side and the card
     height is capped at 100dvh minus header and breathing room. */
  html.js .taiko-track .taiko-panel {
    flex: 0 0 auto;
    width: clamp(34rem, 40vw, 46rem);
    height: min(74dvh, calc(100dvh - 68px - 32px));
    display: grid;
    grid-template-columns: minmax(0, 46%) minmax(0, 1fr);
    gap: clamp(1.5rem, 2.5vw, 2.5rem);
    align-items: end;
    align-content: end;
  }
  html.js .taiko-figure { aspect-ratio: auto; max-width: none; height: 100%; align-self: stretch; }
  html.js .taiko-body { align-self: end; }
}

/* ---------- oath sticky stack ---------- */

.oath { padding: clamp(7rem, 16vh, 12rem) 0; }
.oath-title {
  padding: 0 clamp(1.25rem, 3vw, 2.5rem);
  max-width: 1280px;
  margin: 0 auto 3.5rem;
}
.oath-stack { position: relative; }
.oath-card {
  position: relative;
  isolation: isolate;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  height: 80dvh;
  min-height: 30rem;
  padding: clamp(1.5rem, 3vh, 2.5rem) clamp(1.25rem, 3vw, 2.5rem);
  margin: 0 auto;
  max-width: 1280px;
}
.oath-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #0c0b09;
  opacity: var(--cover, 0);
  pointer-events: none;
}
.oath-card:last-child::after { display: none; }
.oath-inner {
  display: grid;
  grid-template-columns: min(58%, 34rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: stretch;
  align-self: stretch;
  height: 100%;
}
.oath-card:nth-child(even) .oath-inner { grid-template-columns: minmax(0, 1fr) min(58%, 34rem); }
.oath-card:nth-child(even) .oath-figure { order: 2; }
.oath-figure { position: relative; height: 100%; min-height: 0; }
.oath-figure-wide img { object-position: 30% 50%; }
.oath-card:last-child .oath-figure-wide img { object-position: 28% 50%; }
.oath-body {
  display: grid;
  align-content: center;
  max-width: 34rem;
}
.oath-name { font-size: clamp(2rem, 2.8vw + 1rem, 3.4rem); line-height: 1.05; }
.oath-name + .lede { margin-top: 1.25rem; max-width: 30ch; }
@media (max-width: 1023px) {
  .oath-card { height: auto; min-height: 0; padding: 1.25rem; max-width: none; }
  .oath-inner, .oath-card:nth-child(even) .oath-inner { grid-template-columns: 1fr; gap: 1.25rem; }
  .oath-card:nth-child(even) .oath-figure { order: 0; }
  .oath-figure { height: auto; }
  .oath-figure, .oath-figure-wide { aspect-ratio: 4 / 5; }
  .oath-figure-wide { aspect-ratio: 16 / 10; }
  .oath-figure img { height: 100%; }
  .oath-body { max-width: none; }
}

/* ---------- ledger ---------- */

.ledger {
  position: relative;
  padding: clamp(7rem, 16vh, 12rem) clamp(1.25rem, 3vw, 2.5rem);
  overflow: clip;
}
.lamp-glow {
  position: absolute;
  top: 50%;
  left: 8%;
  width: min(60rem, 80vw);
  aspect-ratio: 1;
  transform: translateY(-50%);
  background: radial-gradient(circle, rgba(214, 160, 92, 0.16) 0%, rgba(214, 160, 92, 0.05) 35%, transparent 68%);
  pointer-events: none;
}
.lamp-glow-breathe { animation: breathe 4s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

.ledger-inner { position: relative; max-width: 1280px; margin: 0 auto; }
.ledger-head .h2 { max-width: 14ch; }
.ledger-sub { margin-top: 1.25rem; }
.ledger-sheet { max-width: 620px; margin: 3rem 0 0 auto; }
.ledger-paper {
  position: relative;
  background: var(--paper);
  color: var(--paper-ink);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 2vw, 2rem);
  box-shadow:
    inset 0 0 3.5rem rgba(84, 62, 35, 0.22),
    inset 2px 0 0 rgba(196, 61, 38, 0.35),
    0 24px 70px rgba(0, 0, 0, 0.45);
}
/* ruled paper: faint horizontal rules + a red margin rule + darkened edges */
.ledger-paper::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% 50%, rgba(0, 0, 0, 0) 62%, rgba(74, 53, 28, 0.16) 100%),
    linear-gradient(to right, transparent 0 2.5rem, rgba(196, 61, 38, 0.4) 2.5rem calc(2.5rem + 1px), transparent calc(2.5rem + 1px)),
    repeating-linear-gradient(to bottom, transparent 0 2.15rem, rgba(42, 34, 26, 0.09) 2.15rem calc(2.15rem + 1px));
}
.ledger-cols {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(42, 34, 26, 0.35);
}
.ledger-colhead {
  font-family: var(--font-display);
  font-variant-caps: small-caps;
  letter-spacing: 0.08em;
  color: rgba(42, 34, 26, 0.55);
}
.ledger-lines { list-style: none; }
.ledger-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.45rem 0;
  line-height: 1.3;
  border-bottom: 1px solid rgba(42, 34, 26, 0.14);
}
.ledger-desc {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.125rem, 0.8vw + 0.5rem, 1.3rem);
}
.ledger-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: clamp(1.125rem, 0.8vw + 0.5rem, 1.3rem);
  white-space: nowrap;
}
.ledger-total {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  margin-top: 0.9rem;
  padding-top: 0.6rem;
}
.ledger-total .ledger-desc { font-size: clamp(1.2rem, 0.9vw + 0.55rem, 1.35rem); }
.ledger-runderline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.55rem;
  height: 2px;
  background: var(--seal);
  transform-origin: left;
}
.ledger-note {
  margin-top: 1.5rem;
  color: rgba(42, 34, 26, 0.72);
  font-size: 0.9rem;
}
.ledger-kopi { margin-top: 1rem; font-size: 0.95rem; }

/* pinned ledger: one composed group, paper centred in the viewport below the
   header with its height capped so the total row always stays visible */
@media (min-width: 1024px) {
  html.js .ledger-inner {
    height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(auto, 40rem);
    gap: clamp(2.5rem, 5vw, 5rem);
    align-content: center;
    align-items: center;
    padding: calc(68px + 8px) 0 20px;
  }
  html.js .ledger-sheet { margin: 0; min-width: 0; }
}

/* ---------- council ---------- */

.council { position: relative; overflow: clip; }
.council-frame { position: relative; }
.council-frame img {
  width: 100%;
  height: min(100dvh, 56rem);
  object-fit: cover;
  object-position: 72% 50%;
  will-change: transform;
}
.council .lamp-glow {
  top: auto;
  bottom: -20%;
  left: -10%;
  transform: none;
}
.council-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12, 11, 9, 0.96) 0%, rgba(12, 11, 9, 0.76) 34%, rgba(12, 11, 9, 0) 58%);
}
.council-copy {
  position: relative;
  z-index: 2;
  max-width: 680px;
  padding: 0 clamp(1.25rem, 3vw, 2.5rem) clamp(3rem, 8vh, 6rem);
  margin-top: calc(min(100dvh, 56rem) * -0.6);
}
.council-copy .lede { margin-top: 1.25rem; max-width: 48ch; }
.council-nim { margin-top: 1.5rem; }
html.no-js .council-copy { margin-top: 0; }
@media (max-width: 900px) {
  .council-copy { margin-top: -38vw; }
  .council-scrim {
    background:
      linear-gradient(to top, rgba(12, 11, 9, 0.94) 0%, rgba(12, 11, 9, 0.78) 32%, rgba(12, 11, 9, 0.25) 60%, rgba(12, 11, 9, 0) 80%);
  }
}

/* ---------- glossary marquee ---------- */

.glossary {
  position: relative;
  padding: clamp(5rem, 12vh, 9rem) 0;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}
/* small serif section heading, sits with the marquee as one composition */
.gloss-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 1.6vw + 0.6rem, 1.9rem);
  line-height: 1.2;
  padding: 0 clamp(1.25rem, 3vw, 2.5rem);
  margin-bottom: 1.75rem;
  color: var(--ink);
}
/* screen-reader list: hidden from sight, not from assistive tech */
.gloss-list {
  list-style: none;
  display: grid;
  gap: 0.6rem;
  padding: 0 clamp(1.25rem, 3vw, 2.5rem);
}
.gloss-item dfn, .gloss-pair dfn {
  font-family: var(--font-display);
  font-style: normal;
  color: var(--ink);
}
.gloss-item, .gloss-pair { color: var(--muted); font-size: 1.0625rem; }

.gloss-track {
  position: relative;
  overflow: hidden;
  display: none;
  width: max-content;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 72px, #000 calc(100% - 72px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 72px, #000 calc(100% - 72px), transparent 100%);
}
.gloss-strip {
  display: flex;
  gap: 3.5rem;
  width: max-content;
  padding-right: 3.5rem;
}
@keyframes gloss-track-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.glossary:hover .gloss-track, .glossary:focus-within .gloss-track { animation-play-state: paused; }

@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
  .gloss-track { display: flex; animation: gloss-track-scroll 46s linear infinite; }
  .gloss-list {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .gloss-list .gloss-item {
    display: block;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }
}
@media (prefers-reduced-motion: reduce) {
  .gloss-track { animation: none; }
  .lamp-glow-breathe { animation: none; }
  .seal-stamp, .seal-stamp::before { animation: none !important; }
}

/* ---------- join ---------- */

.join { padding: clamp(7rem, 18vh, 13rem) clamp(1.25rem, 3vw, 2.5rem); }
.join-inner {
  max-width: 44rem;
  margin: 0 auto;
  text-align: center;
}
.join-inner .h2 { margin: 0 auto; }
.join-inner > .body { margin: 1.25rem auto 0; }
.join-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
.form-status {
  display: grid;
  justify-items: start;
  gap: 1rem;
  margin-top: 0.75rem;
}
@media (min-width: 1024px) {
  .join-grid { grid-template-columns: 1fr; justify-content: center; text-align: left; }
}

/* the form card: centred under the heading, seal stamped on its corner */
.join-form {
  position: relative;
  display: grid;
  gap: 1.4rem;
  width: min(26rem, 100%);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.4);
}
.field { display: grid; gap: 0.45rem; text-align: left; }
.field label {
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input {
  background: var(--surface);
  border: 1px solid var(--control);
  border-radius: var(--radius);
  padding: 0.875rem;
  color: var(--ink);
  width: 100%;
  transition: border-color 0.2s ease;
}
.field input::placeholder { color: rgba(163, 154, 136, 0.75); }
.field input:focus { outline: none; border-color: rgba(236, 228, 212, 0.45); }
.field input:focus-visible { outline: 2px solid var(--seal-text); outline-offset: 3px; }

.field-err { min-height: 0; color: var(--seal-text); font-size: 0.9rem; }
.field-help { color: var(--muted); font-size: 0.85rem; }
.hp { position: absolute; left: -9999px; height: 0; width: 0; overflow: hidden; }

.btn-submit { display: inline-flex; align-items: center; justify-content: center; width: 100%; padding: 0.9rem 2.5rem; }
.btn-submit .btn-label { margin-left: 0.6rem; }
.seal-mark {
  width: 1.35rem;
  height: 1.35rem;
  display: inline-block;
  vertical-align: -0.3em;
  flex: 0 0 auto;
}
.btn-submit[disabled] { opacity: 0.6; cursor: wait; }
.join-alert { color: var(--seal-text); font-size: 0.95rem; }
.join-alert:empty { display: none; }
.join-privacy { font-size: 0.85rem; margin-top: 0.5rem; }

.form-status { grid-column: 1; }
.join-form.sealed .field, .join-form.sealed .hp, .join-form.sealed .join-privacy { display: none; }
.stamp-msg { color: var(--ink); font-size: 1.05rem; text-align: left; }
.stamp-msg strong { color: var(--ink); }

/* the seal lands on the form card: absolutely positioned over its top-right corner */
.seal-stamp {
  display: none;
  position: absolute;
  top: -2.75rem;
  right: -3.25rem;
  z-index: 3;
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  background: var(--seal);
  color: #fff;
  place-items: center;
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 1;
  transform: rotate(-6deg);
}
.seal-stamp.on { display: grid; animation: stamp-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.seal-stamp::before {
  content: "";
  position: absolute;
  inset: -1.1rem;
  border: 2px solid rgba(196, 61, 38, 0.55);
  border-radius: 50%;
  animation: seal-ring 0.6s ease-out both;
}
@keyframes stamp-in {
  from { transform: scale(1.6) rotate(-14deg); }
  to { transform: scale(1) rotate(-6deg); }
}
@keyframes seal-ring {
  from { transform: scale(0.4); opacity: 1; }
  to { transform: scale(1.6); opacity: 0; }
}

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--hair);
  padding: 3rem clamp(1.25rem, 3vw, 2.5rem) 4rem;
  display: grid;
  gap: 0.75rem;
  max-width: 100%;
}
.footer-wordmark { font-family: var(--font-display); font-size: 1.5rem; }
.footer-line, .footer-copy { color: var(--muted); font-size: 0.9375rem; }
.footer-copy { font-variant-numeric: tabular-nums; }
.footer-nav { margin-top: 0.25rem; }
.footer-nav a {
  color: var(--muted);
  font-size: 0.9375rem;
  text-decoration: underline;
  text-decoration-color: var(--control);
  text-underline-offset: 0.3em;
}
.footer-nav a:hover { color: var(--ink); }

/* ---------- reduced motion: static end state ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero-lantern { animation: lantern-flicker 6.5s linear infinite; }
}
@keyframes lantern-flicker {
  0% { --r: 27vmax; }
  9% { --r: 28.4vmax; }
  17% { --r: 26.2vmax; }
  26% { --r: 27.6vmax; }
  38% { --r: 25.8vmax; }
  47% { --r: 27.2vmax; }
  61% { --r: 26.4vmax; }
  73% { --r: 28.6vmax; }
  84% { --r: 26.6vmax; }
  100% { --r: 27vmax; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-lantern { animation: none; }
  .btn-seal::before { transition: none; }
}

/* mobile collapse: airy desktop spacing condenses under 768px */
@media (max-width: 767px) {
  .premise, .taiko, .oath, .join, .ledger { padding-block: clamp(4.25rem, 10.5dvh, 7rem); }
  .seal-stamp { right: 0.5rem; top: -2.5rem; }
}