:root {
  color-scheme: dark;
  --bg: #0c1015;
  --panel: #101720;
  --line: #303944;
  --text: #e9ebeb;
  --muted: #a4aeb8;
  --dim: #85919e;
  --amber: #f0a565;
  --blue: #91b6d9;
  --paint-blue: #91b6d9;
  --paint-violet: #948ba5;
  --paint-warm: #c17c50;
  --body-bg: #090c10;
  --shell-border: #1b222c;
  --header-bg: rgba(12,16,21,.88);
  --panel-bg: rgba(13,19,26,.8);
  --copy: #c4cbd2;
  --fact-line: #334553;
  --button-line: #596875;
  --nav-bg: rgba(16,23,32,.93);
  --nav-hover: rgba(23,33,43,.95);
  --nav-active: rgba(26,37,48,.96);
  --texture-opacity: .28;
  --texture-blend: screen;
  --texture-filter: saturate(.65) contrast(1.1);
  font: 16px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f1e8;
  --panel: #f8f6ef;
  --line: #b9bdb9;
  --text: #202831;
  --muted: #4e5b66;
  --dim: #63717b;
  --amber: #a4541c;
  --blue: #315a71;
  --body-bg: #e7e5dc;
  --shell-border: #d6d4ca;
  --header-bg: rgba(244,241,232,.9);
  --panel-bg: rgba(248,246,239,.84);
  --copy: #34414b;
  --fact-line: #a8b7bd;
  --button-line: #909ea2;
  --nav-bg: rgba(248,246,239,.9);
  --nav-hover: rgba(238,236,227,.96);
  --nav-active: rgba(233,233,223,.96);
  --texture-opacity: .3;
  --texture-blend: multiply;
  --texture-filter: saturate(.56) contrast(1.18);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--body-bg); color: var(--text); }
