:root {
  --bg: #090909;
  --panel: #111111;
  --panel-2: #161616;
  --text: #f3efe8;
  --muted: #898783;
  --line: #2a2927;
  --orange: #ff5a14;
  --orange-soft: rgba(255, 90, 20, .12);
  --shadow: rgba(0,0,0,.45);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f2efe8;
  --panel: #e8e4dc;
  --panel-2: #ded8ce;
  --text: #11100f;
  --muted: #706d67;
  --line: #c7c0b5;
  --orange: #e64a08;
  --orange-soft: rgba(230, 74, 8, .10);
  --shadow: rgba(38,31,24,.15);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  min-height: 100vh;
  transition: background .35s ease, color .35s ease;
}
button, select { font: inherit; }
button { color: inherit; }
::selection { background: var(--orange); color: #fff; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .17;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
  z-index: 20;
}

.cursor-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,90,20,.09), transparent 68%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: -1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px 32px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -.04em;
  font-size: 18px;
}
.brand span span { color: var(--orange); }
.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd0b9 0 8%, #ff8a4f 18%, var(--orange) 50%, #8b2400 100%);
  box-shadow: 0 0 7px rgba(255,90,20,.95), 0 0 16px rgba(255,90,20,.55), 0 0 28px rgba(255,90,20,.2);
  animation: spherePulse 2.8s ease-in-out infinite;
}
@keyframes spherePulse { 50% { box-shadow: 0 0 9px rgba(255,90,20,1), 0 0 22px rgba(255,90,20,.7), 0 0 36px rgba(255,90,20,.28); transform: scale(1.08); } }
.main-nav { display: flex; gap: 28px; }
.nav-link, .text-button {
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 4px 0;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 12px;
  text-transform: lowercase;
}
.nav-link.is-active, .nav-link:hover, .text-button:hover { color: var(--orange); }
.nav-link.is-active::before { content: "● "; font-size: 7px; vertical-align: 2px; }
.header-actions { justify-self: end; display: flex; gap: 8px; }
.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  transition: .2s ease;
}
.icon-button:hover { border-color: var(--orange); background: var(--orange-soft); }
.icon-button svg { width: 16px; height: 16px; fill: currentColor; stroke: currentColor; stroke-width: 1.7; }
.sun-icon { display: none; fill: none !important; }
html[data-theme="light"] .sun-icon { display: block; }
html[data-theme="light"] .moon-icon { display: none; }

main { max-width: 1600px; margin: 0 auto; padding: 0 32px; }
.page { display: none; animation: pageIn .38s ease both; }
.page.is-active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero-grid {
  min-height: 34vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: end;
  gap: 60px;
  padding: 64px 0 48px;
}
.eyebrow {
  margin: 0 0 18px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .16em;
  color: var(--orange);
}
h1, h2, h3 { margin: 0; letter-spacing: -.065em; line-height: .92; }
h1 { font-size: clamp(74px, 11vw, 190px); font-weight: 500; }
h1 em { font-style: normal; color: var(--orange); }
.hero-intro {
  max-width: 690px;
  margin: 0;
  color: var(--text);
  font-size: clamp(22px, 2.5vw, 36px);
  line-height: 1.22;
  letter-spacing: -.035em;
}
.hero-stat { border-left: 1px solid var(--line); padding-left: 26px; margin-bottom: 2px; display: grid; gap: 8px; font-family: "DM Mono", monospace; color: var(--muted); font-size: 9px; letter-spacing: .1em; }
.hero-stat strong { color: var(--text); font-family: "Space Grotesk", sans-serif; font-size: 70px; line-height: .9; letter-spacing: -.08em; }
.stat-label { color: var(--orange); }
.section-rule, .catalogue-meta {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: .1em;
}

