/* ============================================================
   The Lucarian Codex · Styles
   Dark: abyss night · Light: dawn fields (follows system)
   ============================================================ */
:root {
  --abyss: #080C0F;
  --slate: #121A1E;
  --glint: #3A6EA5;
  --emerald: #1B4D3E;
  --gild: #C9A86A;
  --steel: #8A9BA8;
  --ice: #7FB3D5;
  --sparks: #3DD68C;
  --light: #E8E6E1;
  --soft: #C8D0D8;

  --bg-hero: url('assets/pack/bg-night.webp');

  --cinzel: 'Cinzel', serif;
  --cormorant: 'Cormorant Garamond', serif;
  --inter: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;

  --ease-portal: cubic-bezier(0.77, 0, 0.175, 1);
}

/* light theme (dawn), tempered */
[data-theme='light'] {
    --abyss: #E9E3D2;
    --slate: #CFC6AC;
    --glint: #2E5E96;
    --emerald: #2E6B52;
    --gild: #A8842F;
    --steel: #6B6353;
    --ice: #33628F;
    --sparks: #22795A;
    --light: #2A2A24;
    --soft: #3D3A30;
    --bg-hero: url('assets/pack/bg-dawn.webp');
}

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

html {
  scroll-snap-type: y mandatory;
  scrollbar-color: var(--gild) var(--abyss);
}
body {
  background: var(--abyss);
  color: var(--soft);
  font-family: var(--inter);
  font-size: 14px;
  line-height: 1.7;
  overflow-x: hidden;
}
::selection { background: var(--gild); color: var(--abyss); }
h1, h2, h3 { font-family: var(--cinzel); color: var(--light); font-weight: 400; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: 0; color: inherit; }

/* thin gold scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--abyss); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gild), rgba(201, 168, 106, 0.55));
}

/* cursor: 6px dot + 24px ring (48px on interactive) */
#cursor-dot, #cursor-ring {
  position: fixed; left: 0; top: 0; z-index: 400; pointer-events: none;
  border-radius: 50%; will-change: transform;
}
#cursor-dot { width: 6px; height: 6px; background: var(--gild); box-shadow: 0 0 8px rgba(201, 168, 106, 0.6); }
#cursor-ring {
  width: 24px; height: 24px;
  border: 1px solid rgba(201, 168, 106, 0.4);
  transition: width 0.35s var(--ease-portal), height 0.35s var(--ease-portal), border-color 0.35s, background 0.35s;
}
#cursor-ring.is-hot {
  width: 48px; height: 48px;
  border-color: rgba(201, 168, 106, 0.75);
  background: rgba(201, 168, 106, 0.07);
}
@media (pointer: fine) {
  body.sigil-cursor, body.sigil-cursor a, body.sigil-cursor button { cursor: none; }
}
@media (pointer: coarse) { #cursor-dot, #cursor-ring { display: none; } }

/* progress vein (gold) */
#progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%; z-index: 300;
  background: linear-gradient(90deg, rgba(201, 168, 106, 0.5), var(--gild));
}

/* stone veil + fog */
.stone-veil {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url('assets/pack/stone-tile.webp') repeat;
  background-size: 512px;
  opacity: 0.06; mix-blend-mode: soft-light;
}
.fog { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.fog::before, .fog::after {
  content: ''; position: absolute; width: 200%; height: 60%; left: -50%;
  background:
    radial-gradient(ellipse 40% 55% at 30% 40%, rgba(58, 110, 165, 0.13), transparent 65%),
    radial-gradient(ellipse 45% 50% at 70% 60%, rgba(27, 77, 62, 0.12), transparent 65%);
  animation: fogDrift 10s ease-in-out infinite alternate;
}
.fog::after { animation-duration: 14s; animation-direction: alternate-reverse; opacity: 0.8; }
@keyframes fogDrift {
  from { transform: translateX(-6%) translateY(0); }
  to   { transform: translateX(6%) translateY(-2%); }
}

/* faint backdrop images per room (fixes the empty feel) */
.room-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--room-img) center 40% / cover no-repeat;
  opacity: 0.08;
}
[data-theme='light'] .room-bg { opacity: 0.06; filter: brightness(0.92); }
.section::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, var(--abyss) 0%, transparent 22%, transparent 78%, var(--abyss) 100%);
  opacity: 0.9;
}

