/* Thought (Pty) Ltd */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("/fonts/cormorant-garamond.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cormorant Garamond";
  src: url("/fonts/cormorant-garamond-italic.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Cinzel";
  src: url("/fonts/cinzel.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cormorant SC";
  src: url("/fonts/cormorant-sc.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #07090f;
  --navy: #0b1426;
  --gold: #c9a24b;
  --gold-hi: #e8c877;
  --cream: #f4ede0;
  --muted: #d9d0b8;
  --hairline: rgba(201, 162, 75, 0.45);
  --header-h: 4.35rem;
  --pad: clamp(1.25rem, 5vw, 5rem);
  --max: 72rem;
  --font-display: "Cormorant Garamond", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --font-caps: "Cinzel", "Palatino Linotype", Palatino, serif;
  --font-sc: "Cormorant SC", "Cormorant Garamond", Palatino, serif;
}

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

html {
  color-scheme: dark;
  background: var(--ink);
  scroll-behavior: auto;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  @view-transition { navigation: auto; }
}

body {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--cream);
  background: var(--ink);
  min-height: 100%;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.055;
  background: url("/images/grain.webp") repeat;
  mix-blend-mode: overlay;
}

img { display: block; max-width: 100%; height: auto; }

a {
  color: var(--gold-hi);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover { color: var(--cream); }

:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 3px;
}

::selection {
  background: var(--gold);
  color: var(--ink);
}

.skip {
  position: absolute;
  inset: 0.75rem auto auto 0.75rem;
  z-index: 60;
  padding: 0.6rem 0.9rem;
  background: var(--cream);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  transform: translateY(-220%);
}
.skip:focus { transform: none; }

.progress {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  z-index: 40;
  background: var(--gold-hi);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .progress {
      display: block;
      animation: progress-x linear;
      animation-timeline: scroll();
    }
  }
}

@keyframes progress-x {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background-color 0.28s ease, box-shadow 0.28s ease, backdrop-filter 0.28s ease;
}

.site-header.is-scrolled {
  background: rgba(7, 9, 15, 0.97);
  box-shadow: 0 1px 0 var(--hairline);
  backdrop-filter: blur(10px);
}

.site-header .shell {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--cream);
  text-decoration: none;
  min-width: 0;
}

.brand:hover { color: var(--gold-hi); }

.brand img {
  width: 2.7rem;
  height: auto;
  flex: none;
}

@media (min-width: 800px) {
  .brand img { width: 3.15rem; }
}

.brand-name {
  font-family: var(--font-caps);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1;
  text-box: trim-both cap alphabetic;
}

.nav-toggle {
  display: none;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--cream);
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  cursor: pointer;
  position: relative;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 1.15rem;
  height: 1px;
  background: currentColor;
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
}

.nav-toggle span::before,
.nav-toggle span::after { content: ""; }
.nav-toggle span::before { translate: -50% calc(-50% - 5px); }
.nav-toggle span::after { translate: -50% calc(-50% + 5px); }

.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { translate: -50% -50%; rotate: 45deg; }
.nav-toggle[aria-expanded="true"] span::after { translate: -50% -50%; rotate: -45deg; }

.site-nav ul {
  display: flex;
  gap: clamp(0.85rem, 1.8vw, 1.7rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-sc);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-box: trim-both cap alphabetic;
}

.site-nav a:hover,
.site-nav a[aria-current="true"] { color: var(--gold-hi); }

@media (min-width: 1220px) {
  .site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    z-index: 31;
    display: flex;
    align-items: center;
    pointer-events: none;
  }
  .site-nav ul {
    pointer-events: none;
    width: 100%;
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: var(--pad);
    justify-content: flex-end;
    gap: clamp(0.7rem, 1.35vw, 1.45rem);
  }
  .site-nav a,
  .site-nav li {
    pointer-events: auto;
  }
}

@media (max-width: 1219px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; z-index: 40; }
  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 25;
    width: 100%;
    background: var(--ink);
    padding: calc(var(--header-h) + 1.5rem) var(--pad) 2.5rem;
    translate: 0 -0.6rem;
    opacity: 0;
    visibility: hidden;
    overflow: auto;
  }
  .site-nav.is-open { translate: 0; opacity: 1; visibility: visible; }
  @media (prefers-reduced-motion: no-preference) {
    .site-nav { transition: translate 0.3s ease, opacity 0.3s ease, visibility 0.3s ease; }
  }
  .site-nav ul { flex-direction: column; gap: 0.2rem; max-width: var(--max); margin-inline: auto; }
  .site-nav a {
    display: flex;
    align-items: center;
    min-height: 3.1rem;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 7vw, 2.6rem);
    letter-spacing: -0.01em;
    color: var(--cream);
    white-space: normal;
  }
  .site-nav a:hover,
  .site-nav a[aria-current="true"] { color: var(--gold-hi); }
  body.nav-open { overflow: hidden; }
}

.shell {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.eyebrow {
  margin: 0 0 0.85rem;
  font-family: var(--font-sc);
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  color: var(--gold);
  text-box: trim-both cap alphabetic;
}

.prose, .lede { text-wrap: pretty; color: var(--muted); }
.prose { max-width: 36rem; margin: 0; }
.prose + .prose { margin-top: 1rem; }

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
  color: var(--cream);
}

.ornament {
  display: block;
  width: min(22rem, 70%);
  height: 1.4rem;
  margin: 1.4rem 0;
  color: var(--gold);
}

.filigree {
  position: absolute;
  width: 5.5rem;
  height: 5.5rem;
  pointer-events: none;
  opacity: 0.85;
  z-index: 1;
}

.filigree.tl { top: 0.8rem; left: 0.8rem; }
.filigree.tr { top: 0.8rem; right: 0.8rem; transform: scaleX(-1); }
.filigree.bl { bottom: 0.8rem; left: 0.8rem; transform: scaleY(-1); }
.filigree.br { bottom: 0.8rem; right: 0.8rem; transform: scale(-1); }

/* Hero: painting first, crest on a plinth beneath the frame, never over it */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  color: var(--cream);
}

.hero-stage {
  position: relative;
  z-index: 0;
  overflow: clip;
  background: var(--ink);
  width: 100%;
}

.hero-stage img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(7, 9, 15, 0.28), transparent 18%),
    linear-gradient(to top, rgba(7, 9, 15, 0.82) 0%, rgba(7, 9, 15, 0.18) 22%, transparent 42%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  width: 100%;
  padding: 2.1rem var(--pad) clamp(2.2rem, 6vh, 3.6rem);
  text-align: center;
  min-height: clamp(22rem, 26vw, 34rem);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  --room-fallback: #2a1014;
  --room-tex: image-set(url("/images/tex-stained-glass.webp") 1x, url("/images/tex-stained-glass-hd.webp") 2x), url("/images/tex-oxblood.webp");
  --room-size: cover, 28rem;
  --room-repeat: no-repeat, repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.42) 0%, rgba(7, 9, 15, 0.7) 32%, rgba(7, 9, 15, 0.76) 100%);
}

.hero-copy.room::before {
  background-position: 72% 42%, center;
}

.hero-crest {
  width: min(11.5rem, 46vw);
  height: auto;
  margin: 0 auto 1.1rem;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.55));
}

.hero h1 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.1rem, 1.1rem + 4.6vw, 4.4rem);
  color: var(--cream);
  max-width: 18ch;
  margin-inline: auto;
}

@media (min-width: 900px) {
  .hero h1 {
    max-width: 100%;
    white-space: nowrap;
    overflow-wrap: normal;
    word-wrap: normal;
    font-size: clamp(2.85rem, 1.15rem + 3.5vw, 4.35rem);
  }
}

.hero .lede {
  margin: 0.9rem auto 0;
  max-width: 28rem;
  color: var(--muted);
  font-size: 1.15rem;
}

.scroll-cue {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--gold);
  text-decoration: none;
  font-family: var(--font-sc);
  font-size: 0.9rem;
  letter-spacing: 0.16em;
}

.scroll-cue:hover { color: var(--gold-hi); }

@media (max-width: 699px) {
  .hero-crest { width: min(8.5rem, 42vw); }
}

/* Quote */
.quote {
  position: relative;
  padding: clamp(4.5rem, 12vh, 8rem) 0;
  overflow-x: clip;
}

.quote .shell {
  position: relative;
  max-width: 44rem;
  text-align: center;
  padding-block: 1.5rem;
}

.quote blockquote {
  margin: 0;
  border: 0;
}

.quote blockquote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.25rem, 0.95rem + 1.3vw, 1.85rem);
  line-height: 1.45;
  color: var(--cream);
  text-wrap: pretty;
  margin: 1.5rem 0 0;
}

.quote .ornament { margin-inline: auto; }

/* Sections */
.section, .quote, .lost { position: relative; scroll-margin-top: var(--header-h); }
.section { padding: clamp(4.25rem, 11vh, 8rem) 0; }

#what .shell,
#how .shell {
  display: grid;
  gap: 2rem 4rem;
  align-items: center;
}

.emblem {
  width: min(13rem, 58vw);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.45));
}

.display {
  font-size: clamp(2rem, 1rem + 3vw, 3.5rem);
  font-style: italic;
}

@media (min-width: 860px) {
  #what .shell { grid-template-columns: 0.7fr 1.1fr; }
  #how .shell { grid-template-columns: minmax(0, 1fr) 16rem; }
  #what .emblem { margin: 0; }
  #how .emblem { margin: 0; justify-self: end; }
}

