* { box-sizing: border-box; }

:root {
  --site-btn-size: 42px;
  --site-btn-radius: 12px;
  --site-btn-font: "IBM Plex Mono", "Avenir Next", "SF Pro Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --site-btn-border: rgba(178, 188, 206, 0.72);
  --site-btn-border-hover: rgba(228, 234, 246, 0.92);
  --bg-paper: #f2f1ec;
  --bg-ink: #141311;
  --panel-bg: rgba(255, 255, 255, 0.72);
  --panel-border: rgba(20, 19, 17, 0.14);
  --muted-text: rgba(20, 19, 17, 0.68);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(120% 90% at 12% 8%, rgba(202, 111, 72, 0.20), rgba(202, 111, 72, 0) 46%),
    radial-gradient(90% 74% at 88% 16%, rgba(65, 93, 139, 0.14), rgba(65, 93, 139, 0) 52%),
    linear-gradient(165deg, #f7f5ee 0%, var(--bg-paper) 48%, #ece8df 100%);
  color: var(--bg-ink);
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.home-page .wrap,
body.legal-page .wrap {
  position: relative;
}

.wrap {
  max-width: 820px;
  margin: 120px auto 100px;
  padding: 44px 34px;
  border-radius: 24px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  box-shadow: 0 20px 52px rgba(24, 16, 14, 0.10);
  animation: fadeIn 600ms ease both;
}

h1 {
  margin: 0 0 28px;
  font-weight: 700;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: 1.3px;
  line-height: 1.18;
}

a {
  color: inherit;
}

.lang-switch-fixed {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 10px;
  z-index: 20;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(16, 20, 26, 0.18);
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(8px) saturate(125%);
}

.lang-switch-fixed .lang-toggle {
  position: relative;
  width: 96px;
  height: var(--site-btn-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--site-btn-radius);
  border: 1px solid var(--site-btn-border);
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(255,255,255,0.16), rgba(255,255,255,0) 48%),
    linear-gradient(160deg, rgba(18,22,30,1), rgba(8,11,15,1));
  color: rgba(252,252,255,0.99);
  font-family: var(--site-btn-font);
  box-shadow: 0 8px 16px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
  cursor: pointer;
  user-select: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}

.lang-switch-fixed .lang-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.lang-switch-fixed .lang-toggle-track {
  position: absolute;
  left: 6px;
  top: 6px;
  width: 38px;
  height: 28px;
  border-radius: 9px;
  background: rgba(242, 245, 252, 0.94);
  box-shadow: 0 2px 6px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.75);
  transition: transform 140ms ease;
}

.lang-switch-fixed .lang-toggle input:checked + .lang-toggle-track {
  transform: translateX(46px);
}

.lang-switch-fixed .lang-toggle-labels {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.55px;
  pointer-events: none;
}

.lang-switch-fixed .lang-toggle-labels span {
  text-align: center;
  color: rgba(252,252,255,0.85);
  transition: color 140ms ease;
}

.lang-switch-fixed .lang-toggle input:not(:checked) ~ .lang-toggle-labels span:first-child,
.lang-switch-fixed .lang-toggle input:checked ~ .lang-toggle-labels span:last-child {
  color: rgba(14,17,23,0.98);
}

.lang-switch-fixed .lang-toggle:hover,
.lang-switch-fixed .lang-toggle:focus-within {
  border-color: var(--site-btn-border-hover);
  box-shadow: 0 0 0 2px rgba(228,234,246,0.26), 0 10px 18px rgba(0,0,0,0.44), inset 0 1px 0 rgba(255,255,255,0.24);
}

.lang-switch-fixed .lang-toggle:active {
  transform: translateY(2px) scale(0.96);
}

.lang-switch-fixed .lang-select.sr-only,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.intro {
  max-width: 60ch;
  font-size: 15px;
  line-height: 1.95;
  margin-bottom: 72px;
  color: var(--muted-text);
}

.section-title {
  margin: 0 0 25px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: rgba(20, 19, 17, 0.54);
}

