:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #202020;
  --body: #424242;
  --secondary: #686868;
  --focus: #202020;
  --art-filter: invert(0);
  --glow-near: rgb(32 32 32 / .5);
  --glow-far: rgb(32 32 32 / .2);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141414;
  --ink: #e8e8e5;
  --body: #c7c7c3;
  --secondary: #a1a19c;
  --focus: #e8e8e5;
  --art-filter: invert(1);
  --glow-near: rgb(232 232 229 / .5);
  --glow-far: rgb(232 232 229 / .2);
}

@media (prefers-color-scheme: dark) {
:root:not([data-theme]) {
  color-scheme: dark;
  --paper: #141414;
  --ink: #e8e8e5;
  --body: #c7c7c3;
  --secondary: #a1a19c;
  --focus: #e8e8e5;
  --art-filter: invert(1);
  --glow-near: rgb(232 232 229 / .5);
  --glow-far: rgb(232 232 229 / .2);
}
}

/* Color transitions are the fallback where snapshot transitions are unavailable. */
.theme-fading, .theme-fading body, .theme-fading a,
.theme-fading p, .theme-fading h1, .theme-fading h2,
.theme-fading span, .theme-fading button, .theme-fading footer {
  transition: background-color 440ms ease, color 440ms ease;
}
/* A gentle whole-page dissolve keeps text and artwork changing together. */
::view-transition-old(root) { animation: theme-out 440ms ease both; }
::view-transition-new(root) { animation: theme-in 440ms ease both; }
@keyframes theme-out { to { opacity: 0; } }
@keyframes theme-in { from { opacity: 0; } }