/* header */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 250;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: linear-gradient(180deg, rgba(8, 12, 15, 0.55), transparent);
  pointer-events: none;
}
[data-theme='light'] .header { background: linear-gradient(180deg, rgba(233, 227, 210, 0.65), transparent); }
.header a { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 36px; height: 36px; }
.brand-name { font-family: var(--mono); font-size: 10px; letter-spacing: 0.3em; color: var(--soft); }
.header__cv {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em;
  color: var(--gild); border: 1px solid rgba(201, 168, 106, 0.55);
  padding: 8px 16px; transition: all 0.3s;
}
.header__cv:hover { border-color: var(--gild); box-shadow: 0 0 12px rgba(201, 168, 106, 0.2); }
.header__theme {
  width: 37px; height: 37px; margin-left: 12px;
  border: 1px solid rgba(201, 168, 106, 0.35);
  color: var(--gild); font-size: 15px; line-height: 1;
  display: grid; place-items: center; transition: all 0.3s;
}
.header__theme:hover { border-color: var(--gild); box-shadow: 0 0 12px rgba(201, 168, 106, 0.2); }
.header__right { display: flex; align-items: center; pointer-events: auto; }

/* sigil nav */
.sigil-nav {
  position: fixed; right: 22px; top: 50%; transform: translateY(-50%);
  z-index: 250; display: flex; flex-direction: column; gap: 12px; align-items: center;
}
.sigil-nav .line { width: 1px; height: 8px; background: linear-gradient(180deg, rgba(201,168,106,0.25), transparent); }
.sigil-dot { position: relative; width: 30px; height: 30px; display: grid; place-items: center; }
.sigil-dot img { width: 22px; height: 22px; opacity: 0.35; transition: opacity 0.3s, filter 0.3s, transform 0.3s; }
.sigil-dot.active img { opacity: 1; transform: scale(1.15); filter: drop-shadow(0 0 6px rgba(201, 168, 106, 0.9)); }
.sigil-dot .tip {
  position: absolute; right: 34px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em; white-space: nowrap;
  color: var(--gild); background: var(--abyss);
  border: 1px solid rgba(201, 168, 106, 0.25); padding: 4px 9px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.sigil-dot:hover .tip { opacity: 1; }

/* watermark sigil */

/* sections */
.section {
  position: relative; min-height: 100vh;
  scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; flex-direction: column; justify-content: center;
  padding: 96px 24px;
  border-top: 1px solid var(--slate);
}
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; }
.kicker { font-family: var(--mono); font-size: 10px; letter-spacing: 0.4em; color: var(--gild); text-transform: uppercase; margin-bottom: 12px; }
.kicker.ice { color: var(--ice); }
.title-xl { font-family: var(--cinzel); font-size: clamp(30px, 4.6vw, 50px); line-height: 1.04; color: var(--light); }
.hairline { height: 1px; background: linear-gradient(90deg, rgba(201, 168, 106, 0.65), transparent); border: 0; margin: 22px 0 34px; }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease-portal), transform 0.8s var(--ease-portal); }
.reveal.in { opacity: 1; transform: none; }

/* hero */
.hero { align-items: center; text-align: center; overflow: hidden; }
.hero__bg {
  position: absolute; inset: -10% 0; z-index: -1;
  background: var(--bg-hero) center 32% / cover no-repeat;
  will-change: transform;
}
.hero__shade {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(8, 12, 15, 0.5), rgba(8, 12, 15, 0.78) 62%, var(--abyss) 96%);
}
[data-theme='light'] .hero__shade {
    background: linear-gradient(180deg, rgba(233, 227, 210, 0.4), rgba(233, 227, 210, 0.72) 62%, var(--abyss) 96%);
  }