.pair {
  display: grid;
  gap: 2rem 3.5rem;
  margin-top: 1.25rem;
}

.pair h3 {
  font-size: clamp(2rem, 1rem + 3vw, 3.4rem);
  font-style: italic;
  color: var(--gold-hi);
}

.pair p { margin: 0.6rem 0 0; color: var(--muted); max-width: 28rem; }

@media (min-width: 800px) {
  .pair { grid-template-columns: 1fr 1.1fr; }
  .pair article:last-child { margin-top: 3.2rem; }
}

.closing {
  margin: 2rem 0 0;
  font-style: italic;
  font-size: clamp(1.2rem, 1rem + 0.9vw, 1.6rem);
  color: var(--cream);
  max-width: 36rem;
  text-wrap: pretty;
}

#ventures .statement, #sectors .statement {
  font-size: clamp(2.8rem, 1.1rem + 7vw, 7rem);
  font-style: italic;
  line-height: 0.96;
  margin: 0.4rem 0 1.4rem;
  color: var(--cream);
}

/* The Seals */
#seals .intro {
  text-align: center;
  margin-bottom: 2.5rem;
}

#seals .intro .prose { margin-inline: auto; }

.cabinet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3vw, 2.5rem);
  align-items: end;
  justify-items: center;
  min-width: 0;
}

.seal {
  text-align: center;
  width: min(100%, 18rem);
  min-width: 0;
  max-width: 100%;
}

.seal img {
  width: 100%;
  max-width: 16rem;
  margin-inline: auto;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.5));
}

.seal figcaption {
  margin-top: 0.85rem;
  font-family: var(--font-sc);
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  overflow-wrap: anywhere;
  hyphens: auto;
  max-width: 100%;
}

@media (min-width: 900px) {
  .cabinet { grid-template-columns: repeat(4, 1fr); align-items: end; }
  .seal { width: 100%; }
}

/* Contact */
#write .shell {
  text-align: center;
}

#write h2 {
  font-style: italic;
  font-size: clamp(2rem, 1rem + 2.6vw, 3.3rem);
  max-width: 22ch;
  margin-inline: auto;
}

.mail {
  display: inline-block;
  margin-top: 1.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1rem + 1.8vw, 2.2rem);
  font-style: italic;
  color: var(--cream);
  text-decoration: none;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 0.12em;
}

.mail:hover { color: var(--gold-hi); border-bottom-color: var(--gold-hi); }

/* Footer */
.footer-end {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
}

.site-footer a {
  color: var(--gold);
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--gold-hi);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.site-footer {
  position: relative;
  z-index: 2;
  padding: 1.4rem 0 2rem;
  border-top: 0;
  color: var(--muted);
  font-size: 0.95rem;
  background: linear-gradient(to bottom, transparent, var(--ink) 42%);
}

.site-footer .shell {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  align-items: center;
}

/* 404 */
.lost {
  position: relative;
  min-height: calc(100svh - var(--header-h) - 8rem);
  display: grid;
  align-items: center;
  padding: clamp(2rem, 5vh, 3.5rem) 0;
  overflow: clip;
}

.lost-mark {
  position: absolute;
  right: -6%;
  top: 10%;
  width: min(28rem, 60vw);
  opacity: 0.18;
  pointer-events: auto;
  filter: drop-shadow(0 0 40px rgba(201, 162, 75, 0.15));
  z-index: 2;
}

.lost .shell { position: relative; z-index: 1; }

.lost h1 {
  font-style: italic;
  font-size: clamp(2.5rem, 1.2rem + 5vw, 5rem);
  max-width: 14ch;
  margin-bottom: 1rem;
}

.lost .prose { margin-bottom: 1.8rem; }

.back {
  color: var(--cream);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 0.1em;
}

.back:hover { color: var(--gold-hi); }


/* Jewel rooms: each major section is a different chamber, texture under a contrast scrim */
.room {
  --room-fade: clamp(5.5rem, 24vh, 16rem);
  position: relative;
  isolation: isolate;
  background-color: transparent;
}

.room::before,
.room::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--room-fade) * -0.55);
  bottom: calc(var(--room-fade) * -0.55);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 var(--room-fade),
    #000 calc(100% - var(--room-fade)),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 var(--room-fade),
    #000 calc(100% - var(--room-fade)),
    transparent 100%
  );
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.room::before {
  z-index: 0;
  background-color: var(--room-fallback, var(--ink));
  background-image: var(--room-tex);
  background-size: var(--room-size, cover);
  background-position: center;
  background-repeat: var(--room-repeat, no-repeat);
}

.room::after {
  z-index: 0;
  background: var(--room-scrim, rgba(7, 9, 15, 0.7));
}

.room > * { position: relative; z-index: 1; }

#motto {
  --room-fallback: #3a1218;
  --room-tex: url("/images/tex-oxblood.webp");
  --room-size: 28rem;
  --room-repeat: repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.58), rgba(7, 9, 15, 0.7) 50%, rgba(7, 9, 15, 0.58));
}

#what {
  --room-fallback: #102418;
  --room-tex: url("/images/tex-emerald.webp");
  --room-size: 30rem;
  --room-repeat: repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.48), rgba(7, 9, 15, 0.6) 48%, rgba(7, 9, 15, 0.48));
}

#how {
  --room-fallback: #16305a;
  --room-tex: url("/images/tex-lapis.webp");
  --room-size: cover;
  --room-repeat: no-repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.72), rgba(7, 9, 15, 0.8) 50%, rgba(7, 9, 15, 0.72));
}

#ventures,
#sectors {
  --room-fallback: #0b1426;
  --room-tex: url("/images/tex-sapphire-sky.webp");
  --room-size: 36rem;
  --room-repeat: repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.5), rgba(7, 9, 15, 0.62) 50%, rgba(7, 9, 15, 0.5));
}

#seals {
  --room-fallback: #1c1228;
  --room-tex: url("/images/tex-amethyst.webp");
  --room-size: 30rem;
  --room-repeat: repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.62), rgba(7, 9, 15, 0.74) 50%, rgba(7, 9, 15, 0.62));
}

#closer {
  --room-fallback: #1a0e12;
  --room-tex: url("/images/tex-oxblood.webp");
  --room-size: 32rem;
  --room-repeat: repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.78), rgba(7, 9, 15, 0.86) 50%, rgba(7, 9, 15, 0.78));
}

#write {
  --room-fallback: #0e241c;
  --room-tex: url("/images/tex-malachite.webp");
  --room-size: cover;
  --room-repeat: no-repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.72), rgba(7, 9, 15, 0.82) 50%, rgba(7, 9, 15, 0.72));
}

.lost.room {
  --room-fallback: #0b1426;
  --room-tex: url("/images/tex-sapphire-sky.webp");
  --room-size: cover;
  --room-repeat: no-repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.55), rgba(7, 9, 15, 0.7) 50%, rgba(7, 9, 15, 0.62));
}

.gem-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin: 1.4rem auto;
  width: min(22rem, 80%);
}

.gem-rule::before,
.gem-rule::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.gem-rule img {
  width: 1.55rem;
  height: 1.55rem;
  object-fit: cover;
  border-radius: 50%;
  flex: none;
  filter: drop-shadow(0 0 5px rgba(201, 162, 75, 0.4));
}

#closer { scroll-margin-top: var(--header-h); }

#closer .shell {
  text-align: center;
  max-width: 58rem;
}

#closer .display { margin-bottom: 1.6rem; }

#closer .macro {
  margin: 0 auto;
  max-width: 52rem;
}

#closer .macro img {
  width: 100%;
  border-radius: 2px;
  box-shadow:
    0 0 0 1px #6e531c,
    0 0 0 7px #c9a24b,
    0 0 0 8px #e8c877,
    0 0 0 9px #6e531c,
    0 18px 44px rgba(0, 0, 0, 0.55);
}

#closer figcaption {
  margin: 1.5rem auto 0;
  max-width: 28rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.5rem);
  line-height: 1.4;
  color: var(--cream);
  text-wrap: pretty;
}


/* Candle glow + reveals */
.candle {
  position: absolute;
  width: 40rem;
  height: 40rem;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(232, 200, 119, 0.1), transparent 65%);
  z-index: 0;
}

.quote .candle { left: 50%; top: 50%; translate: -50% -50%; }

