:root {
  color-scheme: light;
  --bg: #f4f4f1;
  --panel: #ffffff;
  --ink: #171717;
  --muted: #777;
  --line: #d8d8d2;
  --line-dark: #b8b8b1;
  --accent: #111;
  --active: #222;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, "Helvetica Neue", "Noto Sans SC", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 84px 1fr auto;
  align-items: center;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 244, 241, 0.96);
  backdrop-filter: blur(18px);
}

.logo {
  display: grid;
  width: 84px;
  height: 76px;
  place-items: center;
  border-right: 1px solid var(--line);
  font-family: Georgia, serif;
  font-size: 3.2rem;
  font-weight: 700;
  line-height: 1;
}

.artist-name {
  justify-self: center;
  font-size: clamp(1.25rem, 2.2vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.16em;
}

.top-actions {
  display: flex;
  align-items: center;
  min-height: 76px;
  border-left: 1px solid var(--line);
}

.top-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 0 18px;
}

.top-search span {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.top-search input {
  width: min(24vw, 260px);
  min-width: 150px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-dark);
  border-radius: 0;
  background: var(--panel);
  outline: none;
}

.top-search input:focus {
  border-color: var(--ink);
}

.menu-toggle {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
}

.menu-toggle span + span {
  margin-top: -18px;
}

.menu-toggle span:nth-child(3) {
  margin-top: -36px;
}

.menu-panel {
  position: fixed;
  top: 76px;
  right: 0;
  z-index: 40;
  display: grid;
  width: min(320px, 100%);
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.menu-panel[hidden] {
  display: none;
}

.menu-panel a {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  font-size: 1.05rem;
}

.menu-panel a:hover {
  background: #efefeb;
}

.timeline-section {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 34px;
  padding: 34px clamp(18px, 4vw, 56px) 42px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.timeline-heading p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.timeline-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 0.95;
}

.timeline {
  position: relative;
  min-height: 120px;
  margin-top: 18px;
  padding: 0 4px;
  touch-action: none;
  user-select: none;
}

.timeline-line {
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line-dark);
}

.timeline-range {
  position: absolute;
  top: 45px;
  left: var(--range-start, 0%);
  width: calc(var(--range-end, 100%) - var(--range-start, 0%));
  height: 3px;
  background: #d8ad55;
  pointer-events: none;
}

.tick {
  position: absolute;
  top: 58px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 0.76rem;
}

.tick::before {
  content: "";
  position: absolute;
  top: -16px;
  left: 50%;
  width: 1px;
  height: 10px;
  background: var(--line-dark);
}

.timeline-handle {
  position: absolute;
  top: 31px;
  z-index: 3;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--panel);
  cursor: grab;
  transform: translateX(-50%);
}

.timeline-handle:active {
  cursor: grabbing;
}

.timeline-handle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.timeline-handle span {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.timeline-point {
  position: absolute;
  top: 35px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--panel);
  cursor: pointer;
  transform: translateX(-50%);
}

.timeline-point.is-out-of-range {
  opacity: 0.28;
}

.timeline-point span {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.74rem;
  font-weight: 700;
}

.collection-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
}

.works-area {
  min-width: 0;
  padding: clamp(34px, 5vw, 72px) clamp(18px, 4vw, 56px);
}

.painting-section {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 60px);
  padding: 0 0 clamp(64px, 9vw, 118px);
}

.section-title {
  position: sticky;
  top: 112px;
  align-self: start;
}

.section-title span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 34px);
}

.oil-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
}

.work-card {
  min-width: 0;
  scroll-margin-top: 120px;
}

.work-card.is-hidden,
.painting-section.is-empty-hidden {
  display: none;
}

.work-card.wide {
  grid-row: span 2;
}

.work-open {
  display: grid;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.work-open img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #e8e8e2;
}

.work-card.wide img {
  aspect-ratio: 1 / 1;
}

.work-info {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0 18px;
  border-bottom: 1px solid var(--line);
}

.work-info strong {
  font-size: 1rem;
}

.work-info small {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.empty-section p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.side-guide {
  position: sticky;
  top: 76px;
  min-height: calc(100vh - 76px);
  border-left: 1px solid var(--line);
  background: var(--panel);
}

.guide-block {
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.guide-block h3 {
  margin: 0 0 18px;
  font-size: 1rem;
  letter-spacing: 0.12em;
}

.work-directory {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.work-directory a:hover {
  color: var(--ink);
}

.filter-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.filter-button {
  min-height: 42px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.filter-button:nth-child(2n) {
  border-right: 0;
}

.filter-button:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.filter-button.is-active,
.filter-button:hover {
  color: var(--panel);
  background: var(--active);
}

.filter-list {
  display: grid;
  gap: 0;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.filter-list li.is-hidden {
  display: none;
}

.filter-list button {
  width: 100%;
  min-height: 42px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.filter-list button:hover {
  color: var(--ink);
}

.contact {
  display: grid;
  grid-template-columns: 260px minmax(0, 580px);
  gap: 34px;
  padding: 64px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.contact h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 3.2rem);
}

.contact p {
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.work-dialog {
  width: min(980px, calc(100% - 28px));
  padding: 0;
  border: 0;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.work-dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.work-dialog[open] {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 0.8fr);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 1px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.dialog-image {
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: cover;
  background: #e8e8e2;
}

.dialog-content {
  align-self: center;
  padding: clamp(28px, 5vw, 56px);
}

.dialog-type {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
}

.dialog-content h3 {
  margin: 0 0 24px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

.dialog-content dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 26px;
}

.dialog-content dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.dialog-content dd {
  margin: 6px 0 0;
  font-weight: 700;
}

.dialog-desc {
  margin: 0;
  color: #444;
  line-height: 1.85;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 70px 1fr auto;
  }

  .logo,
  .menu-toggle {
    width: 70px;
  }

  .timeline-section,
  .collection-layout,
  .painting-section,
  .contact,
  .work-dialog[open] {
    grid-template-columns: 1fr;
  }

  .side-guide {
    position: static;
    min-height: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .section-title {
    position: static;
  }
}

@media (max-width: 680px) {
  .topbar {
    grid-template-columns: 60px 1fr 60px;
  }

  .logo,
  .menu-toggle {
    width: 60px;
    height: 68px;
  }

  .artist-name {
    font-size: 1rem;
  }

  .top-search {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    min-height: 58px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--bg);
  }

  .top-search input {
    width: 100%;
  }

  .menu-panel {
    top: 68px;
  }

  .timeline-section {
    margin-top: 58px;
  }

  .works-grid,
  .oil-grid {
    grid-template-columns: 1fr;
  }

  .work-info,
  .contact {
    display: block;
  }

  .work-info small {
    display: block;
    margin-top: 6px;
  }

  .dialog-image {
    min-height: 320px;
    max-height: 58vh;
  }

  .dialog-content dl {
    grid-template-columns: 1fr;
  }
}
