:root {
  --ink: #f2e9d8;
  --muted: #8ea5b1;
  --paper: #011d2e;
  --surface: #06273a;
  --line: rgba(201, 154, 78, 0.22);
  --blue: #c99a4e;
  --pink: #e2b96e;
  --yellow: #e2b96e;
  --radius: 6px;
  --serif: STSong, "Songti SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --gold: #c99a4e;
  --gold-soft: #e2b96e;
  --navy-deep: #011d2e;
  --navy-surface: #06273a;
  --navy-raised: #0a3045;
}

* { box-sizing: border-box; }

html { background: var(--navy-deep); }

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 84% 7%, rgba(201, 154, 78, 0.08), transparent 27%),
    linear-gradient(180deg, #011d2e 0%, #021f31 52%, #011d2e 100%);
  font-family: var(--sans);
}

body::before {
  z-index: 0;
  opacity: 0.15;
  background-image:
    linear-gradient(rgba(226, 185, 110, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(226, 185, 110, 0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
  mix-blend-mode: normal;
}

.site-nav,
main,
.site-footer,
.toast { position: relative; z-index: 1; }

.shell {
  width: min(1280px, calc(100% - 10vw));
  margin-inline: auto;
}

.site-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 5vw;
  background: linear-gradient(to bottom, rgba(1, 29, 46, 0.98), rgba(1, 29, 46, 0));
}

.site-nav .brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0;
  color: inherit;
  text-decoration: none;
}

.site-nav .brand img {
  display: block;
  width: auto;
  height: 64px;
}

.nav-links { display: flex; align-items: center; }

.nav-links a {
  margin-left: 24px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 2px;
  text-decoration: none;
  transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible { color: var(--gold-soft); }

.nav-links a[aria-current="page"] {
  position: relative;
  color: var(--ink);
}

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: -8px;
  left: 0;
  height: 1px;
  background: var(--gold);
}

.nav-links .nav-cta {
  padding: 9px 22px;
  border-radius: 999px;
  color: #011d2e;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  font-weight: 700;
}

:focus-visible {
  outline: 2px solid var(--gold-soft) !important;
  outline-offset: 4px !important;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 0;
  padding: 168px 0 54px;
  border-bottom-color: var(--line);
  overflow: visible;
}

.eyebrow {
  margin-bottom: 26px;
  color: var(--gold);
  font: 11px/1.4 Georgia, serif;
  letter-spacing: 0.3em;
}

.eyebrow::before {
  width: 38px;
  height: 1px;
  border-radius: 0;
  background: var(--gold);
  transform: none;
}

h1,
h2,
h3,
.card-title,
.reference-body h3 { font-family: var(--serif); font-weight: 400; }

h1 {
  max-width: none;
  color: var(--ink);
  font-size: clamp(46px, 5.2vw, 76px);
  line-height: 1.08;
  letter-spacing: 0.02em;
}

h1 em {
  color: var(--gold-soft);
  font-family: inherit;
  font-style: normal;
  letter-spacing: 0.05em;
}

.hero-side { max-width: 390px; }

.hero-side p {
  color: #bac8cc;
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 2;
}

.hero-random {
  min-height: 48px;
  flex: 0 0 auto;
  margin: 0;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  color: #011d2e;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.hero-random:hover {
  color: #011d2e;
  background: linear-gradient(135deg, #efd08f, var(--gold-soft));
}

.museum-number {
  color: var(--muted);
  border-top-color: var(--line);
  letter-spacing: 0.14em;
}

.museum-number strong { color: var(--gold-soft); }
.scribble { display: none; }

.reference-section,
.gallery-section,
.source-notice { border-color: var(--line); }

.reference-section { padding: 54px 0 120px; }
.gallery-section { padding: 100px 0 110px; }

.reference-head {
  display: block;
  margin-bottom: 24px;
}

.reference-head h2 {
  max-width: none;
  font-size: clamp(30px, 3.5vw, 48px);
  line-height: 1.16;
  letter-spacing: 0.02em;
}

.reference-context { display: none; }

.section-index {
  color: var(--gold);
  font-family: Georgia, serif;
  letter-spacing: 0.18em;
}

.reference-head h2,
.gallery-title h2 {
  color: var(--ink);
  letter-spacing: 0.04em;
}

.reference-head h2 em { color: var(--gold-soft); font-family: inherit; font-style: normal; }
.reference-head > p,
.gallery-title p,
.reference-context p { color: var(--muted); }

.project-choice,
.filter-button {
  min-height: 44px;
  border-color: var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(6, 39, 58, 0.66);
}

.project-choice:hover,
.filter-button:hover {
  color: var(--gold-soft);
  border-color: rgba(226, 185, 110, 0.6);
}

.project-choice[aria-pressed="true"],
.filter-button[aria-pressed="true"] {
  color: #011d2e;
  border-color: var(--gold);
  background: var(--gold-soft);
}

.reference-context { border-color: var(--line); }
.reference-count { color: var(--gold); }

.reference-grid { gap: 22px; }

.reference-card {
  border-color: var(--line);
  border-radius: 7px;
  background: rgba(6, 39, 58, 0.88);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.12);
}

.reference-card:hover {
  border-color: rgba(226, 185, 110, 0.52);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.23);
}

