:root {
  --wine-950: #321310;
  --wine-900: #481a17;
  --wine-800: #5b241f;
  --wine-700: #73342c;
  --wine-100: #f3ded1;
  --ink: #2c211b;
  --muted: #71635a;
  --paper: #fffaf0;
  --paper-soft: #f6ead7;
  --paper-deep: #e6d1af;
  --green: #496647;
  --white: #fff;
  --shadow: 0 22px 70px rgb(62 30 17 / 20%);
  --radius-lg: 28px;
  --radius-md: 18px;
  --header-height: clamp(120px, 10vw, 140px);
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper-deep);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background-color: var(--paper-deep);
  background-image:
    linear-gradient(180deg, rgb(255 248 231 / 8%), rgb(255 248 231 / 74%)),
    url("assets/design/museum-background.jpg");
  background-position: center, center bottom;
  background-size: cover, max(1440px, 112.5vw, 131vh) auto;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 4px solid #d39547;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.site-shell {
  min-height: 100vh;
  min-height: 100svh;
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px clamp(18px, 4vw, 58px);
  color: var(--white);
  background:
    linear-gradient(135deg, rgb(255 255 255 / 4%) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(90deg, var(--wine-950), var(--wine-700));
  box-shadow: 0 8px 28px rgb(50 19 16 / 24%);
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: clamp(12px, 2vw, 22px);
  padding: 0;
  color: inherit;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.brand-mark {
  width: clamp(100px, 9vw, 120px);
  aspect-ratio: 1;
  flex: none;
  border: 2px solid rgb(255 255 255 / 88%);
  border-radius: 50%;
  background-color: #fff;
  background-image: url("assets/design/logo-uole-mark.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  box-shadow: 0 5px 16px rgb(0 0 0 / 24%);
}

.brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-museum {
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(11px, 1.35vw, 17px);
  letter-spacing: .055em;
  line-height: 1.15;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-department {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 700;
  letter-spacing: .045em;
  line-height: 1;
  text-transform: uppercase;
}

.utility-button {
  display: inline-flex;
  min-height: 48px;
  flex: none;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  color: var(--white);
  border: 1px solid rgb(255 255 255 / 32%);
  border-radius: 999px;
  background: rgb(255 255 255 / 9%);
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.utility-button:hover {
  background: rgb(255 255 255 / 17%);
}

.utility-button:active {
  transform: scale(.97);
}

.utility-icon {
  font-size: 24px;
  line-height: 1;
}

.main-content {
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
}

.search-view {
  display: grid;
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  place-items: center;
  padding: clamp(22px, 4vw, 52px);
}

.search-panel {
  display: grid;
  width: min(1120px, 100%);
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr);
  gap: clamp(28px, 5vw, 76px);
  align-items: center;
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid rgb(102 63 36 / 15%);
  border-radius: var(--radius-lg);
  background: rgb(255 250 240 / 94%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.search-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 13px;
  color: var(--wine-700);
  font-size: clamp(12px, 1.25vw, 15px);
  font-weight: 750;
  letter-spacing: .105em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

.search-copy h1 {
  max-width: 720px;
  margin-bottom: 15px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 5.2vw, 68px);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.02;
}

.lead {
  max-width: 590px;
  margin-bottom: clamp(24px, 4vw, 42px);
  color: var(--muted);
  font-size: clamp(17px, 1.8vw, 22px);
  line-height: 1.48;
}

.number-form label {
  display: block;
  margin-bottom: 9px;
  font-size: 14px;
  font-weight: 700;
}

.number-field {
  position: relative;
  display: flex;
  min-height: 86px;
  align-items: center;
  border: 2px solid #c7a67e;
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: inset 0 2px 5px rgb(58 32 18 / 7%);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.number-field:focus-within {
  border-color: var(--wine-700);
  box-shadow: 0 0 0 5px rgb(115 52 44 / 10%);
}

.number-sign {
  padding-left: 22px;
  color: var(--wine-700);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 700;
}

.number-field input {
  width: 100%;
  min-width: 0;
  padding: 9px 54px 9px 10px;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 44px;
  font-weight: 750;
  letter-spacing: .08em;
}

.number-field input::placeholder {
  color: #cbbcac;
}

.clear-button {
  position: absolute;
  right: 10px;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--muted);
  border: 0;
  border-radius: 50%;
  background: var(--paper-soft);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.field-message {
  min-height: 24px;
  margin: 8px 0 4px;
  color: #9d2828;
  font-size: 14px;
  font-weight: 650;
}

.primary-button {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 24px;
  color: var(--white);
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--wine-700), var(--wine-900));
  box-shadow: 0 10px 24px rgb(91 36 31 / 24%);
  font-size: 18px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.primary-button:hover {
  box-shadow: 0 14px 30px rgb(91 36 31 / 30%);
  transform: translateY(-1px);
}

.primary-button:active {
  transform: translateY(1px);
}

.primary-button:disabled,
body[data-loading="true"] .keypad button {
  cursor: wait;
  opacity: .52;
}

.search-submit {
  width: 100%;
}

.catalog-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.offline-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  color: var(--green);
  border: 1px solid #a9bda7;
  border-radius: 999px;
  background: rgb(255 255 255 / 62%);
  font-size: 13px;
  font-weight: 720;
  cursor: pointer;
}

.offline-button:hover {
  background: #fff;
}

.offline-button:disabled {
  cursor: wait;
  opacity: .72;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: #c28c49;
  box-shadow: 0 0 0 4px rgb(194 140 73 / 14%);
}

body[data-loading="false"] .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgb(73 102 71 / 14%);
}

.keypad {
  display: grid;
  width: min(410px, 100%);
  justify-self: end;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 12px;
  padding: clamp(16px, 2.5vw, 28px);
  border: 1px solid #d4bea0;
  border-radius: 24px;
  background: linear-gradient(145deg, #ead7ba, #d9b991);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 70%), 0 18px 38px rgb(89 51 30 / 16%);
}

.keypad button {
  min-height: clamp(60px, 7.2vw, 78px);
  padding: 8px;
  color: #38251a;
  border: 1px solid #b58b5f;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff1ce, #f0c98f);
  box-shadow: 0 4px 0 #9f7652, 0 8px 14px rgb(83 47 26 / 13%);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 3.6vw, 38px);
  font-weight: 700;
  cursor: pointer;
  transition: transform 90ms ease, box-shadow 90ms ease, filter 90ms ease;
}

.keypad button:hover {
  filter: brightness(1.035);
}

.keypad button:active {
  box-shadow: 0 1px 0 #9f7652;
  transform: translateY(3px);
}

.keypad .keypad-action,
.keypad .keypad-enter {
  color: var(--white);
  border-color: #72433a;
  background: linear-gradient(180deg, #8a5144, #683229);
  box-shadow: 0 4px 0 #4b211b, 0 8px 14px rgb(67 30 24 / 18%);
  font-family: Inter, "Segoe UI", sans-serif;
}

.card-view {
  width: min(1480px, 100%);
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100svh - var(--header-height));
  margin: 0 auto;
  padding: clamp(18px, 3vw, 38px);
}

.exhibit-card {
  display: grid;
  min-height: calc(100vh - var(--header-height) - clamp(36px, 6vw, 76px));
  min-height: calc(100svh - var(--header-height) - clamp(36px, 6vw, 76px));
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid rgb(102 63 36 / 15%);
  border-radius: var(--radius-lg);
  background: rgb(255 250 240 / 96%);
  box-shadow: var(--shadow);
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(20px, 3vw, 38px);
  border-bottom: 1px solid #ead9c2;
  background: rgb(255 255 255 / 44%);
}

.number-badge {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  padding: 7px 16px;
  color: var(--white);
  border-radius: 999px;
  background: var(--wine-800);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .035em;
}

.back-to-search {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: var(--wine-800);
  border: 1px solid #d9bea0;
  border-radius: 999px;
  background: var(--white);
  font-weight: 720;
  cursor: pointer;
}

.card-layout {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(330px, .86fr) minmax(0, 1.14fr);
}

.visual-panel {
  display: grid;
  min-height: 0;
  align-content: center;
  padding: clamp(18px, 3vw, 38px);
  border-right: 1px solid #ead9c2;
  background: linear-gradient(145deg, #ead8bb, #f5e9d5);
}

.exhibit-figure {
  display: grid;
  gap: 13px;
  margin: 0;
}

.image-frame {
  position: relative;
  display: grid;
  min-height: 290px;
  overflow: hidden;
  place-items: center;
  border: 8px solid var(--white);
  border-radius: 22px;
  background: #eee9e2;
  box-shadow: 0 15px 36px rgb(64 40 24 / 18%);
}

.image-frame img {
  display: block;
  width: 100%;
  height: min(57vh, 580px);
  object-fit: contain;
  background: #f5f4f2;
}

.no-photo {
  display: grid;
  width: 100%;
  min-height: min(48vh, 460px);
  place-items: center;
  padding: 28px;
  color: #806e62;
  text-align: center;
  background:
    radial-gradient(circle at 50% 36%, rgb(115 52 44 / 10%) 0 12%, transparent 12.5%),
    linear-gradient(145deg, #f3eee7, #e4d9ca);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.figure-caption {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.gallery-controls button {
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--wine-800);
  border: 1px solid #ccb292;
  border-radius: 50%;
  background: var(--white);
  font-size: 22px;
  cursor: pointer;
}

.gallery-count {
  min-width: 50px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.info-panel {
  min-height: 0;
  overflow-y: auto;
  padding: clamp(24px, 4vw, 52px);
  scrollbar-color: #b68e69 transparent;
  scrollbar-width: thin;
}

.info-panel h1 {
  margin-bottom: 13px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4vw, 50px);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.08;
}

.info-panel h1 em {
  color: var(--wine-700);
  font-weight: 500;
}

.short-note {
  margin-bottom: 16px;
  color: var(--wine-800);
  font-size: 18px;
  font-weight: 670;
  line-height: 1.45;
}

.translation {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: baseline;
  margin-bottom: clamp(22px, 3vw, 34px);
  padding-bottom: 22px;
  color: var(--muted);
  border-bottom: 1px solid #ead9c2;
  font-size: 15px;
  line-height: 1.45;
}

.translation-label {
  padding: 4px 8px;
  color: var(--green);
  border: 1px solid #aac0a8;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.information-grid {
  display: grid;
  gap: 28px;
}

.content-section h2 {
  margin-bottom: 13px;
  color: var(--wine-800);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(23px, 2.3vw, 30px);
  font-weight: 650;
}

.description-copy {
  color: #40352d;
  font-size: clamp(16px, 1.55vw, 18px);
  line-height: 1.67;
}

.description-copy p {
  margin-bottom: .82em;
}

.empty-copy {
  color: var(--muted);
  font-style: italic;
}

.taxonomy-list {
  display: grid;
  gap: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid #dfc9ac;
  border-radius: 17px;
  background: rgb(255 255 255 / 55%);
}

.taxonomy-row {
  display: grid;
  grid-template-columns: minmax(92px, .32fr) 1fr;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid #ead9c2;
}

.taxonomy-row:last-child {
  border-bottom: 0;
}

.taxonomy-row dt {
  color: var(--wine-700);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .035em;
}

.taxonomy-row dd {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.35;
}

.card-navigation {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  padding: 14px clamp(18px, 3vw, 36px);
  border-top: 1px solid #dec7a7;
  background: #ead8bb;
}

.nav-button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 18px;
  color: var(--wine-900);
  border: 1px solid #c5a57d;
  border-radius: 15px;
  background: var(--paper);
  font-weight: 760;
  cursor: pointer;
}

.nav-button.next {
  justify-self: stretch;
}

.nav-button.previous {
  justify-self: stretch;
}

.nav-button.home {
  min-width: 150px;
  color: var(--white);
  border-color: var(--wine-800);
  background: var(--wine-800);
}

.nav-number {
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 13px 17px;
  color: var(--white);
  border-radius: 13px;
  background: var(--wine-900);
  box-shadow: 0 12px 32px rgb(0 0 0 / 28%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

noscript {
  display: block;
  padding: 24px;
  color: #fff;
  background: #8f2424;
  text-align: center;
}

@media (max-width: 900px) {
  .search-panel {
    grid-template-columns: minmax(0, 1fr) minmax(300px, .72fr);
    gap: 28px;
  }

  .card-layout {
    grid-template-columns: minmax(300px, .82fr) minmax(0, 1.18fr);
  }

  .info-panel {
    padding: 28px;
  }
}

@media (max-width: 720px) {
  :root {
    --radius-lg: 20px;
  }

  body {
    background-image:
      radial-gradient(circle at 18% 20%, rgb(255 250 231 / 72%), transparent 42%),
      linear-gradient(160deg, #ead1a5, #f3e3c5 56%, #d6bea0);
    background-position: center;
    background-size: cover;
    background-attachment: scroll;
  }

  .site-header {
    gap: 10px;
    padding: 8px 14px;
  }

  .brand-mark {
    width: 78px;
  }

  .brand-museum {
    max-width: 54vw;
    font-size: 9px;
  }

  .brand-department {
    font-size: clamp(18px, 5.3vw, 25px);
  }

  .utility-button {
    width: 46px;
    height: 46px;
    min-height: 46px;
    justify-content: center;
    padding: 0;
  }

  .utility-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .search-view {
    align-items: start;
    padding: 16px;
  }

  .search-panel {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 25px 20px;
  }

  .search-copy h1 {
    font-size: clamp(36px, 10.5vw, 48px);
  }

  .lead {
    margin-bottom: 24px;
  }

  .number-field {
    min-height: 74px;
  }

  .number-field input {
    font-size: 38px;
  }

  .keypad {
    width: 100%;
    justify-self: stretch;
    gap: 10px;
    padding: 14px;
  }

  .keypad button {
    min-height: 58px;
    font-size: 28px;
  }

  .card-view {
    padding: 12px;
  }

  .exhibit-card {
    min-height: 0;
  }

  .card-heading {
    padding: 13px 14px;
  }

  .number-badge {
    min-height: 42px;
    font-size: 17px;
  }

  .back-to-search {
    min-height: 42px;
  }

  .card-layout {
    grid-template-columns: 1fr;
  }

  .visual-panel {
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid #ead9c2;
  }

  .image-frame {
    min-height: 260px;
    border-width: 6px;
  }

  .image-frame img {
    height: min(54vh, 470px);
  }

  .info-panel {
    overflow: visible;
    padding: 24px 19px 30px;
  }

  .info-panel h1 {
    font-size: clamp(30px, 8.3vw, 42px);
  }

  .translation {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .translation-label {
    width: max-content;
  }

  .taxonomy-row {
    grid-template-columns: 86px 1fr;
    padding: 11px 12px;
  }

  .card-navigation {
    position: sticky;
    z-index: 8;
    bottom: 0;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 7px;
    padding: 9px;
    padding-bottom: max(9px, env(safe-area-inset-bottom));
  }

  .nav-button {
    min-width: 0;
    min-height: 52px;
    padding: 8px;
    font-size: 13px;
  }

  .nav-button.home {
    min-width: 0;
  }

  .nav-number {
    display: none;
  }
}

@media (max-width: 390px) {
  .brand-museum {
    display: none;
  }

  .search-panel {
    padding: 22px 16px;
  }

  .taxonomy-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

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

@media print {
  .site-header,
  .card-heading,
  .card-navigation,
  .gallery-controls {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .card-view,
  .exhibit-card {
    min-height: 0;
    padding: 0;
    box-shadow: none;
  }
}