[data-theme='light'] .hero__kicker { background: rgba(233, 227, 210, 0.65); }
.hero__kicker {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid rgba(201, 168, 106, 0.25); border-radius: 999px;
  background: rgba(8, 12, 15, 0.35); padding: 6px 16px; margin-bottom: 30px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.3em; color: var(--soft);
}
.hero h1 { font-size: clamp(30px, 5vw, 56px); letter-spacing: 0.02em; line-height: 1.05; text-shadow: 0 4px 40px rgba(0, 0, 0, 0.55); }
.hero .sub { font-family: var(--mono); font-size: clamp(11px, 1.4vw, 14px); letter-spacing: 0.5em; color: var(--ice); margin-top: 14px; }
.hero__blurb { font-family: var(--cormorant); font-size: clamp(17px, 2vw, 21px); color: var(--soft); max-width: 560px; margin: 22px auto 0; }
.hero__scroll {
  position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 0.95;
}
.hero__scroll span { font-family: var(--mono); font-size: 9px; letter-spacing: 0.45em; color: var(--soft); }
.hero__scroll i {
  width: 2px; height: 46px;
  background: linear-gradient(180deg, var(--gild) 0%, rgba(201, 168, 106, 0.65) 70%, rgba(201, 168, 106, 0.25) 100%);
  box-shadow: 0 0 8px rgba(201, 168, 106, 0.55);
  animation: drip 2.2s ease-in-out infinite;
}
@keyframes drip { 0% { transform: scaleY(0); transform-origin: top; } 55% { transform: scaleY(1); transform-origin: top; } 100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; } }