.reference-image { background: #0a3045; }
.reference-image::after { color: rgba(242, 233, 216, 0.38); }
.reference-image img { background: #0a3045; }

.reference-source { color: var(--gold); }
.reference-source span:last-child,
.reference-best { color: var(--muted); }
.reference-body h3 { color: var(--ink); letter-spacing: 0.02em; }
.reference-observe { color: #c3ced1; border-color: var(--line); }

.reference-tags span {
  color: #acc0c7;
  background: rgba(142, 165, 177, 0.1);
}

.reference-actions a {
  color: var(--gold-soft);
  border-color: var(--line);
}

.reference-actions a:first-child {
  color: #011d2e;
  border-color: var(--gold);
  background: var(--gold-soft);
}

.competitor-finder {
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #082b3f;
}

.competitor-finder > div:first-child p { color: var(--muted); }
.source-link,
.query-chip {
  color: #c6d1d4;
  border-color: rgba(201, 154, 78, 0.3);
  background: rgba(201, 154, 78, 0.06);
}
.source-link:hover,
.query-chip:hover { color: var(--ink); background: rgba(201, 154, 78, 0.14); }

.gallery-head { margin-bottom: 32px; }
.hall-status { border-color: var(--line); }
.hall-status span { color: var(--muted); background: transparent; }
.hall-status span:first-child {
  color: #011d2e;
  border-color: var(--gold);
  background: var(--gold-soft);
}

.style-grid { gap: 38px 24px; }
.style-card { color: var(--ink); }

.card-art {
  border: 1px solid var(--line);
  border-radius: 7px;
  background-color: #0a3045;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.style-card:hover .card-art,
.style-card:focus-visible .card-art {
  border-color: rgba(226, 185, 110, 0.64);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.32);
}

.card-number,
.card-en,
.card-work { color: var(--muted); }
.card-title { color: var(--ink); font-size: 21px; letter-spacing: 0.04em; }
.card-keywords span { color: #afc0c5; }
.card-keywords span:not(:last-child)::after { color: rgba(201, 154, 78, 0.55); }

.card-arrow {
  color: var(--gold);
  border-color: var(--line);
}

.style-card:hover .card-arrow {
  color: #011d2e;
  background: var(--gold-soft);
}

.source-notice { padding: 40px 0 82px; }
.source-notice h3 { color: var(--gold-soft); }
.source-notice p { color: var(--muted); }

dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 100;
  margin: 0;
  color: var(--ink);
  border: 1px solid rgba(201, 154, 78, 0.28);
  border-radius: 9px;
  background: var(--navy-surface);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.56);
  transform: translate(-50%, -50%);
}

dialog::backdrop { background: rgba(0, 12, 20, 0.82); }
.dialog-art { background-color: #001722; }
.dialog-content { background: var(--navy-surface); }

.dialog-close {
  color: var(--ink);
  border-color: var(--line);
  background: var(--navy-raised);
}

.dialog-kicker,
.dialog-source-link { color: var(--gold); }
.dialog-content h2 { color: var(--ink); font-family: var(--serif); letter-spacing: 0.04em; }
.dialog-en,
.dialog-workline,
.use-line { color: var(--muted); }
.dialog-description { color: #c5d0d3; }

.tag-list span {
  color: #c2ced1;
  border-color: var(--line);
  background: rgba(142, 165, 177, 0.08);
}

.use-line { border-color: var(--line); }
.use-line strong { color: var(--ink); }

.prompt-box {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(1, 29, 46, 0.66);
}

.prompt-text { color: #c5d0d3; }
.copy-button {
  color: #011d2e;
  background: var(--gold-soft);
}

.dialog-nav button {
  color: var(--gold-soft);
  border-color: var(--line);
  background: transparent;
}

.toast {
  color: #011d2e;
  background: var(--gold-soft);
}

.site-footer {
  padding: 70px 5vw 60px;
  color: var(--muted);
  border-top: 1px solid rgba(201, 154, 78, 0.16);
  background: transparent;
  text-align: center;
  font-size: 13px;
  letter-spacing: 2px;
  line-height: 2.2;
}

.site-footer .f-brand {
  display: block;
  width: min(360px, 86vw);
  height: auto;
  margin: 0 auto 18px;
}

.site-footer p { margin: 0; }
.site-footer span { display: block; font-family: Georgia, serif; font-size: 11px; letter-spacing: 0.26em; }

@media (max-width: 960px) {
  .site-nav { padding: 14px 4vw; }
  .site-nav .brand img {
    content: url("/assets/todo-shield.png");
    width: 38px;
    height: 38px;
    object-fit: contain;
  }
  .nav-links { max-width: calc(100vw - 78px); gap: 15px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { margin-left: 0; font-size: 12px; letter-spacing: 1px; white-space: nowrap; }
  .nav-links a[aria-current="page"]::after { bottom: -6px; }
  .nav-links .nav-cta { display: none; }
  .shell { width: min(100% - 8vw, 760px); }
  .hero { min-height: auto; padding-top: 132px; }
}

@media (max-width: 620px) {
  .site-nav { padding-right: 16px; padding-left: 16px; }
  .nav-links { max-width: calc(100vw - 70px); gap: 11px; }
  .nav-links a { font-size: 11.5px; letter-spacing: 0.5px; }
  .shell { width: calc(100% - 36px); }
  .hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 24px;
    padding: 116px 0 42px;
  }
  h1 { font-size: 46px; line-height: 1.12; }
  .hero-random { width: 100%; }
  .reference-section,
  .gallery-section { padding: 72px 0 84px; }
  .reference-section { padding-top: 42px; }
  .reference-head { margin-bottom: 20px; }
  .reference-head h2 { font-size: 32px; line-height: 1.2; }
  .gallery-title h2 { font-size: 30px; line-height: 1.42; }
  .project-selector,
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .project-choice,
  .filter-button { flex: 0 0 auto; }
  .reference-card,
  .competitor-finder,
  .card-art,
  dialog,
  .prompt-box { border-radius: 5px; }
  dialog {
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    transform: none;
  }
  .dialog-layout {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
  }
  .source-notice { display: grid; gap: 14px; }
  .site-footer { padding: 58px 20px 52px; }
}

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