:root {
  --bg: #f6f5f2;
  --paper: #fff1ee;
  --paper-deep: #ffe1dc;
  --surface: rgba(255,255,255,.92);
  --muted-surface: #f2f0ec;
  --ink: #17151f;
  --muted: #665f68;
  --line: #151216;
  --accent: #ffd84d;
  --accent-2: #5a79ff;
  --success: #61d394;
  --warning: #ffb347;
  --error: #ef476f;
  --focus: #3f65ff;
  --pink: #ff5f77;
  --radius-sm: 14px;
  --radius: 22px;
  --radius-lg: 28px;
  --shadow: 10px 10px #151216, 0 34px 90px rgba(27,18,29,.18);
  --soft-shadow: 4px 4px rgba(21,18,22,.22);
  --max: 1180px;
  --space: clamp(72px, 10vw, 132px);
  --fast: 160ms;
  --normal: 260ms;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 18% 8%, rgba(255,216,77,.32), transparent 290px), radial-gradient(circle at 88% 16%, rgba(63,101,255,.14), transparent 340px), linear-gradient(#fff6f3, #ffeceb); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.55; }
body.menu-open, body.modal-open { overflow: hidden; }
img, video, svg { max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 4px; }
.skip-link { position: fixed; left: 16px; top: 12px; z-index: 10000; transform: translateY(-150%); padding: 12px 16px; border: 2px solid var(--line); border-radius: 10px; background: white; font-weight: 900; }
.skip-link:focus { transform: translateY(0); }
.section-shell { width: min(var(--max), calc(100% - 48px)); margin-inline: auto; }
.section { padding-block: var(--space); }
.kicker, .eyebrow { margin: 0 0 12px; font-size: .76rem; font-weight: 950; letter-spacing: .13em; text-transform: uppercase; }
.section-heading { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, .7fr); align-items: end; gap: 64px; margin-bottom: 42px; }
.section-heading.compact { align-items: center; }
.section-heading h2, .about-card h2, .contact-section h2 { margin: 0; font-size: clamp(2.4rem, 6vw, 5.4rem); line-height: .95; letter-spacing: -.055em; font-weight: 950; }
.section-heading p:last-child { margin: 0; color: var(--muted); font-size: 1.08rem; }
.text-link { display: inline-block; font-weight: 900; text-underline-offset: 5px; text-decoration-thickness: 2px; }

.site-header { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 78px; padding: 12px max(24px, calc((100vw - var(--max))/2)); background: rgba(255,241,238,.92); border-bottom: 2px solid rgba(21,18,22,.84); box-shadow: 0 5px 0 rgba(21,18,22,.16); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; line-height: 1; flex-shrink: 0; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--line); border-radius: 13px; background: var(--accent); box-shadow: 3px 3px var(--line); font-weight: 1000; transform: rotate(-3deg); }
.brand strong, .brand small { display: block; }
.brand strong { font-weight: 950; }
.brand small { margin-top: 4px; color: var(--muted); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.primary-nav { display: flex; align-items: center; gap: 6px; }
.primary-nav > a:not(.button) { padding: 9px 10px; border-radius: 10px; font-size: .87rem; font-weight: 850; text-decoration: none; }
.primary-nav > a:not(.button):hover { background: white; }
.menu-toggle { display: none; padding: 9px 12px; border: 2px solid var(--line); border-radius: 12px; background: white; box-shadow: 3px 3px var(--line); font-weight: 900; }

.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.button { display: inline-flex; min-height: 50px; align-items: center; justify-content: center; gap: 10px; padding: 12px 17px; border: 2px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); background: white; box-shadow: var(--soft-shadow); font-weight: 950; line-height: 1.1; text-decoration: none; cursor: pointer; transition: transform var(--fast), box-shadow var(--fast), background var(--fast); }
.button:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px var(--line); }
.button:active { transform: translate(2px,2px); box-shadow: 1px 1px var(--line); }
.button-primary { background: var(--accent); }
.button-secondary { background: white; }
.button-dark { color: white; background: var(--ink); box-shadow: 4px 4px var(--accent); }
.button-small { min-height: 42px; padding: 9px 13px; }