@media (prefers-reduced-motion: no-preference) {
  .candle { animation: candle 9s ease-in-out infinite alternate; }

  @keyframes candle {
    from { transform: translate(-50%, -50%) scale(0.92); opacity: 0.55; }
    to { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
  }

  /* Reveals stay visible unless JS has opted in with .js-reveal.
     Without that class (no JS, reduced motion, or after the failsafe)
     content is fully visible for users, crawlers, and print. */
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    html.js-reveal .reveal-up:not(.is-revealed) {
      animation: reveal-up 1s ease both;
      animation-timeline: view();
      animation-range: entry 0% entry 42%;
    }
    html.js-reveal .reveal-late:not(.is-revealed) {
      animation: reveal-up 1s ease both;
      animation-timeline: view();
      animation-range: entry 10% entry 52%;
    }
    html.js-reveal .reveal-soft:not(.is-revealed) {
      animation: reveal-soft 1.1s ease both;
      animation-timeline: view();
      animation-range: entry 0% entry 50%;
    }
  }
}

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(1.1rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes reveal-soft {
  from { opacity: 0; transform: translateY(0.4rem); }
  to { opacity: 1; transform: translateY(0); }
}

html.js-reveal .reveal-up.is-revealed,
html.js-reveal .reveal-late.is-revealed,
html.js-reveal .reveal-soft.is-revealed,
html.js-reveal-done .reveal-up,
html.js-reveal-done .reveal-late,
html.js-reveal-done .reveal-soft {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

@media print {
  .reveal-up,
  .reveal-late,
  .reveal-soft,
  .candle {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (forced-colors: active) {
  :focus-visible { outline: 2px solid Highlight; }
  .hero-shade { forced-color-adjust: none; }
}

/* Zoomable crests and seals */
a.zoom {
  color: inherit;
  text-decoration: none;
  cursor: zoom-in;
}

a.zoom:hover { color: inherit; }

a.zoom:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 4px;
}

.hero-crest-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto 1.1rem;
  max-width: min(22rem, 92vw);
}

.hero-crest-link {
  display: block;
  width: min(11.5rem, 46vw);
  margin: 0;
}

.hero-crest-link .hero-crest {
  width: 100%;
  margin: 0;
}

.crest-download {
  margin-top: 0.5rem;
  color: var(--gold);
  text-decoration: none;
  font-family: var(--font-sc);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-align: center;
  line-height: 1.4;
  max-width: min(22rem, 92vw);
  overflow-wrap: break-word;
}

.crest-download:hover,
.crest-download:focus-visible {
  color: var(--gold-hi);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

@media (max-width: 699px) {
  .hero-crest-link { width: min(8.5rem, 42vw); }
}

.footer-download {
  flex: 1 0 100%;
  margin: 0.35rem 0 0;
  max-width: 100%;
  min-width: 0;
  text-align: center;
  font-family: var(--font-sc);
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  overflow-wrap: break-word;
}

#what a.zoom,
#how a.zoom {
  display: block;
  width: min(13rem, 58vw);
  margin: 0 auto;
}

#what a.zoom .emblem,
#how a.zoom .emblem {
  width: 100%;
  margin: 0;
}

@media (min-width: 860px) {
  #what a.zoom { margin: 0; }
  #how a.zoom { margin: 0; justify-self: end; }
}

.seal a.zoom { display: block; }

.macro a.zoom { display: block; }

.lost-mark {
  display: block;
}

.lost-mark img {
  width: 100%;
  height: auto;
  filter: inherit;
}

/* Lightbox: never render in-flow when closed.
   display:flex on a closed <dialog> overrides the UA hide rule and parks it below the footer. */
.lightbox:not([open]) {
  display: none !important;
}
.lightbox[open] {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: min(96vw, 72rem);
  max-width: 96vw;
  max-height: 96vh;
  margin: auto;
  padding: 1.25rem 1.25rem 1rem;
  border: 1px solid #6e531c;
  background: #0b0c10;
  color: var(--cream);
  box-shadow:
    0 0 0 1px #c9a24b,
    0 0 0 2px #e8c877,
    0 0 0 3px #6e531c,
    0 28px 80px rgba(0, 0, 0, 0.7);
}

.lightbox::backdrop {
  background: rgba(7, 9, 15, 0.88);
}

.lightbox-close {
  appearance: none;
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 2;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-family: var(--font-sc);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  min-height: 2.5rem;
  padding: 0.35rem 0.7rem;
}

.lightbox-close:hover,
.lightbox-close:focus-visible { color: var(--gold-hi); }

.lightbox-stage {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  height: min(72vh, 40rem);
  min-height: 0;
  max-height: 72vh;
  touch-action: none;
  cursor: zoom-in;
  background: radial-gradient(ellipse at 50% 50%, #16120e 0%, #07090f 70%);
}

.lightbox-stage.is-zoomed { cursor: grab; }
.lightbox-stage.is-zoomed.is-panning { cursor: grabbing; }

.lightbox-stage img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.lightbox-caption {
  margin: 0.85rem 0 0;
  text-align: center;
  font-family: var(--font-sc);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: var(--gold);
}

.lightbox-caption:empty { display: none; }

.lightbox-hint {
  margin: 0.35rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  .lightbox { transition: none; }
}

/* The Two Intelligences */
.treatise-head {
  --room-fallback: #2a1014;
  --room-tex: image-set(url("/images/tex-stained-glass.webp") 1x, url("/images/tex-stained-glass-hd.webp") 2x), url("/images/tex-oxblood.webp");
  --room-size: cover, 28rem;
  --room-repeat: no-repeat, repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.5) 0%, rgba(7, 9, 15, 0.72) 40%, rgba(7, 9, 15, 0.78) 100%);
  text-align: center;
  padding: clamp(2.5rem, 8vh, 5.5rem) 0 clamp(3rem, 8vh, 5rem);
  min-height: clamp(20rem, 24vw, 32rem);
  scroll-margin-top: var(--header-h);
}

.treatise-head.room::before { background-position: 72% 42%, center; }

.treatise-head h1 {
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.2rem, 1.1rem + 4.4vw, 4.6rem);
  max-width: 16ch;
  margin: 0 auto;
}

.treatise-head .lede {
  margin: 0.9rem auto 0;
  max-width: 28rem;
  color: var(--muted);
  font-size: 1.2rem;
}

#considering {
  --room-fallback: #102418;
  --room-tex: url("/images/tex-emerald.webp");
  --room-size: 30rem;
  --room-repeat: repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.5), rgba(7, 9, 15, 0.62) 50%, rgba(7, 9, 15, 0.5));
}

#ledger {
  --room-fallback: #3a1218;
  --room-tex: url("/images/tex-oxblood.webp");
  --room-size: 28rem;
  --room-repeat: repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.62), rgba(7, 9, 15, 0.74) 50%, rgba(7, 9, 15, 0.62));
}

#orrery {
  --room-fallback: #0b1426;
  --room-tex: url("/images/tex-sapphire-sky.webp");
  --room-size: 36rem;
  --room-repeat: repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.5), rgba(7, 9, 15, 0.62) 50%, rgba(7, 9, 15, 0.5));
}

#labour {
  --room-fallback: #0e241c;
  --room-tex: url("/images/tex-malachite.webp");
  --room-size: cover;
  --room-repeat: no-repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.72), rgba(7, 9, 15, 0.82) 50%, rgba(7, 9, 15, 0.72));
}

#charter {
  --room-fallback: #07090f;
  --room-tex: url("/images/tex-starfield-v1.webp");
  --room-size: cover;
  --room-repeat: no-repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.12), rgba(7, 9, 15, 0.28) 50%, rgba(7, 9, 15, 0.18));
}

#covenant {
  --room-fallback: #1c1228;
  --room-tex: url("/images/tex-amethyst.webp");
  --room-size: 30rem;
  --room-repeat: repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.62), rgba(7, 9, 15, 0.74) 50%, rgba(7, 9, 15, 0.62));
}

#considering, #ledger, #orrery, #labour, #charter, #covenant, .treatise-head {
  scroll-margin-top: var(--header-h);
}

.shell.narrow { max-width: 46rem; }

.shell.narrow .prose { max-width: none; }

.shell.narrow .prose + .prose { margin-top: 1.05rem; }

.ledger-scroll {
  margin-top: 1.8rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ledger {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  background: rgba(7, 9, 15, 0.35);
  box-shadow:
    0 0 0 1px #6e531c,
    0 0 0 2px #c9a24b,
    0 0 0 3px #6e531c;
}

.ledger caption {
  caption-side: bottom;
  padding: 0.9rem 0.25rem 0;
  font-style: italic;
  color: var(--muted);
  text-align: left;
  font-size: 0.98rem;
}

.ledger th,
.ledger td {
  border: 1px solid var(--hairline);
  padding: 0.8rem 1rem;
  vertical-align: top;
  text-align: left;
}

.ledger thead th {
  font-family: var(--font-sc);
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--gold-hi);
  background: rgba(201, 162, 75, 0.12);
  font-size: 0.95rem;
}

.ledger tbody th {
  font-family: var(--font-sc);
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--gold);
  width: 9.5rem;
  background: rgba(201, 162, 75, 0.05);
}

.ledger td { color: var(--cream); }

.ledger tbody tr:nth-child(even) td,
.ledger tbody tr:nth-child(even) th {
  background: rgba(7, 9, 15, 0.22);
}