/* about */
.about-grid { display: grid; grid-template-columns: 300px 1fr; gap: 48px; align-items: start; }
.about__body { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.about__paras { font-family: var(--cormorant); font-size: 20px; line-height: 1.75; color: var(--soft); max-width: 620px; }
.about__paras p + p { margin-top: 14px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.fact { border: 1px solid var(--slate); padding: 12px 14px; background: rgba(201, 168, 106, 0.03); }
.fact .k { font-family: var(--mono); font-size: 9px; letter-spacing: 0.25em; color: var(--gild); }
.fact .v { font-family: var(--mono); font-size: 12px; color: var(--soft); margin-top: 3px; word-break: break-all; }

/* portrait: keeps the baked-in rounded corners (10px-equivalent), framed gold */
.portrait { margin: 0; position: relative; width: min(100%, 300px); justify-self: start; }
.portrait img {
  display: block; width: 100%; height: auto;
  filter: saturate(0.92) contrast(1.02);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.portrait::before {
  content: ''; position: absolute; inset: -7px; pointer-events: none;
  border: 1px solid rgba(201, 168, 106, 0.45); border-radius: 14px;
}
.portrait::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(201, 168, 106, 0.3);
  background: linear-gradient(200deg, rgba(201, 168, 106, 0.08), transparent 40%);
  mix-blend-mode: screen;
}
[data-theme='light'] .portrait img { box-shadow: 0 18px 40px rgba(20, 24, 20, 0.25); }
[data-theme='light'] .portrait::before { border-color: rgba(146, 112, 47, 0.5); }
[data-theme='light'] .portrait::after { background: none; box-shadow: inset 0 0 0 1px rgba(146, 112, 47, 0.35); }

/* tech icons: masked monochrome, inherit theme ink; small on purpose */
.ticon {
  width: 13px; height: 13px; flex: 0 0 13px;
  background-color: currentColor;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  display: inline-block; vertical-align: -2px;
  opacity: 0.85;
}
.gem__items span, .modal__stack span { display: inline-flex; align-items: center; gap: 6px; }
.gem__items span:hover .ticon, .modal__stack span:hover .ticon { opacity: 1; }

/* skill gems: clean translucent diamonds */
.gems { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 30px; }
.gem__head { display: flex; align-items: center; gap: 16px; }
.gem__stone {
  --c: var(--gild);
  position: relative; flex: none;
  width: 34px; height: 34px; transform: rotate(45deg);
  border: 1.5px solid color-mix(in srgb, var(--c) 75%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--c) 45%, transparent), color-mix(in srgb, var(--c) 15%, transparent));
  box-shadow: 0 0 18px color-mix(in srgb, var(--c) 50%, transparent), inset 0 0 10px color-mix(in srgb, var(--c) 35%, transparent);
  transition: box-shadow 0.35s, transform 0.35s;
}
.gem__stone::after {
  content: ''; position: absolute; inset: 7px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 90%, transparent), color-mix(in srgb, var(--c) 50%, transparent));
}
.gem__stone::before {
  content: ''; position: absolute; left: 6px; top: 4px; width: 9px; height: 9px;
  background: rgba(255, 255, 255, 0.5); filter: blur(1px); transform: rotate(0deg);
  z-index: 1;
}
.gem__card:hover .gem__stone { transform: rotate(45deg) scale(1.1); box-shadow: 0 0 22px color-mix(in srgb, var(--c) 55%, transparent); }
.gem__name { font-family: var(--cinzel); font-size: 15px; color: var(--light); }
.gem__type { font-family: var(--mono); font-size: 9px; letter-spacing: 0.25em; color: var(--gild); margin-top: 2px; }
.gem__rule { height: 2px; margin: 12px 0 12px 50px; background: linear-gradient(90deg, color-mix(in srgb, var(--c, #C9A86A) 70%, transparent), color-mix(in srgb, var(--c, #C9A86A) 25%, transparent) 60%, transparent); }
.gem__card:hover .gem__rule { background: linear-gradient(90deg, var(--c, #C9A86A), color-mix(in srgb, var(--c, #C9A86A) 40%, transparent) 60%, transparent); }
.gem__items { display: flex; flex-wrap: wrap; gap: 7px; }
.gem__items span {
  font-family: var(--mono); font-size: 11px; color: var(--soft);
  border: 1px solid var(--slate); padding: 3px 9px;
  transition: color 0.25s, border-color 0.25s;
}
.gem__items span:hover { color: var(--light); border-color: rgba(201, 168, 106, 0.25); }

/* ledger */
.ledger { position: relative; margin-left: 10px; padding-left: 38px; border-left: 1px solid rgba(201, 168, 106, 0.2); }
.entry { position: relative; padding-bottom: 42px; }
.entry:last-child { padding-bottom: 0; }
.entry__node {
  position: absolute; left: -45px; top: 4px; width: 13px; height: 13px;
  transform: rotate(45deg); background: var(--abyss);
  border: 1.5px solid rgba(201, 168, 106, 0.65);
  box-shadow: 0 0 8px rgba(201, 168, 106, 0.3);
}
.entry__period { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: var(--gild); }
.entry__role { font-family: var(--cinzel); font-size: 18px; color: var(--light); margin-top: 4px; }
.entry__house { font-size: 12px; color: var(--ice); font-style: italic; margin-top: 2px; }
.entry__summary { font-size: 13px; color: var(--soft); margin: 10px 0 8px; max-width: 640px; }
.entry__deeds { list-style: none; }
.entry__deeds li { position: relative; padding-left: 18px; font-size: 12.5px; color: var(--soft); margin-bottom: 5px; }
.entry__deeds li::before { content: '◆'; position: absolute; left: 0; top: 1px; font-size: 7px; color: var(--gild); }

/* portals */
.portals-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 46px; }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 44px 36px; }
.portal-card { position: relative; text-align: left; display: block; width: 100%; }
.portal-stage { display: block; position: relative; aspect-ratio: 1; }
/* rings swap with theme: white marble ring on night, black ring on dawn */
.portal-cover {
  position: absolute; inset: 29.4%; border-radius: 50%; overflow: hidden;
  background: var(--slate);
}
[data-theme='light'] .portal-cover { inset: 26.1%; }
.portal-cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.4s var(--ease-portal), filter 0.8s;
  filter: saturate(0.9) brightness(0.9);
}
.portal-card:hover .portal-cover img { transform: scale(1.1); filter: saturate(1.05) brightness(1); }
.portal-cover::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(0deg, rgba(8, 12, 15, 0.6), transparent 55%);
  opacity: 0; transition: opacity 0.7s;
}
.portal-card:hover .portal-cover::after { opacity: 1; }
/* ring: one image, constant slow rotation, eased boost on hover (JS) */
.portal-ring {
  position: absolute; inset: 0; width: 100%; height: 100%;
  will-change: transform;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.35));
}
.portal-seal {
  position: absolute; inset: 0; display: grid; place-items: center;
  pointer-events: none;
}
.portal-seal i {
  width: 20px; height: 20px; transform: rotate(45deg);
  border: 1.5px solid rgba(201, 168, 106, 0.9);
  box-shadow: 0 0 14px rgba(201, 168, 106, 0.55), inset 0 0 6px rgba(201, 168, 106, 0.4);
  background: rgba(201, 168, 106, 0.12);
  transition: transform 0.5s var(--ease-portal), box-shadow 0.5s;
}
.portal-card:hover .portal-seal i {
  transform: rotate(225deg) scale(1.15);
  box-shadow: 0 0 22px rgba(201, 168, 106, 0.8), inset 0 0 8px rgba(201, 168, 106, 0.6);
}
.portal--veiled .portal-cover img { filter: saturate(0.3) brightness(0.55); }
.portal--veiled .portal-seal i { opacity: 0.45; }
.portal-meta { margin-top: 14px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.portal-meta h3 { font-size: 15px; }
.portal-meta .m { font-family: var(--mono); font-size: 10px; color: var(--steel); margin-top: 3px; }
.portal-meta .go {
  flex: none; width: 26px; height: 26px; border: 1px solid var(--slate); border-radius: 50%;
  display: grid; place-items: center; font-family: var(--mono); font-size: 11px; color: var(--gild);
  transition: all 0.3s;
}
.portal-card:hover .portal-meta .go { border-color: rgba(201, 168, 106, 0.5); color: var(--gild); }

/* foundations */
.found-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: start; }
.found-row { display: grid; grid-template-columns: 110px 1fr; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--slate); }
.found-row:last-child { border: 0; }
.found-row .p { font-family: var(--mono); font-size: 10px; letter-spacing: 0.15em; color: var(--gild); padding-top: 3px; }
.found-row .d { font-family: var(--cinzel); font-size: 15px; color: var(--light); }
.found-row .h { font-size: 12px; color: var(--steel); font-style: italic; margin-top: 3px; }
.honours { list-style: none; border: 1px solid var(--slate); padding: 18px 20px; background: rgba(201, 168, 106, 0.03); }
.honours li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--slate); font-size: 13px; color: var(--soft); }
.honours li:last-child { border: 0; }
.honours li::before { content: '❖'; color: var(--gild); font-size: 10px; }