.hero { display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(48px,6vw,82px); align-items: center; min-height: calc(100vh - 78px); padding-block: clamp(70px,10vw,126px); }
.status-dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border: 2px solid var(--line); border-radius: 50%; background: var(--success); box-shadow: 2px 2px var(--line); animation: statusPulse 2.4s ease-in-out infinite; }
.hero h1 { max-width: 760px; margin: 0; font-size: clamp(3.35rem,4.4vw,4rem); font-weight: 1000; letter-spacing: -.072em; line-height: .88; }
.hero-line { display: block; white-space: nowrap; }
.hero h1 .hero-accent { color: var(--accent-2); text-shadow: 3px 3px var(--line); -webkit-text-stroke: 1px var(--line); }
.hero-lede { max-width: 680px; margin: 28px 0 34px; color: #403a43; font-size: clamp(1.06rem,1.8vw,1.35rem); line-height: 1.55; }
.hero .text-link { margin-left: 6px; }
.hero-visual { position: relative; min-height: 580px; border: 2px solid var(--line); border-radius: 44px; background: radial-gradient(circle, rgba(21,18,22,.17) 1px, transparent 1.5px) 0 0/24px 24px, rgba(255,255,255,.72); box-shadow: var(--shadow); overflow: hidden; isolation: isolate; }
.hero-visual::after { content: ""; position: absolute; inset: 45% -10% -20% 35%; z-index: -1; border-radius: 50%; background: rgba(255,216,77,.72); filter: blur(4px); }
.rive-stage { position: absolute; inset: 76px 38px 72px; z-index: 1; display: grid; place-items: center; border: 2px solid rgba(21,18,22,.2); border-radius: 50%; background: rgba(255,255,255,.45); overflow: hidden; }
.rive-logo-canvas { width: 100%; height: 100%; opacity: 0; transition: opacity 300ms ease; }
.hero-visual.rive-ready .rive-logo-canvas { opacity: 1; }
.rive-logo-fallback { position: absolute; display: grid; place-items: center; gap: 10px; transition: opacity 180ms ease; }
.hero-visual.rive-ready .rive-logo-fallback { opacity: 0; }
.rive-logo-fallback span { display: grid; width: 92px; height: 92px; place-items: center; border: 3px solid var(--line); border-radius: 28px; background: var(--accent); box-shadow: 7px 7px var(--line); font-size: 2rem; font-weight: 1000; transform: rotate(-4deg); }
.rive-logo-fallback strong { padding: 7px 11px; border: 2px solid var(--line); border-radius: 999px; background: white; font-size: .8rem; }
.orbit { position: absolute; left: 50%; top: 50%; border: 2px dashed rgba(21,18,22,.34); border-radius: 50%; transform: translate(-50%,-50%); }
.orbit-one { width: 78%; aspect-ratio: 1; }
.orbit-two { width: 51%; aspect-ratio: 1; }
.quest-node { position: absolute; z-index: 2; width: 132px; min-height: 108px; padding: 12px; border: 2px solid var(--line); border-radius: 20px; background: white; box-shadow: 5px 5px var(--line); transition: transform var(--normal); }
.quest-node:hover { transform: translateY(-8px) rotate(1deg); }
.quest-node span { display: inline-grid; place-items: center; width: 31px; height: 31px; border: 2px solid var(--line); border-radius: 50%; font-size: .7rem; font-weight: 950; }
.quest-node strong, .quest-node small { display: block; }
.quest-node strong { margin-top: 8px; font-size: 1.15rem; font-weight: 950; }
.quest-node small { font-size: .72rem; }
.quest-node small { color: var(--muted); }
.node-learn { left: 5%; top: 5%; background: #fff8d9; transform: rotate(-3deg); }
.node-build { right: 3%; top: 43%; background: #e9f7ff; transform: rotate(3deg); }
.node-play { left: 8%; bottom: 4%; background: #e9ffe9; transform: rotate(2deg); }
.guide-chip { position: absolute; right: 8%; bottom: 10%; padding: 11px 13px; border: 2px solid var(--line); border-radius: 999px; background: var(--paper); box-shadow: 4px 4px var(--line); font-size: .82rem; font-weight: 900; transform: rotate(-2deg); }
.guide-chip span { color: var(--pink); }

.discipline-strip { padding: 18px 0; border-block: 2px solid var(--line); background: var(--ink); color: white; overflow: hidden; }
.marquee-inner { display: flex; width: max-content; gap: 0; animation: stripMove 30s linear infinite; }
.marquee-inner span { white-space: nowrap; font-weight: 900; }
.marquee-inner span::after { content: "✦"; margin: 0 24px; color: var(--accent); }

.capability-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
.capability-card { display: flex; min-height: 420px; flex-direction: column; align-items: flex-start; padding: 26px; border: 2px solid var(--line); border-radius: var(--radius-lg); box-shadow: 7px 7px var(--line); transition: transform var(--normal), box-shadow var(--normal); }
.capability-card:hover, .capability-card:focus-within { transform: translateY(-8px); box-shadow: 11px 11px var(--line); }
.capability-card h3 { margin: auto 0 16px; font-size: clamp(2rem,3.3vw,3.25rem); line-height: .98; letter-spacing: -.045em; }
.capability-card p { margin: 0 0 22px; }
.capability-card a { font-weight: 950; text-underline-offset: 5px; }
.card-number { font-size: .72rem; font-weight: 950; letter-spacing: .1em; text-transform: uppercase; }
.card-yellow { background: #fff8d9; }
.card-blue { background: #e9f7ff; }
.card-green { background: #e9ffe9; }

.project-grid { display: grid; grid-template-columns: repeat(12,1fr); gap: 24px; }
.project-card { grid-column: span 4; display: flex; min-height: 520px; flex-direction: column; border: 2px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; transition: transform var(--normal), box-shadow var(--normal); }
.project-card:nth-child(1), .project-card:nth-child(2) { grid-column: span 6; }
.project-card:hover { transform: translateY(-7px); box-shadow: 8px 8px var(--line); }
.project-visual { position: relative; display: grid; min-height: 220px; place-items: center; border-bottom: 2px solid var(--line); background: var(--project-color,#fff8d9); overflow: hidden; }
.project-card:nth-child(-n+2) .project-visual { min-height: 280px; }
.project-visual::before { content: ""; position: absolute; inset: 16px; border: 2px solid rgba(21,18,22,.22); border-radius: 22px; background: repeating-linear-gradient(135deg, transparent, transparent 14px, rgba(255,255,255,.3) 14px, rgba(255,255,255,.3) 28px); }
.project-visual .project-screenshot { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.project-monogram { position: relative; z-index: 1; font-size: clamp(3.4rem,8vw,7rem); font-weight: 1000; letter-spacing: -.08em; text-shadow: 4px 4px rgba(255,255,255,.75); transform: rotate(-4deg); }
.project-status { position: absolute; right: 18px; top: 18px; z-index: 2; padding: 7px 10px; border: 2px solid var(--line); border-radius: 999px; background: white; box-shadow: 3px 3px var(--line); font-size: .66rem; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.project-content { display: flex; flex: 1; flex-direction: column; padding: 24px; }
.project-category { color: var(--muted); font-size: .72rem; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.project-content h3 { margin: 8px 0 10px; font-size: clamp(1.65rem,3vw,2.65rem); line-height: 1; letter-spacing: -.04em; }
.project-tagline { margin: 0 0 12px; font-weight: 800; }
.project-summary { margin: 0 0 22px; color: var(--muted); }
.project-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.project-actions a { font-weight: 950; }
.loading-state, .empty-state { grid-column: 1/-1; padding: 50px; border: 2px dashed var(--line); border-radius: var(--radius); text-align: center; }

.ecosystem-section { padding-block: var(--space); color: white; background: var(--ink); }
.section-heading.light p:last-child { color: #d7ced8; }
.ecosystem-map { display: grid; grid-template-columns: repeat(12,1fr); gap: 18px; }
.eco-card { grid-column: span 4; display: flex; min-height: 265px; flex-direction: column; padding: 24px; border: 2px solid white; border-radius: 24px; color: var(--ink); background: var(--accent); box-shadow: 7px 7px white; text-decoration: none; transition: transform var(--normal); }
.eco-card:hover { transform: translateY(-7px) rotate(-.5deg); }
.eco-card:nth-child(1), .eco-card:nth-child(2) { grid-column: span 6; }
.eco-chat { background: #e9f7ff; }
.eco-tools { background: #e9ffe9; }
.eco-lexle { background: var(--paper-deep); }
.eco-cosmic { background: #f2edff; }
.eco-index { font-size: .7rem; font-weight: 950; }
.eco-card strong { margin: auto 0 8px; font-size: clamp(1.55rem,3vw,2.6rem); line-height: 1; }
.eco-card small { min-height: 52px; color: #4c4650; font-size: .9rem; }
.eco-card > span:last-child { margin-top: 18px; font-weight: 950; }

.side-quest-band { display: grid; grid-template-columns: 1fr 1fr; min-height: 440px; padding: 0; border: 2px solid var(--line); border-radius: 36px; background: var(--accent); box-shadow: var(--shadow); overflow: hidden; }
.side-quest-copy { padding: clamp(32px,6vw,72px); }
.side-quest-copy h2 { margin: 0 0 18px; font-size: clamp(2.7rem,6vw,5.6rem); line-height: .92; letter-spacing: -.055em; }
.side-quest-copy p:not(.kicker) { max-width: 560px; }
.microcopy { color: #554c26; font-size: .8rem; }
.pizza-art { position: relative; display: grid; place-items: center; border-left: 2px solid var(--line); background: radial-gradient(circle at center, white 0 3px, transparent 4px) 0 0/30px 30px, var(--pink); overflow: hidden; }
.pizza-art img { width: 180px; image-rendering: pixelated; filter: drop-shadow(18px 18px 0 rgba(21,18,22,.34)); transform: rotate(15deg); }
.pizza-art span { position: absolute; top: 25px; right: -14px; padding: 9px 38px; border-block: 2px solid var(--line); background: white; font-weight: 1000; transform: rotate(13deg); }
.pizza-art i { position: absolute; width: 380px; height: 18px; border: 3px solid white; border-radius: 50%; transform: rotate(-28deg); }

.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 72px; align-items: start; }
.about-card { padding: clamp(30px,5vw,64px); border: 2px solid var(--line); border-radius: var(--radius-lg); background: white; box-shadow: var(--shadow); }
.about-lede { font-size: 1.25rem; font-weight: 750; }
.principles { display: grid; gap: 16px; }
.principles article { display: grid; grid-template-columns: 54px 1fr; gap: 18px; padding: 24px; border: 2px solid var(--line); border-radius: 22px; background: var(--muted-surface); box-shadow: 5px 5px var(--line); }
.principles article > span { display: grid; width: 48px; height: 48px; place-items: center; border: 2px solid var(--line); border-radius: 50%; background: var(--accent); font-weight: 950; }
.principles h3, .principles p { margin: 0; }
.principles h3 { font-size: 1.25rem; }
.principles p { color: var(--muted); }

.log-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.log-card { padding: 24px; border: 2px solid var(--line); border-radius: 22px; background: white; box-shadow: 5px 5px var(--line); }
.log-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .72rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.log-card h3 { margin: 26px 0 10px; font-size: 1.55rem; line-height: 1.05; }
.log-card p { color: var(--muted); }
.log-card a { font-weight: 950; }

.contact-section { padding-block: var(--space); color: white; background: var(--ink); }
.contact-grid { display: grid; grid-template-columns: .86fr 1.14fr; gap: clamp(48px,8vw,110px); align-items: start; }
.contact-section h2 { max-width: 650px; }
.contact-section p { color: #d7ced8; }
.contact-note { margin-top: 28px; padding: 18px; border: 2px solid white; border-radius: 16px; background: rgba(255,255,255,.06); }
.contact-form { display: grid; gap: 18px; padding: clamp(24px,4vw,42px); border: 2px solid white; border-radius: var(--radius-lg); color: var(--ink); background: var(--paper); box-shadow: 10px 10px var(--accent); }
.contact-form label { display: grid; gap: 7px; font-weight: 900; }
.contact-form label span { color: var(--muted); font-size: .8rem; font-weight: 600; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form input, .contact-form textarea, .contact-form select, .filter-control { width: 100%; min-height: 48px; padding: 11px 12px; border: 2px solid var(--line); border-radius: 11px; color: var(--ink); background: white; }
.contact-form textarea { resize: vertical; }
.contact-form [aria-invalid="true"] { border-color: var(--error); background: #fff4f6; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }
.privacy-note { margin: 0; color: var(--muted) !important; font-size: .75rem; }
.form-status { min-height: 24px; font-weight: 850; }
.form-status.success { padding: 14px; border: 2px solid var(--line); border-radius: 12px; background: #e9ffe9; }
.error-summary { padding: 14px; border: 2px solid var(--error); border-radius: 12px; background: #fff4f6; }

.site-footer { padding: 46px 0; border-top: 2px solid var(--line); background: var(--paper); }
.footer-grid { display: grid; grid-template-columns: 1.1fr 1fr auto; gap: 36px; align-items: start; }
.footer-grid strong { font-size: 1.3rem; }
.footer-grid p { margin: 6px 0 0; color: var(--muted); font-size: .86rem; }
.footer-grid nav { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.footer-grid nav a { font-weight: 850; }

.game-overlay { position: fixed; inset: 0; z-index: 9999; display: none; align-items: center; justify-content: center; padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); background: rgba(12,10,15,.88); backdrop-filter: blur(9px); }
.game-overlay[aria-hidden="false"], .game-overlay:not([hidden]) { display: flex; }
.game-container { position: relative; width: min(100%, 1050px); height: min(84vh, 720px); border: 3px solid white; border-radius: 24px; background: linear-gradient(#0e2343,#53275d); box-shadow: 12px 12px var(--accent); overflow: hidden; }
.game-canvas, .game-ui-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.game-ui-layer { pointer-events: none; }
.game-header { display: flex; justify-content: space-between; align-items: center; padding: 18px; }
.close-game-btn, .save-score-btn, .initials-input { pointer-events: auto; }
.close-game-btn { display: grid; width: 48px; height: 48px; place-items: center; border: 2px solid white; border-radius: 50%; color: white; background: var(--ink); font-size: 1.7rem; cursor: pointer; }
.lives-container { display: flex; gap: 4px; }
.heart-icon { width: 26px; fill: var(--pink); }
.score-display { position: absolute; left: 50%; top: 18px; color: white; font-size: 2rem; font-weight: 1000; transform: translateX(-50%); }
.game-over-modal { position: absolute; left: 50%; top: 50%; width: min(430px, calc(100% - 32px)); max-height: calc(100% - 120px); padding: 26px; border: 3px solid var(--line); border-radius: 22px; color: var(--ink); background: var(--paper); box-shadow: 9px 9px var(--accent); text-align: center; transform: translate(-50%,-50%); overflow: auto; pointer-events: auto; }
.game-over-modal[hidden] { display: none; }
.game-over-modal h2 { margin: 0; font-size: 2.8rem; text-transform: uppercase; }
.save-score-btn { min-height: 48px; padding: 10px 18px; border: 2px solid var(--line); border-radius: 12px; background: var(--accent); box-shadow: 4px 4px var(--line); font-weight: 950; cursor: pointer; }
.initials-input { width: 110px; margin: 6px 8px 16px; padding: 10px; border: 2px solid var(--line); border-radius: 10px; text-align: center; text-transform: uppercase; }
.highscore-list { margin: 16px 0; text-align: left; }
.highscore-item { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid #bdb4ba; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

/* Lab, case study, quest log */
.subpage-hero { padding-block: 86px 56px; }
.subpage-hero h1 { max-width: 900px; margin: 0; font-size: clamp(3.4rem,9vw,8rem); line-height: .84; letter-spacing: -.065em; }
.subpage-hero p { max-width: 690px; font-size: 1.2rem; }
.lab-toolbar { position: sticky; top: 77px; z-index: 100; padding: 18px; border: 2px solid var(--line); border-radius: 20px; background: rgba(255,241,238,.96); box-shadow: 6px 6px var(--line); backdrop-filter: blur(12px); }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.filter-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.filter-chip { padding: 8px 11px; border: 2px solid var(--line); border-radius: 999px; background: white; font-size: .8rem; font-weight: 900; cursor: pointer; }
.filter-chip[aria-pressed="true"] { background: var(--accent); box-shadow: 3px 3px var(--line); }
.lab-results { padding-block: 40px var(--space); }
.results-meta { margin-bottom: 20px; color: var(--muted); font-weight: 800; }
.case-layout { display: grid; grid-template-columns: .7fr 1.3fr; gap: 70px; padding-bottom: var(--space); }
.case-sidebar { position: sticky; top: 110px; align-self: start; padding: 24px; border: 2px solid var(--line); border-radius: 20px; background: white; box-shadow: 6px 6px var(--line); }
.case-body { display: grid; gap: 42px; }
.case-section { padding-bottom: 34px; border-bottom: 2px solid rgba(21,18,22,.18); }
.case-section h2 { margin: 0 0 12px; font-size: 2rem; }

@keyframes statusPulse { 50% { transform: scale(1.25); box-shadow: 3px 3px var(--line); } }
@keyframes stripMove { to { transform: translateX(-25%); } }

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-visual { min-height: 520px; }
}

@media (max-width: 980px) {
  .menu-toggle { display: block; }
  .primary-nav { position: fixed; inset: 78px 0 auto; display: none; align-items: stretch; flex-direction: column; padding: 24px; border-bottom: 2px solid var(--line); background: var(--paper); box-shadow: 0 10px var(--line); }
  .primary-nav.open { display: flex; }
  .primary-nav > a:not(.button) { padding: 13px; font-size: 1rem; }
  .section-heading { grid-template-columns: 1fr; gap: 20px; }
  .capability-grid { grid-template-columns: 1fr; }
  .capability-card { min-height: 330px; }
  .project-card, .project-card:nth-child(-n+2) { grid-column: span 6; }
  .eco-card, .eco-card:nth-child(-n+2) { grid-column: span 6; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .log-grid { grid-template-columns: 1fr 1fr; }
  .case-layout { grid-template-columns: 1fr; }
  .case-sidebar { position: static; }
}

@media (max-width: 680px) {
  .section-shell { width: min(100% - 28px, var(--max)); }
  .site-header { min-height: 70px; padding-inline: 14px; }
  .brand small { display: none; }
  .brand-mark { width: 40px; height: 40px; }
  .primary-nav { inset-block-start: 70px; }
  .hero { padding-block: 54px 70px; }
  .hero h1 { font-size: clamp(3rem,14.5vw,5rem); }
  .hero-line { white-space: normal; }
  .hero h1 .hero-accent { text-shadow: 2px 2px var(--line); }
  .hero-visual { min-height: 430px; border-radius: 28px; }
  .rive-stage { inset: 68px 30px 62px; }
  .quest-node { width: 148px; min-height: 122px; padding: 14px; }
  .quest-node strong { margin-top: 12px; font-size: 1.25rem; }
  .node-learn { left: 5%; }
  .node-build { right: 4%; top: 36%; }
  .node-play { left: 8%; }
  .guide-chip { right: 3%; bottom: 4%; font-size: .7rem; }
  .section { padding-block: 78px; }
  .section-heading h2, .about-card h2, .contact-section h2 { font-size: clamp(2.35rem,12vw,4rem); }
  .project-card, .project-card:nth-child(-n+2), .eco-card, .eco-card:nth-child(-n+2) { grid-column: 1/-1; }
  .project-card { min-height: 480px; }
  .side-quest-band { grid-template-columns: 1fr; width: min(100% - 28px,var(--max)); }
  .pizza-art { min-height: 300px; border-left: 0; border-top: 2px solid var(--line); }
  .about-grid { gap: 40px; }
  .about-card { padding: 28px 22px; }
  .log-grid { grid-template-columns: 1fr; }
  .field-row, .footer-grid, .search-row { grid-template-columns: 1fr; }
  .footer-grid { gap: 26px; }
  .game-container { height: min(88vh, 700px); }
  .subpage-hero { padding-block: 64px 42px; }
}

/* 2026-07-11 reference-spec rebuild. The supplied mockup is the layout source of truth. */
:root {
  --reference-cream: #fff6e5;
  --reference-navy: #062e5b;
  --reference-blue: #085bd8;
  --reference-coral: #ff5c62;
  --reference-pink: #ee2864;
  --reference-yellow: #ffbf14;
  --reference-green: #75b62c;
  --reference-line: rgba(6, 46, 91, .18);
}

html { background: var(--reference-cream); }
body { color: var(--reference-navy); background: var(--reference-cream); }
.section-shell { width: min(1180px, calc(100vw - 40px)); }

.site-header {
  position: relative;
  top: auto;
  width: min(1180px, calc(100vw - 40px));
  min-height: 86px;
  margin: 0 auto;
  padding: 12px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.brand { gap: 10px; color: var(--reference-navy); }
.brand-rive {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
}
.brand-rive .rive-logo-canvas { position: absolute; inset: -7px; width: 72px; height: 72px; opacity: 0; }
.brand-rive.rive-ready .rive-logo-canvas { opacity: 1; }
.brand-rive.rive-ready .brand-rive-fallback { opacity: 0; }
.brand-rive-fallback {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--reference-yellow);
  background: var(--reference-blue);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  font-size: 11px;
  font-weight: 1000;
}
.brand-wordmark { display: grid; line-height: .86; text-transform: uppercase; }
.brand-wordmark small { margin: 0; color: var(--reference-navy); font-size: 9px; font-weight: 1000; letter-spacing: .34em; text-align: center; }
.brand-wordmark strong { display: block; font-size: 22px; font-weight: 1000; letter-spacing: .02em; white-space: nowrap; }
.brand-wordmark i { font-style: normal; }
.brand-wordmark i:nth-child(1) { color: var(--reference-blue); }
.brand-wordmark i:nth-child(2) { color: var(--reference-coral); }
.brand-wordmark i:nth-child(3) { color: var(--reference-green); }
.brand-wordmark i:nth-child(4) { color: var(--reference-yellow); }

.primary-nav { gap: 10px; }
.primary-nav > a:not(.button) { padding: 10px 8px; color: var(--reference-navy); font-size: 12px; font-weight: 1000; text-transform: uppercase; }
.primary-nav .button { min-height: 44px; padding-inline: 22px; color: white; border: 0; border-radius: 10px; background: var(--reference-blue); box-shadow: 4px 4px 0 var(--reference-navy); }

.hero {
  grid-template-columns: minmax(360px, .78fr) minmax(580px, 1.22fr);
  gap: 18px;
  min-height: 404px;
  padding-block: 12px 0;
  align-items: end;
}
.hero-copy { align-self: center; padding: 18px 0 34px 28px; }
.hero .eyebrow { color: var(--reference-coral); font-size: 12px; font-weight: 1000; letter-spacing: .1em; text-transform: uppercase; }
.hero .eyebrow span { color: var(--reference-pink); }
.hero h1 { max-width: 480px; font-size: clamp(56px, 4.1vw, 72px); line-height: .93; letter-spacing: 0; }
.hero h1 .hero-accent { color: var(--reference-coral); text-shadow: none; -webkit-text-stroke: 0; }
.hero-lede { max-width: 410px; margin: 18px 0 22px; color: var(--reference-navy); font-size: 17px; line-height: 1.45; }
.hero .button-row { gap: 18px; }
.hero .button { min-height: 48px; padding: 0 22px; border: 2px solid var(--reference-navy); border-radius: 9px; font-size: 13px; text-transform: uppercase; box-shadow: 4px 4px 0 var(--reference-navy); }
.hero .button-primary { color: white; background: var(--reference-blue); }
.hero .button-secondary { color: var(--reference-navy); background: var(--reference-cream); }

.reference-hero-art {
  height: 404px;
  min-height: 0;
  border: 0;
  border-radius: 0 0 18px 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}
.reference-hero-art::before,
.reference-hero-art::after { display: none; }
.reference-hero-art img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: center bottom; mix-blend-mode: normal; }

.side-quest-band {
  grid-template-columns: 210px minmax(300px, .95fr) minmax(460px, 1.2fr);
  width: min(1160px, calc(100vw - 40px));
  min-height: 136px;
  margin-top: 4px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--reference-navy);
  box-shadow: none;
  overflow: hidden;
}
.side-quest-copy { display: grid; align-content: center; padding: 18px 24px; }
.side-quest-copy .kicker { margin: 0; color: white; font-size: 20px; letter-spacing: 0; }
.side-quest-copy h2 { margin: 2px 0 12px; color: white; font-size: 15px; letter-spacing: 0; }
.side-quest-copy .button { width: max-content; min-height: 36px; padding: 0 18px; color: white; border: 0; border-radius: 7px; background: var(--reference-coral); box-shadow: none; font-size: 11px; }
.pizza-art { min-height: 136px; border: 0; background: var(--reference-navy); }
.pizza-art img { width: 100%; height: 100%; object-fit: cover; object-position: center; filter: none; transform: none; mix-blend-mode: normal; }
.pizza-scoreboard { grid-template-columns: repeat(3, 1fr); border: 0; }
.pizza-scoreboard div { min-height: 136px; padding: 18px 10px; }
.pizza-scoreboard div + div { border-left: 1px solid rgba(255,255,255,.32); }
.pizza-scoreboard strong { color: var(--reference-yellow); font-size: clamp(1.5rem, 2.2vw, 2.2rem); }
.pizza-scoreboard small { color: var(--reference-green); font-size: 10px; }

.ecosystem-pathways {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-block: 14px 0;
}
.pathway-card {
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr 18px;
  min-height: 142px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: var(--reference-navy);
  border: 1px solid var(--reference-line);
  border-radius: 12px;
  background: rgba(255,255,255,.42);
  box-shadow: 0 8px 24px rgba(6,46,91,.05);
}
.pathway-card img { width: 92px; height: 112px; object-fit: cover; object-position: center top; border-radius: 8px; mix-blend-mode: normal; }
.pathway-chat img { background: #ffcadb; }
.pathway-tools img { background: #ffd97b; }
.pathway-projects img { background: #b7dc73; }
.pathway-card strong { display: block; margin-bottom: 7px; color: var(--reference-blue); font-size: 17px; text-transform: uppercase; }
.pathway-chat strong { color: var(--reference-pink); }
.pathway-tools strong { color: #d68700; }
.pathway-projects strong { color: var(--reference-green); }
.pathway-card small { display: block; font-size: 12px; line-height: 1.35; }
.pathway-card b { font-size: 28px; }

.section { padding-block: 78px; }
.section-heading h2 { color: var(--reference-navy); letter-spacing: 0; }
.kicker { color: var(--reference-pink); letter-spacing: .1em; }
.capability-grid { gap: 14px; }
.capability-card { min-height: 310px; border: 1px solid var(--reference-line); border-radius: 12px; box-shadow: none; }
.capability-card h3 { font-size: clamp(2rem, 3vw, 3rem); letter-spacing: 0; }
.project-card, .eco-card, .about-card, .principles article, .log-card { border-width: 1px; border-color: var(--reference-line); border-radius: 12px; box-shadow: none; }
.ecosystem-section, .contact-section { background: var(--reference-navy); }
.about-grid { position: relative; }
.about-grid::after { content: ""; position: absolute; right: 4%; bottom: 0; width: 220px; height: 310px; background: url('/public/sidequest-assets/forgekeeper.png') center bottom/contain no-repeat; mix-blend-mode: normal; pointer-events: none; }
.principles { align-self: center; }
.contact-section { position: relative; overflow: hidden; }
.contact-section::after { content: ""; position: absolute; right: max(4vw, 20px); bottom: -26px; width: 160px; height: 210px; background: url('/public/sidequest-assets/dragon.png') center bottom/contain no-repeat; mix-blend-mode: normal; opacity: .85; pointer-events: none; }

@media (max-width: 1080px) {
  .primary-nav > a:not(.button) { display: none; }
  .hero { grid-template-columns: 1fr 1fr; }
  .side-quest-band { grid-template-columns: 190px 1fr; }
  .pizza-scoreboard { grid-column: 1 / -1; }
  .ecosystem-pathways { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .section-shell, .site-header, .side-quest-band { width: min(100% - 24px, 1180px); }
  .site-header { min-height: 72px; }
  .brand-rive { width: 50px; height: 50px; flex-basis: 50px; }
  .brand-rive .rive-logo-canvas { width: 62px; height: 62px; }
  .brand-wordmark strong { font-size: 18px; }
  .menu-toggle { display: inline-flex; min-height: 42px; align-items: center; border: 2px solid var(--reference-navy); border-radius: 8px; background: var(--reference-yellow); box-shadow: 3px 3px 0 var(--reference-navy); }
  .primary-nav { top: 70px; border: 2px solid var(--reference-navy); border-radius: 12px; background: var(--reference-cream); box-shadow: 6px 6px 0 var(--reference-navy); }
  .primary-nav > a:not(.button) { display: block; }
  .hero { grid-template-columns: 1fr; gap: 0; min-height: 0; padding-top: 18px; }
  .hero-copy { padding: 14px 8px 22px; }
  .hero h1 { font-size: clamp(48px, 14vw, 64px); }
  .hero-lede { font-size: 15px; }
  .hero .button-row { align-items: stretch; }
  .hero .button { flex: 1 1 150px; justify-content: center; }
  .reference-hero-art { height: 260px; min-height: 0; border-radius: 0 0 12px 12px; }
  .reference-hero-art img { min-height: 0; object-position: 52% bottom; }
  .side-quest-band { grid-template-columns: 1fr; margin-top: 12px; }
  .side-quest-copy { text-align: left; }
  .pizza-art { min-height: 118px; }
  .pizza-scoreboard { grid-column: auto; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255,255,255,.25); }
  .pizza-scoreboard div { min-height: 112px; padding: 14px 6px; }
  .pizza-scoreboard strong { font-size: 1.2rem; }
  .pizza-scoreboard span, .pizza-scoreboard small { font-size: 8px; }
  .ecosystem-pathways { grid-template-columns: 1fr; }
  .pathway-card { grid-template-columns: 86px 1fr 18px; min-height: 124px; }
  .pathway-card img { width: 86px; height: 100px; }
  .section { padding-block: 56px; }
  .about-grid::after { display: none; }
}

/* Quiet character stages keep illustration and interface hierarchy separate. */
.reference-hero-art {
  isolation: isolate;
  border: 1px solid rgba(10, 50, 89, .14);
  border-bottom: 0;
  background: rgba(255, 250, 241, .72);
}
.reference-hero-art::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 12%;
  right: 7%;
  bottom: 0;
  height: 76%;
  display: block;
  border: 1px solid rgba(10, 50, 89, .13);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  background: rgba(220, 238, 255, .36);
}
.reference-hero-art::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 5%;
  right: 2%;
  bottom: 0;
  height: 1px;
  display: block;
  background: rgba(10, 50, 89, .2);
}
.reference-hero-art .hero-character {
  position: absolute;
  z-index: 2;
  inset: auto;
  bottom: 0;
  display: block;
  width: auto;
  min-height: 0;
  object-fit: contain;
  object-position: center bottom;
}
.reference-hero-art .hero-tinkerer { left: 9%; height: 87%; }
.reference-hero-art .hero-forgekeeper { right: 2%; height: 98%; }
.pathway-card { overflow: hidden; }
.pathway-card img {
  background: transparent;
  object-fit: cover;
  object-position: center 17%;
  transform: scale(1.06);
}
.pathway-chat img,
.pathway-tools img,
.pathway-projects img { background: transparent; }
.about-grid::after { background-image: url('/public/sidequest-assets/forgekeeper-cutout.png'); }

@media (max-width: 760px) {
  .reference-hero-art { border-radius: 12px 12px 0 0; }
  .reference-hero-art::before { left: 5%; right: 5%; height: 72%; }
  .reference-hero-art .hero-tinkerer { left: 3%; height: 88%; }
  .reference-hero-art .hero-forgekeeper { right: -8%; height: 100%; }
}

/* Final main-page cleanup: restored hero, honest side quest, and icon-led cards. */
.reference-hero-art .hero-scene {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center bottom;
}

.side-quest-band {
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 150px;
  overflow: hidden;
}

.side-quest-copy { padding: 22px 24px; }
.side-quest-copy .kicker { font-size: 12px; letter-spacing: .09em; }
.side-quest-copy h2 { margin: 4px 0 5px; font-size: 22px; }
.side-quest-copy > p:not(.kicker) {
  max-width: 310px;
  margin: 0 0 14px;
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
  line-height: 1.35;
}

.pizza-art { min-height: 150px; }
.pizza-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.pathway-card img {
  width: 92px;
  height: 102px;
  padding: 9px;
  object-fit: contain;
  object-position: center;
  transform: none;
  border-radius: 9px;
}
.pathway-learn img { background: #e7f2ff; }
.pathway-chat img { background: #ffe5ef; }
.pathway-tools img { background: #fff0bd; }
.pathway-projects img { background: #e8f3c5; }

@media (max-width: 760px) {
  .side-quest-band { grid-template-columns: 1fr; }
  .side-quest-copy { padding: 22px 24px 18px; }
  .pizza-art { min-height: 138px; }
  .pathway-card img { width: 82px; height: 94px; padding: 8px; }
}


/* Final main-page cleanup precedence. */
.reference-hero-art .hero-scene {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center bottom;
}
.side-quest-band {
  grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr);
  min-height: 150px;
  overflow: hidden;
}
.side-quest-copy { padding: 22px 28px; }
.side-quest-copy .kicker { font-size: 12px; letter-spacing: .09em; }
.side-quest-copy h2 { margin: 4px 0 5px; color: white; font-size: 26px; }
.side-quest-copy > p:not(.kicker) { max-width: 310px; margin: 0 0 14px; color: rgba(255,255,255,.78); font-size: 13px; line-height: 1.35; }
.pizza-art { min-height: 150px; }
.pathway-card img {
  width: 92px;
  height: 102px;
  padding: 9px;
  object-fit: contain;
  object-position: center;
  transform: none;
  border-radius: 9px;
}
.pathway-learn img { background: #e7f2ff; }
.pathway-chat img { background: #ffe5ef; }
.pathway-tools img { background: #fff0bd; }
.pathway-projects img { background: #e8f3c5; }

@media (max-width: 760px) {
  .side-quest-band { grid-template-columns: 1fr; }
  .side-quest-copy { padding: 22px 24px 18px; }
  .pizza-art { min-height: 138px; }
  .pathway-card img { width: 82px; height: 94px; padding: 8px; }
}

/* Main homepage cleanup: strong hero scene, honest side quest, and icon-led cards. */
.reference-hero-art .hero-scene {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center bottom;
}
.side-quest-band {
  grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr);
  min-height: 150px;
  overflow: hidden;
}
.side-quest-copy { padding: 22px 28px; }
.side-quest-copy .kicker { font-size: 12px; letter-spacing: .09em; }
.side-quest-copy h2 { margin: 4px 0 5px; color: white; font-size: 26px; }
.side-quest-copy > p:not(.kicker) { max-width: 310px; margin: 0 0 14px; color: rgba(255,255,255,.78); font-size: 13px; line-height: 1.35; }
.pizza-art { min-height: 150px; }
.pathway-card img {
  width: 92px;
  height: 102px;
  padding: 9px;
  object-fit: contain;
  object-position: center;
  transform: none;
  border-radius: 9px;
}
.pathway-learn img { background: #e7f2ff; }
.pathway-chat img { background: #ffe5ef; }
.pathway-tools img { background: #fff0bd; }
.pathway-projects img { background: #e8f3c5; }

@media (max-width: 760px) {
  .side-quest-band { grid-template-columns: 1fr; }
  .side-quest-copy { padding: 22px 24px 18px; }
  .pizza-art { min-height: 138px; }
  .pathway-card img { width: 82px; height: 94px; padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .marquee-inner { width: 100%; flex-wrap: wrap; justify-content: center; gap: 10px; transform: none !important; }
}

@media (forced-colors: active) {
  .button, .project-card, .capability-card, .eco-card { border: 2px solid ButtonText; }
}

/* 2026-07-11 Side Quest ecosystem design-language rollout.
   This layer centralizes the approved solid-fill palette and creates temporary
   character slots that can be replaced by final artwork or Rive assets later. */
:root {
  --sq-navy: #0A3259;
  --sq-cobalt: #1E90FF;
  --sq-coral: #FF6247;
  --sq-pink: #ED2061;
  --sq-yellow: #F9D11F;
  --sq-cream: #FFE8C8;
  --sq-apple: #A4CE39;
  --sq-leaf: #2CB34F;
  --sq-forest: #157B29;
  --bg: var(--sq-cream);
  --paper: #fff7ea;
  --paper-deep: #ffdcae;
  --surface: rgba(255, 247, 234, .94);
  --muted-surface: #f8e7c7;
  --ink: #0a1d35;
  --muted: #4e5870;
  --line: var(--sq-navy);
  --accent: var(--sq-yellow);
  --accent-2: var(--sq-cobalt);
  --success: var(--sq-apple);
  --warning: var(--sq-yellow);
  --error: var(--sq-coral);
  --focus: var(--sq-cobalt);
  --pink: var(--sq-pink);
  --radius-sm: 18px;
  --radius: 26px;
  --radius-lg: 34px;
  --shadow: 12px 12px 0 var(--sq-navy), 0 28px 70px rgba(10, 50, 89, .2);
  --soft-shadow: 5px 5px 0 var(--sq-navy);
}

body {
  background:
    radial-gradient(circle at 10% 8%, rgba(249, 209, 31, .44), transparent 260px),
    radial-gradient(circle at 88% 10%, rgba(30, 144, 255, .2), transparent 320px),
    linear-gradient(180deg, #fff6e7 0%, var(--sq-cream) 48%, #fff7ea 100%);
}

.site-header {
  background: rgba(255, 232, 200, .92);
  border-bottom-color: var(--sq-navy);
  box-shadow: 0 6px 0 rgba(10, 50, 89, .2);
}

.brand-mark,
.button,
.menu-toggle,
.quest-node,
.capability-card,
.project-card,
.eco-card,
.about-card,
.principles article,
.log-card,
.contact-form,
.lab-toolbar,
.case-sidebar,
.game-over-modal {
  border-color: var(--sq-navy);
}

.brand-mark {
  position: relative;
  color: var(--sq-navy);
  background: linear-gradient(135deg, var(--sq-cobalt) 0 48%, var(--sq-forest) 48% 100%);
  border-radius: 9px;
  box-shadow: 4px 4px 0 var(--sq-navy);
  font-size: 0;
  transform: rotate(45deg);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border: 2px solid var(--sq-navy);
}

.brand-mark::before {
  inset: 9px;
  background: var(--sq-yellow);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.brand-mark::after {
  inset: 17px;
  background: #fffaf0;
  transform: rotate(45deg);
}

.primary-nav > a:not(.button):hover {
  background: rgba(255, 255, 255, .68);
}

.button {
  border-width: 3px;
  box-shadow: var(--soft-shadow);
}

.button-primary {
  background: var(--sq-yellow);
}

.button-secondary {
  background: #fffaf0;
}

.button-dark {
  color: #fffaf0;
  background: var(--sq-navy);
  box-shadow: 5px 5px 0 var(--sq-yellow);
}

.status-dot {
  background: var(--sq-apple);
}

.hero {
  grid-template-columns: minmax(0, 1.06fr) minmax(390px, .94fr);
}

.hero h1 {
  max-width: 850px;
  font-size: clamp(3.8rem, 6.6vw, 7.4rem);
  letter-spacing: -.06em;
}

.hero h1 .hero-accent {
  color: var(--sq-coral);
  text-shadow: 4px 4px 0 var(--sq-navy);
  -webkit-text-stroke: 1px var(--sq-navy);
}

.hero-lede {
  color: #29405c;
}

.hero-visual {
  min-height: 620px;
  background:
    radial-gradient(circle, rgba(10, 50, 89, .2) 1px, transparent 1.5px) 0 0/26px 26px,
    linear-gradient(145deg, #fffaf0, #ffe0b2);
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 86px 72px 112px;
  z-index: 0;
  border: 3px solid rgba(10, 50, 89, .18);
  border-radius: 42px;
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(10, 50, 89, .18) 48% 49%, transparent 49% 100%),
    linear-gradient(0deg, transparent 0 54%, rgba(10, 50, 89, .18) 54% 55%, transparent 55% 100%);
}

.hero-visual::after {
  inset: 42% -15% -24% 28%;
  background: var(--sq-apple);
  filter: none;
}

.character-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.sq-character-guide {
  position: absolute;
  left: 50%;
  bottom: 54px;
  width: 190px;
  height: 286px;
  transform: translateX(-50%);
}

.sq-character-guide::before,
.sq-character-guide::after,
.sq-character-guide span {
  content: "";
  position: absolute;
  display: block;
  border: 4px solid var(--sq-navy);
}

.sq-character-guide .character-head {
  left: 49px;
  top: 22px;
  width: 92px;
  height: 86px;
  border-radius: 46% 48% 44% 42%;
  background: #ffad63;
}

.sq-character-guide .character-head::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 31px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sq-navy);
  box-shadow: 34px 0 0 var(--sq-navy);
}

.sq-character-guide .character-head::after {
  content: "";
  position: absolute;
  left: 29px;
  top: 55px;
  width: 34px;
  height: 13px;
  border-bottom: 4px solid var(--sq-navy);
  border-radius: 50%;
}

.sq-character-guide .character-body {
  left: 42px;
  top: 94px;
  width: 104px;
  height: 148px;
  border-radius: 36px 36px 26px 26px;
  background:
    linear-gradient(120deg, var(--sq-coral) 0 42%, var(--sq-forest) 42% 100%);
}

.sq-character-guide .character-body::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 26px;
  width: 35px;
  height: 102px;
  border: 4px solid var(--sq-navy);
  border-radius: 999px;
  background: var(--sq-yellow);
  transform: rotate(18deg);
}

.sq-character-guide .character-body::after {
  content: "";
  position: absolute;
  right: -34px;
  top: 28px;
  width: 35px;
  height: 102px;
  border: 4px solid var(--sq-navy);
  border-radius: 999px;
  background: var(--sq-apple);
  transform: rotate(-18deg);
}

.sq-character-guide .character-satchel {
  left: 69px;
  top: 145px;
  width: 54px;
  height: 48px;
  border-radius: 16px;
  background: var(--sq-yellow);
  transform: rotate(-4deg);
}

.sq-character-guide .character-satchel::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 12px;
  width: 22px;
  height: 22px;
  border: 4px solid var(--sq-navy);
  border-radius: 50%;
  background: var(--sq-apple);
}

.sq-character-guide::before {
  left: 49px;
  bottom: 0;
  width: 31px;
  height: 70px;
  border-radius: 999px;
  background: var(--sq-forest);
}

.sq-character-guide::after {
  right: 49px;
  bottom: 0;
  width: 31px;
  height: 70px;
  border-radius: 999px;
  background: var(--sq-forest);
}

.sq-character-guide > .character-head {
  box-shadow:
    -26px -18px 0 -12px var(--sq-navy),
    0 -28px 0 -13px var(--sq-navy),
    28px -14px 0 -15px var(--sq-navy);
}

.sq-companion {
  position: absolute;
  z-index: 4;
  border: 4px solid var(--sq-navy);
  box-shadow: 6px 6px 0 rgba(10, 50, 89, .28);
}

.sq-dragon {
  right: 45px;
  top: 84px;
  width: 92px;
  height: 72px;
  border-radius: 45% 55% 45% 50%;
  background: var(--sq-apple);
}

.sq-dragon span::after {
  content: "";
  position: absolute;
  left: 12px;
  bottom: -14px;
  width: 12px;
  height: 28px;
  border: 4px solid var(--sq-navy);
  border-radius: 999px;
  background: var(--sq-forest);
  box-shadow: 32px 0 0 -4px var(--sq-forest), 32px 0 0 0 var(--sq-navy);
}

.sq-dragon::before,
.sq-dragon::after {
  content: "";
  position: absolute;
  border: 4px solid var(--sq-navy);
}

.sq-dragon::before {
  right: -24px;
  top: 18px;
  width: 38px;
  height: 26px;
  border-left: 0;
  border-radius: 0 999px 999px 0;
  background: var(--sq-coral);
}

.sq-dragon::after {
  left: 20px;
  top: -29px;
  width: 48px;
  height: 36px;
  border-radius: 50% 50% 0 0;
  background: var(--sq-pink);
}

.sq-dragon span::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 24px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sq-navy);
  box-shadow: 30px 0 0 var(--sq-navy);
}

.sq-wizard {
  left: 48px;
  top: 220px;
  width: 76px;
  height: 94px;
  border-radius: 34px 34px 22px 22px;
  background: var(--sq-pink);
}

.sq-wizard::before {
  content: "";
  position: absolute;
  left: 13px;
  top: -58px;
  width: 49px;
  height: 64px;
  border: 4px solid var(--sq-navy);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: var(--sq-navy);
}

.sq-wizard::after {
  content: "";
  position: absolute;
  left: 21px;
  top: 28px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sq-navy);
  box-shadow: 25px 0 0 var(--sq-navy);
}

.rive-stage {
  inset: 96px 88px 118px;
  z-index: 1;
  border-radius: 38px;
  background: rgba(255, 250, 240, .58);
}

.orbit {
  border-color: rgba(10, 50, 89, .35);
}

.quest-node {
  background: #fffaf0;
}

.quest-prop {
  position: absolute;
  z-index: 3;
  border: 4px solid var(--sq-navy);
  box-shadow: 6px 6px 0 rgba(10, 50, 89, .22);
}

.prop-compass {
  right: 148px;
  bottom: 154px;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: #fffaf0;
}

.prop-compass::before,
.prop-compass::after,
.prop-lantern::before,
.prop-satchel::before {
  content: "";
  position: absolute;
}

.prop-compass::before {
  inset: 18px;
  background: var(--sq-coral);
  clip-path: polygon(50% 0, 66% 44%, 100% 50%, 58% 62%, 50% 100%, 35% 60%, 0 50%, 42% 38%);
}

.prop-compass::after {
  left: 35px;
  top: 35px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sq-navy);
}

.prop-satchel {
  left: 58px;
  bottom: 74px;
  width: 96px;
  height: 70px;
  border-radius: 18px 18px 24px 24px;
  background: var(--sq-coral);
}

.prop-satchel::before {
  left: 30px;
  top: 19px;
  width: 31px;
  height: 25px;
  border: 4px solid var(--sq-navy);
  border-radius: 9px;
  background: var(--sq-yellow);
}

.prop-lantern {
  right: 46px;
  top: 214px;
  width: 58px;
  height: 78px;
  border-radius: 16px;
  background: var(--sq-yellow);
}

.prop-lantern::before {
  left: 14px;
  top: 14px;
  width: 22px;
  height: 34px;
  border: 4px solid var(--sq-navy);
  border-radius: 50% 50% 42% 42%;
  background: var(--sq-coral);
}

.node-learn { background: #fff3a8; }
.node-build { background: #cbe7ff; }
.node-play { background: #dff0a4; }

.guide-chip {
  color: var(--sq-navy);
  background: #fffaf0;
}

.discipline-strip,
.ecosystem-section,
.contact-section {
  background: var(--sq-navy);
}

.marquee-inner span::after {
  color: var(--sq-yellow);
}

.card-yellow { background: #fff3a8; }
.card-blue { background: #cbe7ff; }
.card-green { background: #dff0a4; }

.capability-card {
  position: relative;
  overflow: hidden;
}

.capability-card::before {
  content: "";
  position: absolute;
  right: 22px;
  top: 22px;
  width: 58px;
  height: 58px;
  border: 4px solid var(--sq-navy);
  border-radius: 18px;
  background: #fffaf0;
  box-shadow: 5px 5px 0 rgba(10, 50, 89, .22);
}

.card-yellow::before {
  border-radius: 50%;
  background:
    linear-gradient(135deg, transparent 0 44%, var(--sq-coral) 44% 56%, transparent 56%),
    #fffaf0;
}

.card-blue::before {
  background:
    linear-gradient(90deg, var(--sq-cobalt) 0 44%, #fffaf0 44% 56%, var(--sq-pink) 56% 100%);
}

.card-green::before {
  border-radius: 18px 18px 8px 8px;
  background: var(--sq-yellow);
}

.project-visual::before {
  background: none;
}

.project-monogram {
  color: var(--sq-navy);
  text-shadow: 4px 4px 0 rgba(255, 250, 240, .95);
}

.eco-card {
  background: var(--sq-yellow);
}

.eco-chat { background: #cbe7ff; }
.eco-tools { background: #dff0a4; }
.eco-lexle { background: #ffcfc5; }
.eco-cosmic { background: #f8b8d0; }

.side-quest-band {
  grid-template-columns: minmax(250px, .95fr) minmax(360px, 1.2fr) minmax(260px, .85fr);
  min-height: 210px;
  align-items: stretch;
  color: #fffaf0;
  background: var(--sq-navy);
  border-radius: 24px;
  box-shadow: 10px 10px 0 rgba(10, 50, 89, .3), 0 24px 60px rgba(10, 50, 89, .22);
}

.side-quest-copy {
  padding: 30px;
}

.side-quest-copy .kicker {
  color: var(--sq-yellow);
}

.side-quest-copy h2 {
  color: #fffaf0;
  font-size: clamp(2rem, 3.2vw, 3.2rem);
  letter-spacing: 0;
}

.side-quest-copy p:not(.kicker) {
  color: rgba(255, 250, 240, .78);
}

.pizza-scoreboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  border-inline: 2px solid rgba(255, 250, 240, .26);
}

.pizza-scoreboard div {
  display: grid;
  gap: 8px;
  min-height: 100%;
  align-content: center;
  justify-items: center;
  padding: 24px 18px;
  text-align: center;
}

.pizza-scoreboard div + div {
  border-left: 2px solid rgba(255, 250, 240, .22);
}

.pizza-scoreboard span {
  color: rgba(255, 250, 240, .76);
  font-size: .76rem;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pizza-scoreboard strong {
  color: var(--sq-yellow);
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  line-height: 1;
}

.pizza-scoreboard small {
  color: var(--sq-apple);
  font-weight: 900;
  text-transform: uppercase;
}

.pizza-art {
  background:
    radial-gradient(circle at center, rgba(255, 250, 240, .9) 0 3px, transparent 4px) 0 0/30px 30px,
    var(--sq-coral);
}

.pizza-character {
  display: grid;
  width: 230px;
  height: 230px;
  place-items: center;
  border: 5px solid var(--sq-navy);
  border-radius: 42% 48% 45% 50%;
  background: var(--sq-cream);
  box-shadow: 16px 16px 0 rgba(10, 50, 89, .3);
  transform: rotate(9deg);
}

.pizza-character img {
  width: 150px;
  filter: none;
  transform: rotate(4deg);
}

.principles article > span {
  background: var(--sq-apple);
}

.contact-form {
  background: #fffaf0;
  box-shadow: 10px 10px 0 var(--sq-yellow);
}

.site-footer {
  background: #fff7ea;
}

.game-container {
  background: linear-gradient(#0A3259, #1E90FF);
  box-shadow: 12px 12px 0 var(--sq-yellow);
}

.heart-icon {
  fill: var(--sq-pink);
}

.lab-toolbar {
  background: rgba(255, 232, 200, .96);
}

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .hero h1 {
    font-size: clamp(3.1rem, 15vw, 5.1rem);
  }
  .hero-visual {
    min-height: 520px;
  }
  .sq-character-guide {
    bottom: 34px;
    width: 145px;
    height: 236px;
  }
  .sq-character-guide .character-head {
    left: 36px;
    width: 84px;
    height: 76px;
  }
  .sq-character-guide .character-body {
    left: 34px;
    top: 82px;
    width: 82px;
    height: 132px;
  }
  .sq-dragon {
    right: 28px;
    top: 72px;
  }
  .sq-wizard {
    left: 26px;
    top: 192px;
  }
  .rive-stage {
    inset: 110px 42px 128px;
  }
  .pizza-character {
    width: 190px;
    height: 190px;
  }
  .side-quest-band {
    grid-template-columns: 1fr;
  }
  .pizza-scoreboard {
    grid-template-columns: 1fr;
    border-block: 2px solid rgba(255, 250, 240, .22);
    border-inline: 0;
  }
  .pizza-scoreboard div + div {
    border-left: 0;
    border-top: 2px solid rgba(255, 250, 240, .18);
  }
  .prop-compass {
    right: 36px;
    bottom: 132px;
    transform: scale(.8);
  }
  .prop-satchel {
    left: 28px;
    bottom: 70px;
    transform: scale(.76);
  }
  .prop-lantern {
    right: 26px;
    top: 174px;
    transform: scale(.72);
  }
}

/* Final reference-spec precedence. Keep this block last. */
body { background: var(--reference-cream); }
.site-header { position: relative; top: auto; width: min(1180px, calc(100vw - 40px)); min-height: 86px; margin: 0 auto; padding: 12px 0; border: 0; background: transparent; box-shadow: none; }
.primary-nav .button, .hero .button { border-color: var(--reference-navy); }
.primary-nav .button, .hero .button-primary { color: white; background: var(--reference-blue); }
.hero { grid-template-columns: minmax(420px, .84fr) minmax(540px, 1.16fr); gap: 18px; min-height: 404px; padding-block: 12px 0; align-items: end; }
.hero h1 { max-width: 480px; font-size: clamp(56px, 4.1vw, 72px); line-height: .93; letter-spacing: 0; }
.hero h1 .hero-accent { color: var(--reference-coral); text-shadow: none; -webkit-text-stroke: 0; }
.hero-lede { color: var(--reference-navy); }
.reference-hero-art { position: relative; height: 404px; min-height: 0; border: 0; border-radius: 0 0 18px 0; background: transparent; box-shadow: none; overflow: hidden; }
.reference-hero-art::before, .reference-hero-art::after { display: none; }
.reference-hero-art img { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: center bottom; mix-blend-mode: normal; }
.side-quest-band { grid-template-columns: 210px minmax(300px, .95fr) minmax(460px, 1.2fr); min-height: 136px; padding: 0; border: 0; border-radius: 16px; background: var(--reference-navy); box-shadow: none; }
.side-quest-copy { display: grid; align-content: center; padding: 18px 24px; }
.side-quest-copy .kicker { margin: 0; color: var(--reference-yellow); font-size: 20px; letter-spacing: 0; }
.side-quest-copy h2 { margin: 2px 0 12px; color: white; font-size: 15px; line-height: 1.15; letter-spacing: 0; }
.side-quest-copy .button { width: max-content; min-height: 36px; padding: 0 18px; color: white; border: 0; border-radius: 7px; background: var(--reference-coral); box-shadow: none; font-size: 11px; }
.pizza-art { min-height: 136px; border: 0; background: var(--reference-navy); }
.pizza-art img { width: 100%; height: 100%; object-fit: cover; filter: none; transform: none; }
.pizza-scoreboard { grid-template-columns: repeat(3, 1fr); border: 0; }
.pizza-scoreboard div { min-height: 136px; }
.pizza-scoreboard div + div { border-top: 0; border-left: 1px solid rgba(255,255,255,.32); }
.about-grid::after { content: ""; position: absolute; right: 4%; bottom: 0; width: 220px; height: 310px; background: url('/public/sidequest-assets/forgekeeper.png') center bottom/contain no-repeat; mix-blend-mode: normal; pointer-events: none; }

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; }
  .side-quest-band { grid-template-columns: 190px 1fr; }
  .pizza-scoreboard { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .site-header, .side-quest-band { width: min(100% - 24px, 1180px); }
  .hero { grid-template-columns: 1fr; gap: 0; min-height: 0; padding-top: 18px; }
  .hero h1 { font-size: clamp(48px, 14vw, 64px); }
  .reference-hero-art { height: 260px; min-height: 0; border-radius: 0 0 12px 12px; }
  .side-quest-band { grid-template-columns: 1fr; }
  .pizza-art { min-height: 118px; }
  .pizza-scoreboard { grid-column: auto; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255,255,255,.25); }
  .pizza-scoreboard div { min-height: 112px; padding: 14px 6px; }
  .pizza-scoreboard div + div { border-top: 0; border-left: 1px solid rgba(255,255,255,.2); }
  .pizza-scoreboard strong { font-size: 1.2rem; }
  .pizza-scoreboard span, .pizza-scoreboard small { font-size: 8px; }
  .about-grid::after { display: none; }
}


/* Shared quiet-stage treatment must remain after the reference-spec overrides. */
.reference-hero-art {
  isolation: isolate;
  border: 1px solid rgba(10, 50, 89, .14);
  border-bottom: 0;
  background: rgba(255, 250, 241, .72);
}
.reference-hero-art::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 12%;
  right: 7%;
  bottom: 0;
  height: 76%;
  display: block;
  border: 1px solid rgba(10, 50, 89, .13);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  background: rgba(220, 238, 255, .36);
}
.reference-hero-art::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 5%;
  right: 2%;
  bottom: 0;
  height: 1px;
  display: block;
  background: rgba(10, 50, 89, .2);
}
.reference-hero-art .hero-character {
  position: absolute;
  z-index: 2;
  inset: auto;
  bottom: 0;
  display: block;
  width: auto;
  min-height: 0;
  object-fit: contain;
  object-position: center bottom;
}
.reference-hero-art .hero-tinkerer { left: 9%; height: 87%; }
.reference-hero-art .hero-forgekeeper { right: 2%; height: 98%; }
.about-grid::after { background-image: url('/public/sidequest-assets/forgekeeper-cutout.png'); }

@media (max-width: 760px) {
  .reference-hero-art { border-radius: 12px 12px 0 0; }
  .reference-hero-art::before { left: 5%; right: 5%; height: 72%; }
  .reference-hero-art .hero-tinkerer { left: 3%; height: 88%; }
  .reference-hero-art .hero-forgekeeper { right: -8%; height: 100%; }
}

/* Live homepage cleanup overrides. Keep this block last. */
.reference-hero-art .hero-scene {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center bottom;
}
.side-quest-band {
  grid-template-columns: minmax(240px, 300px) minmax(320px, 380px);
  justify-content: center;
  min-height: 150px;
  overflow: hidden;
}
.side-quest-copy { padding: 22px 24px; }
.side-quest-copy .kicker { font-size: 12px; letter-spacing: .09em; }
.side-quest-copy h2 { margin: 4px 0 5px; font-size: 22px; }
.side-quest-copy > p:not(.kicker) {
  max-width: 310px;
  margin: 0 0 14px;
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
  line-height: 1.35;
}
.pizza-art {
  width: 100%;
  max-width: 380px;
  min-height: 150px;
  overflow: hidden;
  border-left: 1px solid rgba(255, 255, 255, .18);
}
.pizza-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
}
.pathway-card img {
  width: 92px;
  height: 102px;
  padding: 9px;
  object-fit: contain;
  object-position: center;
  transform: none;
  border-radius: 9px;
}
.pathway-learn img { background: #e7f2ff; }
.pathway-chat img { background: #ffe5ef; }
.pathway-tools img { background: #fff0bd; }
.pathway-projects img { background: #e8f3c5; }

@media (max-width: 760px) {
  .side-quest-band { grid-template-columns: 1fr; }
  .side-quest-copy { padding: 22px 24px 18px; }
  .pizza-art { max-width: none; min-height: 138px; border-top: 1px solid rgba(255, 255, 255, .18); border-left: 0; }
  .pathway-card img { width: 82px; height: 94px; padding: 8px; }
}
