@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400;1,6..72,500&display=swap');
:root { --serif: 'Newsreader', 'Iowan Old Style', Baskerville, Georgia, serif; --mono: 'DM Mono', ui-monospace, monospace; --gutter: clamp(1.5rem, 6vw, 7rem); --paper: #f5dce4; --ink: #51263b; --muted: #815569; --accent: #a44669; --thread: #c67d9b; --prose: clamp(1.15rem, 1rem + .3vw, 1.4rem); --quotation: clamp(1.45rem, 2.5vw, 1.9rem); --display: clamp(2.1rem, 4.4vw, 3.6rem); --turn: clamp(1.8rem, 3.6vw, 3rem); color-scheme: light; }
* { box-sizing: border-box; }
html { background: #f5dce4; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--prose)/1.5 var(--serif); transition: background-color 550ms, color 550ms; }
body[data-tone="serious"] { --paper: #28242d; --ink: #f1e7ed; --muted: #bca8b5; --accent: #efb3cd; --thread: #dc9ebd; color-scheme: dark; }
body[data-sunrise="rising"], body[data-sunrise="reset"], body[data-darkening="falling"], body[data-darkening="reset"] { transition: none; }
body[data-tone="attention"] { --paper: #faf9f2; --ink: #293c38; --muted: #677973; --accent: #39776d; --thread: #75968b; color-scheme: light; }
::selection { background: #a44669; color: white; }
a { color: inherit; text-underline-offset: .25em; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
p, figure, blockquote { margin: 0; }
p + p { margin-top: 1.2em; }
h1, h2, h3 { font-weight: 400; line-height: 1.08; margin: 0; text-wrap: balance; }
em { font-weight: 400; color: var(--accent); }
.skip-link, .visually-hidden { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; padding: 0; overflow: hidden; white-space: nowrap; }
.skip-link { position: fixed; z-index: 30; top: 1rem; left: 1rem; }
.skip-link:focus { clip-path: none; width: auto; height: auto; padding: .75rem 1rem; background: var(--paper); }
#net-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
article > * { position: relative; }
.copy, .scene-heading, .lens-pair, .chat-app, .attention-panel, figcaption, .thought-cloud { position: relative; z-index: 2; }
.copy { width: 100%; max-width: 36rem; margin: auto; }
.passage { padding: clamp(4rem, 10vh, 7rem) var(--gutter); }
.byline, .eyebrow, .scroll-cue, figcaption { font: .65rem/1.5 var(--mono); letter-spacing: .045em; color: var(--muted); }
.eyebrow { margin-bottom: 1.8rem; }
.opening { min-height: 100svh; padding: 2rem var(--gutter) 2rem max(var(--gutter), 10rem); display: flex; flex-direction: column; max-width: 105rem; margin: auto; }
.opening-ribbon { position: absolute; inset: 0; overflow: hidden; opacity: .4; pointer-events: none; }
.opening-ribbon svg { width: 100%; height: 100%; }
.opening-ribbon path { fill: none; stroke: #bb7890; stroke-width: .7; }
.opening > :not(.opening-ribbon) { position: relative; z-index: 2; }
.byline span { padding: 0 .5em; }
.opening-title { margin-top: clamp(3rem, 8vh, 6rem); }
h1 { font-size: clamp(2.7rem, 6vw, 5.5rem); letter-spacing: -.045em; }
.subtitle { max-width: 30rem; margin-top: .8rem; color: var(--muted); font-size: 1rem; }
.opening-line { margin: auto 0; padding: 4rem 0; }
.opening-line h2 { font-size: clamp(2.8rem, 6.5vw, 6rem); line-height: 1.03; letter-spacing: -.035em; }
.opening-line > p { margin-top: 1.4rem; font-style: italic; color: var(--muted); }
.scroll-cue span { margin-left: 1.5rem; }
.intimacy .copy { max-width: 38rem; }
.intimacy .copy > p:first-child { font-size: inherit; line-height: inherit; }
.aside { color: var(--muted); margin-top: 3rem; }
.reaction { font-size: var(--quotation); line-height: 1.3; margin-top: 2rem; }
.jake { padding-top: 4rem; padding-bottom: 1rem; }
.jake-net-bridge { width: calc(100% - var(--gutter) - var(--gutter)); max-width: 36rem; margin: 0 auto; }
.jake-net-bridge svg { display: block; width: 100%; height: auto; }
.jake-net-bridge path { stroke-width: 1; vector-effect: non-scaling-stroke; }
.net-idea { padding-top: 1rem; }
.jake h2 { font-size: var(--display); margin-bottom: 2rem; }
.jake #novel-heading { margin-top: 2rem; }
.jake h3 { font-size: var(--quotation); line-height: 1.3; margin: 3rem 0 1.5rem; }
.jake-connection { margin-top: 2.5rem; }
.novel-intro { font-size: inherit; line-height: inherit; margin: 2rem 0; }
.novel-intro cite { display: inline-block; color: var(--accent); }
.net-idea h2 { font-size: var(--turn); line-height: 1.3; margin: 2rem 0; }
.net-substitution { margin-top: 3rem; font-style: italic; }
.jake-decisions { margin: 2rem 0; color: var(--muted); }
.jake-decisions p { margin: .4rem 0; }
.jake-decisions p:nth-child(2) { padding-left: 1rem; }
.jake-decisions p:nth-child(3) { padding-left: 2rem; }
.jake-sense { font-size: inherit; line-height: inherit; margin-top: 2rem; }
.jake-problem { color: var(--accent); margin-top: 1.6rem; font-style: italic; font-size: var(--turn); line-height: 1.2; }
.diagnostic-conclusion { font-size: var(--turn); line-height: 1.2; margin-top: 2rem; text-wrap: balance; }
.language-world span { display: block; font-size: var(--turn); line-height: 1.2; margin-top: .6em; }
.net-intro { margin-top: 3rem; }
.scene-heading { max-width: 70rem; margin: 0 auto 2.5rem; }
.scene-heading h2 { font-size: var(--quotation); line-height: 1.3; }
.scene-heading > p:last-child:not(.eyebrow) { color: var(--muted); margin-top: 1.5rem; }
.chat-scene { padding: 4rem var(--gutter) 3rem; scroll-margin-top: 2rem; }
.chat-composition { max-width: 78rem; margin: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.chat-room, .window-room { position: relative; min-width: 0; }
.chat-room img, .window-room img { display: block; width: 100%; height: auto; }
.chat-room figcaption { margin-top: 1rem; text-align: center; }
.chat-room img { opacity: .86; transition: opacity 700ms; }
body[data-chat-step="3"] .chat-room img { opacity: .45; }
.chat-app { background: #352e39; color: #f5edf2; border: 1px solid #6d5768; border-radius: .7rem; overflow: hidden; min-width: 0; font-family: var(--serif); box-shadow: 0 1rem 3rem #160f2020; }
.chat-topbar { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.25rem; border-bottom: 1px solid #695464; font: .65rem/1.5 var(--mono); }
.chat-mark { font-size: 1.5rem; color: #efb3cd; }

.chat-log { padding: 1.6rem 1.25rem; }
.message { margin-bottom: 1.8rem; }
.message .speaker { display: block; font: .62rem/1.4 var(--mono); margin-bottom: .55rem; color: #c4adbc; }
.message p { font-size: clamp(1.1rem, 1.7vw, 1.35rem); line-height: 1.4; }
.message p + p { margin-top: .75rem; }
.message--me { margin-left: 18%; padding: .9rem 1rem; background: #544151; border-radius: .6rem .6rem 0 .6rem; }
.message--me .speaker { color: #ebc5d8; }
.chat-controls { display: flex; align-items: center; justify-content: flex-end; gap: .7rem; min-height: 5rem; border-top: 1px solid #695464; padding: .9rem 1.25rem; }
button, #chat-leave { min-height: 44px; border: 1px solid currentColor; padding: .75rem 1rem; background: none; color: var(--accent); font: .67rem/1.4 var(--mono); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .9rem; }
.chat-controls button, #chat-leave { color: #efb3cd; }
button:hover, #chat-leave:hover { background: #a4466912; }
button:disabled { opacity: .65; cursor: default; }
#chat-next, #attention-next { display: none; }
#chat-leave { border: 0; }
.enhanced #chat-next, .enhanced #attention-next { display: inline-flex; }
.enhanced #chat-leave { display: none; }
.enhanced .chat-app.is-complete #chat-next { display: none; }
.enhanced .chat-app.is-complete #chat-leave { display: inline-flex; }
.enhanced .chat-log { height: 23rem; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scroll-behavior: auto; }
.enhanced .chat-turn:not(.is-shown) { display: none; }
.enhanced .chat-turn.is-past .message--ai { color: #c2b2bf; }
.enhanced .chat-turn.is-current { animation: arrive 180ms ease-out; }
@keyframes arrive { from { opacity: .3; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.fallback-note { max-width: 36rem; margin: 2rem auto; font-size: 1rem; }

.language-scene { padding-top: 3rem; padding-bottom: 5rem; }
.lens-pair { max-width: 66rem; margin: auto; }
.lens-pair > p { max-width: 36rem; margin-left: auto; margin-right: auto; font-size: inherit; line-height: inherit; }
.lens-pair > p span { display: inline; }
.lens-pair h2 { max-width: 56rem; margin: 3rem auto 0; font-size: var(--display); line-height: 1.15; letter-spacing: -.025em; }
.language-essence { margin-top: 2rem; }
.language-machine { max-width: 56rem; margin: 3.5rem auto; }
.io-machine { display: grid; align-items: center; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); font-family: var(--mono); }
.io-machine__channel { position: relative; display: flex; min-width: 0; padding-right: clamp(1.2rem, 3vw, 3rem); align-items: flex-start; flex-direction: column; }
.io-machine__channel::after { content: ''; position: absolute; top: 50%; right: 0; width: clamp(1.2rem, 3vw, 3rem); height: 1px; background: #efb3cd; }
.io-machine__channel--output { padding-right: 0; padding-left: clamp(1.2rem, 3vw, 3rem); }
.io-machine__channel--output::after { right: auto; left: 0; }
.io-machine__label { margin-bottom: .7rem; color: #c4adbc; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; }
.io-machine__token { width: 100%; min-width: 0; padding: 1rem clamp(.8rem, 2vw, 1.4rem); overflow-wrap: anywhere; border: 1px solid #7e6477; background: #443845; color: #f5edf2; font-size: clamp(.9rem, 1.8vw, 1.1rem); line-height: 1.2; text-align: center; }
.io-machine__core { position: relative; display: grid; width: clamp(8.5rem, 18vw, 13rem); aspect-ratio: 1.15; place-items: center; align-content: center; border: .28rem solid #6d5768; border-radius: .35rem; background: #352e39; box-shadow: inset 0 0 0 1px #927b8c, .5rem .6rem 0 #160f2030; color: #f5edf2; }
.io-machine__core > span { font-size: clamp(2.2rem, 4vw, 3.2rem); letter-spacing: -.06em; }
.io-machine__core small { color: #c4adbc; font-size: .48rem; letter-spacing: .1em; text-transform: uppercase; }
.io-machine__screw { position: absolute; top: .65rem; width: .45rem; height: .45rem; border: 1px solid #c4adbc; border-radius: 50%; }
.io-machine__screw--one { left: .65rem; }
.io-machine__screw--two { right: .65rem; }
.language-tail { margin-top: 4rem; }
.language-tail p:last-child { font-size: var(--turn); line-height: 1.2; margin-top: 2rem; text-wrap: balance; }

.manager-interruption { margin: 2.5rem 0; }
.manager-interruption span { font-style: italic; color: var(--accent); }

.way-out { padding-top: 7rem; padding-bottom: 5rem; }
.way-out p { font-size: inherit; line-height: inherit; }
.freedom-scene h2 { font-size: var(--turn); line-height: 1.3; margin-bottom: 2rem; }
.freedom-scene blockquote { margin: 2rem 0; font-size: var(--quotation); line-height: 1.3; }
.freedom-scene cite, .freedom-scene blockquote, .attention-idea h2, .attention-idea blockquote { color: var(--accent); }
.self-filter { margin: 2rem 0; }
.self-filter p { margin: .5rem 0; }
.attention-idea h2 { font-size: var(--display); margin: 1.5rem 0 2.5rem; letter-spacing: -.025em; }
.attention-idea blockquote { margin: 2rem 0 3rem; font-size: var(--quotation); line-height: 1.3; }
.window-scene { padding: 4.5rem var(--gutter) 3rem; scroll-margin-top: 2rem; }
.window-composition { max-width: 78rem; margin: auto; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, .85fr); gap: 2.5rem; align-items: center; }
.window-room img { opacity: 1; }
.window-room figcaption { margin-top: 1rem; text-align: center; }
.thought-cloud { position: absolute; top: 2%; left: 9%; width: 41%; min-height: 6.2rem; display: grid; place-items: center; padding: 1rem .7rem; background: #faf9f2; color: #293c38; border: 1px solid #9aac9b; border-radius: 48% 50% 43% 45%; font-size: clamp(.9rem, 1.4vw, 1.25rem); line-height: 1.2; text-align: center; }
.thought-cloud::before, .thought-cloud::after { content: ''; position: absolute; border: 1px solid #9aac9b; background: #faf9f2; border-radius: 50%; }
.thought-cloud::before { width: .7rem; height: .7rem; left: 62%; bottom: -1.1rem; }
.thought-cloud::after { width: .3rem; height: .3rem; left: 65%; bottom: -1.7rem; }
.thought-cloud p { margin: 0; }
.thought-question { display: none; color: #39776d; }
.attention-panel { padding: 1.2rem 0; }
.attention-panel .eyebrow { margin-bottom: 1rem; }
.reflection-start { font-size: inherit; }
.attention-questions { margin: 1.5rem 0; padding: 0; list-style: none; }
.attention-questions li { margin: 1.2rem 0; font-size: clamp(1.5rem, 2.5vw, 2.2rem); line-height: 1.2; }
.enhanced .attention-questions li:not(.is-shown) { display: none; }
.enhanced .attention-questions li.is-past { font-size: 1rem; color: var(--muted); }
.enhanced .attention-questions li.is-current { color: var(--accent); }
#attention-next { background: var(--accent); color: var(--button-ink, #faf9f2); border: 2px solid var(--accent); border-radius: .3rem; min-width: 10.5rem; min-height: 52px; font-size: .78rem; padding: .9rem 1.4rem; animation: invite 3s ease-in-out infinite; }
#attention-next:hover { filter: brightness(1.1); }
#attention-next:disabled { animation: none; background: transparent; color: var(--ink); border-color: var(--muted); opacity: .75; }
@keyframes invite { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 20%, transparent); } }
.return { padding-top: 4rem; }
.attention-coda { margin-top: 4rem; }
.attention-coda p:nth-child(2) { color: var(--accent); font-size: var(--turn); line-height: 1.2; margin-top: 2rem; }
.return-question { margin-top: 3rem; }
.love-line { font-size: var(--quotation); line-height: 1.3; font-style: italic; color: var(--accent); margin: 2rem 0; }
.return h2 { font-size: var(--turn); line-height: 1.2; margin-top: 1rem; text-wrap: balance; }
.final-point { display: grid; place-items: center; height: 8rem; position: relative; z-index: 2; }
.final-point span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.ending { padding: 0 var(--gutter) 4rem; text-align: center; }
.ending .copy > p:first-child { font-style: italic; color: var(--accent); }
.civilisation-beat { font-size: var(--display); line-height: 1.15; letter-spacing: -.025em; margin: clamp(4rem, 12vh, 8rem) 0 clamp(3rem, 8vh, 5rem); }
.living { margin-top: 2.5rem; font-style: italic; color: var(--muted); }
.under { font-size: var(--display); letter-spacing: -.025em; margin-top: .7rem; }
.essay-links { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin-top: 2.5rem; }
.home-link, .another-link { display: inline-flex; align-items: center; justify-content: center; gap: .65rem; min-height: 44px; font: .65rem/1.5 var(--mono); text-decoration: none; color: var(--muted); }
.home-link:hover, .another-link:hover { color: var(--accent); }
.breathing-dot { flex: 0 0 auto; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); animation: home-breathe 2.4s ease-in-out infinite; }
@keyframes home-breathe { 0%, 100% { opacity: .38; transform: scale(.72); } 50% { opacity: 1; transform: scale(1.18); } }
.progress { display: none; position: fixed; z-index: 20; top: 50%; left: clamp(.5rem, 1.8vw, 2rem); width: 6.5rem; height: min(65vh, 32rem); transform: translateY(-50%); pointer-events: none; font: .57rem/1.1 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.enhanced .progress { display: block; }
.progress__track { position: absolute; inset: 0 auto 0 0; width: 1px; background: color-mix(in srgb, var(--muted) 30%, transparent); }
.progress__fill { display: block; width: 1px; height: calc(var(--progress, 0) * 100%); background: var(--accent); }
.progress ol { position: relative; height: 100%; margin: 0; padding: 0; list-style: none; }
.progress li { position: absolute; top: calc(var(--position, 0) * 100%); left: 0; transform: translateY(-50%); }
.progress__stage { display: block; padding-left: .85rem; color: var(--muted); }
.progress__stage::before { content: ''; position: absolute; left: -2px; top: .1rem; width: 5px; height: 5px; border: 1px solid var(--muted); border-radius: 50%; }
.progress__stage > span { opacity: .65; }
.progress__stage[aria-current="location"] { color: var(--accent); }
.progress__stage[aria-current="location"] > span { opacity: 1; }
.progress__stage[aria-current="location"]::before { background: var(--accent); border-color: var(--accent); transform: scale(1.2); }
@media (max-width: 1250px) { .progress { width: .35rem; } .progress__stage > span { display: none; } }
@media (max-width: 760px) {
  .opening { padding: 1.3rem var(--gutter) 1.5rem; }
  .byline { font-size: .53rem; letter-spacing: .015em; }
  .opening-title { margin-top: 3.1rem; }
  h1 { font-size: clamp(2.5rem, 10vw, 4.3rem); }
  .subtitle { max-width: 27ch; font-size: .9rem; }
  .opening-line h2 { font-size: clamp(2.2rem, 10.4vw, 4.6rem); }
  .passage { padding-top: 3.5rem; padding-bottom: 3.5rem; }
  .jake { padding-top: 2rem; padding-bottom: 1rem; }
  .net-idea { padding-top: 1rem; }
  .chat-scene { padding: 3rem var(--gutter) 2rem; }
  .chat-composition { display: block; }
  .chat-room { max-width: 28rem; margin: 0 auto 1.5rem; }
  .chat-room img { max-height: 15rem; object-fit: contain; }
  .chat-room figcaption { display: none; }
  .chat-topbar { padding: .75rem 1rem; gap: .5rem; }

  .chat-log { padding: 1.3rem 1rem; }
  .enhanced .chat-log { height: 21rem; }
  .message p { font-size: 1.14rem; }
  .chat-controls { padding: .75rem 1rem; min-height: 4.5rem; }

  .lens-pair h2 { margin-top: 2rem; }
  .language-tail { margin-top: 3rem; }
  .io-machine { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 2.5rem; }
  .io-machine__channel { width: min(100%, 17rem); padding: 0; align-items: center; }
  .io-machine__channel::after { top: 100%; right: auto; left: 50%; width: 1px; height: 2.5rem; }
  .io-machine__channel--output::after { top: -2.5rem; }
  .io-machine__core { width: 10rem; }
  .window-scene { padding: 3.5rem var(--gutter) 2rem; }
  .window-composition { display: block; }
  .window-room { max-width: 34rem; margin: auto; }
  .window-room img { margin-top: 3rem; }
  .thought-cloud { top: -9%; left: 8%; width: 48%; font-size: clamp(.78rem, 3.5vw, 1.1rem); min-height: 4.6rem; padding: .75rem .5rem; }
  .window-room figcaption { font-size: .52rem; margin-top: .8rem; }
  .attention-panel { margin-top: 2rem; padding: 0; min-height: 15rem; }
  .attention-questions li { font-size: 1.85rem; }

  .home-link, .another-link { font-size: .58rem; }
}
@media (max-width: 340px) {
  .byline { font-size: .47rem; }

  .chat-controls { padding: .75rem; }
  button, #chat-leave { font-size: .59rem; padding: .7rem; }

  .thought-cloud { width: 56%; left: 2%; }
  .attention-questions li { font-size: 1.6rem; }
  .home-link { font-size: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  body { background: white; color: black; font-size: 12pt; }
  #net-canvas, .progress, .opening-ribbon, button, #chat-leave, .chat-room { display: none !important; }
  .opening { min-height: 0; }
  .passage, .chat-scene, .window-scene { padding: 1.5rem; }
  .chat-composition, .window-composition { display: block; }
  .enhanced .chat-log { height: auto; overflow: visible; }
  .enhanced .chat-turn, .enhanced .attention-questions li { display: block !important; }
  .chat-app, .thought-cloud { background: white; color: black; }
  .thought-cloud { position: relative; width: auto; border: 0; }
  .thought-cloud::before, .thought-cloud::after { display: none; }
  .thought-question { display: none !important; }
  .thought-story { display: block !important; }
  .copy *, .scene-heading *, .lens-pair *, .message *, .attention-questions * { color: black !important; }
  .io-machine__token, .io-machine__core { background: white; box-shadow: none; }
}
