:root {
  color-scheme: light;
  --paper: #f3f1e9;
  --ink: #17282c;
  --muted: #748083;
  --line: rgba(23, 40, 44, .17);
  --card: #fbfaf5;
  --lime: #d6ed62;
  --coral: #e46f52;
  --serif: Georgia, "Noto Serif SC", "Songti SC", serif;
  --sans: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); }
button, input { font: inherit; }
a { color: inherit; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 0 clamp(22px, 5.2vw, 84px); border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; gap: 11px; align-items: center; text-decoration: none; font-size: 9px; font-weight: 800; line-height: 1.12; letter-spacing: .12em; }
.wordmark-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--ink); border-radius: 50%; font-family: var(--serif); font-size: 20px; font-weight: 400; }
.topnav { display: flex; gap: 34px; }
.topnav a { text-decoration: none; font-size: 11px; font-weight: 650; }
.topnav a span { margin-left: 4px; color: var(--muted); font-size: 8px; }
.topbar-note, .eyebrow, .hero-meta, .hero-art-label, .hero-art-footer, .results-line, .footer, .dialog-topline, .dialog-index { font-size: 9px; font-weight: 750; letter-spacing: .11em; }
.topbar-note { color: var(--muted); }
.hero { display: grid; grid-template-columns: minmax(360px, .93fr) minmax(420px, 1.07fr); gap: clamp(34px, 7vw, 110px); align-items: center; min-height: 590px; padding: 76px clamp(22px, 9vw, 144px) 84px; overflow: hidden; }
.hero-copy { max-width: 540px; }
.eyebrow { display: flex; align-items: center; gap: 15px; margin: 0 0 22px; color: var(--muted); text-transform: uppercase; }
.eyebrow span:first-child { color: var(--coral); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 22px; font-family: var(--serif); font-size: clamp(42px, 6.1vw, 82px); font-weight: 500; line-height: 1.1; letter-spacing: -.055em; }
h1 em, .about-content h2 em { color: var(--coral); font-style: normal; }
.hero-description { max-width: 390px; margin-bottom: 27px; color: #526166; font-size: 14px; line-height: 1.9; }
.hero-link { display: inline-flex; gap: 35px; align-items: center; padding: 13px 16px; background: var(--ink); color: var(--paper); font-size: 11px; text-decoration: none; transition: gap .2s, background .2s; }
.hero-link:hover { gap: 48px; background: #29454b; }
.hero-link span:last-child { color: var(--lime); font-size: 16px; }
.hero-meta { display: flex; justify-content: space-between; max-width: 390px; margin-top: 68px; color: var(--muted); font-size: 8px; }
.hero-art { position: relative; max-width: 620px; padding: 17px; background: #e7e5dc; transform: rotate(1.2deg); box-shadow: 18px 20px 0 rgba(23, 40, 44, .08); }
.hero-art::before { position: absolute; z-index: -1; inset: 12px -12px -12px 12px; border: 1px solid var(--coral); content: ""; }
.hero-art-label, .hero-art-footer { display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; }
.hero-art-label { padding: 2px 2px 12px; }
.hero-art-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; min-height: 220px; background: #f9f8f2; }
.hero-art-cell { display: grid; place-items: center; min-width: 0; min-height: 230px; overflow: hidden; background: #f9f8f2; }
.hero-art-cell img { width: 100%; height: 100%; max-height: 330px; object-fit: contain; }
.hero-art-cell.is-empty { color: #aab0ab; font-size: 8px; }
.hero-art-footer { padding: 12px 2px 1px; }
.hero-art-footer span:last-child { color: var(--coral); font-size: 13px; }
.stat-strip { display: grid; grid-template-columns: repeat(3, minmax(100px, 1fr)) minmax(160px, 1.3fr); align-items: center; gap: 22px; padding: 28px clamp(22px, 9vw, 144px); background: var(--ink); color: var(--paper); }
.stat-strip div { display: flex; align-items: baseline; gap: 11px; border-right: 1px solid rgba(243, 241, 233, .2); }
.stat-strip strong { color: var(--lime); font-family: var(--serif); font-size: 34px; font-weight: 400; letter-spacing: -.04em; }
.stat-strip div span { color: rgba(243, 241, 233, .76); font-size: 10px; }
.stat-strip p { margin: 0; color: rgba(243, 241, 233, .66); font-size: 10px; line-height: 1.7; text-align: right; }
.gallery-section { padding: 105px clamp(22px, 6.5vw, 104px) 112px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 25px; margin-bottom: 37px; }
.section-heading h2 { margin: 0; font-family: var(--serif); font-size: clamp(32px, 4vw, 52px); font-weight: 500; letter-spacing: -.045em; }
.section-heading h2 span { color: var(--muted); font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.section-intro { max-width: 240px; margin: 0 0 5px; color: var(--muted); font-size: 11px; line-height: 1.8; text-align: right; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-button { padding: 9px 13px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: #627075; cursor: pointer; font-size: 10px; transition: color .15s, background .15s, border .15s; }
.filter-button:hover { border-color: var(--line); color: var(--ink); }
.filter-button.is-active { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.search-box { display: flex; align-items: center; gap: 8px; width: min(235px, 100%); padding: 8px 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .35); }
.search-icon { color: var(--coral); font-size: 19px; line-height: .7; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 10px; }
.search-box kbd { padding: 2px 5px; border: 1px solid var(--line); color: var(--muted); font-size: 8px; }
.results-line { display: flex; justify-content: space-between; gap: 10px; padding: 19px 0 14px; color: var(--muted); font-size: 8px; letter-spacing: .055em; }
.gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.role-card { min-width: 0; padding: 15px; border: 1px solid rgba(23, 40, 44, .09); background: var(--card); transition: border-color .2s, transform .2s; }
.role-card:hover { border-color: rgba(23, 40, 44, .35); transform: translateY(-2px); }
.role-card-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.role-card-heading h3 { overflow: hidden; margin: 0; font-family: var(--serif); font-size: 17px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.role-card-heading h3 span { margin-left: 7px; color: var(--muted); font-family: var(--sans); font-size: 9px; font-weight: 500; }
.role-card-heading button { flex: 0 0 auto; padding: 0; border: 0; background: none; color: var(--coral); cursor: pointer; font-size: 9px; }
.role-outputs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.gallery-grid.is-filtered .role-outputs { grid-template-columns: minmax(0, 1fr); }
.output-cell { min-width: 0; }
.output-button { display: block; width: 100%; padding: 0; border: 0; background: #eae9e1; cursor: zoom-in; }
.image-frame { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; background: #eeede7; }
.image-frame img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform .35s; }
.output-button:hover .image-frame img { transform: none; }
.missing-image { display: grid; place-items: center; aspect-ratio: 4 / 5; padding: 8px; background: #eeede7; color: #969e9a; font-size: 9px; text-align: center; }
.output-label { display: flex; justify-content: space-between; gap: 3px; padding: 7px 1px 0; color: var(--muted); font-size: 8px; }
.output-label strong { overflow: hidden; color: var(--ink); font-size: 8px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { padding: 65px 10px; color: var(--muted); text-align: center; }
.about-section { padding: 75px clamp(22px, 9vw, 144px) 86px; background: #e6e7df; }
.about-content { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 9vw, 140px); align-items: start; }
.about-content h2 { margin: 0; font-family: var(--serif); font-size: clamp(39px, 5vw, 68px); font-weight: 500; line-height: 1.12; letter-spacing: -.05em; }
.about-copy { max-width: 520px; }
.about-copy p { color: #536166; font-size: 12px; line-height: 1.9; }
.model-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 24px; }
.model-tag { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); font-size: 10px; }
.model-tag span:last-child { color: var(--muted); }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 25px clamp(22px, 5.2vw, 84px); color: var(--muted); font-size: 8px; }
.footer a { color: var(--ink); text-decoration: none; }
.detail-dialog { width: min(1100px, calc(100% - 28px)); max-height: min(92vh, 1000px); padding: 22px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); box-shadow: 0 24px 100px rgba(0, 0, 0, .25); }
.detail-dialog::backdrop { background: rgba(12, 27, 31, .7); backdrop-filter: blur(4px); }
.dialog-topline { display: flex; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.dialog-close { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; font-size: 20px; line-height: 1; }
.dialog-heading { display: flex; justify-content: space-between; align-items: end; padding: 22px 0; }
.dialog-heading .eyebrow { margin-bottom: 6px; }
.dialog-heading h2 { margin: 0; font-family: var(--serif); font-size: clamp(28px, 4vw, 42px); font-weight: 500; }
.dialog-heading h2 span { margin-left: 9px; color: var(--muted); font-family: var(--sans); font-size: 13px; }
.dialog-index { color: var(--muted); }
.dialog-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dialog-item { min-width: 0; }
.dialog-item-label { padding: 9px 0; color: var(--muted); font-size: 10px; }
.dialog-image, .dialog-placeholder { display: grid; place-items: center; width: 100%; aspect-ratio: 3 / 4; background: var(--card); object-fit: contain; }
.dialog-placeholder { color: var(--muted); font-size: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr 1fr; padding-right: 6vw; padding-left: 6vw; }
  .stat-strip, .gallery-section, .about-section { padding-right: 6vw; padding-left: 6vw; }
  .gallery-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar { min-height: 64px; padding: 0 18px; }
  .topbar-note { display: none; }
  .topnav { gap: 16px; }
  .topnav a { font-size: 10px; }
  .hero { grid-template-columns: 1fr; gap: 43px; min-height: 0; padding: 57px 22px 64px; }
  .hero-description { font-size: 13px; }
  .hero-meta { margin-top: 35px; }
  .hero-art { width: calc(100% - 10px); margin-left: 4px; }
  .hero-art-cell { min-height: 170px; }
  .stat-strip { grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 20px 18px; }
  .stat-strip div { display: block; }
  .stat-strip strong { display: block; font-size: 27px; }
  .stat-strip div span { font-size: 9px; }
  .stat-strip p { display: none; }
  .gallery-section { padding: 67px 16px 72px; }
  .section-heading { display: block; margin-bottom: 23px; }
  .section-intro { margin-top: 12px; text-align: left; }
  .section-heading h2 span { display: block; margin-top: 5px; }
  .toolbar { display: block; }
  .search-box { width: 100%; margin-top: 12px; }
  .results-line { font-size: 7px; }
  .role-card { padding: 9px; }
  .role-outputs { gap: 4px; }
  .output-label { display: block; }
  .output-label strong { display: block; margin-top: 3px; }
  .about-section { padding: 60px 22px; }
  .about-content { grid-template-columns: 1fr; gap: 25px; }
  .footer { flex-wrap: wrap; padding: 21px 18px; }
  .dialog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-dialog { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Gallery UX 2.0: keep the existing palette and image-led layout. */
html { scrollbar-gutter: stable; }
body.modal-open { overflow: hidden; }
.dialog-heading { gap: 16px; align-items: center; }
.dialog-heading > div:first-child { min-width: 0; }
.dialog-navigation { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.dialog-prev, .dialog-next, .dialog-close { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.dialog-prev, .dialog-next { border-radius: 50%; font-size: 20px; }
.dialog-navigation button:disabled { opacity: .4; cursor: default; }
.dialog-index { font-size: 11px; white-space: nowrap; }
.dialog-image-button { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.dialog-image-button:hover { outline: 1px solid var(--coral); }
.dialog-item-label { color: var(--ink); font-size: 12px; }
.image-viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 12px 18px 18px; border: 0; background: var(--paper); color: var(--ink); overflow: hidden; }
.image-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
.image-viewer::backdrop { background: rgba(12, 27, 31, .92); }
.viewer-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 44px; }
.viewer-header p { min-width: 0; margin: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-controls { display: flex; gap: 6px; flex-shrink: 0; }
.viewer-controls button { min-width: 44px; height: 44px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--ink); cursor: pointer; font-size: 18px; }
#viewer-reset { font-size: 12px; }
.viewer-controls button:disabled { opacity: .4; cursor: default; }
.viewer-stage { position: relative; min-height: 0; overflow: hidden; touch-action: none; user-select: none; }
.viewer-stage.is-zoomed { cursor: grab; }
.viewer-stage.is-zoomed:active { cursor: grabbing; }
#viewer-image { position: absolute; left: 50%; top: 50%; max-width: none; object-fit: contain; pointer-events: none; }
@media (max-width: 640px) {
  .role-outputs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 8px; }
  .gallery-grid.is-filtered .role-outputs { grid-template-columns: 1fr; }
  .output-label { display: flex; align-items: center; font-size: 11px; padding-top: 8px; }
  .output-label strong { margin: 0; font-size: 12px; }
  .role-card { padding: 12px; }
  .role-card-heading { align-items: center; gap: 8px; }
  .role-card-heading h3 { font-size: 18px; white-space: normal; line-height: 1.4; }
  .role-card-heading h3 span { display: block; margin: 2px 0 0; font-size: 11px; overflow-wrap: anywhere; }
  .role-card-heading button { min-height: 44px; font-size: 12px; }
  .filter-button { min-height: 44px; font-size: 12px; }
  .search-box { min-height: 44px; }
  .search-box input { font-size: 16px; }
  .results-line { flex-wrap: wrap; font-size: 10px; line-height: 1.5; }
  .dialog-heading { flex-wrap: wrap; padding: 16px 0; }
  .dialog-heading h2 span { display: block; margin: 5px 0 0; font-size: 12px; overflow-wrap: anywhere; }
  .dialog-navigation { justify-content: space-between; width: 100%; }
  .detail-dialog { max-height: 94dvh; }
  .dialog-grid { gap: 12px 8px; }
  .image-viewer { padding: 10px 10px 14px; }
  .viewer-header { flex-wrap: wrap; gap: 6px; }
  .viewer-header p { width: 100%; font-size: 12px; }
  .viewer-controls { margin-left: auto; }
}

.image-shell { position: relative; }
.image-shell img { opacity: 0; transition: opacity .16s ease; }
.image-shell.is-loaded img { opacity: 1; }
.image-feedback { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; padding: 8px; background: var(--card); color: var(--muted); font-size: 11px; text-align: center; pointer-events: none; }
.image-feedback[hidden] { display: none; }
.image-shell.is-error .image-feedback { pointer-events: auto; }
.image-retry { min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--ink); cursor: pointer; font-size: 12px; }
.image-retry[hidden] { display: none; }
.hero-media { width: 100%; height: 100%; }
.gallery-more { display: block; min-height: 44px; margin: 28px auto 0; padding: 10px 26px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; font-size: 12px; }
.gallery-more[hidden] { display: none; }
#search-clear { width: 32px; min-width: 32px; height: 32px; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 20px; }
#search-clear[hidden] { display: none; }
@media (max-width: 640px) {
  #search-clear { height: 44px; width: 40px; min-width: 40px; }
}

@media (min-width: 641px) {
  .output-label { font-size: 10px; }
  .output-label strong { font-size: 11px; }
  .role-card-heading h3 span { font-size: 10px; }
  .role-card-heading button { min-height: 32px; font-size: 11px; }
  .search-box input { font-size: 12px; }
}