* { box-sizing: border-box; }
html { background: var(--paper); scroll-padding-top: 32px; }
body {
  position: relative;
  isolation: isolate;
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
h1, h2, p, ul, ol { margin: 0; }
ul, ol { padding: 0; }
a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--secondary);
}
a:hover { text-decoration-color: var(--ink); text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--focus); outline-offset: 5px; border-radius: 1px; }
::selection { background: var(--ink); color: var(--paper); }
.page { width: min(760px, calc(100% - 64px)); margin-inline: auto; }
.masthead { display: flex; justify-content: space-between; align-items: center; padding-block: 38px; gap: 24px; }
.wordmark { font-size: 19px; font-weight: 650; letter-spacing: -0.8px; text-decoration: none; }
.masthead nav { display: flex; gap: 24px; align-items: center; }
.masthead nav a { color: var(--secondary); text-decoration: none; font-size: 13px; min-height: 44px; display: inline-flex; align-items: center; gap: 5px; }
.masthead nav a:hover { color: var(--ink); text-decoration: underline; }
.theme-toggle { appearance: none; border: 0; padding: 0; background: transparent; color: var(--secondary); display: inline-grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; cursor: pointer; }
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { color: var(--ink); }
.theme-toggle:focus-visible { outline: 1px solid var(--focus); outline-offset: 1px; border-radius: 50%; }
.theme-toggle svg { transition: transform 440ms ease; }
[data-theme="dark"] .theme-toggle svg { transform: rotate(180deg); }
main { display: flex; flex-direction: column; gap: 62px; padding-top: 57px; }
.introduction { margin-left: 144px; display: flex; flex-direction: column; gap: 20px; }
.eyebrow { color: var(--secondary); font-family: var(--mono); font-size: 11px; letter-spacing: 0.02em; }
.eyebrow span { padding-inline: 8px; }
h1 { color: var(--ink); font-family: var(--serif); font-size: clamp(35px, 5vw, 46px); font-weight: 400; line-height: 1.16; letter-spacing: -1.8px; text-wrap: balance; }
.period { color: var(--secondary); }
.intro-copy { display: grid; gap: 17px; padding-top: 4px; }
.conviction { color: var(--ink); }
.section-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-left: 144px; scroll-margin-top: 24px; }
.margin-label { color: var(--body); font-family: var(--sans); font-size: 13px; font-weight: 600; line-height: 1.5; letter-spacing: .01em; }
.work-list { list-style: none; display: grid; gap: 24px; }
.work-link { font-weight: 500; text-decoration: none; }
.work-link:hover { text-decoration: underline; }
.work-link span { padding-left: 3px; color: var(--secondary); font-size: 14px; }
.work-list p { color: var(--secondary); font-size: 15px; line-height: 1.6; padding-top: 3px; }
.beliefs { display: grid; gap: 7px; }
.beliefs-note { padding-top: 17px; }
.history-content { display: grid; gap: 22px; }
.history-thesis { font-family: var(--serif); color: var(--ink); font-size: 28px; line-height: 1.3; letter-spacing: -0.6px; }
.timeline { display: grid; gap: 24px; list-style: none; padding-block: 5px; }
.timeline li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 19px; }
.year { padding-top: 4px; font-family: var(--mono); font-size: 12px; color: var(--secondary); font-variant-numeric: tabular-nums; }
.timeline a { font-size: 15px; text-decoration: none; }
.timeline a:hover { text-decoration: underline; }
.timeline a span { color: var(--secondary); font-size: 13px; }
.timeline p { color: var(--secondary); font-size: 14px; line-height: 1.6; padding-top: 3px; }
.history-ending { color: var(--ink); }
.contact-copy { display: grid; gap: 14px; }
.email-link { justify-self: start; overflow-wrap: anywhere; }
footer { margin-left: 144px; padding-block: 67px 34px; display: flex; justify-content: space-between; gap: 20px; font-size: 12px; color: var(--secondary); }
footer a { color: var(--secondary); text-decoration: none; min-height: 44px; display: inline-flex; align-items: flex-start; white-space: nowrap; }
footer a:hover { text-decoration: underline; }
.skip-link { position: absolute; top: 8px; left: 12px; padding: 8px 12px; background: var(--paper); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

/* Procedural geometry, quiet at rest and deliberate in motion. */
.emergence { display: none; }
@media screen and (min-width: 1180px) {
  .emergence {
    display: block;
    position: absolute;
    top: 195px;
    left: max(24px, calc(50vw - 620px));
    width: min(300px, calc(50vw - 330px));
  }
  .emergence[role="button"] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .emergence figure { margin: 0; }
  .emergence img, .emergence canvas {
    width: 100%;
    height: auto;
    opacity: .48;
    transform-origin: center;
    filter: var(--art-filter) drop-shadow(0 0 0 transparent);
    transition: opacity 280ms ease, filter 280ms ease, transform 350ms ease;
  }
  .emergence:hover img, .emergence:hover canvas,
  .emergence:focus-visible canvas {
    opacity: 1;
    filter: var(--art-filter) drop-shadow(0 0 1px var(--glow-near)) drop-shadow(0 0 7px var(--glow-far));
    transform: scale(1.025);
  }
  .emergence.is-changing canvas { opacity: .85; }
  .emergence.is-changing:hover canvas { opacity: 1; }
  .emergence [hidden] { display: none; }
  .emergence figcaption { display: grid; gap: 8px; min-height: 100px; align-content: start; padding-top: 18px; color: var(--secondary); opacity: 1; transition: opacity 220ms ease; }
  #rule-status { font: 11px/1.5 var(--mono); color: var(--body); }
  #form-note { font: 12px/1.6 var(--sans); max-width: 250px; }
  .emergence.is-changing figcaption { opacity: 0; }
  .emergence:focus-visible { outline: 1px solid #aaa; outline-offset: 8px; }

}

@media (max-width: 640px) {
  .page { width: calc(100% - 48px); max-width: 480px; }
  .masthead { padding-block: 20px; gap: 16px; }
  .masthead nav { gap: 12px; }
  .masthead nav a { font-size: 12px; }
  main { gap: 44px; padding-top: 35px; }
  .introduction { margin-left: 0; gap: 18px; }
  h1 { font-size: clamp(32px, 8.5vw, 42px); letter-spacing: -1.3px; }
  .section-row { margin-left: 0; gap: 14px; }
  .work-list { gap: 22px; }
  .history-thesis { font-size: 26px; }
  .timeline li { grid-template-columns: 40px minmax(0, 1fr); gap: 15px; }
  footer { margin-left: 0; padding-block: 48px 20px; font-size: 11px; }
}

@media (max-width: 359px) {
  .page { width: calc(100% - 36px); }
  .masthead nav { gap: 6px; }
  .masthead { gap: 12px; }
  .masthead nav a { font-size: 11px; }
  .eyebrow { font-size: 10px; }
  .eyebrow span { padding-inline: 4px; }
}

@media print {
  :root, :root[data-theme], :root:not([data-theme]) { --paper: #fff; --ink: #202020; --body: #424242; --secondary: #686868; color-scheme: light; }
  .page { width: 100%; }
  .masthead, .skip-link { display: none; }
  main { padding-top: 0; gap: 28px; }
  .introduction { margin-left: 0; }
  .section-row { margin-left: 0; break-inside: avoid; }
  footer { padding-block: 28px 0; }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .theme-toggle svg { transition: none; }
  .emergence img, .emergence canvas, .emergence figcaption { transition: none; }
  .emergence:hover canvas, .emergence:focus-visible canvas { transform: none; }
}
