/* Galleria Matthews
   Layout: an entrance hall, then five white gallery rooms in historical order,
   each a wall (frames, plaques, wall text) over a strip of oak floor (bench, shell).
   The gallery commits to one visual world, a lit white gallery, so it keeps a
   single light palette in every viewer theme. */
:root {
  --wall: #f4f3ef;          /* gallery white, a touch warm */
  --wall-shadow: #e3e0d8;
  --stone: #e6e2da;         /* entrance hall plaster */
  --stone-deep: #cfc8bb;
  --ink: #1f1c19;           /* lettering and body text */
  --muted: #5d574f;         /* captions, periods */
  --gold: #9a7638;          /* gilding, rules */
  --gold-light: #d8bd7e;
  --plaque: #fbfaf6;
  --oak: #c7a274;
  --oak-dark: #9c7a50;
  --focus: #2f5d8a;

  --font-inscription: "Noto Serif Display", Georgia, serif;
  --font-display: "Noto Serif Display", Georgia, serif;
  --font-body: "Noto Serif Display", Georgia, serif;
  --font-label: "Noto Serif Display", Georgia, serif;

  --measure: 62ch;
  --room-max: 1240px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.gutter {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.inner { max-width: var(--room-max); margin: 0 auto; }

/* ---------- Entrance hall ---------- */
.entrance {
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(255,255,255,.7), transparent 70%),
    linear-gradient(var(--stone), var(--stone));
  padding-block: 56px 72px;
  border-bottom: 1px solid var(--stone-deep);
}
.portal {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.lintel {
  width: 100%;
  border-top: 2px solid var(--stone-deep);
  border-bottom: 2px solid var(--stone-deep);
  padding-block: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.inscription {
  margin: 0;
  font-family: var(--font-inscription);
  font-weight: 600;
  font-size: clamp(30px, 6.4vw, 64px);
  letter-spacing: .14em;
  line-height: 1.1;
  color: #5b5348;
  text-shadow: 0 1px 0 rgba(255,255,255,.85), 0 -1px 0 rgba(0,0,0,.18);
  text-wrap: balance;
}
.motto {
  margin: 0;
  font-family: var(--font-inscription);
  font-size: clamp(14px, 2.2vw, 20px);
  letter-spacing: .42em;
  color: #6c6356;
  text-shadow: 0 1px 0 rgba(255,255,255,.85);
}
.motto-caption {
  margin: 0;
  font-style: italic;
  font-size: 15px;
  color: var(--muted);
}
.entrance-body {
  max-width: var(--room-max);
  margin: 40px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
.entrance-copy { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.headline {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.15;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.opening { margin: 0; max-width: var(--measure); }
.choices { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.btn {
  font-family: var(--font-label);
  font-size: 14px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 22px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--ink);
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  transition: background .2s, color .2s;
}
.btn-primary { background: var(--ink); color: var(--wall); }
.btn:hover { background: var(--gold); border-color: var(--gold); color: #fff; }
.choice-note { font-family: var(--font-label); font-size: 13px; color: var(--muted); margin: 0; }

/* ---------- Rooms ---------- */
.room {
  position: relative;
  background:
    radial-gradient(ellipse 28% 38% at 22% 0%, rgba(255,250,235,.95), transparent 70%),
    radial-gradient(ellipse 28% 38% at 50% 0%, rgba(255,250,235,.95), transparent 70%),
    radial-gradient(ellipse 28% 38% at 78% 0%, rgba(255,250,235,.95), transparent 70%),
    linear-gradient(var(--wall), var(--wall));
  border-top: 1px solid var(--wall-shadow);
  transition: transform .9s cubic-bezier(.2,.7,.2,1), opacity .9s ease;
  transform-origin: 50% 20%;
}
.room.waiting { transform: scale(.985); }
.track {
  height: 10px;
  background: linear-gradient(#2b2926, #2b2926) center / 70% 3px no-repeat;
  opacity: .5;
}
.wall { padding-block: 44px 40px; }
.room-sign { display: flex; flex-direction: column; gap: 4px; margin-bottom: 36px; }
.room-number {
  font-family: var(--font-inscription);
  font-size: 15px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}
.room-period {
  font-family: var(--font-label);
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.hang {
  display: flex;
  flex-wrap: wrap;
  gap: 40px 48px;
  justify-content: center;
  align-items: flex-end;
}
.piece { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; flex: 0 1 300px; min-width: 0; }
.piece.wide { flex-basis: 520px; }
.piece.tall { flex-basis: 230px; }
.frame { width: 100%; box-shadow: 0 18px 30px -18px rgba(0,0,0,.45), 0 2px 4px rgba(0,0,0,.12); }
.frame img { width: 100%; height: auto; }
.plaque {
  background: var(--plaque);
  border: 1px solid var(--wall-shadow);
  padding: 8px 14px 9px;
  max-width: 280px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.plaque-title { display: block; font-family: var(--font-display); font-style: italic; font-size: 16px; line-height: 1.3; }
.plaque-meta { display: block; font-family: var(--font-label); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

/* Frame styles by period */
.frame.rococo-entrance { padding: 14px; background: linear-gradient(135deg, #f1dc9c, #a77d33 30%, #f6e6b0 50%, #94692a 75%, #e8cf8a); }
.room--flemish .frame { border: 16px solid #3a2a1d; outline: 2px solid #b08a45; outline-offset: -10px; background: #3a2a1d; }
.room--rococo .frame {
  padding: 16px;
  background: linear-gradient(135deg, #f1dc9c, #a77d33 30%, #f6e6b0 50%, #94692a 75%, #e8cf8a);
}
.room--rococo .frame img { outline: 3px solid #7a5420; }
.room--deco .frame { border: 10px solid #141210; outline: 1px solid var(--gold-light); outline-offset: -6px; background: #141210; }
.room--futurist .frame { border: 6px solid #9aa0a4; border-color: #c9cdd0 #7d8387 #6c7175 #b9bec1; background: #9aa0a4; }
.room--mcm .frame { border: 9px solid #6b4426; background: #6b4426; }

/* Wall text, quote, object */
.wall-copy {
  margin-top: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 40px 56px;
  align-items: start;
}
.wall-text { min-width: 0; }
.wall-title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.15;
  text-wrap: balance;
}
.wall-text p { margin: 0 0 14px; max-width: var(--measure); text-wrap: pretty; }
.wall-side { display: flex; flex-direction: column; gap: 32px; align-items: center; min-width: 0; }
.quote-label {
  margin: 0;
  background: var(--plaque);
  border: 1px solid var(--wall-shadow);
  padding: 20px 22px;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
  width: 100%;
}
.quote-label p { margin: 0; font-size: 17px; line-height: 1.55; }
.quote-label footer { margin-top: 10px; font-family: var(--font-label); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.object { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.object-label { font-family: var(--font-label); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-align: center; }
.mirror-ring {
  width: 220px; height: 220px; max-width: 100%;
  border-radius: 50%;
  padding: 16px;
  background: radial-gradient(circle, #5a3f27 60%, #3a2919 61%, #6b4b2d 75%, #2e2014);
  box-shadow: 0 0 0 3px #b08a45 inset, 0 16px 26px -14px rgba(0,0,0,.5);
}
.mirror-ring canvas { width: 100%; height: 100%; border-radius: 50%; display: block; background: #ddd; }
.tree-relief { width: 220px; max-width: 100%; filter: drop-shadow(0 2px 1px rgba(0,0,0,.25)) drop-shadow(0 -1px 0 rgba(255,255,255,.6)); }
.sunburst { width: 200px; max-width: 100%; height: auto; }
.plinth {
  width: 180px; height: 150px;
  border: 1px dashed #a49c90;
  background: linear-gradient(#efece6, #e6e2da);
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 14px;
  font-family: var(--font-label); font-size: 12px; letter-spacing: .08em; color: var(--muted);
}

/* Floor, bench, shell */
.floor {
  position: relative;
  height: 130px;
  background:
    linear-gradient(rgba(0,0,0,.18), transparent 14px),
    repeating-linear-gradient(90deg, transparent 0 158px, rgba(90,60,30,.22) 158px 160px),
    linear-gradient(var(--oak), var(--oak-dark));
  border-top: 6px solid #e9e6df;
  overflow: hidden;
}
.floor .inner { position: relative; height: 100%; }
.bench {
  position: absolute;
  left: 50%;
  top: 22px;
  transform: translateX(-50%);
  width: min(420px, 70%);
  height: 70px;
}
.bench-seat { position: absolute; inset: 0 0 auto; height: 22px; border-radius: 3px; }
.bench-leg { position: absolute; top: 20px; width: 12px; height: 46px; }
.bench-leg.l { left: 8%; } .bench-leg.r { right: 8%; }
.bench-shadow { position: absolute; left: 4%; right: 4%; bottom: -6px; height: 10px; border-radius: 50%; background: rgba(0,0,0,.22); filter: blur(4px); }
.bench--flemish .bench-seat { background: linear-gradient(#8a2c2c, #6e1f1f); border-top: 6px solid #4a3220; box-shadow: 0 4px 0 #3a2618; }
.bench--flemish .bench-leg { background: #3a2618; }
.bench--rococo .bench-seat { background: linear-gradient(#e9b8b6, #cf8e8b); border-radius: 12px; box-shadow: 0 0 0 4px #c9a253; }
.bench--rococo .bench-leg { background: linear-gradient(90deg, #a97d33, #e8cf8a, #a97d33); border-radius: 0 0 8px 8px; width: 10px; }
.bench--deco .bench-seat { background: linear-gradient(#1f4d3f, #163a30); box-shadow: 0 4px 0 #111, inset 0 -3px 0 var(--gold-light); }
.bench--deco .bench-leg { background: #111; width: 16px; border-bottom: 3px solid var(--gold-light); }
.bench--futurist .bench-seat { background: linear-gradient(100deg, #b9bec1, #7d8387 60%, #c9cdd0); clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%); }
.bench--futurist .bench-leg { background: #6c7175; transform: skewX(-18deg); }
.bench--mcm .bench-seat { background: linear-gradient(#8a5a33, #6b4426); height: 16px; box-shadow: 0 3px 0 #4f311b; }
.bench--mcm .bench-leg { background: #2a1d14; width: 8px; transform-origin: top; }
.bench--mcm .bench-leg.l { transform: rotate(10deg); } .bench--mcm .bench-leg.r { transform: rotate(-10deg); }

.shell-btn {
  position: absolute;
  width: 44px; height: 44px;
  padding: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: .9;
  transition: transform .25s;
}
.shell-btn:hover { transform: scale(1.15) rotate(-8deg); }
.shell-btn svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.shell-btn.found { opacity: .55; }

/* Doorways between rooms */
.doorway {
  background: var(--wall-shadow);
  padding-block: 28px;
  text-align: center;
}
.doorway a {
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  text-decoration: none;
  font-family: var(--font-label); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.arch {
  width: 64px; height: 84px;
  border: 2px solid #b8b1a5;
  border-radius: 32px 32px 0 0;
  background: linear-gradient(var(--wall), #fff);
}

/* Room 5 panels, curator, front desk */
.panels {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}
.panel { border-top: 2px solid var(--gold); padding-top: 14px; min-width: 0; }
.panel h3, .curator h3, .desk h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.25;
}
.panel p { margin: 0; font-size: 17px; }
.panel ul { margin: 0; padding-left: 1.1em; font-size: 17px; display: grid; gap: 6px; }

.curator {
  margin-top: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 32px 56px;
  align-items: start;
}
.curator-text p { margin: 0 0 12px; max-width: var(--measure); }

.desk {
  margin-top: 64px;
  background: linear-gradient(#f9f7f2, #f1ede4);
  border: 1px solid var(--wall-shadow);
  border-top: 14px solid #6b4426;
  padding: 32px clamp(18px, 4vw, 44px) 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 32px 48px;
}
.desk p { margin: 0; max-width: var(--measure); }
.desk-email { margin-top: 14px !important; font-family: var(--font-label); font-size: 15px; user-select: all; }
.desk form { display: grid; gap: 14px; min-width: 0; }
.field { display: grid; gap: 5px; }
.field label { font-family: var(--font-label); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea {
  font: inherit; font-size: 17px;
  padding: 10px 12px;
  border: 1px solid #bdb6aa;
  background: #fff;
  color: var(--ink);
  border-radius: 0;
  width: 100%;
}
.field textarea { min-height: 120px; resize: vertical; }
.form-status { font-family: var(--font-label); font-size: 14px; color: var(--ink); margin: 0; }

/* Footer */
.site-footer {
  background: #1f1c19;
  color: #ece7dd;
  padding-block: 40px 96px;
}
.site-footer .inner { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; }
.site-footer img { width: 96px; height: auto; }
.site-footer p { margin: 0; font-family: var(--font-label); font-size: 13px; letter-spacing: .06em; line-height: 1.7; }

/* Gallery map */
.map {
  position: fixed;
  left: max(16px, env(safe-area-inset-left, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 20;
  background: rgba(251,250,246,.96);
  border: 1px solid #cfc8bb;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px;
  font-family: var(--font-label);
}
.map-title { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0; }
.map-plan { display: flex; gap: 3px; }
.map-plan a {
  width: 34px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #b8b1a5;
  font-family: var(--font-inscription); font-size: 12px;
  text-decoration: none; color: var(--ink); background: #fff;
}
.map-plan a.here { background: var(--ink); color: #fff; border-color: var(--ink); }
.map-foot { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; align-items: center; }
.map-foot a { color: var(--ink); }

/* Shell card */
.card-scrim {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(31,28,25,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.card {
  background: var(--plaque);
  max-width: 420px; width: 100%;
  padding: 26px 26px 22px;
  border-top: 4px solid var(--gold);
  box-shadow: 0 20px 40px rgba(0,0,0,.3);
  display: flex; flex-direction: column; gap: 14px;
}
.card p { margin: 0; font-size: 18px; }
.card-count { font-family: var(--font-label); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* ---------- Brochure ---------- */
.brochure { background: var(--plaque); }
.brochure main { max-width: 720px; margin: 0 auto; padding-block: 40px 72px; }
.brochure-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; border-bottom: 1px solid var(--wall-shadow); padding-bottom: 14px; margin-bottom: 32px; }
.brochure-top a { font-family: var(--font-label); font-size: 14px; }
.brochure h1 { font-family: var(--font-inscription); font-weight: 600; letter-spacing: .1em; font-size: clamp(22px, 4vw, 30px); margin: 0; }
.brochure h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(24px, 3.4vw, 32px); line-height: 1.2; margin: 40px 0 12px; text-wrap: balance; }
.brochure h3 { font-family: var(--font-display); font-weight: 500; font-size: 21px; margin: 26px 0 8px; }
.brochure p { margin: 0 0 14px; }
.brochure blockquote { margin: 0 0 20px; padding-left: 18px; border-left: 2px solid var(--gold); }
.brochure blockquote footer { font-family: var(--font-label); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.brochure .desk { grid-template-columns: minmax(0, 1fr); }

/* ---------- Narrow screens ---------- */
@media (max-width: 860px) {
  body { font-size: 18px; }
  .entrance-body, .wall-copy, .curator, .desk { grid-template-columns: minmax(0, 1fr); }
  .panels { grid-template-columns: minmax(0, 1fr); }
  .piece, .piece.wide, .piece.tall { flex-basis: 100%; }
  .piece.tall { max-width: 320px; }
  .map { left: 0; right: 0; bottom: 0; flex-direction: row; align-items: center; justify-content: space-between; padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); border-width: 1px 0 0; }
  .map-title { display: none; }
  .map-plan a { width: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .room, .room.waiting { transition: none; opacity: 1; transform: none; }
  .shell-btn, .btn { transition: none; }
}
