:root {
  --terre: #6f1d1b;
  --argile: #bb9457;
  --boue: #432818;
  --ecorce: #99582a;
  --beige: #ffe6a7;
  --logo-yellow: #ffe06a;
  --bg: #f7dda0;
  --bg-deep: #edcb7e;
  --surface: rgba(255, 239, 193, .88);
  --surface-solid: #fbe5ae;
  --surface-alt: #e9c781;
  --text: #432818;
  --muted: #735038;
  --accent: #6f1d1b;
  --accent-2: #99582a;
  --line: rgba(67, 40, 24, .27);
  --shadow: 0 12px 34px rgba(67, 40, 24, .12);
  --font-scale: 1;
  --serif: Georgia, "Times New Roman", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
}

[data-theme="library"] {
  --bg: #2f1c11; --bg-deep: #432818; --surface: rgba(111, 29, 27, .92); --surface-solid: #6f1d1b;
  --surface-alt: #5b241d; --text: #ffe6a7; --muted: #dfc68d; --accent: #bb9457; --accent-2: #ffe6a7;
  --line: rgba(255, 230, 167, .25); --shadow: 0 14px 38px rgba(0, 0, 0, .3);
}

[data-theme="earth"] {
  --bg: #7d431f; --bg-deep: #99582a; --surface: rgba(111, 29, 27, .91); --surface-solid: #6f1d1b;
  --surface-alt: #7b2f22; --text: #ffe6a7; --muted: #ecd29b; --accent: #bb9457; --accent-2: #ffe6a7;
  --line: rgba(255, 230, 167, .25); --shadow: 0 14px 38px rgba(67, 40, 24, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: calc(16px * var(--font-scale)); }
body { margin: 0; min-width: 320px; color: var(--text); background: var(--bg); font-family: var(--sans); line-height: 1.65; transition: color .25s, background .25s; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--argile); outline-offset: 3px; }
h1, h2, h3, h4, blockquote { font-family: var(--serif); line-height: 1.14; }
h1, h2, h3, p { margin-top: 0; }
h2 { font-size: clamp(2rem, 4vw, 3.4rem); margin-bottom: .7rem; letter-spacing: -.025em; }
h3 { font-size: 1.45rem; }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 1rem; left: 1rem; z-index: 100; transform: translateY(-160%); padding: .7rem 1rem; background: var(--surface-solid); color: var(--text); }
.skip-link:focus { transform: none; }
.paper-noise { position: fixed; inset: 0; pointer-events: none; opacity: .16; z-index: -1; background-image: radial-gradient(rgba(67,40,24,.26) .55px, transparent .7px), radial-gradient(rgba(255,255,255,.28) .5px, transparent .7px), repeating-linear-gradient(7deg, transparent 0 13px, rgba(67,40,24,.035) 14px 15px); background-size: 7px 7px, 11px 11px, 100% 16px; }

.site-header { padding: 2.2rem clamp(1rem, 5vw, 5rem) 1.4rem; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--bg-deep) 58%, transparent), transparent); }
.brand-block { display: flex; justify-content: center; align-items: center; gap: 1.3rem; text-align: left; }
.brand-logo { width: clamp(68px, 8vw, 94px); filter: drop-shadow(0 6px 8px rgba(67,40,24,.2)); }
.brand-block h1 { margin: .1rem 0 .25rem; font-size: clamp(1.65rem, 4vw, 3.25rem); letter-spacing: .16em; }
.brand-kicker, .section-eyebrow { margin-bottom: .25rem; color: var(--accent); font-size: .7rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.brand-subtitle { margin: 0; color: var(--muted); font-family: var(--serif); font-style: italic; }
.primary-nav { display: flex; justify-content: center; gap: .25rem; margin: 1.8rem auto 1rem; max-width: 1120px; border-block: 1px solid var(--line); padding: .45rem; overflow-x: auto; scrollbar-width: thin; }
.nav-link { flex: 0 0 auto; border: 0; background: transparent; padding: .65rem .85rem; color: var(--muted); font-size: .82rem; font-weight: 700; letter-spacing: .04em; }
.nav-link:hover, .nav-link.active { color: var(--accent); background: color-mix(in srgb, var(--surface) 58%, transparent); }
.nav-link.active::after { content: ""; display: block; width: 18px; margin: .35rem auto -.35rem; border-bottom: 2px solid currentColor; }
.search-wrap { display: flex; align-items: center; gap: .7rem; max-width: 680px; margin: 0 auto; padding: .65rem 1rem; border: 1px solid var(--line); background: var(--surface); box-shadow: inset 0 1px rgba(255,255,255,.15); }
.search-wrap input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; }
.search-wrap kbd { border: 1px solid var(--line); padding: .05rem .4rem; border-radius: 4px; color: var(--muted); }