body, .site-shell, .site-header, .detail-area, .project-nav > *, .theme-toggle { transition: background-color .34s ease, border-color .34s ease, color .34s ease; }
button { font: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 100; top: -5rem; left: 1rem; padding: .6rem 1rem; background: var(--amber); color: var(--bg); }
.skip-link:focus { top: 1rem; }
.site-shell { position: relative; isolation: isolate; max-width: 1600px; height: 100svh; min-height: 630px; margin: auto; display: grid; grid-template-rows: 66px minmax(0,1fr) auto; overflow: hidden; background: var(--bg); border-inline: 1px solid var(--shell-border); }
.texture { position: absolute; z-index: -1; inset: 0; pointer-events: none; background: url('/assets/cross-texture.jpg') 50% 48% / cover no-repeat; opacity: var(--texture-opacity); filter: var(--texture-filter); mix-blend-mode: var(--texture-blend); transition: opacity .34s ease, filter .34s ease; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 25px; padding: 0 clamp(20px,4vw,56px); border-bottom: 1px solid var(--line); background: var(--header-bg); }
.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; white-space: nowrap; }
.brand:hover, .header-right a:hover, .visit-link:hover, .colophon a:hover { color: var(--amber); }
.brand-name { font-size: 14px; font-weight: 700; letter-spacing: -.03em; }
.pixel-mark { display: flex; align-items: center; gap: 7px; width: 87px; min-width: 87px; height: 42px; color: var(--amber); font-size: 22px; font-weight: 700; }
.pixel-mark.is-ready { font-size: 0; }
.pixel-glyph { display: grid; grid-template-columns: repeat(7,4px); grid-template-rows: repeat(7,4px); gap: 2px; }
.pixel-cell { width: 4px; height: 4px; background: transparent; opacity: 0; }
.pixel-cell.on { background: var(--cell-color, var(--amber)); opacity: 1; animation: pixel-on .55s cubic-bezier(.2,.85,.2,1) both; animation-delay: var(--delay); }
.header-right { display: flex; align-items: center; gap: 32px; color: var(--muted); font-size: 14px; }
.header-right a { text-decoration: none; color: var(--text); }
.header-right a span { color: var(--amber); }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 88px; min-height: 34px; padding: 5px 9px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.theme-toggle:hover { border-color: var(--amber); color: var(--amber); }
.theme-symbol { color: var(--amber); font-size: 17px; line-height: 1; }
.main { position: relative; z-index: 1; min-height: 0; display: flex; flex-direction: column; gap: clamp(22px,4vh,38px); padding: clamp(27px,4vh,40px) clamp(20px,4vw,56px) clamp(20px,3vh,32px); }
.intro { flex: 0 0 auto; }
.eyebrow { color: var(--muted); font-size: 12px; letter-spacing: .05em; }
.prompt, .period { color: var(--amber); }
.cursor { display: inline-block; width: 7px; height: 14px; margin-left: 8px; background: var(--amber); vertical-align: -2px; animation: cursor-blink 1.2s steps(1,end) infinite; }
.intro h1 { margin: 16px 0 12px; font-size: clamp(30px,3.3vw,48px); line-height: 1.13; letter-spacing: -.07em; font-weight: 650; }
.intro p { max-width: 870px; margin: 0; color: var(--copy); font-size: 16px; line-height: 1.58; }
.detail-area { position: relative; flex: 1 1 auto; min-height: 0; border: 1px solid var(--line); background: var(--panel-bg); overflow: auto; scrollbar-color: var(--dim) transparent; }
.detail-view { position: relative; z-index: 1; width: 100%; height: 100%; min-height: 255px; padding: clamp(17px,2.5vh,25px) clamp(20px,3vw,38px); animation: detail-in .3s ease-out both; }
.detail-topline { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); color: var(--blue); font-size: 12px; letter-spacing: .07em; }
.detail-topline span:last-child { color: var(--dim); }
.detail-topline .state { color: var(--amber) !important; }
.state-dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--amber); }
.idle-content { display: flex; flex-direction: column; justify-content: center; height: calc(100% - 35px); min-height: 170px; }
.idle-command { color: var(--amber); font-size: clamp(17px,1.6vw,22px); }
.idle-content p { margin: 9px 0 0; color: var(--muted); font-size: 16px; }
.detail-body { height: calc(100% - 35px); min-height: 195px; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: 15px 0 0; }
.detail-copy { max-width: 720px; }
.detail-label { color: var(--dim); font-size: 12px; letter-spacing: .04em; }
.detail-body h2 { margin: 4px 0 10px; font-size: clamp(28px,3vw,40px); line-height: 1.1; letter-spacing: -.065em; }
.detail-body p { margin: 0; color: var(--copy); font-size: 16px; line-height: 1.62; }
.detail-view:not(.idle-view) .detail-copy > * { animation: line-arrive .4s ease-out both; }
.detail-view:not(.idle-view) .detail-copy > :nth-child(2) { animation-delay: .05s; }
.detail-view:not(.idle-view) .detail-copy > :nth-child(3) { animation-delay: .1s; }
.detail-view:not(.idle-view) .detail-copy > :nth-child(4) { animation-delay: .15s; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; color: var(--blue); font-size: 12px; }
.facts span { border: 1px solid var(--fact-line); padding: 4px 7px; }
.visit-link { flex: 0 0 auto; align-self: flex-end; display: inline-flex; gap: 15px; align-items: center; border: 1px solid var(--button-line); padding: 9px 12px; color: var(--text); font-size: 13px; text-decoration: none; white-space: nowrap; }
.visit-link span { color: var(--amber); }
.site-footer { position: relative; z-index: 1; padding: 0 clamp(20px,4vw,56px) 13px; background: transparent; }
.footer-label { display: flex; justify-content: space-between; gap: 15px; padding: 0 0 11px; color: var(--dim); font-size: 12px; letter-spacing: .06em; }
.project-nav { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border: 1px solid var(--line); }
.project-nav > * { position: relative; min-width: 0; display: flex; align-items: center; gap: 13px; min-height: 68px; padding: 12px clamp(11px,1.8vw,23px); border: 0; border-right: 1px solid var(--line); background: var(--nav-bg); color: var(--text); text-decoration: none; text-align: left; cursor: pointer; font-size: clamp(13px,1.15vw,16px); overflow: hidden; }
.project-nav > *:last-child { border-right: 0; }
.project-nav > *:hover { background: var(--nav-hover); }
.project-nav > button[aria-expanded="true"] { background: var(--nav-active); }
.project-nav > button::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: var(--amber); transform: scaleX(0); transform-origin: left; transition: transform .42s cubic-bezier(.2,.8,.2,1); }
.project-nav > button::after { content: ""; position: absolute; top: -1px; left: 0; width: 5px; height: 5px; border-radius: 50%; background: var(--amber); opacity: 0; }
.project-nav > button[aria-expanded="true"]::before { transform: scaleX(1); }
.project-nav > button[aria-expanded="true"]::after { animation: dot-trace .42s cubic-bezier(.2,.8,.2,1) both; }
.project-nav > button[aria-expanded="true"] .nav-icon { transform: rotate(45deg); }
.nav-index { color: var(--amber); font-size: 12px; }
.nav-icon { margin-left: auto; color: var(--amber); font-size: 18px; transition: transform .2s ease; }
.colophon { display: flex; justify-content: space-between; gap: 16px; padding-top: 11px; color: var(--dim); font-size: 12px; }
.colophon a { text-decoration: none; }
@keyframes pixel-on { from { opacity: 0; transform: translateY(5px) scale(.7); } to { opacity: 1; transform: none; } }
@keyframes cursor-blink { 50% { opacity: 0; } }
@keyframes detail-in { from { opacity: .35; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes line-arrive { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes dot-trace { 0% { opacity: 1; left: 0; } 90% { opacity: 1; } 100% { opacity: 0; left: calc(100% - 5px); } }
@media (max-width: 900px) {
  .detail-body { display: block; }
  .visit-link { margin-top: 17px; }
}
@media (max-width: 620px) {
  .site-shell { min-height: 690px; grid-template-rows: 61px minmax(0,1fr) auto; }
  .brand-name { font-size: 14px; }
  .header-right .location { display: none; }
  .header-right { gap: 13px; }
  .theme-toggle { min-width: 34px; padding: 5px 7px; }
  .theme-label { display: none; }
  .main { gap: 18px; padding-top: 23px; }
  .intro h1 { font-size: clamp(26px,7.5vw,34px); margin: 14px 0 10px; }
  .intro p { font-size: 16px; line-height: 1.5; }
  .detail-view { min-height: 220px; padding: 12px 17px; }
  .detail-body { min-height: 180px; padding-top: 8px; }
  .detail-body p { font-size: 16px; line-height: 1.5; }
  .detail-body h2 { font-size: 27px; }
  .facts { display: none; }
  .visit-link { margin-top: 8px; padding: 7px 10px; }
  .idle-content p { font-size: 16px; }
  .project-nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .project-nav > * { min-height: 51px; border-bottom: 1px solid var(--line); font-size: 14px; }
  .project-nav > *:nth-child(2) { border-right: 0; }
  .project-nav > *:nth-child(n+3) { border-bottom: 0; }
  .colophon { flex-direction: column; gap: 2px; font-size: 12px; }
  .footer-label { font-size: 12px; }
}
@media (max-width: 480px) {
  .brand-name { display: none; }
}
@media (max-height: 690px) and (min-width: 621px) {
  .main { gap: 18px; padding-top: 20px; padding-bottom: 16px; }
  .intro h1 { margin: 8px 0; }
  .site-footer { padding-bottom: 8px; }
  .project-nav > * { min-height: 56px; }
  .detail-view { min-height: 205px; }
  .detail-body { min-height: 160px; }
}
@media (max-height: 610px) {
  .site-shell { height: auto; min-height: 610px; }
  body { overflow: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pixel-cell.on, .cursor, .detail-view, .detail-view:not(.idle-view) .detail-copy > *, .project-nav > button[aria-expanded="true"]::after { animation: none; }
  body, .site-shell, .site-header, .detail-area, .project-nav > *, .theme-toggle, .texture, .project-nav > button::before, .nav-icon { transition: none; }
}