.ledger-note {
  margin: 1.25rem 0 0;
  max-width: 46rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.ledger-note sup { color: var(--gold); }

.orrery {
  margin: 1.8rem auto 0;
  max-width: 46rem;
  text-align: center;
}

.orrery svg {
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
}

.orrery figcaption {
  margin-top: 0.9rem;
  font-style: italic;
  color: var(--muted);
  font-size: 1.05rem;
}

.spin-slow,
.spin-rev {
  transform-origin: center;
  transform-box: fill-box;
}

@media (prefers-reduced-motion: no-preference) {
  .spin-slow {
    animation: orrery-spin 80s linear infinite;
  }
  .spin-rev {
    animation: orrery-spin 110s linear infinite reverse;
  }
}

@keyframes orrery-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.charter {
  position: relative;
  margin-top: 1.8rem;
  padding: clamp(2.2rem, 5vw, 3.2rem) clamp(1.4rem, 4vw, 3rem);
  border: 1px solid var(--hairline);
  background: rgba(7, 9, 15, 0.4);
  box-shadow:
    0 0 0 1px #6e531c,
    0 0 0 2px #c9a24b,
    0 0 0 3px #6e531c;
}

.charter-lede,
.charter-end {
  margin: 0;
  font-style: italic;
  text-wrap: pretty;
}

.charter-end {
  margin-top: 1.4rem;
  text-align: center;
  color: var(--gold-hi);
  font-size: 1.2rem;
}

.articles {
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: article;
}

.articles li {
  position: relative;
  margin: 0 0 1rem;
  padding-left: 3rem;
  text-wrap: pretty;
}

.articles li::before {
  counter-increment: article;
  content: counter(article, upper-roman);
  position: absolute;
  left: 0;
  top: 0.15em;
  font-family: var(--font-sc);
  color: var(--gold);
  letter-spacing: 0.08em;
  font-size: 0.95rem;
}

@media (max-width: 719px) {
  .ledger { min-width: 0; width: 100%; box-shadow: 0 0 0 1px #6e531c; }
  .ledger caption {
    display: block;
    width: 100%;
    max-width: none;
    caption-side: bottom;
    box-sizing: border-box;
    margin: 0.9rem 0 0;
    padding: 0.2rem 0 0;
    text-align: left;
    white-space: normal;
  }
  .ledger thead { display: none; }
  .ledger,
  .ledger tbody,
  .ledger tr,
  .ledger th,
  .ledger td { display: block; width: 100%; }
  .ledger tr {
    margin: 0 0 1.1rem;
    border: 1px solid var(--hairline);
    background: rgba(7, 9, 15, 0.35);
  }
  .ledger tbody th,
  .ledger tbody td,
  .ledger tbody tr:nth-child(even) td,
  .ledger tbody tr:nth-child(even) th {
    border: 0;
    background: transparent;
    width: auto;
  }
  .ledger tbody th {
    padding-bottom: 0.15rem;
    color: var(--gold-hi);
  }
  .ledger td[data-k]::before {
    content: attr(data-k);
    display: block;
    font-family: var(--font-sc);
    color: var(--gold);
    letter-spacing: 0.1em;
    font-size: 0.86rem;
    margin-bottom: 0.25rem;
  }
}

/* ---------- Eye candy: rooms, gallery, charts, motion ---------- */

#intelligences {
  --room-fallback: #0b1426;
  --room-tex: url("/images/tex-sapphire-sky.webp");
  --room-size: 36rem;
  --room-repeat: repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.55), rgba(7, 9, 15, 0.68) 50%, rgba(7, 9, 15, 0.55));
}

#ages {
  --room-fallback: #1a0e12;
  --room-tex: url("/images/tex-oxblood.webp");
  --room-size: 32rem;
  --room-repeat: repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.62), rgba(7, 9, 15, 0.74) 50%, rgba(7, 9, 15, 0.62));
}

#cabinet {
  --room-fallback: #1c1228;
  --room-tex: url("/images/tex-amethyst.webp");
  --room-size: 30rem;
  --room-repeat: repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.62), rgba(7, 9, 15, 0.74) 50%, rgba(7, 9, 15, 0.62));
}

/* Filigree dividers: fully drawn by default so no-JS, print, pause, and reduced-motion stay complete. */
.drawn-rule {
  position: relative;
  z-index: 2;
  background: transparent;
  padding: 0.15rem var(--pad);
  line-height: 0;
}

.drawn-rule svg {
  display: block;
  width: min(52rem, 100%);
  height: 2.5rem;
  margin-inline: auto;
  overflow: visible;
}

.filigree-stroke {
  stroke: var(--gold);
  stroke-width: 1.15;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.filigree-flourish { stroke: var(--gold-hi); stroke-width: 0.9; opacity: 0.85; }

.filigree-stone { fill: var(--gold-hi); stroke: none; }

html.js-motion .drawn-rule:not(.is-drawn):not(.is-drawn-instant) .filigree-stroke {
  stroke-dashoffset: 1;
}

html.js-motion .drawn-rule.is-drawn .filigree-stroke {
  animation: draw-filigree 1.25s ease-out forwards;
}

html.js-motion .drawn-rule.is-drawn-instant .filigree-stroke,
html:not(.js-motion) .drawn-rule .filigree-stroke {
  stroke-dashoffset: 0;
  animation: none;
}

@keyframes draw-filigree {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

/* No hero parallax scale: the gilt frame must stay fully visible. */

/* Gold heading shimmer. Colour stays gold unless js-motion arms the clip. */
@media (prefers-reduced-motion: no-preference) {
  .eyebrow,
  .gilt,
  .pair h3 {
    background-image: linear-gradient(
      105deg,
      var(--gold) 0%,
      var(--gold) 36%,
      #fff4c4 50%,
      var(--gold-hi) 64%,
      var(--gold) 100%
    );
    background-size: 220% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: gold-shimmer 10s ease-in-out infinite;
  }
  .pair h3 {
    background-image: linear-gradient(
      105deg,
      var(--gold-hi) 0%,
      var(--gold-hi) 36%,
      #fff4c4 50%,
      var(--gold) 64%,
      var(--gold-hi) 100%
    );
  }
}

@keyframes gold-shimmer {
  0%, 58%, 100% { background-position: 100% 0; }
  72% { background-position: 0% 0; }
}

/* Gem glints on crests and seals. */
.sparkle { position: relative; }

.sparkle::after {
  content: "";
  position: absolute;
  width: 12%;
  height: 12%;
  left: 41%;
  top: 26%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 246, 208, 0.95) 0%, rgba(232, 200, 119, 0) 70%);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
}

@media (prefers-reduced-motion: no-preference) {
  .sparkle::after { animation: gem-glint 6.8s ease-in-out infinite; }
  .seal:nth-child(2) .sparkle::after,
  .sparkle.delay-2::after { animation-delay: 1.7s; left: 48%; top: 34%; }
  .seal:nth-child(3) .sparkle::after,
  .sparkle.delay-3::after { animation-delay: 3.2s; left: 36%; top: 30%; }
  .seal:nth-child(4) .sparkle::after { animation-delay: 4.6s; left: 52%; top: 22%; }
}

@keyframes gem-glint {
  0%, 72%, 100% { opacity: 0; transform: scale(0.55); }
  78% { opacity: 0.9; transform: scale(1.25); }
  86% { opacity: 0; transform: scale(0.6); }
}

/* Full-width hall banner */
.hall-banner {
  position: relative;
  isolation: isolate;
  z-index: 1;
  margin: 0;
  background: transparent;
  line-height: 0;
  overflow: hidden;
}



.hall-banner a.zoom { display: block; overflow: hidden; }

.hall-banner img {
  width: 100%;
  height: clamp(18rem, 38vw, 36rem);
  object-fit: cover;
  object-position: center 58%;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 min(16vh, 9rem),
    #000 calc(100% - min(16vh, 9rem)),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 min(16vh, 9rem),
    #000 calc(100% - min(16vh, 9rem)),
    transparent 100%
  );
}

/* Stat cards */
.stat-cards {
  list-style: none;
  margin: 1.8rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.stat-cards li {
  margin: 0;
  padding: 1rem 0.9rem 1.05rem;
  text-align: center;
  background: rgba(7, 9, 15, 0.42);
  box-shadow:
    0 0 0 1px #6e531c,
    0 0 0 2px #c9a24b,
    0 0 0 3px #6e531c;
}

.stat-cards img {
  width: 2.4rem;
  height: 2.4rem;
  margin: 0 auto 0.45rem;
  object-fit: contain;
}

.stat-cards strong {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.35rem, 1rem + 1.2vw, 1.9rem);
  color: var(--gold-hi);
  line-height: 1.15;
}

.stat-cards span {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--font-sc);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

@media (min-width: 800px) {
  .stat-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
  .stat-cards { grid-template-columns: repeat(5, 1fr); }
}

/* Engraved chart panels */
.chart-panel {
  margin: 2rem 0 0;
  padding: 1.15rem 1rem 1.05rem;
  background: rgba(7, 9, 15, 0.4);
  box-shadow:
    0 0 0 1px #6e531c,
    0 0 0 2px #c9a24b,
    0 0 0 3px #6e531c;
}

.chart-panel h3 {
  font-family: var(--font-sc);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  color: var(--gold);
  font-style: normal;
  margin: 0 0 0.85rem;
}

.chart-panel svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-panel .chart-note,
.lore-note,
.intel-foot {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
  text-wrap: pretty;
}

.intel-link {
  margin: 1.4rem 0 0;
  font-style: italic;
}

.chart-grid {
  display: grid;
  gap: 1.2rem;
  margin-top: 0.4rem;
}

@media (min-width: 900px) {
  .chart-grid { grid-template-columns: 1.15fr 0.85fr; align-items: stretch; }
}

/* Astrolabe / orrery of offices */
.roles {
  display: grid;
  gap: 1.4rem;
  margin-top: 2rem;
  align-items: center;
}

.home-orrery {
  margin: 0 auto;
  width: min(20rem, 80vw);
}

.home-orrery svg { width: 100%; height: auto; display: block; }

.role-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
  margin: 0;
}

.role-cols section h3 {
  font-family: var(--font-sc);
  font-size: 1rem;
  letter-spacing: 0.16em;
  color: var(--gold-hi);
  font-style: normal;
  margin: 0 0 0.5rem;
}

.role-cols ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.role-cols li {
  margin: 0;
  padding: 0.35rem 0;
  border-top: 1px solid var(--hairline);
  color: var(--cream);
  font-style: italic;
}

.role-cols li:last-child { border-bottom: 1px solid var(--hairline); }

