:root {
  color-scheme: dark;
  --bg: #080909;
  --text: #e9e7e2;
  --muted: #959794;
  --line: #252726;
  --accent: #cfa59d;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 30px; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 7px; }
::selection { background: #634c48; color: white; }

.skip-link { position: fixed; top: -60px; left: 20px; z-index: 10; background: var(--text); color: var(--bg); padding: 12px; }
.skip-link:focus { top: 20px; }
.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; }

/* Hero */

.hero { min-height: 800px; height: 100svh; position: relative; padding: 0 5vw; display: flex; align-items: center; }
.hero-layout { width: 100%; max-width: 1280px; margin-inline: auto; display: grid; grid-template-columns: 50% 50%; align-items: center; }
.introduction { position: relative; z-index: 2; padding-bottom: 64px; padding-left: clamp(24px, 5vw, 96px); }
.introduction h1 { font-family: Baskerville, 'Times New Roman', serif; font-weight: 400; font-size: clamp(3.6rem, 5.7vw, 5.85rem); line-height: 1; letter-spacing: -.05em; margin: 0 0 31px; max-width: 100%; overflow-wrap: break-word; }
.subtitle { font-size: 1.0625rem; line-height: 1.8; color: #a6a8a4; letter-spacing: -.015em; margin: 0; }

/* Brain */

.brain-experience { position: relative; height: max(580px, calc(var(--notes-height, 380px) + 140px)); width: 100%; --note-width: 44%; --tone: var(--accent); }
.brain-canvas { position: absolute; top: 70px; left: 0; width: 54%; height: 410px; touch-action: pan-y; }
.brain-canvas canvas { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; }
.brain-loading { position: absolute; left: 13%; top: 43%; font-size: .75rem; color: var(--muted); transition: opacity .5s; }
.brain-loading.loaded { opacity: 0; pointer-events: none; }

.hemisphere-target { position: absolute; z-index: 1; pointer-events: none; opacity: 0; padding: 0; background: transparent; border: 1px solid transparent; border-radius: 45%; color: var(--text); }
.hemisphere-target:focus-visible { opacity: 1; outline: 1px solid var(--accent); outline-offset: 7px; background: rgba(235, 169, 187, .035); }

.replay { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #a49098; cursor: pointer; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .65s, color .2s; }
.replay.is-available { opacity: 1; visibility: visible; pointer-events: auto; }
.replay:hover, .replay:focus-visible { color: #ebbbca; }
.replay svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }

.connector { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; color: var(--tone); opacity: 0; }
.connector-line { fill: none; stroke: currentColor; stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 1; }
.connector.visible { opacity: .65; transition: opacity .15s; }
.connector.visible .connector-line { stroke-dashoffset: 0; transition: stroke-dashoffset 1s; }
#arrowhead path { fill: none; stroke: currentColor; stroke-width: 1; }

.hemisphere-notes { position: absolute; top: 100px; right: 0; width: var(--note-width); bottom: 82px; }
.hemisphere-note { position: absolute; top: 0; left: 0; right: 0; opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .8s, transform .8s, visibility .8s; }
.hemisphere-note.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.hemisphere-note h2 { font-family: Baskerville, 'Times New Roman', serif; font-weight: 400; font-size: 1.5rem; letter-spacing: -.025em; line-height: 1.15; margin: 0 0 24px; }
.hemisphere-note ul { padding: 0 0 0 13px; margin: 0; color: #adb0aa; font-size: 1rem; line-height: 1.55; }
.hemisphere-note li { padding-left: 5px; margin-bottom: 17px; }
.hemisphere-note li::marker { font-size: .55em; color: var(--tone); }

.brain-credit { position: absolute; top: 496px; left: 0; width: 54%; margin: 0; padding-inline: 6px; color: var(--muted); font-size: .875rem; line-height: 1.6; text-align: center; text-wrap: pretty; }
.brain-credit a, .site-footer a { color: #b8b9b3; text-decoration: underline; text-decoration-color: #626762; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .2s, text-decoration-color .2s; }
.brain-credit a:hover, .brain-credit a:focus-visible, .site-footer a:hover, .site-footer a:focus-visible { color: var(--text); text-decoration-color: var(--accent); }

/* Fallback when WebGL is unavailable: hemisphere buttons become visible controls. */
.brain-experience.unavailable .connector, .brain-experience.unavailable .replay { display: none; }
.brain-experience.unavailable .brain-loading { max-width: 250px; line-height: 1.6; }
.brain-experience.unavailable button:disabled { opacity: .4; cursor: default; }
.brain-experience.unavailable .brain-canvas { display: flex; justify-content: center; align-items: flex-end; gap: 12px; padding-bottom: 30px; }
.brain-experience.unavailable .brain-canvas canvas { display: none; }
.brain-experience.unavailable .hemisphere-target { position: static; opacity: 1; pointer-events: auto; width: auto !important; height: auto !important; padding: 10px; border-color: var(--line); border-radius: 3px; cursor: pointer; }
.brain-experience.unavailable .hemisphere-target .sr-only { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; }

@media (max-width: 1100px) {
  .hero { padding: 0 4vw; min-height: 820px; }
  .introduction h1 { font-size: 4.1rem; }
  .brain-experience { --note-width: 46%; height: max(620px, calc(var(--notes-height, 380px) + 140px)); }
  .brain-canvas { width: 52%; top: 95px; height: 360px; }
  .hemisphere-notes { top: 99px; }
  .brain-credit { top: 471px; width: 52%; }
}

/* Mobile stacks the hero and centers it around the brain. */
@media (max-width: 760px) {
  .hero { height: auto; min-height: 100svh; display: block; padding: 80px 7vw 50px; }
  .hero-layout { display: block; }
  .introduction { padding-bottom: 30px; padding-left: 0; text-align: center; }
  .introduction h1 { font-size: 3.45rem; margin-bottom: 22px; }
  .subtitle { line-height: 1.65; max-width: 30rem; margin-inline: auto; text-wrap: balance; }
  .brain-experience { display: flex; flex-direction: column; height: auto; min-height: 650px; padding-top: 340px; --note-width: 100%; }
  .brain-canvas { height: 300px; width: 100%; top: -12px; }
  .brain-loading { top: 130px; left: 50%; transform: translateX(-50%); white-space: nowrap; }
  .hemisphere-notes { position: relative; top: auto; right: auto; bottom: auto; flex-shrink: 0; width: 94%; max-width: 24rem; height: var(--notes-height, 310px); margin-inline: auto; }
  .hemisphere-note h2 { margin-bottom: 19px; text-align: center; }
  .hemisphere-note ul { line-height: 1.5; width: fit-content; max-width: 100%; margin-inline: auto; text-align: left; }
  .hemisphere-note li { margin-bottom: 12px; }
  .brain-credit { position: relative; top: auto; left: auto; flex-shrink: 0; width: 94%; max-width: 360px; margin: auto auto 0; padding: 28px 0 0; }
}

/* Work tabs: one translucent rose strip with slanted dividers. */

.work { min-height: 100svh; padding: 24px 0 0; display: flex; flex-direction: column; background: var(--bg); }
.work-tabs { --tab-slant: 28px; position: relative; display: grid; grid-template-columns: repeat(4, minmax(4.7em, 1fr)); width: 100%; overflow-x: auto; font-family: Baskerville, Georgia, serif; font-size: 1.125rem; isolation: isolate; background: rgb(255 99 110 / .7); }
.work-tabs button { position: relative; display: grid; place-items: center; width: calc(100% + var(--tab-slant)); min-width: 0; min-height: 56px; margin-left: calc(var(--tab-slant) / -2); padding: 16px calc(var(--tab-slant) / 2); border: 0; border-radius: 0; background: transparent; color: rgb(243 233 237 / .72); font-size: inherit; font-weight: 400; line-height: 1.25; cursor: pointer; clip-path: polygon(var(--tab-slant) 0, 100% 0, calc(100% - var(--tab-slant)) 100%, 0 100%); isolation: isolate; transition: background-color .2s, color .2s; }
.work-tabs button:first-child { width: calc(100% + var(--tab-slant) / 2); margin-left: 0; padding-left: 0; clip-path: polygon(0 0, 100% 0, calc(100% - var(--tab-slant)) 100%, 0 100%); }
.work-tabs button:last-child { width: calc(100% + var(--tab-slant) / 2); padding-right: 0; clip-path: polygon(var(--tab-slant) 0, 100% 0, 100% 100%, 0 100%); }
.work-tabs button::after { content: ''; position: absolute; z-index: 2; top: 0; right: 0; bottom: 0; width: calc(var(--tab-slant) + 1px); height: 100%; background: rgb(24 9 16 / .7); clip-path: polygon(calc(100% - 1px) 0, 100% 0, 1px 100%, 0 100%); pointer-events: none; }
.work-tabs button:last-child::after { content: none; }
.work-tabs .tab-label { position: relative; z-index: 3; max-width: 100%; text-align: center; }
.work-tabs .tab-label::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: rgb(255 99 110); opacity: 0; transition: opacity .2s; }
.work-tabs [aria-selected=true] { background: var(--bg); color: var(--text); }
.work-tabs [aria-selected=true] .tab-label::after { opacity: 1; }
.work-tabs button:focus-visible { outline: none; }
.work-tabs button:focus-visible .tab-label { outline: 2px solid #f5dce5; outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .work-tabs button:not([aria-selected=true]):hover { color: #f3e9ed; background: rgb(255 224 236 / .045); }
}

/* Work panels */

.work-panel { width: 90%; max-width: 1120px; margin-inline: auto; padding: 12px 0 88px; min-height: 340px; }
.project-list { list-style: none; margin: 0; padding: 0; }
.project-item { border-bottom: 1px solid var(--line); }
.project-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; column-gap: clamp(24px, 4vw, 64px); min-height: 136px; padding: 30px 0; }
.project-identity { min-width: 0; }
.project-name { margin: 0; font-family: Baskerville, Georgia, serif; font-size: clamp(1.6rem, 2.1vw, 1.9rem); font-weight: 400; line-height: 1.18; letter-spacing: -.025em; color: var(--text); }
.project-domain { display: block; margin-top: 9px; color: #8e928c; font-size: .9375rem; line-height: 1.4; }
.project-name a, .project-domain, .project-pair-domains a { transition: color .2s; }
.project-name a:hover, .project-name a:focus-visible,
a.project-domain:hover, a.project-domain:focus-visible,
.project-pair-domains a:hover, .project-pair-domains a:focus-visible { color: #deb2bd; }
.project-description { max-width: 48ch; margin: 0; color: #a4a9a1; font-size: 1.0625rem; line-height: 1.65; text-wrap: pretty; }

.project-pair .project-row { padding-block: 34px; }
.project-pair-names { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 .3em; font-size: clamp(1.05rem, 1.85vw, 1.7rem); line-height: 1.35; }
.project-pair-names a { white-space: nowrap; }
.project-pair-domains { display: flex; flex-wrap: wrap; gap: 0 .5em; }
.project-plus { color: #8e928c; font-size: 1rem; font-family: Baskerville, Georgia, serif; }

#panel-past .project-description a { color: #c9babf; text-decoration: underline; text-decoration-color: #736369; text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .2s, text-decoration-color .2s; }
#panel-past .project-description a:hover, #panel-past .project-description a:focus-visible { color: #ebbbca; text-decoration-color: currentColor; }

/* Footer */

.site-footer { width: 90%; max-width: 1120px; margin-inline: auto; padding: 0 0 56px; color: var(--muted); font-size: .875rem; line-height: 1.6; text-align: center; }

@media (max-width: 760px) {
  .work { padding: 16px 0 0; min-height: 90svh; }
  .work-tabs { --tab-slant: 12px; font-size: 1rem; }
  .work-tabs button { min-height: 64px; padding-block: 12px; }
  .work-panel { width: 86%; padding-top: 8px; padding-bottom: 56px; }
  .project-row { grid-template-columns: minmax(0, 1fr); gap: 15px 20px; padding: 28px 0; min-height: 0; }
  .project-name { font-size: 1.7rem; }
  .project-description { grid-column: 1 / -1; grid-row: 2; line-height: 1.6; }
  .project-pair .project-row { padding-block: 28px; }
  .project-pair .project-identity { grid-column: 1 / -1; }
  .project-pair-names { font-size: clamp(1.05rem, 4.5vw, 1.5rem); }
}

@media (max-width: 380px) {
  .introduction h1 { font-size: 3.25rem; }
  .work-tabs { font-size: .875rem; }
}

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