main { width: min(1240px, calc(100% - 2rem)); min-height: 60vh; margin: 0 auto; padding: clamp(2rem, 5vw, 5rem) 0 6rem; }
.view { display: none; animation: pageIn .4s ease both; }
.view.active { display: block; }
.archival-panel { position: relative; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.archival-panel::after { content: ""; position: absolute; inset: 5px; pointer-events: none; border: 1px solid color-mix(in srgb, var(--line) 45%, transparent); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1.25rem; }
.daily-thought, .explore-callout { min-height: 260px; padding: clamp(1.5rem, 4vw, 3rem); overflow: hidden; }
.daily-thought blockquote { margin: 1.2rem 0; font-size: clamp(1.55rem, 3.3vw, 2.5rem); }
.daily-thought cite { display: block; margin-top: 1rem; color: var(--accent); font-family: var(--sans); font-size: .84rem; font-style: normal; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.explore-callout { display: flex; flex-direction: column; justify-content: center; background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--surface-alt) 65%, transparent)); }
.explore-callout h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); max-width: 12em; }
.giant-initial { position: absolute; right: .5rem; bottom: -2.5rem; opacity: .07; color: var(--accent); font: 13rem/1 var(--serif); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: clamp(3rem, 7vw, 5.5rem) 0 1.25rem; border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
.section-heading h2, .section-heading h3 { margin: 0; }
.compact-heading { margin: 0 0 1rem; }
.page-intro { max-width: 760px; margin: 0 0 2rem; }
.page-intro p:last-child { color: var(--muted); font-family: var(--serif); font-size: 1.08rem; }

.primary-button, .secondary-button, .text-button, .icon-button { position: relative; z-index: 1; border: 0; transition: transform .2s, background .2s, color .2s; }
.primary-button { align-self: flex-start; padding: .78rem 1rem; background: var(--accent); color: var(--beige); font-weight: 800; }
.primary-button:hover { transform: translateY(-2px); background: var(--ecorce); }
.primary-button.compact { padding: .55rem .8rem; }
.secondary-button { border: 1px solid var(--line); padding: .55rem .8rem; background: var(--surface-solid); font-weight: 700; }
.secondary-button:hover { background: var(--surface-alt); }
.text-button { padding: .35rem .1rem; background: transparent; color: var(--accent); font-weight: 800; }
.text-button:hover { color: var(--accent-2); }
.text-button.danger { color: #a3312e; }
.icon-button { display: inline-grid; place-items: center; width: 42px; height: 42px; background: transparent; border: 1px solid var(--line); }

.thinker-list { display: grid; gap: 1.15rem; }
.thinker-card { position: relative; display: grid; grid-template-columns: minmax(190px, 25%) 1fr 52px; min-height: 280px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 4px 18px rgba(67,40,24,.08); overflow: hidden; transition: transform .25s, box-shadow .25s, background .25s; }
.thinker-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); background: color-mix(in srgb, var(--surface-solid) 92%, white); }
.thinker-card::before { content: attr(data-index); position: absolute; right: 4rem; bottom: -2.1rem; color: var(--accent); opacity: .045; font: 8rem/1 var(--serif); }
.portrait-panel { position: relative; min-height: 280px; border-right: 1px solid var(--line); background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 80%, black), var(--ecorce)); overflow: hidden; }
.portrait-panel svg { width: 100%; height: 100%; display: block; }
.archive-number { position: absolute; left: .75rem; top: .7rem; padding: .2rem .45rem; color: var(--beige); background: rgba(67,40,24,.7); font-size: .65rem; letter-spacing: .15em; }
.card-body { padding: 1.45rem clamp(1rem, 3vw, 2rem); }
.card-title-row { display: flex; justify-content: space-between; gap: 1rem; }
.thinker-card h3 { margin: 0 0 .25rem; font-size: clamp(1.55rem, 3vw, 2.15rem); }
.years { color: var(--accent); font-family: var(--serif); font-weight: 700; }
.discipline-line { margin: .1rem 0 .9rem; color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.card-description { max-width: 70ch; margin-bottom: .8rem; }
.meta-line { margin: .35rem 0 0; font-size: .86rem; color: var(--muted); }
.meta-line strong { color: var(--text); }
.card-actions { display: flex; flex-direction: column; align-items: center; gap: .55rem; padding: 1rem .45rem; border-left: 1px solid var(--line); background: color-mix(in srgb, var(--surface-alt) 38%, transparent); }
.card-actions button { width: 38px; height: 38px; border: 1px solid transparent; background: transparent; font-size: 1.15rem; }
.card-actions button:hover { border-color: var(--line); background: var(--surface); }
.favorite-button.active { color: var(--logo-yellow); text-shadow: 0 1px 1px var(--boue); }
.card-open-overlay { position: absolute; inset: 0 52px 0 0; border: 0; background: transparent; cursor: pointer; }
.card-open-overlay:focus-visible { outline-offset: -5px; }
.toolbar, .visual-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 1rem; padding: 1rem; margin-bottom: 1rem; }
.toolbar label, .visual-toolbar label, .setting-content label { display: grid; gap: .3rem; color: var(--muted); font-size: .76rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
select, .visual-toolbar input, .setting-content input[type="url"], .year-controls input { border: 1px solid var(--line); padding: .55rem .7rem; background: var(--surface-solid); }
.grow { flex: 1; }
.chip-group { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { border: 1px solid var(--line); padding: .42rem .72rem; background: transparent; font-size: .78rem; font-weight: 700; }
.chip:hover, .chip.active { color: var(--beige); border-color: var(--accent); background: var(--accent); }
.result-count, .muted { color: var(--muted); }
.empty-state { padding: 4rem 1rem; text-align: center; color: var(--muted); }
.empty-state > span { font-size: 3rem; }

.network-shell, .constellation-shell { position: relative; min-height: 620px; overflow: hidden; }
#ideas-network, #constellation-svg { display: block; width: 100%; height: 620px; touch-action: manipulation; }
.network-node { cursor: pointer; }
.network-node circle, .network-node rect, .network-node polygon { fill: var(--surface-solid); stroke: var(--accent); stroke-width: 2; transition: opacity .2s, stroke-width .2s; }
.network-node text { fill: var(--text); font: 700 12px var(--serif); pointer-events: none; }
.network-node.dimmed, .network-link.dimmed, .constellation-node.dimmed { opacity: .16; }
.network-node.selected circle { fill: var(--accent); stroke: var(--argile); stroke-width: 4; }
.network-node.selected text { fill: var(--beige); }
.network-link { fill: none; stroke: var(--argile); stroke-width: 1.7; opacity: .75; }
.network-detail { position: absolute; right: 1rem; bottom: 1rem; width: min(300px, calc(100% - 2rem)); z-index: 2; padding: 1rem; border: 1px solid var(--line); background: var(--surface-solid); box-shadow: var(--shadow); }
.network-detail:empty { display: none; }
.network-detail h3 { margin-bottom: .3rem; }
.network-detail p { margin-bottom: .5rem; font-size: .87rem; }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; padding: 1rem 0; color: var(--muted); font-size: .78rem; }
.legend span::before { content: ""; display: inline-block; width: 18px; margin-right: .4rem; border-top: 2px solid var(--argile); vertical-align: middle; }
.idea-results { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.idea-pill { border: 1px solid var(--line); padding: .45rem .7rem; background: var(--surface); }

.time-console { padding: 1.4rem; text-align: center; }
.era-shortcuts { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin-bottom: 1.25rem; }
.era-shortcuts button { border: 0; border-bottom: 1px solid var(--line); padding: .3rem .5rem; color: var(--muted); background: transparent; }
.era-shortcuts button:hover { color: var(--accent); border-color: var(--accent); }
.year-controls { display: flex; justify-content: center; align-items: end; gap: 1rem; }
.year-controls label { display: grid; gap: .2rem; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.year-controls input { width: 130px; text-align: center; font: 700 1.5rem var(--serif); }
.timeline-range { width: min(900px, 100%); margin: 1.5rem auto .3rem; accent-color: var(--accent); }
.range-labels { display: flex; justify-content: space-between; width: min(900px, 100%); margin: 0 auto 1rem; color: var(--muted); }
.range-labels strong { color: var(--accent); font: 2rem var(--serif); }
.time-grid { display: grid; grid-template-columns: 1fr 320px; gap: 1.25rem; margin-top: 2rem; }
.living-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.living-card { display: grid; grid-template-columns: 60px 1fr; gap: .8rem; align-items: center; border: 1px solid var(--line); padding: .8rem; background: var(--surface); cursor: pointer; text-align: left; }
.living-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.mini-portrait { width: 60px; height: 60px; border-radius: 50%; overflow: hidden; background: var(--accent); }
.living-card h4 { margin: 0; font-size: 1rem; }
.living-card p { margin: .1rem 0 0; color: var(--muted); font-size: .78rem; }
.world-events { align-self: start; padding: 1.25rem; }
.event-item { position: relative; padding-left: 1.2rem; margin: 1rem 0; }
.event-item::before { content: ""; position: absolute; left: 0; top: .5rem; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.event-item small { color: var(--muted); }
.comparison { margin-top: 2rem; padding: 1.4rem; }
.compare-controls { display: flex; gap: .7rem; align-items: center; }
.compare-controls select { flex: 1; }
.life-bars { position: relative; margin: 1.5rem 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.life-row { display: grid; grid-template-columns: 190px 1fr; gap: 1rem; align-items: center; margin: .8rem 0; }
.life-track { position: relative; height: 16px; background: color-mix(in srgb, var(--line) 35%, transparent); }
.life-segment { position: absolute; top: 0; height: 100%; min-width: 3px; background: var(--accent); }

.constellation-controls { align-items: center; flex-wrap: wrap; }
.discipline-filters { display: flex; flex: 1; flex-wrap: wrap; gap: .45rem; }
.discipline-filters label { display: flex; align-items: center; gap: .3rem; text-transform: none; }
.constellation-axis { stroke: var(--line); }
.constellation-axis-label { fill: var(--muted); font: 11px var(--sans); }
.constellation-link { stroke: var(--argile); stroke-width: 1.5; opacity: .45; }
.constellation-node { cursor: pointer; transition: opacity .2s; }
.constellation-node .shape { fill: var(--surface-solid); stroke: var(--accent); stroke-width: 2; }
.constellation-node.highlight .shape { fill: var(--accent); stroke: var(--logo-yellow); stroke-width: 3; }
.constellation-node text { fill: var(--text); font: 700 11px var(--serif); }
.map-tooltip { position: absolute; z-index: 4; max-width: 240px; pointer-events: none; padding: .75rem; border: 1px solid var(--line); background: var(--surface-solid); box-shadow: var(--shadow); font-size: .8rem; }

footer { display: flex; justify-content: space-between; gap: 1rem; padding: 2rem clamp(1rem, 5vw, 5rem) 5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
footer nav { display: flex; gap: 1rem; }
footer button { border: 0; padding: 0; background: transparent; color: inherit; }

.settings-toggle { position: fixed; z-index: 30; left: 1.15rem; bottom: 1.15rem; display: grid; align-content: center; gap: 5px; width: 54px; height: 54px; border: 1px solid var(--argile); border-radius: 50%; padding: 14px; background: var(--boue); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.settings-toggle span { display: block; width: 100%; height: 2px; background: var(--beige); transition: transform .25s, opacity .25s; }
.settings-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.settings-toggle.open span:nth-child(2) { opacity: 0; }
.settings-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(28,16,10,.55); backdrop-filter: blur(2px); }
.settings-panel { position: fixed; inset: 0 auto 0 0; z-index: 50; width: min(420px, 92vw); padding: 1.3rem; overflow-y: auto; color: var(--text); background: var(--bg); box-shadow: 12px 0 50px rgba(0,0,0,.25); transform: translateX(-105%); transition: transform .3s ease; }
.settings-panel.open { transform: none; }
.settings-header { display: flex; justify-content: space-between; align-items: start; border-bottom: 1px solid var(--line); margin-bottom: 1rem; padding-bottom: 1rem; }
.settings-header h2 { margin: 0; font-size: 2rem; }
.accordion details { border-bottom: 1px solid var(--line); }
.accordion summary { padding: 1rem .2rem; font-family: var(--serif); font-size: 1.05rem; font-weight: 700; cursor: pointer; }
.setting-content { display: grid; gap: 1rem; padding: 0 .2rem 1.2rem; color: var(--muted); }
.theme-options, .language-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.theme-options button, .language-options button { border: 1px solid var(--line); padding: .55rem; background: var(--surface); }
.theme-options button.active, .language-options button.active { outline: 2px solid var(--accent); }
.theme-swatch { display: block; height: 38px; margin-bottom: .35rem; border: 1px solid rgba(67,40,24,.3); }
.theme-swatch.parchment { background: linear-gradient(135deg, #ffe6a7 50%, #bb9457 50%); }
.theme-swatch.library { background: linear-gradient(135deg, #432818 50%, #6f1d1b 50%); }
.theme-swatch.earth { background: linear-gradient(135deg, #99582a 50%, #6f1d1b 50%); }
.language-options { grid-template-columns: repeat(2, 1fr); }
.youtube-setting { display: grid; gap: .65rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.button-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.status-message { min-height: 1.2rem; margin: 0; font-size: .8rem; }
#youtube-player-wrap { width: 100%; min-height: 180px; }
#youtube-player { width: 100%; min-height: 180px; }
.switch-row { display: flex !important; justify-content: space-between; align-items: center; }

.music-player { position: fixed; z-index: 25; right: 1rem; bottom: 1rem; display: flex; align-items: center; gap: .55rem; width: min(360px, calc(100vw - 90px)); border: 1px solid var(--argile); padding: .45rem; color: var(--beige); background: rgba(67,40,24,.96); box-shadow: 0 8px 24px rgba(0,0,0,.22); }
.music-player .icon-button { border-color: rgba(255,230,167,.25); color: var(--beige); }
.track-meta { min-width: 0; flex: 1; line-height: 1.25; }
.track-meta small { display: block; color: var(--argile); }
.track-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.music-player input { width: 72px; accent-color: var(--argile); }

.thinker-dialog { width: min(1100px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 1px solid var(--argile); color: var(--text); background: var(--bg); box-shadow: 0 25px 90px rgba(0,0,0,.5); }
.thinker-dialog::backdrop { background: rgba(35,20,12,.7); backdrop-filter: blur(4px); }
.modal-close { position: sticky; z-index: 10; top: 1rem; float: right; margin: 1rem 1rem 0 0; color: var(--beige); background: rgba(67,40,24,.85); }
.modal-hero { display: grid; grid-template-columns: minmax(240px, 34%) 1fr; min-height: 430px; border-bottom: 1px solid var(--line); }
.modal-portrait { background: linear-gradient(145deg, var(--terre), var(--ecorce)); }
.modal-portrait svg { width: 100%; height: 100%; display: block; }
.modal-heading { display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem, 6vw, 5rem); }
.modal-heading h2 { margin: .3rem 0 .6rem; font-size: clamp(2.5rem, 7vw, 5rem); }
.modal-heading .lead { font-family: var(--serif); font-size: 1.2rem; }
.modal-body { display: grid; grid-template-columns: 1.45fr .8fr; gap: clamp(1.5rem, 5vw, 4rem); padding: clamp(1.5rem, 5vw, 4rem); }
.modal-section { margin-bottom: 2.5rem; }
.modal-section h3 { border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.takeaways { border-left: 4px solid var(--accent); padding: 1.1rem 1.3rem; background: var(--surface); }
.takeaways li { margin: .4rem 0; }
.works-list, .timeline-list, .quote-list { padding: 0; list-style: none; }
.works-list li, .timeline-list li { display: grid; grid-template-columns: 64px 1fr; gap: .7rem; border-bottom: 1px solid var(--line); padding: .7rem 0; }
.works-list strong, .timeline-list strong { color: var(--accent); }
.quote-list li { border-left: 2px solid var(--argile); margin: 1rem 0; padding-left: 1rem; font-family: var(--serif); font-style: italic; }
.connection-groups { display: grid; gap: 1.2rem; }
.connection-group h4 { margin: 0 0 .5rem; color: var(--accent); font: 800 .72rem var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.connection-button { display: flex; width: 100%; align-items: center; gap: .7rem; border: 1px solid var(--line); margin: .4rem 0; padding: .55rem; background: var(--surface); text-align: left; }
.connection-button:hover { transform: translateX(3px); border-color: var(--accent); }
.idea-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.toast-region { position: fixed; z-index: 100; right: 1rem; top: 1rem; display: grid; gap: .5rem; }
.toast { padding: .75rem 1rem; color: var(--beige); background: var(--boue); box-shadow: var(--shadow); animation: pageIn .25s ease both; }

@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }

@media (max-width: 900px) {
  .hero-grid, .time-grid, .modal-body { grid-template-columns: 1fr; }
  .thinker-card { grid-template-columns: 210px 1fr 48px; }
  .time-grid .world-events { order: -1; }
  .world-events { width: 100%; }
  .primary-nav { justify-content: flex-start; }
}

@media (max-width: 650px) {
  .site-header { padding-top: 1.2rem; }
  .brand-block { flex-direction: column; gap: .5rem; text-align: center; }
  .brand-kicker { display: none; }
  .brand-block h1 { font-size: 1.48rem; }
  .brand-subtitle { font-size: .85rem; }
  .primary-nav { margin-top: 1rem; justify-content: flex-start; }
  main { width: min(100% - 1.1rem, 1240px); padding-top: 2rem; }
  .hero-grid { gap: .8rem; }
  .daily-thought, .explore-callout { min-height: 230px; }
  .section-heading { align-items: start; flex-direction: column; }
  .thinker-card { grid-template-columns: 1fr 48px; }
  .portrait-panel { grid-column: 1 / -1; min-height: 245px; border-right: 0; border-bottom: 1px solid var(--line); }
  .card-body { grid-column: 1; padding: 1.15rem; }
  .card-actions { grid-column: 2; }
  .card-open-overlay { inset: 0 48px 0 0; }
  .toolbar, .visual-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar label select { width: 100%; }
  .network-shell, .constellation-shell { min-height: 520px; overflow-x: auto; }
  #ideas-network, #constellation-svg { min-width: 720px; height: 520px; }
  .living-grid { grid-template-columns: 1fr; }
  .compare-controls { align-items: stretch; flex-direction: column; }
  .life-row { grid-template-columns: 1fr; gap: .3rem; }
  .modal-hero { grid-template-columns: 1fr; }
  .modal-portrait { min-height: 320px; }
  .modal-heading { padding: 1.5rem; }
  .modal-heading h2 { font-size: 2.7rem; }
  footer { flex-direction: column; padding-bottom: 6rem; }
  .music-player { right: .55rem; bottom: .55rem; width: calc(100vw - 77px); }
  .music-player input { display: none; }
  .settings-toggle { left: .55rem; bottom: .55rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