@media (min-width: 800px) {
  .roles { grid-template-columns: 1fr auto 1fr; gap: 1.5rem 2rem; }
  .roles .home-orrery { order: 0; }
  .role-cols { display: contents; }
  .role-cols .hi { order: -1; text-align: right; }
  .role-cols .ai { order: 1; }
  .role-cols .hi li { padding-right: 0.2rem; }
}

/* Lore timeline */
.lore-line {
  list-style: none;
  margin: 1.8rem 0 0;
  padding: 0;
  display: grid;
  gap: 0;
  counter-reset: age;
}

.lore-line li {
  position: relative;
  margin: 0;
  padding: 0 0 1.4rem 1.5rem;
  border-left: 1px solid var(--hairline);
}

.lore-line li:last-child { padding-bottom: 0; }

.lore-line li::before {
  content: "";
  position: absolute;
  left: -0.38rem;
  top: 0.35rem;
  width: 0.7rem;
  height: 0.7rem;
  background: var(--gold-hi);
  box-shadow: 0 0 0 3px var(--ink), 0 0 0 4px var(--gold);
  transform: rotate(45deg);
}

.lore-name {
  display: block;
  font-family: var(--font-sc);
  letter-spacing: 0.1em;
  color: var(--gold-hi);
  font-size: 0.95rem;
}

.lore-note {
  display: block;
  margin: 0.2rem 0 0;
  font-style: italic;
  color: var(--cream);
}

@media (min-width: 800px) {
  .lore-line {
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    border-top: 1px solid var(--hairline);
  }
  .lore-line li {
    border-left: 0;
    padding: 1.4rem 0.8rem 0;
    text-align: center;
  }
  .lore-line li::before {
    left: 50%;
    top: -0.38rem;
    margin-left: -0.35rem;
  }
}

/* Cabinet of curiosities */
.curiosity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  margin: 1.8rem 0 0;
  min-width: 0;
}

.curiosity figure {
  margin: 0;
}

.curiosity a.zoom {
  display: block;
  overflow: hidden;
  background: var(--ink);
  box-shadow:
    0 0 0 1px #6e531c,
    0 0 0 2px #c9a24b,
    0 0 0 3px #6e531c;
}

.curiosity img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center 20%;
}

.curiosity figcaption {
  margin: 0.45rem 0 0;
  font-family: var(--font-sc);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-align: center;
  overflow-wrap: anywhere;
  hyphens: auto;
  max-width: 100%;
}

@media (max-width: 799px) {
  .curiosity figure:last-child { grid-column: 1 / -1; max-width: 22rem; margin-inline: auto; width: 100%; }
  .curiosity figure:last-child img { aspect-ratio: 4 / 3; object-position: center; }
}
@media (min-width: 800px) {
  .curiosity { grid-template-columns: repeat(6, 1fr); }
  .curiosity figure:nth-child(1),
  .curiosity figure:nth-child(2) { grid-column: span 3; }
  .curiosity figure:nth-child(3),
  .curiosity figure:nth-child(4) { grid-column: span 3; }
  .curiosity figure:nth-child(5),
  .curiosity figure:nth-child(6),
  .curiosity figure:nth-child(7) { grid-column: span 2; }
  .curiosity figure:nth-child(1) img,
  .curiosity figure:nth-child(2) img,
  .curiosity figure:nth-child(5) img,
  .curiosity figure:nth-child(6) img,
  .curiosity figure:nth-child(7) img { aspect-ratio: 4 / 3; object-position: center; }
  .curiosity figure:nth-child(3) img,
  .curiosity figure:nth-child(4) img { aspect-ratio: 3 / 4; object-position: center 12%; }
}

@media (prefers-reduced-motion: no-preference) {
  .curiosity img,
  .hall-banner img,
  .write-still img {
    transition: transform 0.6s ease;
  }
  .curiosity a.zoom:hover img,
  .hall-banner a.zoom:hover img,
  .write-still:hover img {
    transform: scale(1.035);
  }
}

/* Write with the hands still */
#write .shell.write-split {
  text-align: center;
}

@media (min-width: 800px) {
  #write .shell.write-split {
    display: grid;
    grid-template-columns: 1fr minmax(14rem, 22rem);
    gap: 2.5rem;
    align-items: center;
    text-align: left;
  }
  #write .write-split h2 { margin-inline: 0; }
}

.write-still {
  display: block;
  margin: 1.6rem auto 0;
  max-width: 22rem;
  box-shadow:
    0 0 0 1px #6e531c,
    0 0 0 2px #c9a24b,
    0 0 0 3px #6e531c;
}

.write-still img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

@media (min-width: 800px) {
  .write-still { margin: 0; }
}

@media print {
  .filigree-stroke { stroke-dashoffset: 0 !important; animation: none !important; }
  .hero-stage img,
  .curiosity img,
  .hall-banner img,
  .write-still img {
    animation: none !important;
    transform: none !important;
  }
  .sparkle::after { display: none !important; }
  .eyebrow, .gilt, .pair h3 {
    animation: none !important;
    color: var(--gold) !important;
    -webkit-text-fill-color: var(--gold) !important;
    background: none !important;
  }
}

.chart-legend {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem 1.2rem;
}
.chart-legend li {
  margin: 0;
  color: var(--muted);
  font-style: italic;
  font-size: 0.98rem;
}
.chart-legend span {
  font-family: var(--font-sc);
  font-style: normal;
  letter-spacing: 0.1em;
  color: var(--gold-hi);
  font-size: 0.86rem;
  margin-right: 0.4rem;
}
@media (min-width: 700px) {
  .chart-legend { grid-template-columns: 1fr; }
}

@media (max-width: 799px) {
  .chart-panel .svg-anno { display: none; }
}

.gauges { margin: 0.2rem 0 0; }
.gauge { margin: 0.85rem 0 0; }
.gauge:first-child { margin-top: 0.2rem; }
.gauge-lab {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8rem;
  font-family: var(--font-sc);
  letter-spacing: 0.08em;
  font-size: 0.86rem;
  color: var(--gold);
}
.gauge-lab strong {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--cream);
  letter-spacing: 0;
  font-size: 1.15rem;
  text-align: right;
}
.gauge-track {
  height: 0.72rem;
  margin-top: 0.4rem;
  background: rgba(110, 83, 28, 0.28);
  box-shadow: inset 0 0 0 1px #6e531c;
}
.gauge-track i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #c9a24b, #e8c877);
}
.gauge-track i.full { width: 100%; }

/* Motto of the two intelligences */
.intel-motto {
  position: relative;
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  align-items: center;
  margin: 0.4rem 0 1.5rem;
  padding: 1.7rem 1.3rem 1.5rem;
  text-align: center;
  color: var(--gold-hi);
  background: rgba(7, 9, 15, 0.42);
  box-shadow:
    0 0 0 1px #6e531c,
    0 0 0 2px #c9a24b,
    0 0 0 3px #6e531c;
}

.intel-motto .filigree {
  width: 4.2rem;
  height: 4.2rem;
  opacity: 0.8;
}

.motto-full {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  max-width: 1px;
}

.motto-half {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  min-width: 0;
}

.motto-who {
  font-family: var(--font-sc);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(1.05rem, 0.9rem + 0.5vw, 1.35rem);
  letter-spacing: 0.22em;
  color: var(--gold);
  line-height: 1;
}

.motto-for {
  font-family: var(--font-sc);
  font-style: normal;
  font-weight: 400;
  font-size: 0.82rem;
  letter-spacing: 0.28em;
  color: var(--muted);
  line-height: 1.2;
}

.motto-word {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.35rem, 1rem + 4.4vw, 5.1rem);
  line-height: 0.96;
  letter-spacing: -0.02em;
  color: var(--gold-hi);
  text-wrap: balance;
}

.motto-mark {
  display: block;
  width: 2.1rem;
  color: var(--gold);
  margin: 0.15rem 0;
}

.motto-mark svg {
  display: block;
  width: 100%;
  height: auto;
}

@media (min-width: 800px) {
  .intel-motto {
    grid-template-columns: 1fr auto 1fr;
    gap: 0.8rem 1.6rem;
    padding: 2.15rem 2.6rem 1.9rem;
  }
  .motto-half.hi { justify-self: end; justify-items: end; text-align: right; }
  .motto-half.ai { justify-self: start; justify-items: start; text-align: left; }
  .motto-mark {
    width: 2.4rem;
    margin: 0;
  }
}

@media (max-width: 799px) {
  .motto-mark {
    width: min(14rem, 70vw);
    height: 1.15rem;
    overflow: hidden;
  }
  .motto-mark svg {
    width: 100%;
    height: 1.15rem;
    transform: rotate(90deg);
    transform-origin: center;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .motto-word {
    background-image: linear-gradient(
      105deg,
      var(--gold-hi) 0%,
      var(--gold-hi) 36%,
      #fff4c4 50%,
      var(--gold) 64%,
      var(--gold-hi) 100%
    );
    background-size: 220% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: gold-shimmer 10s ease-in-out infinite;
  }
}

.hero-motto,
.footer-motto {
  margin: 0.65rem 0 0;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.hero-motto {
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.2rem);
}

.footer-motto {
  flex: 1 0 100%;
  margin: 0 0 0.15rem;
  text-align: center;
  font-size: 1rem;
  color: var(--gold);
}

.footer-copy {
  flex: 1 0 100%;
  margin: 0;
  max-width: 100%;
  min-width: 0;
  text-align: center;
  overflow-wrap: break-word;
}

.footer-reg {
  white-space: nowrap;
}

.footer-contact {
  flex: 1 0 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0.1rem 0 0;
  font-style: normal;
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: center;
  color: var(--muted);
}

.footer-contact a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 0.5rem;
  color: var(--gold);
}