/* contact */
.contact { text-align: center; align-items: center; }
.contact__panel {
  max-width: 680px; margin: 0 auto; padding: 44px 36px;
  border: 1px solid rgba(201, 168, 106, 0.2);
  background: rgba(201, 168, 106, 0.03);
}
.contact__blurb { font-family: var(--cormorant); font-size: 19px; color: var(--soft); max-width: 500px; margin: 10px auto 26px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.cta {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em;
  padding: 12px 20px; border: 1px solid rgba(201, 168, 106, 0.5);
  color: var(--soft); transition: all 0.3s;
}
.cta:hover { border-color: var(--gild); color: var(--light); box-shadow: 0 0 16px rgba(201, 168, 106, 0.25); }
.cta.primary { border-color: rgba(201, 168, 106, 0.5); color: var(--gild); }
.contact__meta { margin-top: 26px; display: flex; flex-direction: column; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; color: var(--steel); }
.phone-reveal {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em;
  color: var(--steel); border: 1px dashed rgba(201, 168, 106, 0.35);
  padding: 9px 16px; transition: all 0.3s;
}
.phone-reveal:hover { color: var(--gild); border-color: var(--gild); }
.phone-reveal img { height: 22px; width: auto; display: none; }
.phone-reveal.shown img { display: block; }
.phone-reveal.shown span { display: none; }
.phone-reveal.shown { border-style: solid; padding: 6px 14px; }

/* footer (plain, no backdrop) */
.footer {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 34px 24px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em; color: var(--steel);
  border-top: 1px solid var(--slate);
  scroll-snap-align: end;
}
.footer img { width: 30px; height: 30px; }

/* modal: open = circle expand, close = reverse circle collapse */
.modal { position: fixed; inset: 0; z-index: 350; display: grid; place-items: center; visibility: hidden; pointer-events: none; transition: visibility 0s linear 1.25s; }
.modal.open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.modal.snap::before, .modal.snap .modal__panel { transition: none !important; }
.modal::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(8, 12, 15, 0.9); backdrop-filter: blur(10px);
  clip-path: circle(0% at var(--ox, 50%) var(--oy, 50%));
  transition: clip-path 1.2s var(--ease-portal);
}
[data-theme='light'] .modal::before { background: rgba(233, 227, 210, 0.93); }
.modal.open::before { clip-path: circle(150% at var(--ox, 50%) var(--oy, 50%)); }
.modal__panel {
  position: relative; width: min(660px, calc(100vw - 40px));
  max-height: calc(100vh - 60px); overflow-y: auto;
  background: var(--abyss); border: 1px solid rgba(201, 168, 106, 0.25);
  padding: 38px 42px;
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.45s ease, transform 0.45s var(--ease-portal);
}
.modal.open .modal__panel { opacity: 1; transform: none; }
.modal.closing .modal__panel { opacity: 0; transform: translateY(12px); transition: opacity 0.35s ease, transform 0.35s var(--ease-portal); }
.modal.closing::before { clip-path: circle(0% at var(--ox, 50%) var(--oy, 50%)); transition: clip-path 0.9s var(--ease-portal); }
.modal__close {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px;
  border: 1px solid rgba(201, 168, 106, 0.3); color: var(--gild);
  font-family: var(--mono); transition: all 0.25s;
}
.modal__close:hover { border-color: var(--gild); color: var(--light); transform: rotate(90deg); }
.modal__kind { font-family: var(--mono); font-size: 10px; letter-spacing: 0.3em; color: var(--gild); text-transform: uppercase; }
.modal__title { font-family: var(--cinzel); font-size: clamp(22px, 3vw, 30px); color: var(--light); margin: 10px 0 14px; }
.modal__cover { width: 100%; aspect-ratio: 16/9; object-fit: cover; border: 1px solid var(--slate); margin-bottom: 18px; }
.modal__stack { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.modal__stack span { font-family: var(--mono); font-size: 10.5px; color: var(--ice); border: 1px solid rgba(58, 110, 165, 0.35); padding: 3px 9px; }
.modal__body { font-size: 13.5px; color: var(--soft); line-height: 1.75; }
.modal__links { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* responsive */
@media (max-width: 900px) {
  .about-grid, .found-grid { grid-template-columns: 1fr; }
  .portrait { width: min(60%, 240px); margin-bottom: 6px; }
  .sigil-nav { right: 6px; }
  .sigil-dot .tip { display: none; }
  .watermark { display: none; }
}