.recent-section { padding-bottom: 72px; }
.recent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 18px;
  padding-top: 20px;
}
.recent-card { cursor: pointer; min-width: 0; }
.recent-art { position: relative; overflow: hidden; background: var(--panel); aspect-ratio: 16/10; border: 1px solid var(--line); }
.recent-meta { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; padding-top: 11px; border-top: 1px solid var(--line); margin-top: 10px; }
.recent-meta h3 { font-size: clamp(22px, 2.1vw, 34px); letter-spacing: -.045em; transition: color .2s ease; }
.recent-card:hover h3 { color: var(--orange); }
.recent-meta p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.recent-date { font: 9px "DM Mono", monospace; color: var(--orange); text-transform: uppercase; white-space: nowrap; }

.timeline-section { padding-bottom: 72px; }
.timeline-shell { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.timeline {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 1fr);
  gap: 0;
  min-width: max(100%, 1180px);
  padding: 56px 0 28px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 39px;
  height: 1px;
  background: var(--line);
}
.timeline-item {
  position: relative;
  display: block;
  padding: 22px 22px 0 0;
  min-width: 0;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: -21px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--orange);
  background: var(--bg);
  border-radius: 50%;
  z-index: 1;
}
.timeline-date { text-align: left; font-family: "DM Mono", monospace; color: var(--orange); font-size: 9px; line-height: 1.4; text-transform: uppercase; margin-bottom: 12px; }
.timeline-node { display: none; }
.timeline-card { display: block; border-top: 0; padding-top: 0; cursor: pointer; }
.timeline-card:hover .timeline-title { color: var(--orange); }
.timeline-art { display: none; }
.timeline-copy { display: flex; flex-direction: column; align-items: flex-start; min-height: 118px; }
.work-index { color: var(--muted); font: 9px "DM Mono", monospace; margin-bottom: 12px; }
.timeline-title { font-size: clamp(24px, 2.2vw, 36px); letter-spacing: -.05em; line-height: .95; transition: color .2s ease; }
.timeline-artist { margin: 8px 0 14px; color: var(--muted); font-size: 12px; }
.mini-tags, .dialog-tags { display:flex; flex-wrap:wrap; gap:6px; }
.tag {
  border: 1px solid var(--line);
  padding: 5px 7px;
  font: 9px "DM Mono", monospace;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.archive-heading { display:grid; grid-template-columns: 1fr 420px; align-items:end; gap:40px; padding: 92px 0 52px; }
.archive-heading h2 { font-size: clamp(40px, 6vw, 80px); font-weight:500; }
.archive-summary { margin:0; color:var(--muted); font-size:16px; line-height:1.55; max-width:390px; }
.filter-bar { display:grid; grid-template-columns: minmax(0,1fr) 220px 220px; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.filter-group { display:flex; gap:7px; flex-wrap:wrap; padding:16px 20px 16px 0; align-items:center; }
.filter-chip { border:1px solid var(--line); background:transparent; color:var(--muted); padding:7px 9px; cursor:pointer; font:9px "DM Mono", monospace; text-transform:uppercase; letter-spacing:.05em; }
.filter-chip:hover, .filter-chip.is-active { background:var(--orange); border-color:var(--orange); color:#fff; }
.select-wrap { border-left:1px solid var(--line); padding:10px 14px; position:relative; }
.select-wrap label { display:block; color:var(--orange); font:9px "DM Mono", monospace; margin-bottom:4px; text-transform:uppercase; }
.select-wrap select { appearance:none; width:100%; border:0; outline:0; background:transparent; color:var(--text); font:12px "DM Mono", monospace; cursor:pointer; padding-right:20px; }
.select-wrap::after { content:"⌄"; position:absolute; right:14px; bottom:12px; color:var(--orange); pointer-events:none; }
.catalogue-meta { border-top:0; margin-bottom: 26px; }
.art-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap: 44px 18px; padding-bottom:100px; }
.art-card { cursor:pointer; }
.card-art { aspect-ratio: 4/3; border:1px solid var(--line); }
.card-art::after { content:"OPEN ↗"; position:absolute; right:0; bottom:0; padding:7px 9px; background:var(--orange); color:#fff; font:9px "DM Mono", monospace; transform:translateY(100%); transition:.2s ease; }
.art-card:hover .card-art::after { transform:none; }
.card-info { border-top:1px solid var(--line); padding-top:10px; margin-top:10px; display:grid; grid-template-columns:1fr auto; gap:10px; }
.card-info h3 { font-size:25px; letter-spacing:-.04em; }
.card-info p { margin:5px 0 0; color:var(--muted); font-size:12px; }
.card-year { color:var(--orange); font:10px "DM Mono", monospace; }
.card-tags { margin-top:11px; display:flex; gap:5px; flex-wrap:wrap; }
.empty-state { grid-column:1/-1; padding:80px 0; color:var(--muted); font:13px "DM Mono", monospace; }

.art-dialog { width:min(1200px, calc(100vw - 32px)); max-height:calc(100vh - 32px); padding:0; border:1px solid var(--line); background:var(--bg); color:var(--text); box-shadow:0 30px 90px var(--shadow); }
.art-dialog::backdrop { background:rgba(0,0,0,.78); backdrop-filter:blur(8px); }
.dialog-layout { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(370px,.9fr); min-height:620px; }
.dialog-art { min-height:620px; border-right:1px solid var(--line); }
.dialog-copy { padding:52px; overflow:auto; }
.dialog-copy h3 { font-size:clamp(28px,3.5vw,48px); line-height:1.1; }
.dialog-artist { color:var(--orange); font-size:18px; margin:18px 0 34px; }
.dialog-description { color:var(--muted); line-height:1.7; font-size:15px; }
.detail-grid { display:grid; grid-template-columns:1fr 1fr; border-top:1px solid var(--line); margin:34px 0 24px; }
.detail-cell { padding:14px 0; border-bottom:1px solid var(--line); }
.detail-cell:nth-child(odd) { border-right:1px solid var(--line); padding-right:16px; }
.detail-cell:nth-child(even) { padding-left:16px; }
.detail-cell span { display:block; color:var(--muted); font:9px "DM Mono", monospace; text-transform:uppercase; margin-bottom:5px; }
.detail-cell strong { font:12px "DM Mono", monospace; font-weight:400; }
.dialog-close { position:absolute; right:14px; top:10px; z-index:3; border:0; background:none; color:var(--text); font-size:31px; cursor:pointer; }

footer { max-width:1600px; margin:0 auto; border-top:1px solid var(--line); padding:22px 32px 34px; display:flex; justify-content:space-between; color:var(--muted); font:9px "DM Mono", monospace; letter-spacing:.09em; }

@media (max-width: 900px) {
  .site-header { grid-template-columns:1fr auto; gap:16px; padding:16px 18px; }
  .main-nav { order:3; grid-column:1/-1; justify-content:space-between; border-top:1px solid var(--line); padding-top:12px; }
  main { padding:0 18px; }
  .hero-grid, .archive-heading { grid-template-columns:1fr; min-height:auto; padding-top:64px; }
  .hero-stat { display:none; }
  .recent-grid { grid-template-columns:1fr; gap:34px; }
  .timeline { grid-auto-columns:220px; min-width:max-content; }
  .filter-bar { grid-template-columns:1fr 1fr; }
  .filter-group { grid-column:1/-1; padding-right:0; }
  .select-wrap:first-of-type { border-left:0; }
  .art-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dialog-layout { grid-template-columns:1fr; }
  .dialog-art { min-height:380px; border-right:0; border-bottom:1px solid var(--line); }
  .dialog-copy { padding:32px 24px 40px; }
}
@media (max-width: 560px) {
  .art-grid { grid-template-columns:1fr; }
  .filter-bar { grid-template-columns:1fr; }
  .select-wrap { border-left:0; border-top:1px solid var(--line); }
  .archive-heading h2 { font-size:40px; }
  h1 { font-size:72px; }
  .hero-grid { padding-top:46px; padding-bottom:38px; }
  .hero-intro { font-size:24px; }
  .recent-section, .timeline-section { padding-bottom:54px; }
  footer { padding-left:18px; padding-right:18px; }
}
/* Collection media and year groups */
.media-shell { width:100%; height:100%; position:relative; }
.art-media { display:block; width:100%; height:100%; object-fit:contain; background:var(--panel); }
.media-unavailable { display:flex; width:100%; height:100%; min-height:140px; padding:24px; flex-direction:column; align-items:center; justify-content:center; gap:12px; text-align:center; overflow-wrap:anywhere; color:var(--muted); }
.media-unavailable small { font-size:11px; line-height:1.6; }
.media-shell > .media-unavailable { display:none; }
.has-error > .art-media, .has-error > .video-label { display:none; }
.has-error > .media-unavailable { display:flex; }
.video-label { position:absolute; bottom:12px; left:12px; padding:8px; background:var(--bg); font:11px 'DM Mono',monospace; }
.recent-art, .card-art { position:relative; overflow:hidden; }
.dialog-art { height:min(80vh,800px); min-height:380px; display:flex; flex-direction:column; }
.dialog-main-media { flex:1; min-height:0; }
.media-selector { display:flex; justify-content:center; gap:12px; padding:16px; }
.media-selector button { padding:9px 14px; border:1px solid var(--line); color:var(--text); background:var(--panel); cursor:pointer; }
.media-selector button[aria-pressed="true"] { border-color:var(--orange); color:var(--orange); }
.asset-links { grid-column:1/-1; display:flex; flex-wrap:wrap; gap:20px; font-size:12px; margin-top:16px; }
.asset-links a, .media-unavailable a { color:var(--orange); }
.timeline-shell { overflow:visible; }
.timeline { display:block; min-width:0; padding:12px 0; }
.timeline::before { display:none; }
.year-group { border-bottom:1px solid var(--line); }
.year-group summary { display:flex; justify-content:space-between; align-items:center; padding:25px 0; cursor:pointer; list-style:none; }
.year-group summary::-webkit-details-marker { display:none; }
.year-group summary > span:first-child { font-size:36px; letter-spacing:-.05em; }
.year-group summary > span:last-child { font:12px 'DM Mono',monospace; color:var(--orange); }
.year-works { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; padding-bottom:28px; }
.card-info h3, .recent-meta h3, #dialogTitle { overflow-wrap:anywhere; }
.search-label { display:block; font-size:12px; color:var(--muted); margin-bottom:10px; }
#searchInput { width:100%; padding:15px; margin-bottom:20px; border:1px solid var(--line); background:var(--panel); color:var(--text); font:inherit; }
.filter-bar { grid-template-columns:minmax(0,1fr) repeat(3,minmax(140px,190px)); }
:focus-visible { outline:2px solid var(--orange); outline-offset:4px; }
@media(max-width:900px) { .year-works { grid-template-columns:repeat(2,minmax(0,1fr)); } .filter-bar { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) { .year-works { grid-template-columns:1fr; } .dialog-art { height:48vh; min-height:260px; } .filter-bar { grid-template-columns:minmax(0,1fr); } .select-wrap { border-left:0; } .dialog-copy { padding:28px; } .dialog-copy h3 { font-size:28px; } }

footer { flex-wrap:wrap; gap:18px; align-items:center; }
#goUp { cursor:pointer; white-space:nowrap; }

/* Collection dropdowns follow the active theme. */
#digitalArtPage .select-wrap { background:var(--bg); }
#yearFilter, #protocolFilter, #artistFilter,
#yearFilter option, #protocolFilter option, #artistFilter option {
  background-color:var(--bg);
  color:var(--text);
  color-scheme:inherit;
}

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