:root {
  --ink: #ece9df;
  --muted: #b8beb7;
  --paper: #101411;
  --surface: #171c18;
  --panel: #1c221e;
  --line: #526459;
  --section-line: #718579;
  --accent: #d7ff36;
  --warm: #d2a26b;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 86px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.65; }
button, a { font: inherit; }
a { color: inherit; text-underline-offset: 4px; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
img { display: block; max-width: 100%; }
figure, p, h1, h2, h3, ul { margin: 0; }
button { color: inherit; }
.shell { width: min(1320px, calc(100% - 48px)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; top: 10px; left: 10px; z-index: 30; transform: translateY(-180%); padding: 10px 14px; background: var(--accent); color: var(--paper); font-size: 15px; }
.skip:focus { transform: none; color: var(--paper); }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; min-height: 68px; padding: 10px max(24px, calc((100vw - 1320px) / 2)); border-bottom: 1px solid var(--section-line); background: #101411f2; backdrop-filter: blur(12px); }
.brand { font-family: var(--mono); font-size: 15px; font-weight: 600; text-decoration: none; }
.nav { display: flex; gap: 24px; margin-left: auto; }
.nav a { padding: 8px 0; color: var(--muted); font-size: 15px; text-decoration: none; }
.nav .active { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }

.gallery-room { width: min(1080px, calc(100% - 48px)); margin-inline: auto; padding: 42px 0 58px; border-top: 1px solid var(--section-line); }
.first-room { padding-top: 28px; border-top: 0; }
.wall-label { width: min(700px, 100%); margin: 0 auto 18px; color: var(--muted); font-family: var(--mono); font-size: 15px; letter-spacing: .025em; }
.wall-label span { display: inline-block; margin-right: 10px; color: var(--warm); }
.gallery-grid { display: grid; justify-content: center; margin-inline: auto; }
.months-grid, .process-grid { grid-template-columns: repeat(3, minmax(0, 212px)); width: min(700px, 100%); gap: 28px 30px; }
.states-grid { grid-template-columns: repeat(4, minmax(0, 190px)); width: min(820px, 100%); gap: 20px; }
.gallery-piece { min-width: 0; }

.art-card { position: relative; display: block; width: 100%; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 0; background: #0b0e0c; text-align: left; cursor: zoom-in; box-shadow: 0 16px 42px #07100a42; transition: border-color 240ms ease, transform 240ms ease, box-shadow 240ms ease; }
.art-card::after { content: "↗"; position: absolute; top: 9px; right: 10px; z-index: 2; display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #dfe7dd70; background: #0c100dd9; color: var(--ink); font-size: 15px; line-height: 1; opacity: .82; transition: background 220ms ease, color 220ms ease; }
.art-card:hover { transform: translateY(-4px); border-color: var(--section-line); box-shadow: 0 24px 54px #05090778; }
.art-card:hover::after { background: var(--accent); color: var(--paper); }
.art-card:active { transform: translateY(-1px); }
.art-card img { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; transition: transform 420ms cubic-bezier(.2,.7,.2,1), filter 300ms ease; }
.art-card:hover img { transform: scale(1.025); filter: brightness(.9); }
.art-label { position: absolute; inset: auto 0 0; z-index: 1; display: grid; gap: 2px; min-height: 114px; padding: 34px 13px 12px; background: linear-gradient(180deg, transparent 0%, #080b09de 34%, #080b09f7 100%); color: var(--ink); }
.art-label .art-number { color: #d6b182; font-family: var(--mono); font-size: 15px; letter-spacing: .03em; }
.art-label strong { font-size: 19px; font-weight: 600; line-height: 1.25; letter-spacing: -.015em; }
.art-label > span:last-child { color: #d2d6d0; font-size: 15px; line-height: 1.45; }

.art-dialog { width: min(1040px, calc(100% - 40px)); max-width: none; max-height: min(88dvh, 820px); padding: 0; overflow: hidden; border: 1px solid var(--section-line); border-radius: 0; background: var(--panel); color: var(--ink); box-shadow: 0 40px 100px #000b; }
.art-dialog::backdrop { background: #060806dc; backdrop-filter: blur(8px); }
.dialog-shell { position: relative; display: grid; grid-template-columns: minmax(280px, 410px) minmax(0, 1fr); min-height: min(76dvh, 720px); }
.dialog-close { position: absolute; top: 14px; right: 14px; z-index: 2; min-height: 42px; padding: 8px 12px; border: 1px solid var(--section-line); background: #101411ed; color: var(--ink); font-size: 15px; cursor: pointer; transition: background 200ms ease, color 200ms ease; }
.dialog-close:hover { background: var(--accent); color: var(--paper); }
.dialog-visual { display: grid; place-items: center; min-height: 100%; padding: 40px; border-right: 1px solid var(--section-line); background: #090c0a; }
.dialog-visual img { width: min(100%, 340px); height: auto; max-height: 70dvh; aspect-ratio: 2 / 3; object-fit: contain; border: 1px solid var(--line); }
.dialog-copy { min-width: 0; max-height: min(88dvh, 820px); padding: 48px 46px 32px; overflow-y: auto; }
.dialog-kicker { color: var(--warm); font-family: var(--mono); font-size: 15px; letter-spacing: .04em; }
.dialog-copy h2 { margin-top: 8px; font-size: clamp(28px, 3vw, 42px); line-height: 1.1; letter-spacing: -.035em; }
.dialog-thesis { max-width: 34em; margin-top: 12px; color: var(--muted); font-size: 17px; line-height: 1.65; }
.dialog-section { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
.dialog-section h3 { margin-bottom: 9px; color: var(--warm); font-family: var(--mono); font-size: 15px; font-weight: 500; letter-spacing: .04em; }
.dialog-section p, .dialog-section li { font-size: 16px; line-height: 1.78; }
.dialog-section ul { display: grid; gap: 7px; padding-left: 1.25em; }
.prompt-link { display: inline-block; margin-top: 16px; color: var(--accent); font-size: 15px; }
.prompt-link[hidden] { display: none; }
.dialog-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
.dialog-nav button { min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 15px; cursor: pointer; transition: border-color 200ms ease, color 200ms ease; }
.dialog-nav button:last-child { justify-self: end; }
.dialog-nav button:hover { border-color: var(--accent); color: var(--accent); }
.dialog-nav span { color: var(--muted); font-family: var(--mono); font-size: 15px; }

.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 18px 28px; padding-top: 24px; padding-bottom: 34px; border-top: 1px solid var(--section-line); color: var(--muted); }
.footer p, .footer a { font-size: 15px; }
.footer div { display: flex; gap: 24px; }

@media (max-width: 860px) {
  .states-grid { grid-template-columns: repeat(2, minmax(0, 190px)); width: min(410px, 100%); gap: 20px 24px; }
  .dialog-shell { grid-template-columns: minmax(240px, 330px) minmax(0, 1fr); }
  .dialog-visual { padding: 30px; }
  .dialog-copy { padding: 46px 30px 28px; }
}

@media (max-width: 740px) {
  .top { min-height: 64px; padding: 10px 16px; }
  .nav { gap: 16px; }
  .shell { width: calc(100% - 32px); }
  .gallery-room { width: calc(100% - 32px); padding: 34px 0 44px; }
  .first-room { padding-top: 22px; }
  .wall-label { width: min(212px, 100%); margin-bottom: 14px; }
  .months-grid, .process-grid { grid-template-columns: minmax(0, 212px); width: min(212px, 100%); gap: 22px; }
  .states-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(360px, 100%); gap: 14px; }
  .states-grid .art-label { min-height: 108px; padding-inline: 10px; }
  .art-dialog { width: 100%; height: 100dvh; max-height: none; margin: 0; border: 0; }
  .dialog-shell { display: block; min-height: 100%; }
  .dialog-visual { min-height: 0; height: 38dvh; padding: 18px; border-right: 0; border-bottom: 1px solid var(--section-line); }
  .dialog-visual img { width: auto; height: calc(38dvh - 36px); max-height: calc(38dvh - 36px); }
  .dialog-copy { max-height: 62dvh; padding: 30px 22px 26px; }
  .dialog-close { top: 10px; right: 10px; }
  .dialog-copy h2 { font-size: 30px; }
}

@media (max-width: 390px) {
  .brand { display: none; }
  .nav { width: 100%; margin-left: 0; justify-content: space-between; }
}

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