:root {
  color-scheme: dark;
  --ink: #110e14;
  --panel: #19151e;
  --soft: #221c28;
  --edge: #4b3c4e;
  --pale: #f3e5dc;
  --muted: #c8b5c4;
  --light: #f2cea0;
  --gold: #efc897;
  --serif: "Iowan Old Style", "Hoefler Text", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 1.1rem; }
body { margin: 0; color: var(--pale); background: var(--ink); font: 1rem/1.55 system-ui,sans-serif; }
[hidden] { display: none !important; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: .25em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.skip:not(:focus) { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.skip:focus { position: fixed; z-index: 10; left: 1rem; top: 1rem; background: var(--soft); padding: .5rem .85rem; }
.frame { width: min(100% - 4rem, 74rem); margin-inline: auto; }
.mast, .foot { display: flex; justify-content: space-between; align-items: center; gap: .7rem; }
.mast { min-height: 4.85rem; border-bottom: 1px solid var(--edge); }
.mast nav { display: flex; gap: clamp(.85rem, 3vw, 2.1rem); }
.mast nav a { text-decoration: none; color: var(--muted); font-size: .89rem; }
.mast nav a:hover { text-decoration: underline; }
.sigil { text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: .67rem; font: 600 1.42rem/1 var(--serif); letter-spacing: -.045em; }
.sigil i { display: block; width: .7rem; height: .7rem; transform: rotate(45deg); border: 1px solid var(--gold); background: #ae7760; box-shadow: inset 0 0 5px #fff2c9; }

.hero { margin-block: 1.35rem 3.8rem; position: relative; min-height: clamp(27rem, 50vw, 39rem); display: grid; align-items: center; overflow: hidden; background: #100c11; border: 1px solid #3f333c; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 44%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13,9,15,.96) 0%, rgba(13,9,15,.82) 25%, rgba(13,9,15,.20) 54%, transparent 74%), linear-gradient(0deg, rgba(13,9,15,.48), transparent 46%); pointer-events: none; }
.hero-copy { position: relative; z-index: 1; width: min(100%, 34rem); padding: clamp(1.6rem,6vw,5.15rem); }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 400; letter-spacing: -.065em; line-height: .95; }
.hero h1 { color: #f3e1d8; font-size: clamp(4.5rem, 10.7vw, 10rem); }
.hero p { font-size: clamp(.99rem, 1.7vw, 1.2rem); max-width: 21rem; color: #e1cdd3; }
.button { display: inline-flex; gap: .6rem; min-height: 2.65rem; padding: .47rem .78rem; align-items: center; justify-content: center; border: 1px solid var(--edge); background: transparent; border-radius: 2px; font-size: .85rem; font-weight: 675; text-decoration: none; }
.button.gold { background: var(--gold); color: #291b21; border-color: var(--gold); }
.button.gold:hover { background: #ffdfb0; }
.button.quiet:not(:disabled):hover { border-color: var(--gold); color: var(--gold); }
.button:disabled { opacity: .48; cursor: default; }
.button span { font-weight: 400; }

.lab { padding-bottom: 3.2rem; }
.lab-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .7rem 1.2rem; margin-bottom: 1.2rem; }
.lab-title h2 { font-size: clamp(2.65rem, 6.5vw, 5rem); }
.lab-title p { max-width: 21rem; margin: 0; color: var(--muted); font-size: .93rem; }
.app { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(16.5rem, .72fr); border: 1px solid var(--edge); background: var(--panel); }
.net-panel { margin: 0; min-width: 0; padding: 1.15rem; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; background: #15111a; }
.net-panel figcaption { display: flex; justify-content: space-between; gap: .65rem; font: .75rem/1.35 var(--mono); color: var(--gold); text-transform: uppercase; letter-spacing: .11em; }
.net-panel figcaption span { color: var(--muted); }
#map { position: relative; min-height: clamp(22rem, 42vw, 33rem); margin: .55rem 0; overflow: hidden; isolation: isolate; background: radial-gradient(ellipse at 48% 48%, #35223c 0%, #211827 49%, transparent 75%); }
#map canvas, #jewels { position: absolute; inset: 0; width: 100%; height: 100%; }
.jewel {
  position: absolute; left: var(--x); top: var(--y); width: 2.75rem; height: 2.75rem; padding: 0;
  transform: translate(-50%, -50%); border: 1px solid transparent; border-radius: 50%;
  background: transparent; color: #fff4eb; font: .69rem/1 var(--mono); isolation: isolate;
}
.jewel::before { content: ""; position: absolute; inset: .43rem; border-radius: 50%; z-index: -1; border: 1px solid #d2a9c6; box-shadow: 0 0 14px #bf93c670; background: radial-gradient(circle at 29% 21%, #fff2cf 0%, var(--spark) 22%, #563e66 52%, #241d31 83%); }
.jewel[aria-pressed=true] { border-color: var(--gold); background: #f1c59430; font-weight: 700; }
.jewel[aria-pressed=true]::before { box-shadow: 0 0 18px var(--gold); border-color: #ffe2b7; }
.jewel:hover:not([aria-pressed=true]) { border-color: #b291a4; }
.j01 { --x: 20%; --y: 15%; --spark: #9bc6c7; }
.j02 { --x: 43%; --y: 12%; --spark: #d795aa; }
.j03 { --x: 66%; --y: 17%; --spark: #a3abd8; }
.j04 { --x: 86%; --y: 28%; --spark: #dbb876; }
.j05 { --x: 16%; --y: 46%; --spark: #c49ee4; }
.j06 { --x: 40%; --y: 42%; --spark: #c1b27e; }
.j07 { --x: 63%; --y: 45%; --spark: #a0cbb6; }
.j08 { --x: 84%; --y: 61%; --spark: #dd99af; }
.j09 { --x: 14%; --y: 76%; --spark: #d9ae89; }
.j10 { --x: 36%; --y: 82%; --spark: #a2bcd9; }
.j11 { --x: 58%; --y: 75%; --spark: #d5a8ce; }
.j12 { --x: 77%; --y: 85%; --spark: #b7bc82; }
.help { color: var(--muted); font-size: .79rem; margin: .35rem 0 0; }
.help:empty { display: none; }

.lens-panel { min-width: 0; padding: 1.15rem; border-left: 1px solid var(--edge); }
.lens-head { display: flex; gap: .5rem 1rem; flex-wrap: wrap; align-items: end; justify-content: space-between; }
.kicker { margin: 0 0 .42rem; color: var(--gold); font: .72rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .10em; }
.lens-head h3 { font-size: clamp(2.2rem, 4vw, 3.4rem); }
label { display: grid; gap: .23rem; color: var(--muted); font-size: .8rem; }
select { min-height: 2.65rem; padding: .37rem .45rem; border: 1px solid #645366; border-radius: 2px; background: #221b2a; font-size: .85rem; }
.lens { margin: .8rem 0; text-align: center; }
.lens canvas { display: block; width: 100%; height: clamp(10rem,19vw,15rem); background: radial-gradient(ellipse, #362842 0%, #1d1724 54%, var(--panel) 72%); }
.lens figcaption { min-height: 1.55rem; color: var(--gold); font: .76rem/1.45 var(--mono); }
.follow { margin-block: 0 .4rem; }
#follow { width: 100%; }
.trail { margin-top: .85rem; padding-top: .7rem; border-top: 1px solid var(--edge); }
#path { margin: 0 0 .48rem; color: var(--pale); font: .76rem/1.55 var(--mono); overflow-wrap: anywhere; }
.trail-actions { display: flex; flex-wrap: wrap; gap: .42rem; }
.share { display: inline-block; margin-top: .7rem; font-size: .78rem; color: var(--gold); }
.caption { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; justify-content: space-between; margin-top: 1rem; color: var(--muted); font-size: .88rem; }
.caption p { max-width: 42rem; margin: 0; }
.caption a { color: var(--gold); }

.essay { max-width: 49rem; margin-top: 1rem; padding-block: clamp(2rem, 5vw, 5rem); }
.essay h1 { font-size: clamp(3.6rem, 9.4vw, 8.4rem); }
.lede { color: #edcfb9; font-size: clamp(1.05rem, 2vw, 1.35rem); }
.essay section { margin-top: 2.3rem; padding-top: 1.4rem; border-top: 1px solid var(--edge); }
.essay h2 { color: var(--pale); font-size: clamp(2rem, 5vw, 3.3rem); }
.essay p, .essay li { color: var(--muted); }
.essay .lede { color: #edcfb9; }
.essay li { margin-block: .45rem; }
.essay section a:not(.button) { color: var(--gold); }
.essay-art { margin: 1.6rem 0; }
.essay-art img { width: 100%; max-height: 22rem; object-fit: cover; object-position: center 42%; display: block; border: 1px solid var(--edge); }
.essay-art figcaption { font-size: .75rem; color: var(--muted); margin-top: .35rem; }
.foot { min-height: 4.8rem; color: var(--muted); border-top: 1px solid var(--edge); font-size: .85rem; flex-wrap: wrap; }
.foot .sigil { color: var(--pale); }

@media (max-width: 45rem) {
  .frame { width: calc(100% - 2rem); }
  .mast { min-height: 3.8rem; }
  .hero { min-height: 0; margin-block: .9rem 2.8rem; align-items: end; }
  .hero img { height: 58%; object-position: 70% 42%; }
  .hero::after { background: linear-gradient(0deg, #100c11 0% 45%, rgba(16,12,17,.8) 53%, transparent 75%); }
  .hero-copy { padding: 10.5rem 1rem 1.2rem; }
  .hero h1 { font-size: clamp(3.5rem, 15vw, 5.6rem); }
  .hero p { max-width: 18rem; }
  .app { grid-template-columns: 1fr; }
  .lens-panel { border-left: 0; border-top: 1px solid var(--edge); }
  .net-panel, .lens-panel { padding: .8rem; }
  #map { min-height: clamp(14rem, 78vw, 24rem); }
  .lens canvas { height: 11.6rem; }
}