.exhibitions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.exhibition-card {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(20, 19, 17, 0.14);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(250, 248, 244, 0.90));
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(21, 18, 16, 0.08);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.exhibition-card:hover {
  transform: translateY(-5px);
  border-color: rgba(202, 111, 72, 0.54);
  box-shadow: 0 20px 40px rgba(21, 18, 16, 0.16);
}

.exhibition-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.exhibition-card .year-tag {
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 4px 8px;
  font-size: 11px;
  letter-spacing: 1.1px;
  color: #fff;
  background: rgba(15, 16, 21, 0.82);
  border-radius: 999px;
}

.exhibition-card .card-info {
  padding: 15px 15px 16px;
  display: grid;
  gap: 6px;
}

.exhibition-card .title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.3px;
}

.exhibition-card .details {
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.2px;
  color: rgba(20, 19, 17, 0.70);
}

.back {
  display: inline-flex;
  margin: 0 0 18px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  text-decoration: none;
  color: rgba(20, 19, 17, 0.58);
}

.back:hover {
  color: rgba(20, 19, 17, 0.92);
}

.meta {
  margin: -8px 0 24px;
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.8px;
  color: rgba(20, 19, 17, 0.56);
}

.exhibition-text {
  margin-top: 30px;
  margin-bottom: 140px;
  width: min(80%, 68ch);
  font-size: 12px;
  line-height: 1.9;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(20, 19, 17, 0.60);
}

.exhibition-text p {
  margin: 0 0 22px;
}

.exhibition-text p:first-child {
  font-weight: 500;
  letter-spacing: 0.3px;
}

.site-footer {
  position: relative;
  margin-top: 44px;
  padding: 16px 16px 14px;
  border: 1px solid rgba(20, 19, 17, 0.18);
  border-radius: 14px;
  background:
    radial-gradient(120% 120% at 8% 8%, rgba(98, 106, 124, 0.08), rgba(98, 106, 124, 0) 50%),
    radial-gradient(90% 90% at 92% 16%, rgba(130, 145, 170, 0.06), rgba(130, 145, 170, 0) 56%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.78), rgba(242, 241, 237, 0.72));
  box-shadow: 0 8px 22px rgba(24, 16, 14, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.66);
  backdrop-filter: blur(6px) saturate(104%);
  color: rgba(20, 19, 17, 0.74);
  font-size: 11px;
  line-height: 1.55;
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.025), rgba(0, 0, 0, 0) 42%),
    radial-gradient(circle at 88% 88%, rgba(255, 255, 255, 0.11) 0 1px, transparent 1px 100%);
  background-size: auto, 4px 4px;
  pointer-events: none;
  opacity: 0.24;
}

.site-footer-copy,
.site-footer-contact,
.site-footer-note {
  position: relative;
  margin: 5px 0;
}

.site-footer-contact a,
.site-footer-legal a {
  color: rgba(20, 19, 17, 0.9);
  text-decoration: none;
  border-bottom: 1px solid rgba(20, 19, 17, 0.2);
  transition: border-color 140ms ease, color 140ms ease;
}

.site-footer-contact a:hover,
.site-footer-legal a:hover {
  color: rgba(20, 19, 17, 1);
  border-bottom-color: rgba(20, 19, 17, 0.62);
}

.site-footer-legal {
  position: relative;
  display: flex;
  gap: 10px 14px;
  flex-wrap: wrap;
  margin: 10px 0 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(20, 19, 17, 0.2);
}

.site-footer-note {
  color: rgba(20, 19, 17, 0.6);
  max-width: 70ch;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .wrap {
    margin: 84px 14px 60px;
    padding: 24px 18px;
    border-radius: 18px;
  }

  .lang-switch-fixed {
    top: 10px;
    right: 10px;
    transform: scale(0.94);
    transform-origin: top right;
  }

  .intro {
    margin-bottom: 42px;
    font-size: 14px;
  }

  .exhibition-text {
    width: 100%;
    margin-bottom: 80px;
  }
}

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