.footer-place {
  display: block;
  margin: 0;
  max-width: 36rem;
  text-wrap: pretty;
}

@media print {
  .motto-word,
  .hero-motto,
  .footer-motto {
    animation: none !important;
    color: var(--gold-hi) !important;
    -webkit-text-fill-color: var(--gold-hi) !important;
    background: none !important;
  }
}

/* Guiding spirit and the SI seal */
.spirit-line {
  margin: 0.9rem 0 1.15rem;
  text-align: center;
  font-family: var(--font-sc);
  font-size: clamp(1rem, 0.85rem + 0.55vw, 1.28rem);
  letter-spacing: 0.12em;
  color: var(--gold-hi);
  text-wrap: pretty;
}

.si-seal {
  margin: 2.2rem auto 0;
  max-width: 26rem;
  text-align: center;
}

.si-seal svg {
  display: block;
  width: min(22rem, 78vw);
  height: auto;
  margin: 0 auto 0.9rem;
  overflow: visible;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
}

.si-spin {
  transform-box: view-box;
  transform-origin: 50% 50%;
}

@media (prefers-reduced-motion: no-preference) {
  .si-spin-a { animation: si-spin-cw 90s linear infinite; }
  .si-spin-b { animation: si-spin-ccw 130s linear infinite; }
  .si-spin-c { animation: si-spin-cw 56s linear infinite; }
  .si-spin-d { animation: si-spin-ccw 76s linear infinite; }
}

@keyframes si-spin-cw {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes si-spin-ccw {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}
@media print {
  .si-spin { animation: none !important; }
}

.si-equation {
  margin: 0 0 0.55rem;
  font-family: var(--font-sc);
  letter-spacing: 0.22em;
  color: var(--gold);
  font-size: 1.05rem;
}

.si-creed {
  margin: 0;
  font-family: var(--font-sc);
  font-size: clamp(1.05rem, 0.9rem + 0.7vw, 1.4rem);
  letter-spacing: 0.14em;
  color: var(--gold-hi);
  text-wrap: pretty;
}

.si-creed::before,
.si-creed::after {
  content: " · ";
  color: var(--gold);
  letter-spacing: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .spirit-line,
  .si-creed,
  .si-equation {
    background-image: linear-gradient(
      105deg,
      var(--gold-hi) 0%,
      var(--gold-hi) 36%,
      #fff4c4 50%,
      var(--gold) 64%,
      var(--gold-hi) 100%
    );
    background-size: 220% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: gold-shimmer 10s ease-in-out infinite;
  }
}

@media print {
  .spirit-line, .si-creed, .si-equation {
    animation: none !important;
    color: var(--gold-hi) !important;
    -webkit-text-fill-color: var(--gold-hi) !important;
    background: none !important;
  }
}

/* Five engraved interludes, and the ascent */
.interlude {
  padding: clamp(4.8rem, 11vw, 9rem) 0;
  scroll-margin-top: var(--header-h);
}

.interlude .shell {
  max-width: 52rem;
}

.interlude-frame {
  position: relative;
  margin: 0 auto;
  padding: clamp(2.4rem, 5.5vw, 3.8rem) clamp(1.5rem, 5vw, 3.4rem) clamp(2.2rem, 5vw, 3.4rem);
  background: rgba(7, 9, 15, 0.48);
}

/* Faint hairlines that fade away between the corner flourishes; no full box. */
.interlude-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(201, 162, 75, 0.34), rgba(201, 162, 75, 0.08) 16%, transparent 34%, transparent 66%, rgba(201, 162, 75, 0.08) 84%, rgba(201, 162, 75, 0.34)) top / 100% 1px no-repeat,
    linear-gradient(90deg, rgba(201, 162, 75, 0.34), rgba(201, 162, 75, 0.08) 16%, transparent 34%, transparent 66%, rgba(201, 162, 75, 0.08) 84%, rgba(201, 162, 75, 0.34)) bottom / 100% 1px no-repeat,
    linear-gradient(180deg, rgba(201, 162, 75, 0.34), rgba(201, 162, 75, 0.08) 16%, transparent 34%, transparent 66%, rgba(201, 162, 75, 0.08) 84%, rgba(201, 162, 75, 0.34)) left / 1px 100% no-repeat,
    linear-gradient(180deg, rgba(201, 162, 75, 0.34), rgba(201, 162, 75, 0.08) 16%, transparent 34%, transparent 66%, rgba(201, 162, 75, 0.08) 84%, rgba(201, 162, 75, 0.34)) right / 1px 100% no-repeat;
}

.interlude-frame .filigree {
  width: 4.6rem;
  height: 4.6rem;
  opacity: 0.85;
}

.interlude-num {
  margin: 0 0 1.25rem;
  text-align: center;
  font-family: var(--font-caps);
  font-size: clamp(1.35rem, 1rem + 1.1vw, 2rem);
  letter-spacing: 0.28em;
  color: var(--gold-hi);
}

.interlude-prose {
  margin: 0 auto;
  max-width: 38rem;
  font-size: clamp(1.18rem, 1rem + 0.7vw, 1.55rem);
  line-height: 1.72;
  font-style: italic;
  color: var(--cream);
  text-wrap: pretty;
}

.interlude-prose::first-letter {
  font-family: var(--font-caps);
  font-style: normal;
  font-size: 3.6em;
  float: left;
  line-height: 0.72;
  padding: 0.12em 0.14em 0.02em 0;
  color: var(--gold-hi);
}

#interlude-i {
  --room-fallback: #2a1014;
  --room-tex: image-set(url("/images/tex-stained-glass.webp") 1x, url("/images/tex-stained-glass-hd.webp") 2x), url("/images/tex-oxblood.webp");
  --room-size: cover, 28rem;
  --room-repeat: no-repeat, repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.55) 0%, rgba(7, 9, 15, 0.72) 50%, rgba(7, 9, 15, 0.55) 100%);
}

#interlude-i.room::before {
  background-position: 72% 42%, center;
}

#interlude-ii {
  --room-fallback: #0b1426;
  --room-tex: url("/images/tex-sapphire-sky.webp");
  --room-size: 36rem;
  --room-repeat: repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.5), rgba(7, 9, 15, 0.66) 50%, rgba(7, 9, 15, 0.5));
}

#interlude-iii {
  --room-fallback: #102418;
  --room-tex: url("/images/tex-emerald.webp");
  --room-size: 30rem;
  --room-repeat: repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.5), rgba(7, 9, 15, 0.64) 50%, rgba(7, 9, 15, 0.5));
}

#interlude-iv {
  --room-fallback: #16305a;
  --room-tex: url("/images/tex-lapis.webp");
  --room-size: cover;
  --room-repeat: no-repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.62), rgba(7, 9, 15, 0.74) 50%, rgba(7, 9, 15, 0.62));
}

#interlude-v {
  --room-fallback: #1c1228;
  --room-tex: url("/images/tex-amethyst.webp");
  --room-size: 30rem;
  --room-repeat: repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.55), rgba(7, 9, 15, 0.7) 50%, rgba(7, 9, 15, 0.55));
}

#ascent {
  --room-fallback: #0b1426;
  --room-tex: url("/images/tex-sapphire-sky.webp");
  --room-size: 36rem;
  --room-repeat: repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.52), rgba(7, 9, 15, 0.66) 50%, rgba(7, 9, 15, 0.52));
  scroll-margin-top: var(--header-h);
}

.ascent-chart {
  margin: 1.8rem 0 0;
  padding: 1.2rem 0.6rem 0.8rem;
  background: rgba(7, 9, 15, 0.4);
  box-shadow:
    0 0 0 1px #6e531c,
    0 0 0 2px #c9a24b,
    0 0 0 3px #6e531c;
}

.ascent-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 699px) {
  .ascent-chart { overflow-x: auto; }
  .ascent-chart svg { min-width: 28rem; }
  .interlude-prose::first-letter { font-size: 3em; }
}

@media print {
  .interlude-prose, .interlude-num { color: inherit; }
}
.ascent-legend {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.3rem 1rem;
  grid-template-columns: 1fr;
}
.ascent-legend li {
  margin: 0;
  font-family: var(--font-sc);
  letter-spacing: 0.1em;
  color: var(--gold-hi);
  font-size: 0.92rem;
}
.ascent-chart .svg-anno { display: none; }
@media (min-width: 800px) {
  .ascent-legend { grid-template-columns: repeat(5, 1fr); text-align: center; }
}
@media (max-width: 799px) {
  .ascent-chart { overflow-x: hidden; }
  .ascent-chart svg { min-width: 0; }
}

/* ---------- Mobile overflow hardening ---------- */
.shell, .section, .interlude, .quote, .cabinet, .curiosity,
.stat-cards, .roles, .chart-grid, .lore-line, .chart-panel,
.intel-motto, .si-seal, .interlude-frame, .pair, main {
  min-width: 0;
}

.cabinet > *, .curiosity > *, .stat-cards > *, .roles > * { min-width: 0; }

h1, h2, h3, .display, .statement, .prose, .lede, .closing,
.interlude-prose, .charter-lede, .articles li, .spirit-line,
.si-creed, .si-equation, .footer-motto, .intel-foot, .chart-note,
.lore-name, .lore-note, .motto-word, .stat-cards strong,
.stat-cards span {
  overflow-wrap: anywhere;
  word-wrap: break-word;
}

