@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --ink: #101211;
  --panel: #161a17;
  --paper: #eeefe5;
  --muted: #afb5aa;
  --line: #343b33;
  --accent: #d4ee8a;
  --amber: #edbd84;
  --mono: "DM Mono", Consolas, monospace;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--paper);
  background: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
::selection { background: var(--accent); color: var(--ink); }
.wrap { width: min(88%, 1350px); margin-inline: auto; }
.skip { position: absolute; top: 8px; left: 8px; z-index: 3; padding: 10px; color: var(--ink); background: var(--accent); transform: translateY(-160%); }
.skip:focus { transform: none; }
.mast { display: grid; min-height: 83px; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.brand { display: inline-flex; justify-self: start; align-items: center; gap: 13px; }
.brand span { font: 500 .72rem/1.25 var(--mono); letter-spacing: .075em; }
.mast nav { display: flex; gap: clamp(20px, 4vw, 60px); }
.mast nav a, .nav-link, .back { font-size: .9rem; color: var(--muted); }
.mast a:hover, .back:hover, .archive summary:hover { color: var(--accent); }
.nav-link { justify-self: end; padding: 9px 14px; border: 1px solid var(--line); }
.hero { position: relative; overflow: hidden; isolation: isolate; border-block: 1px solid var(--line); background: #141b16; }
.terrain { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg,#101511 1%,#101511ed 21%,#10151132 64%,transparent), linear-gradient(0deg,#101211 1%,transparent 38%); }
.hero-content { min-height: clamp(550px, 76svh, 850px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; position: relative; padding: 65px 0 120px; }
.eyebrow { margin: 0 0 21px; color: var(--accent); font: 500 .78rem/1.5 var(--mono); letter-spacing: .11em; text-transform: uppercase; }
.eyebrow span { display: inline-block; width: 21px; height: 1px; background: currentColor; margin: 0 .6em .24em 0; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-weight: 600; letter-spacing: -.073em; }
h1 { font-size: clamp(5.15rem, 12vw, 12.5rem); line-height: .78; margin: 0 0 30px -.055em; }
h1 em { font-style: normal; color: var(--accent); }
.hero-copy { font-size: clamp(1.08rem, 1.8vw, 1.35rem); line-height: 1.45; max-width: 24ch; margin: 0 0 28px; color: #e0e4d8; }
.action { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; padding: 10px 18px; font-weight: 600; font-size: .93rem; color: #161d0f; background: var(--accent); border: 1px solid var(--accent); }
.action:hover { background: #e6f6bd; }
.hero-base { position: absolute; bottom: 0; inset-inline: 0; min-height: 64px; border-top: 1px solid #bcccaf40; display: grid; align-items: center; grid-template-columns: 1fr auto 1fr; }
.hero-base > :last-child { text-align: right; }
.hero-base > span, .work-caption, .diagram figcaption, .diagram-key { color: var(--muted); font: 400 .76rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .065em; }
.work { padding-block: clamp(78px, 11vw, 152px) clamp(62px, 8vw, 104px); }
.section-head { display: grid; grid-template-columns: 1fr minmax(220px, 330px); align-items: end; gap: 20px; margin-bottom: 34px; }
.section-head p:last-child, .studio-copy > p:not(.eyebrow) { color: var(--muted); line-height: 1.65; font-size: 1.06rem; margin: 0 0 4px; }
h2 { font-size: clamp(3rem, 7vw, 6.5rem); line-height: .94; margin-bottom: 0; }
.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2.4vw, 32px); }
.work-image { aspect-ratio: 1.47; overflow: hidden; border: 1px solid var(--line); background: #18221c; }
.study { width: 100%; height: 100%; display: block; }
.work-item h3 { font-size: 1.45rem; margin: 17px 0 5px; letter-spacing: -.035em; }
.work-item p { margin: 0; max-width: 34ch; color: var(--muted); line-height: 1.5; }
.portfolio { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(12px, 2.4vw, 32px); margin-bottom: 46px; }
.portfolio figure { margin: 0; }
.portfolio img { width: 100%; aspect-ratio: 1.5; object-fit: cover; display: block; }
.portfolio figcaption { padding: 10px 0; }
.work-caption { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 27px; }
.studio { background: var(--panel); border-block: 1px solid var(--line); }
.studio-layout { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(32px,9vw,145px); align-items: center; padding-block: clamp(72px,10vw,130px); }
.studio-copy h2 { margin-bottom: 26px; font-size: clamp(3rem, 6.2vw, 5.85rem); }
.studio-copy > p:not(.eyebrow) { margin-bottom: 15px; max-width: 48ch; }
.studio-copy .action { margin-top: 9px; }
.diagram { margin: 0; }
.registration {
  display: grid;
  grid-template: repeat(5, 1fr) / repeat(7, 1fr);
  padding: 5% 5.5%;
  aspect-ratio: 1.55;
  border: 1px solid #435047;
  background: radial-gradient(ellipse at 58% 45%, #344831, #121915 82%);
}
.registration-dot {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid #6d8b5b35;
  margin: -1px 0 0 -1px;
}
.registration-dot::before {
  content: "";
  width: clamp(7px, 1.4vw, 11px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #80947542;
}
.registration-dot[data-color="green"]::before { background: #d4ee8a; box-shadow: 0 0 10px #d4ee8a77; }
.registration-dot[data-color="amber"]::before { background: #edbd84; border-radius: 0; transform: rotate(45deg) scale(.82); }
.registration-dot[data-color="blue"]::before { background: #9cc8e9; border-radius: 1px; }
.registration-dot[data-color="violet"]::before { border: 2px solid #d0b9e6; box-shadow: 0 0 8px #d0b9e650; }
.registration-views { display: flex; gap: 4px; }
.registration-views .view-switch { min-width: 34px; padding-inline: 6px; }
.view-switch[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.diagram figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.view-switch { color: var(--paper); background: transparent; border: 1px solid var(--line); min-height: 44px; padding: 5px 11px; }
.view-switch:hover { border-color: var(--accent); }
.diagram-key { margin: 10px 0 0; color: var(--accent); }
.square { display: inline-block; width: 9px; height: 9px; border: 1px solid currentColor; margin-right: .45em; }
.clue { position: relative; }
.clue summary, .archive summary { list-style: none; cursor: pointer; }
.clue summary::-webkit-details-marker, .archive summary::-webkit-details-marker { display: none; }
.clue summary { display: grid; height: 44px; width: 44px; place-items: center; color: #acba9a; }
.clue summary:hover, .clue[open] summary { color: var(--accent); }
.point { background: currentColor; width: 7px; height: 7px; border-radius: 100%; box-shadow: 0 0 0 5px #a9bc8b22; }
.crop { display: inline-block; width: 8px; height: 13px; border-inline: 1px solid currentColor; }
.clue-note { position: absolute; z-index: 1; bottom: 100%; right: 0; width: max-content; max-width: 70vw; padding: 11px 14px; background: #19231b; border: 1px solid #506048; color: var(--accent); font: .82rem/1.6 var(--mono); letter-spacing: 0; text-transform: none; }
.first-clue .clue-note { right: auto; left: 50%; transform: translateX(-50%); }
.clue-note span { display: block; }
.room-study { padding-bottom: clamp(70px, 10vw, 125px); }
.room-study h2 { font-size: clamp(3rem, 6.8vw, 6.35rem); }
.room-viewer { border: 1px solid #414b41; background: #19211d; }
.room-stage { position: relative; background: radial-gradient(ellipse at 45% 40%, #485246, #151a18 80%); height: clamp(380px, 52vw, 680px); overflow: hidden; }
.room-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.room-stage canvas:active { cursor: grabbing; }
.room-stage canvas:focus-visible { outline-offset: -4px; }
.room-indicator { position: absolute; top: 14px; left: 14px; display: flex; align-items: center; gap: 12px; pointer-events: none; color: #f1eee1; background: #101712e8; border: 1px solid #78816c; padding: 8px 11px; font: .82rem var(--mono); text-transform: uppercase; }
.room-indicator > :first-child { color: var(--accent); }
.room-indicator > :last-child:empty { display: none; }
.room-loading { display: none; position: absolute; inset: 0; pointer-events: none; place-items: center; color: var(--paper); font: .88rem var(--mono); }
.room-stage[data-loading="true"] .room-loading { display: grid; }
.room-zoom { position: absolute; bottom: 14px; right: 14px; display: flex; background: #101712ee; border: 1px solid #78816c; }
.room-zoom button { min-width: 48px; min-height: 46px; background: transparent; border: 0; color: var(--paper); font-size: 1.35rem; }
.room-zoom button + button { border-left: 1px solid #78816c; }
.room-zoom button:hover { color: var(--accent); }
.room-controls { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px; }
.room-controls p { margin: 0; color: var(--muted); font: .8rem/1.45 var(--mono); }
.room-options { display: flex; flex-wrap: wrap; gap: 8px; }
.room-options button { --tone: #94a9b8; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 13px; color: var(--paper); background: #222c25; border: 1px solid #505e51; }
.room-options button::before { content: ""; width: 8px; height: 8px; background: var(--tone); }
.room-options [data-tone="green"] { --tone: #9cab78; }
.room-options [data-tone="yellow"] { --tone: #d0a765; }
.room-options [data-tone="night"] { --tone: #a493b5; }
.room-options button:hover { border-color: var(--paper); }
.room-options [aria-pressed="true"] { border-color: var(--accent); background: #323d2a; color: var(--accent); }
.room-status { color: var(--muted); margin: 0; }
.room-status:empty { display: none; }
.room-status:not(.visually-hidden):not(:empty) { padding: 0 13px 13px; }
.material { display: grid; grid-template-columns: .8fr 1.2fr; align-items: center; gap: clamp(32px, 8vw, 120px); padding-block: clamp(70px, 9vw, 116px); }
.material h2 { font-size: clamp(3rem, 5.6vw, 5.6rem); margin-bottom: 20px; }
.material-copy > p:last-child { color: var(--muted); font-size: 1.06rem; line-height: 1.65; max-width: 34ch; margin: 0; }
.inspection { margin: 0; }
.inspection-scene {
  aspect-ratio: 1.94;
  overflow: hidden;
  border: 1px solid #52605a;
  background: #34452a;
}
.inspection-scene canvas { display: block; width: 100%; height: 100%; }
.inspection-controls { display: grid; grid-template-columns: auto minmax(50px, 1fr) 8ch; gap: 12px; align-items: center; margin-top: 7px; color: var(--muted); font: .8rem var(--mono); }
.inspection-controls input { width: 100%; min-height: 44px; margin: 0; accent-color: var(--amber); cursor: pointer; }
.inspection-controls output { color: var(--amber); text-align: right; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.foot { padding-block: 20px 28px; }
.footer-row { display: grid; grid-template-columns: 1fr minmax(120px, 1.8fr) 1fr; align-items: start; gap: 20px; }
.footer-row > .brand, .back { margin-top: 7px; }
.back { justify-self: end; white-space: nowrap; }
.archive > summary { width: fit-content; margin: 0 auto; display: flex; gap: 12px; align-items: center; min-height: 44px; color: var(--muted); font: .79rem var(--mono); }
.archive[open] > summary { color: var(--accent); }
.archive-content { border: 1px solid var(--line); margin-top: 5px; padding: clamp(18px, 4vw, 36px); background: #151a15; }
.archive-content h2 { font-size: clamp(2.2rem, 4.8vw, 4rem); margin-bottom: 16px; }
.archive-content p { color: var(--muted); line-height: 1.5; }
.archive label { font: .8rem var(--mono); display: block; margin-bottom: 8px; }
.input-row { display: flex; gap: 8px; }
.input-row input { width: min(145px, 100%); min-width: 0; background: var(--ink); border: 1px solid #687260; color: var(--paper); padding: 6px 12px; font: 1.35rem var(--mono); letter-spacing: .19em; }
#archive-status { margin: 9px 0; }
.hint { font-size: .9rem; }
.hint summary { min-height: 32px; color: var(--muted); text-decoration: underline; padding-top: 4px; }
.hint p { margin: 3px 0 8px; }
@media(max-width: 750px) {
  .wrap { width: 90%; }
  .mast { min-height: 70px; grid-template-columns: 1fr auto; gap: 12px; }
  .mast .nav-link { display: none; }
  .mast nav { gap: clamp(12px, 3vw, 20px); }
  .room-stage { height: clamp(310px, 65vw, 500px); }
  .room-controls { align-items: flex-start; flex-direction: column; }
  .hero::after { background: linear-gradient(90deg,#101511f6 1%,#10151164 70%,#10151117),linear-gradient(0deg,#101211,transparent 47%); }
  .hero-content { min-height: 590px; }
  .studio-layout, .section-head, .material { grid-template-columns: 1fr; }
  .portfolio { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: 1fr; gap: 29px; }
  .work-image { aspect-ratio: 1.75; }
  .footer-row { grid-template-columns: 1fr auto; gap: 10px; }
  .footer-row .archive { grid-row: 2; grid-column: 1 / -1; }
}
@media(max-width: 415px) {
  h1 { font-size: clamp(4.15rem, 18vw, 5.15rem); }
  .hero-base > span { font-size: .64rem; }
}
@media(prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

:root.phd-homecoming::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  pointer-events: none;
  animation: phd-home-fade 1.45s ease-out both;
}
@keyframes phd-home-fade {
  0%, 12% { opacity: 1; }
  100% { opacity: 0; }
}
