:root {
  --midnight: #0F273F;
  --founders: #055E98;
  --teal: #30A6B0;
  --horizon: #86BCDE;
  --cream: #F7F6F2;
  --paper: #FFFDF8;
  --gold: #C89B3C;
  --ink: #132D40;
  --muted: #5B6F7E;
  --line: #C8D5DC;
  --green: #147A52;
  --yellow: #A76A00;
  --red: #A63D40;
  --shadow: 0 18px 45px rgb(15 39 63 / 18%);
  --radius: 1.15rem;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--cream); }
body { min-height: 100vh; margin: 0; background: linear-gradient(180deg, #f7f6f2 0%, #eef6f7 100%); }
button, a { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: .22rem solid var(--gold); outline-offset: .18rem; }
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; color: var(--midnight); line-height: 1.08; }
p { line-height: 1.62; }
.skip-link { position: fixed; left: 1rem; top: 1rem; z-index: 9999; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; padding: 0; background: white; color: var(--midnight); border-radius: .5rem; }
.skip-link:focus { width: auto; height: auto; overflow: visible; clip-path: none; padding: .8rem 1rem; }
.site-header { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .72rem clamp(1rem, 3vw, 2.4rem); color: white; background: rgb(15 39 63 / 96%); box-shadow: 0 5px 22px rgb(15 39 63 / 25%); backdrop-filter: blur(12px); }
.brand-button { display: flex; align-items: center; gap: .7rem; padding: 0; color: white; background: none; border: 0; text-align: left; }
.brand-mark { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1px solid rgb(255 255 255 / 42%); border-radius: 50%; font-family: Georgia, serif; font-weight: 800; color: var(--cream); }
.brand-button span:last-child { display: grid; }
.brand-button strong { font-family: Georgia, serif; font-size: 1rem; }
.brand-button small { color: #bde7ec; }
.site-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .25rem; }
.site-nav button { padding: .58rem .68rem; color: white; background: transparent; border: 0; border-radius: .55rem; }
.site-nav button:hover { background: rgb(255 255 255 / 11%); }
#app-main { min-height: calc(100vh - 4rem); }
.screen { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(1.2rem, 3vw, 2.6rem) 0 3rem; }
.screen.narrow { width: min(900px, calc(100% - 2rem)); }
.eyebrow { margin: 0 0 .45rem; color: var(--teal); font-weight: 800; letter-spacing: .09em; text-transform: uppercase; font-size: .76rem; }
.display-title { max-width: 16ch; margin: 0 0 .85rem; font-size: clamp(2.25rem, 5.2vw, 4.65rem); }
.screen-title { margin: 0 0 .8rem; font-size: clamp(2rem, 4vw, 3.4rem); }
.lede { max-width: 64ch; margin: 0; color: #29475b; font-family: Georgia, serif; font-size: clamp(1.08rem, 2.2vw, 1.35rem); }
.button-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.15rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; padding: .72rem 1rem; border-radius: .72rem; border: 1px solid transparent; font-weight: 800; text-decoration: none; }
.button-primary { color: white; background: var(--founders); }
.button-primary:hover { background: #044c7a; }
.button-secondary { color: var(--midnight); background: white; border-color: #adc6d2; }
.button-secondary:hover { background: #edf7f8; }
.button-quiet { color: var(--founders); background: transparent; border-color: #a8c0cd; }
.button-danger { color: white; background: var(--red); }
.button[disabled] { opacity: .52; cursor: not-allowed; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: rgb(255 253 248 / 96%); box-shadow: var(--shadow); }

/* Prologue */
.prologue { position: relative; width: 100%; min-height: 100vh; overflow: hidden; display: grid; place-items: center; padding: 2rem 1rem; background: linear-gradient(rgb(9 31 47 / 34%), rgb(9 31 47 / 74%)), url('assets/visuals/landing-ensemble.webp') center 12% / cover; isolation: isolate; }
.prologue::before, .prologue::after { content: ""; position: absolute; z-index: -1; top: -4%; bottom: -6%; width: clamp(7rem, 13vw, 12rem); background: linear-gradient(90deg, #d8d0b8, #f0ead8 38%, #b7aa8a 72%, #ece4cf); border: 1rem solid rgb(238 231 211 / 42%); box-shadow: 0 0 40px rgb(0 0 0 / 35%); }
.prologue::before { left: 5%; }
.prologue::after { right: 5%; }
.ivy { position: absolute; z-index: 0; width: 19rem; height: 19rem; opacity: .8; background: radial-gradient(ellipse at 25% 22%, #214d2c 0 11%, transparent 12%), radial-gradient(ellipse at 56% 35%, #2c6538 0 10%, transparent 11%), radial-gradient(ellipse at 72% 65%, #153b24 0 11%, transparent 12%), radial-gradient(ellipse at 35% 78%, #397647 0 10%, transparent 11%); filter: drop-shadow(0 8px 10px rgb(0 0 0 / 28%)); }
.ivy-left { left: 0; top: 4%; transform: rotate(-18deg); }
.ivy-right { right: 0; bottom: 0; transform: rotate(158deg); }
.scroll { position: relative; z-index: 2; width: min(760px, 94vw); padding: clamp(2rem, 6vw, 4.6rem) clamp(1.5rem, 6vw, 4.8rem); color: #173a4f; text-align: center; background: linear-gradient(90deg, #c9af78, #f1dfb3 6%, #f7e9c6 50%, #ead3a2 94%, #b89b63); border-radius: 1rem 1rem .45rem .45rem; box-shadow: 0 28px 70px rgb(0 0 0 / 45%), inset 0 0 28px rgb(112 73 23 / 18%); }
.scroll::before, .scroll::after { content: ""; position: absolute; left: -1.4rem; right: -1.4rem; height: 2rem; border-radius: 999px; background: linear-gradient(#8f6a32, #d5b67c 35%, #7d592b 70%, #bc9558); box-shadow: 0 8px 16px rgb(0 0 0 / 28%); }
.scroll::before { top: -.7rem; }
.scroll::after { bottom: -.7rem; }
.scroll h1 { margin: .3rem 0 1rem; font-size: clamp(2.1rem, 5vw, 4rem); }
.scroll p { max-width: 60ch; margin: .65rem auto; font-family: Georgia, serif; font-size: clamp(1rem, 2.2vw, 1.25rem); }
.scroll .button-row { justify-content: center; }

/* Landing */
.landing-grid { display: grid; grid-template-columns: minmax(0, .76fr) minmax(26rem, 1.24fr); gap: clamp(1.2rem, 4vw, 3rem); align-items: center; }
.landing-copy { padding: clamp(.5rem, 2vw, 1.4rem); }
.landing-copy .mission-list { display: grid; gap: .68rem; margin: 1.2rem 0 0; padding: 0; list-style: none; }
.mission-list li { display: flex; gap: .65rem; align-items: flex-start; }
.mission-list span { display: grid; place-items: center; flex: 0 0 1.8rem; height: 1.8rem; border-radius: 50%; color: white; background: var(--teal); font-weight: 900; }
.landing-visual { overflow: hidden; }
.landing-visual { background: var(--midnight); }
.landing-visual img { width: 100%; height: auto; object-fit: contain; object-position: center; }
.prototype-note { margin-top: .8rem; color: var(--muted); font-size: .86rem; }

/* Framework */
.framework-shell { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: 1.3rem; align-items: start; }
.framework-stage { padding: clamp(1.1rem, 3vw, 2rem); }
.framework-progress { display: flex; gap: .4rem; margin-bottom: 1.1rem; }
.framework-progress span { flex: 1; height: .42rem; border-radius: 99px; background: #d5e0e5; }
.framework-progress span.done { background: var(--teal); }
.dimension-hero { display: grid; grid-template-columns: 4.4rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.dimension-icon { display: grid; place-items: center; width: 4.4rem; height: 4.4rem; border-radius: 1rem; color: white; background: linear-gradient(135deg, var(--founders), var(--teal)); font-size: 2rem; }
.example-card { margin-top: 1rem; padding: 1rem; border-left: .4rem solid var(--gold); border-radius: 0 .8rem .8rem 0; background: #fff4d6; }
.framework-nav { display: flex; justify-content: space-between; gap: .7rem; margin-top: 1.25rem; }
.framework-sidebar { padding: 1rem; position: sticky; top: 6rem; }
.framework-sidebar ol { margin: .7rem 0 0; padding-left: 1.35rem; }
.framework-sidebar li { margin: .55rem 0; color: var(--muted); }
.framework-sidebar li.active { color: var(--founders); font-weight: 800; }
.practice-options { display: grid; gap: .65rem; margin-top: 1rem; }
.traffic-choice { display: grid; grid-template-columns: 1.1rem minmax(0, 1fr); gap: .75rem; align-items: start; width: 100%; padding: 1rem; text-align: left; border: 1px solid var(--line); border-radius: .85rem; background: white; }
.traffic-dot { width: 1.1rem; height: 1.1rem; margin-top: .15rem; border-radius: 50%; }
.green { background: var(--green); } .yellow { background: #d99516; } .red { background: var(--red); }

/* Characters */
.character-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .9rem; margin-top: 1.3rem; }
.character-card { overflow: hidden; display: flex; flex-direction: column; min-height: 100%; border-top: .4rem solid var(--character-color); }
.character-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.character-card-body { display: flex; flex: 1; flex-direction: column; padding: .9rem; }
.character-card h2 { margin: 0 0 .2rem; font-size: 1.32rem; }
.character-role { margin: 0 0 .7rem; color: var(--muted); font-size: .88rem; }
.status-pill { align-self: flex-start; margin-bottom: .65rem; padding: .3rem .55rem; border-radius: 999px; color: var(--midnight); background: #e8f3f5; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.character-card .button { margin-top: auto; width: 100%; }

/* Bio */
.bio-grid { display: grid; grid-template-columns: minmax(18rem, .72fr) minmax(0, 1.28fr); gap: 1.4rem; align-items: start; }
.bio-portrait { overflow: hidden; position: sticky; top: 6rem; }
.bio-portrait img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.bio-portrait figcaption { padding: .8rem 1rem; color: white; background: var(--character-color); font-weight: 800; }
.bio-content { padding: clamp(1rem, 3vw, 1.8rem); }
.bio-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: 1rem 0; }
.bio-fact { padding: .85rem; border-radius: .8rem; background: #edf6f7; }
.bio-fact strong { display: block; color: var(--midnight); }
.bio-section { padding-top: 1rem; border-top: 1px solid var(--line); }
.connection-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.connection-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .55rem; border: 1px solid var(--line); border-radius: 999px; background: white; font-size: .84rem; }
.connection-chip img { width: 1.6rem; height: 1.6rem; border-radius: 50%; object-fit: cover; }

/* Map */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 1rem; align-items: start; }
.map-card { position: relative; overflow: hidden; min-height: 42rem; background: var(--midnight); }
.map-card > img { width: 100%; height: 100%; min-height: 42rem; object-fit: cover; object-position: center; opacity: .86; }
.map-overlay { position: absolute; inset: 0; }
.route-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.route-line { fill: none; stroke-width: 1.2; vector-effect: non-scaling-stroke; opacity: .2; }
.route-line.active { stroke-width: 3.3; opacity: .98; filter: drop-shadow(0 1px 2px rgb(0 0 0 / 65%)); }
.hub-button { position: absolute; transform: translate(-50%, -50%); width: 2.7rem; height: 2.7rem; border: .2rem solid white; border-radius: 50%; color: white; background: var(--midnight); box-shadow: 0 7px 15px rgb(0 0 0 / 42%); font-weight: 900; }
.hub-button.current { width: 3.25rem; height: 3.25rem; background: var(--teal); animation: pulse 1.8s infinite; }
.hub-button.complete { background: var(--green); }
.hub-button.future { opacity: .72; }
.map-panel { position: sticky; top: 6rem; padding: 1rem; }
.selected-character { display: grid; grid-template-columns: 3.2rem minmax(0,1fr); gap: .7rem; align-items: center; }
.selected-character img { width: 3.2rem; height: 3.2rem; border-radius: 50%; object-fit: cover; border: .2rem solid var(--character-color); }
.progress-bar { height: .7rem; overflow: hidden; margin: .8rem 0; border-radius: 999px; background: #dbe6ea; }
.progress-bar span { display: block; height: 100%; background: var(--character-color); }
.progress-list { list-style: none; margin: .8rem 0 0; padding: 0; }
.progress-list li { display: grid; grid-template-columns: 1.5rem minmax(0,1fr); gap: .5rem; align-items: center; padding: .42rem 0; font-size: .84rem; }
.progress-symbol { display: grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: #e5edf0; font-size: .7rem; }
.progress-list li.done .progress-symbol { color: white; background: var(--green); }
.progress-list li.now { color: var(--founders); font-weight: 800; }
.trail-key { display: grid; gap: .35rem; margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.trail-key span { display: flex; align-items: center; gap: .55rem; font-size: .78rem; }
.trail-swatch { width: 2.2rem; border-top: .25rem solid var(--swatch); }
@keyframes pulse { 50% { box-shadow: 0 0 0 .65rem rgb(48 166 176 / 18%), 0 7px 15px rgb(0 0 0 / 42%); } }

/* Arrival */
.arrival-hero { position: relative; min-height: 34rem; overflow: hidden; display: flex; align-items: flex-end; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--midnight); }
.arrival-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.arrival-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 22%, rgb(15 39 63 / 35%) 50%, rgb(15 39 63 / 96%) 100%); }
.arrival-copy { position: relative; z-index: 2; max-width: 760px; padding: clamp(1.2rem, 4vw, 2.4rem); color: white; }
.arrival-copy h1 { margin: 0; color: white; font-size: clamp(2.2rem, 5vw, 4.2rem); }
.arrival-copy p { font-size: 1.05rem; }
.arrival-copy .eyebrow { color: #a9e4e8; }
.arrival-copy .button-secondary { color: white; background: rgb(255 255 255 / 12%); border-color: rgb(255 255 255 / 45%); }
.placeholder-tag { display: inline-block; margin-top: .6rem; padding: .3rem .55rem; border: 1px dashed rgb(255 255 255 / 55%); border-radius: .45rem; color: #f4ddab; font-size: .78rem; }

/* Challenge */
.challenge-shell { display: grid; grid-template-columns: minmax(0,1fr) 18rem; gap: 1rem; align-items: start; }
.challenge-main { overflow: hidden; }
.challenge-header { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr); gap: .9rem; align-items: center; padding: 1rem; color: white; background: linear-gradient(135deg, var(--midnight), #174e63); }
.challenge-header img { width: 5.2rem; height: 5.2rem; border-radius: 50%; object-fit: cover; border: .22rem solid var(--teal); }
.challenge-header h1 { margin: .2rem 0; color: white; }
.challenge-header p { margin: 0; color: #d9eff2; }
.scenario { padding: clamp(1rem, 3vw, 1.6rem); }
.scenario-box { padding: 1rem; border-left: .4rem solid var(--teal); border-radius: 0 .8rem .8rem 0; background: #edf7f8; }
.route-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .7rem; margin-top: 1rem; }
.route-option { min-height: 8.5rem; padding: .85rem; text-align: left; border: 1px solid var(--line); border-top: .42rem solid var(--route-color); border-radius: .85rem; background: white; }
.route-option strong { display: block; margin-bottom: .35rem; color: var(--midnight); }
.lens-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .75rem; margin-top: 1rem; }
.lens-card { padding: .9rem; border: 1px solid var(--line); border-radius: .8rem; background: white; }
.lens-card h3 { margin: 0 0 .35rem; font-size: 1.05rem; }
.safeguard-list { display: grid; gap: .55rem; margin-top: 1rem; }
.safeguard { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem; border: 1px solid var(--line); border-radius: .7rem; background: white; }
.safeguard input { margin-top: .25rem; transform: scale(1.2); }
.challenge-sidebar { position: sticky; top: 6rem; padding: 1rem; }
.challenge-sidebar img { width: 4.5rem; height: 4.5rem; border-radius: 50%; object-fit: cover; }
.dimension-meter { display: grid; gap: .4rem; margin-top: .8rem; }
.dimension-meter span { padding: .38rem .5rem; border-radius: .45rem; background: #edf3f5; font-size: .77rem; }

/* Completion */
.completion-card { padding: clamp(1.2rem, 4vw, 2.8rem); text-align: center; }
.completion-card img { width: 8rem; height: 8rem; margin: 0 auto 1rem; border-radius: 50%; object-fit: cover; border: .35rem solid var(--teal); }
.artifact-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .75rem; margin: 1.2rem 0; text-align: left; }
.artifact { padding: .9rem; border-radius: .8rem; background: #edf7f8; }

/* Resources */
.resources-screen { min-height: calc(100vh - 4rem); padding: clamp(1rem, 3vw, 2.4rem); background: linear-gradient(rgb(15 39 63 / 42%), rgb(15 39 63 / 68%)), url('assets/visuals/resources-map-backdrop.webp') center / cover fixed; }
.resources-panel { width: min(1060px, 100%); margin: 0 auto; padding: clamp(1.2rem, 4vw, 2.7rem); border: 1px solid rgb(255 255 255 / 48%); border-radius: var(--radius); background: rgb(247 246 242 / 94%); box-shadow: 0 28px 70px rgb(0 0 0 / 35%); backdrop-filter: blur(8px); }
.resources-principles { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; margin: 1rem 0; }
.resource-card { padding: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: white; }
.resource-card h2, .resource-card h3 { margin-top: 0; }
.reference-list { display: grid; gap: .7rem; padding-left: 1.4rem; }
.reference-list li { line-height: 1.55; }

/* Moe */
.moe-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; background: rgb(8 23 35 / 72%); backdrop-filter: blur(6px); }
.moe-overlay[hidden] { display: none; }
.moe-dialog { display: grid; grid-template-columns: 8rem minmax(0,1fr); gap: 1rem; width: min(680px, 96vw); padding: 1rem; border: .2rem solid var(--horizon); border-radius: 1.2rem; background: var(--paper); box-shadow: 0 30px 80px rgb(0 0 0 / 45%); }
.moe-dialog > img { width: 8rem; height: 8rem; border-radius: 50%; object-fit: cover; border: .25rem solid var(--founders); }
.moe-dialog h2 { margin: .15rem 0 .4rem; }
.moe-dialog p { margin: .35rem 0; }
.sr-status { position: fixed; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 980px) {
  .character-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .landing-grid, .framework-shell, .map-layout, .challenge-shell { grid-template-columns: 1fr; }
  .framework-sidebar, .map-panel, .challenge-sidebar, .bio-portrait { position: static; }
  .map-card, .map-card > img { min-height: 34rem; }
}
@media (max-width: 720px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .site-nav { width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .2rem; }
  .site-nav button { white-space: nowrap; }
  .landing-grid, .bio-grid { grid-template-columns: 1fr; }
  .character-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .route-grid, .lens-grid, .artifact-grid, .resources-principles { grid-template-columns: 1fr; }
  .bio-facts { grid-template-columns: 1fr; }
  .moe-dialog { grid-template-columns: 1fr; text-align: center; }
  .moe-dialog > img { margin: 0 auto; }
  .moe-dialog .button-row { justify-content: center; }
}
@media (max-width: 460px) {
  .character-grid { grid-template-columns: 1fr; }
  .framework-nav { flex-direction: column-reverse; }
  .button-row .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