@media (max-width: 799px) {
  .eyebrow, .motto-who, .motto-for, .si-equation, .si-creed,
  .spirit-line, .interlude-num, .lore-name, figcaption,
  .stat-cards span, .chart-panel h3, .footer-motto, .brand-name,
  .ledger caption, .ascent-legend li, .role-cols h3, .gauge-lab {
    letter-spacing: 0.05em;
  }

  .intel-motto {
    padding: 1.2rem 0.8rem 1.15rem;
  }
  .intel-motto .filigree {
    width: 2.5rem;
    height: 2.5rem;
  }
  .motto-word {
    font-size: clamp(1.7rem, 10.5vw, 2.45rem);
    line-height: 1.02;
  }
  .motto-who { font-size: clamp(0.9rem, 3.4vw, 1.1rem); }

  .spirit-line {
    font-size: clamp(0.86rem, 3.5vw, 1.05rem);
    letter-spacing: 0.04em;
    padding-inline: 0.15rem;
    line-height: 1.45;
  }

  .si-seal { max-width: 100%; }
  .si-seal svg { width: min(17.5rem, 82vw); }
  .si-equation { font-size: 0.92rem; letter-spacing: 0.08em; }
  .si-creed {
    font-size: clamp(0.9rem, 3.7vw, 1.08rem);
    letter-spacing: 0.05em;
    padding-inline: 0.35rem;
    line-height: 1.45;
  }

  .interlude { padding: clamp(3rem, 8vw, 5.2rem) 0; }
  .interlude-frame {
    padding: 1.55rem 0.95rem 1.4rem;
  }
  .interlude-frame .filigree {
    width: 2.6rem;
    height: 2.6rem;
  }
  .interlude-num { letter-spacing: 0.18em; margin-bottom: 0.9rem; }
  .interlude-prose { font-size: clamp(1.05rem, 4.1vw, 1.22rem); }
  .interlude-prose::first-letter {
    font-size: 2.45em;
    padding: 0.1em 0.1em 0 0;
  }

  .hero h1 { font-size: clamp(1.75rem, 8.8vw, 2.35rem); }
  .display, #charter .display, #write h2 {
    overflow-wrap: anywhere;
  }

  .stat-cards { gap: 0.5rem; }
  .stat-cards li { padding: 0.7rem 0.45rem 0.8rem; }
  .stat-cards strong { font-size: clamp(1.05rem, 5vw, 1.4rem); }
  .stat-cards span { font-size: 0.72rem; letter-spacing: 0.05em; }

  .cabinet { gap: 1rem 0.65rem; }
  .seal { width: 100%; }
  .seal figcaption,
  .curiosity figcaption {
    letter-spacing: 0.04em;
    font-size: 0.76rem;
  }

  .chart-panel { padding: 0.9rem 0.7rem 0.85rem; }
  .drawn-rule { overflow: hidden; }
  .footer-motto { font-size: 0.9rem; }
  .charter, .articles { overflow-wrap: anywhere; }

  .lost h1, .lost .prose { overflow-wrap: anywhere; }
}

@media (max-width: 359px) {
  .motto-word { font-size: clamp(1.5rem, 9.8vw, 1.95rem); }
  .intel-motto { padding: 1rem 0.65rem 0.95rem; }
  .interlude-frame { padding: 1.4rem 0.8rem 1.25rem; }
  .stat-cards { grid-template-columns: 1fr; }
}


/* Lightbox print download */
.lightbox-download {
  display: block;
  margin: 0.85rem auto 0;
  max-width: min(28rem, 92%);
  text-align: center;
  color: var(--gold);
  text-decoration: none;
  font-family: var(--font-sc);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  line-height: 1.4;
  overflow-wrap: break-word;
}
.lightbox-download:hover,
.lightbox-download:focus-visible {
  color: var(--gold-hi);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
.lightbox-download[hidden] { display: none; }

/* Seal print downloads on the page */
.seal-download {
  display: block;
  margin: 0.55rem auto 0;
  color: var(--gold);
  text-decoration: none;
  font-family: var(--font-sc);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-align: center;
  line-height: 1.4;
  max-width: min(22rem, 92%);
  overflow-wrap: break-word;
}
.seal-download:hover,
.seal-download:focus-visible {
  color: var(--gold-hi);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
.emblem-block {
  display: block;
  width: min(13rem, 58vw);
  margin: 0 auto;
  text-align: center;
  min-width: 0;
}
#what a.zoom,
#how a.zoom {
  display: block;
  width: min(13rem, 58vw);
  margin: 0 auto;
}

/* Eve / open question */
.eve-question {
  position: relative;
  margin: 1.8rem auto 0;
  max-width: 38rem;
  text-align: center;
}
.eve-frame {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  font-style: italic;
  text-wrap: pretty;
}
.eve-riddle {
  margin: 0.85rem 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.28rem, 1rem + 1.15vw, 1.85rem);
  line-height: 1.4;
  color: var(--cream);
  text-wrap: pretty;
}
.eve-flame {
  display: block;
  width: 0.7rem;
  height: 1.35rem;
  margin: 1.1rem auto 0;
  border-radius: 50% 50% 45% 45%;
  background:
    radial-gradient(circle at 50% 70%, #f4ede0 0%, #e8c877 35%, #c9a24b 70%, transparent 80%);
  box-shadow: 0 0 16px 4px rgba(232, 200, 119, 0.35);
  opacity: 0.85;
}
@media (prefers-reduced-motion: no-preference) {
  .eve-flame { animation: eve-flicker 3.6s ease-in-out infinite alternate; }
  @keyframes eve-flicker {
    from { transform: scale(0.92) translateY(0.08rem); opacity: 0.6; }
    to { transform: scale(1.08) translateY(-0.06rem); opacity: 1; }
  }
}

/* Dramatic scale, power, satellite */
.scale-suite {
  display: grid;
  gap: 1.4rem;
  margin-top: 1.6rem;
  min-width: 0;
}
.mechanism-panel h3,
.orbital-panel h3,
.power-panel h3 {
  font-family: var(--font-sc);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  color: var(--gold);
  font-style: normal;
  margin: 0 0 0.85rem;
}
.mechanism-lead,
.power-lead {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-style: italic;
  text-wrap: pretty;
}
.mechanism-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.mechanism-list li {
  position: relative;
  margin: 0;
  padding: 0.45rem 0 0.45rem 1.1rem;
  color: var(--cream);
  text-wrap: pretty;
  border-top: 1px solid rgba(201, 162, 75, 0.22);
}
.mechanism-list li:first-child { border-top: 0; }
.mechanism-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(232, 200, 119, 0.45);
}
.scale-drama-svg { width: 100%; height: auto; display: block; overflow: visible; }
.scale-drama .brain-mass,
.scale-drama .brain-nodes,
.scale-drama .brain-glow,
.scale-drama .uncharted-labels {
  transform-box: fill-box;
  transform-origin: center;
}
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    html.js-reveal .scale-drama .brain-glow:not(.is-revealed),
    html.js-reveal .scale-drama .brain-mass,
    html.js-reveal .scale-drama .brain-nodes {
      animation: brain-rise 1.4s ease both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
    html.js-reveal .scale-drama .uncharted-labels {
      animation: reveal-soft 1.3s ease both;
      animation-timeline: view();
      animation-range: entry 15% entry 65%;
    }
  }
  @keyframes brain-rise {
    from { opacity: 0.15; transform: scale(0.72); }
    to { opacity: 1; transform: scale(1); }
  }
}
.power-bars { margin: 0.4rem 0 0; }
.power-bar { margin: 0.85rem 0 0; }
.power-bar:first-child { margin-top: 0.15rem; }
.power-lab {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
  font-size: 0.95rem;
  color: var(--muted);
}
.power-lab span { min-width: 0; text-wrap: pretty; }
.power-lab strong {
  color: var(--gold);
  font-family: var(--font-sc);
  font-weight: 500;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.power-track {
  margin-top: 0.35rem;
  height: 0.55rem;
  background: rgba(201, 162, 75, 0.12);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 75, 0.35);
  overflow: hidden;
}
.power-track i {
  display: block;
  height: 100%;
  min-width: 3px;
  background: linear-gradient(90deg, #c9a24b, #e8c877);
}
.power-track i.full { width: 100%; }
.power-bar.person .power-track i { min-width: 4px; box-shadow: 0 0 10px #e8c877; }
.orbital-panel {
  margin: 0;
  padding: 1.15rem 1rem 1.05rem;
  background: rgba(7, 9, 15, 0.4);
  box-shadow:
    0 0 0 1px #6e531c,
    0 0 0 2px #c9a24b,
    0 0 0 3px #6e531c;
  min-width: 0;
}
.orbital-plate {
  display: block;
  width: 100%;
  height: auto;
  margin: 0.4rem 0 0;
}
.orbital-equals {
  margin: 1rem 0 0;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.2rem, 1rem + 0.9vw, 1.7rem);
  color: var(--cream);
  text-wrap: pretty;
}
.orbital-equals strong { color: var(--gold); font-style: italic; }
.orbital-source {
  display: inline-block;
  margin-left: 0.5em;
  padding: 0;
  font-family: var(--font-sc);
  font-style: normal;
  font-size: 0.52em;
  letter-spacing: 0.1em;
  vertical-align: super;
  color: var(--muted);
  text-decoration: none;
  line-height: 1;
}
.orbital-source:hover,
.orbital-source:focus-visible { color: var(--gold); }

/* Charter old-style ship */
.charter-ship {
  margin: 1.8rem 0 0;
  min-width: 0;
}
.charter-ship img {
  display: block;
  width: 100%;
  height: auto;
  -webkit-mask-image: radial-gradient(ellipse 98% 96% at 50% 50%, #000 78%, transparent 100%);
  mask-image: radial-gradient(ellipse 98% 96% at 50% 50%, #000 78%, transparent 100%);
}
.charter-ship figcaption {
  margin: 1.1rem auto 0;
  max-width: 36rem;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.5rem);
  line-height: 1.4;
  color: var(--cream);
  text-wrap: pretty;
}

/* Thoughtful Business Ventures */
#ventures .shell { min-width: 0; }
#ventures .display { margin-bottom: 0.6rem; }
#ventures .prose { margin-bottom: 1.6rem; }
.venture-cabinet {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.4rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 560px) {
  .venture-cabinet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .venture-cabinet { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.venture-cabinet {
  align-items: stretch;
}
.venture-card {
  text-align: center;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0.7rem 0.7rem 1rem;
  background: rgba(7, 9, 15, 0.35);
  box-shadow:
    0 0 0 1px #6e531c,
    0 0 0 2px #c9a24b,
    0 0 0 3px #6e531c;
}
.venture-art {
  position: relative;
  margin: 0 auto;
  width: 100%;
  max-width: 16rem;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
}
.venture-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  margin: 0;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.5));
}
.venture-num {
  margin: 0.7rem 0 0;
  font-family: var(--font-sc);
  font-size: 1.35rem;
  letter-spacing: 0.14em;
  color: var(--gold);
  line-height: 1;
}
.venture-status {
  margin: 0.45rem 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--cream);
  text-wrap: pretty;
}

.house-services {
  margin: 0 0 2.6rem;
}
.service-heading {
  margin: 0 0 0.5rem;
  font-size: clamp(1.65rem, 1.2rem + 1.3vw, 2.35rem);
  font-style: italic;
  color: var(--cream);
  text-wrap: balance;
}
.house-services > .prose {
  margin-bottom: 1.25rem;
}
.service-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: stretch;
}
@media (min-width: 700px) {
  .service-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.service-card {
  min-width: 0;
  margin: 0;
  padding: 1.05rem 1.15rem 1.2rem;
  background: rgba(7, 9, 15, 0.35);
  box-shadow:
    0 0 0 1px #6e531c,
    0 0 0 2px #c9a24b,
    0 0 0 3px #6e531c;
}
.service-card h4 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.18rem, 1.05rem + 0.45vw, 1.42rem);
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--gold-hi);
  text-wrap: balance;
}
.service-card p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
  text-wrap: pretty;
}
.service-invite {
  margin: 1.05rem 0 0;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--cream);
  text-wrap: pretty;
}
.service-invite a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.15rem;
  color: var(--gold);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
.service-invite a:hover,
.service-invite a:focus-visible {
  color: var(--gold-hi);
}

@media (min-width: 1220px) {
  .site-nav a { font-size: 0.84rem; letter-spacing: 0.055em; }
  .site-nav ul { gap: clamp(0.55rem, 1.15vw, 1.3rem); }
}

.site-nav a[href="/#charter"] { white-space: nowrap; }

@media (max-width: 599px) {
  .power-lab { flex-direction: column; gap: 0.15rem; }
  .power-lab strong { white-space: normal; }
}

/* c3, ChingChing.Club leaf */
html {
  scroll-padding-top: var(--header-h);
}

.c3-page {
  --room-fallback: #0b1426;
  --room-tex: url("/images/tex-sapphire-sky.webp");
  --room-size: cover;
  --room-repeat: no-repeat;
  --room-scrim: linear-gradient(180deg, rgba(7, 9, 15, 0.55), rgba(7, 9, 15, 0.7) 50%, rgba(7, 9, 15, 0.6));
}

.c3-shell {
  min-width: 0;
  max-width: 40rem;
  margin-inline: auto;
  text-align: center;
}

.c3-hero {
  position: relative;
  padding: 0.6rem 0 2.2rem;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  text-align: center;
}

.c3-hero-art {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0 auto 1.2rem;
  background: none;
  box-shadow: none;
  border: 0;
  overflow: visible;
}

.c3-hero-pic {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center 48%;
  border: 0;
  box-shadow: none;
  background: none;
  -webkit-mask-image: radial-gradient(ellipse 94% 90% at 50% 46%, #000 48%, transparent 80%);
  mask-image: radial-gradient(ellipse 94% 90% at 50% 46%, #000 48%, transparent 80%);
}
@media (max-width: 700px) {
  .c3-hero-pic {
    aspect-ratio: 3 / 4;
    min-height: 24rem;
    object-position: center 40%;
  }
}

.c3-mark {
  display: block;
  width: min(8.5rem, 42vw);
  height: auto;
  margin: 0 auto 1.1rem;
}

.c3-hero h1,
.c3-leaf h1 {
  margin: 0 auto 0.55rem;
  font-style: italic;
  font-size: clamp(2.3rem, 1.2rem + 4vw, 4.2rem);
  line-height: 1.1;
  color: var(--cream);
  text-wrap: balance;
  max-width: 16ch;
}

.c3-stand {
  margin: 0 auto;
  max-width: 28rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.2rem, 1rem + 0.8vw, 1.55rem);
  line-height: 1.4;
  color: var(--gold-hi);
  text-wrap: pretty;
}

.c3-intro,
.c3-team {
  text-align: center;
  padding-top: clamp(2.2rem, 5vh, 3.6rem);
  padding-bottom: clamp(2.2rem, 5vh, 3.6rem);
}

.c3-heading {
  margin: 0 auto 0.9rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.65rem, 1.2rem + 1.3vw, 2.4rem);
  line-height: 1.15;
  color: var(--cream);
  text-wrap: balance;
}

.c3-page .prose,
.c3-leaf .prose {
  margin: 0 auto 1rem;
  max-width: 36rem;
  text-align: center;
}

.c3-page .prose .mail,
.c3-leaf .prose .mail,
.c3-member .mail {
  display: inline;
  margin: 0;
  font-size: 1em;
  font-style: italic;
  line-height: inherit;
  overflow-wrap: anywhere;
}

.c3-team-shell { max-width: 52rem; }

.c3-team-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.2rem;
  list-style: none;
  margin: 0.4rem auto 0;
  padding: 0;
  align-items: stretch;
}

@media (min-width: 700px) {
  .c3-team-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.c3-member {
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 0.4rem 0.4rem;
  background: none;
  box-shadow: none;
  border: 0;
  text-align: center;
}

.c3-portrait {
  display: flex;
  justify-content: center;
  min-width: 0;
  margin: 0 0 0.2rem;
}

.c3-portrait img {
  display: block;
  width: auto;
  height: min(22rem, 58vw);
  max-width: 100%;
  border: 0;
  box-shadow: none;
  background: none;
}

.c3-monogram {
  display: block;
  width: 2.4rem;
  height: auto;
  margin: 0.15rem auto 0.45rem;
  filter: drop-shadow(0 0 6px rgba(201, 162, 75, 0.16));
}

html.js-motion .c3-monogram {
  animation: c3-seal-gleam 7.5s ease-in-out infinite;
}

@keyframes c3-seal-gleam {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(201, 162, 75, 0.12)); }
  50% { filter: drop-shadow(0 0 16px rgba(232, 200, 119, 0.42)); }
}

.c3-member h3 {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.45rem, 1.2rem + 0.6vw, 1.85rem);
  color: var(--gold-hi);
}

.c3-role {
  margin: 0 0 0.7rem;
  font-style: italic;
  color: var(--gold);
  text-wrap: pretty;
}

.c3-member p {
  margin: 0;
  color: var(--muted);
  text-wrap: pretty;
}

.c3-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.5rem;
  list-style: none;
  margin: 2rem auto 0;
  padding: 0;
}

.c3-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.15rem 0;
  color: var(--cream);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  text-box: trim-both cap alphabetic;
}

.c3-actions a:hover,
.c3-actions a:focus-visible {
  color: var(--gold-hi);
  border-bottom-color: var(--gold-hi);
}

@media (max-width: 480px) {
  .c3-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.js-motion .c3-monogram { animation: none; }
}

.c3-page .site-footer,
.c3-page .footer-motto,
.c3-page .footer-copy,
.c3-page .footer-contact {
  text-align: center;
}

/* Masters and reckoning */
.masters { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; gap: 1.1rem; max-width: 44rem; }
.masters li { color: var(--muted); text-wrap: pretty; padding-left: 1.1rem; border-left: 1px solid var(--hairline); }
.masters strong { color: var(--gold-hi); font-weight: 500; font-style: italic; }
#ledger .pair article:last-child { margin-top: 0; }
#ledger .pair + .prose { margin-top: 2rem; max-width: 40rem; }
#ledger .prose + .closing { margin-top: 1.4rem; max-width: 40rem; }

/* Footer icon links */
.footer-links {
  flex: 1 0 100%;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  list-style: none;
  margin: 0.3rem 0 0;
  padding: 0;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0 0.7rem;
  color: var(--gold);
  text-decoration: none;
  font-family: var(--font-sc);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  transition: color 0.2s ease;
}
.footer-links a:hover,
.footer-links a:focus-visible { color: var(--gold-hi); }
.footer-links svg { display: block; flex: none; }
