/* ============================================================
   GUELPH MUSEUMS — cinematic archive
   Smoke Whisper #ECE7D5 · Weathered Steel #837D75
   Duststone Clay #806055 · Cinder Red #A33633
   ============================================================ */
:root {
  --smoke:  #ECE7D5;
  --steel:  #837D75;
  --clay:   #806055;
  --cinder: #A33633;
  --ink:    #2B241F;
  --grade:  #ECE7D5;
  --sans: "Archivo", system-ui, sans-serif;
  --serif: "Spectral", Georgia, serif;
  --display: "Fraunces", "Spectral", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
::selection { background: var(--cinder); color: var(--smoke); }
:focus-visible { outline: 2px solid var(--cinder); outline-offset: 3px; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--smoke); }
::-webkit-scrollbar-thumb { background: var(--steel); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--cinder); }
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  font-family: var(--sans);
  background: var(--grade);
  color: var(--ink);
  transition: background 0.25s linear;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; }

/* ============ PRELOADER ============ */
.loader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--smoke);
  display: grid; place-items: center;
  transition: opacity 0.8s ease, visibility 0.8s;
}
.loader.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { text-align: center; width: min(76vw, 340px); }
.loader-brand {
  font-family: var(--sans); font-weight: 600; letter-spacing: 0.3em;
  font-size: 0.9rem; margin-bottom: 2rem; color: var(--ink);
}
.loader-brand em { font-style: normal; font-weight: 300; color: var(--clay); }
.loader-bar { height: 1px; background: rgba(131,125,117,0.35); margin-bottom: 1.1rem; }
.loader-fill { height: 100%; width: 0%; background: var(--cinder); transition: width 0.25s ease; }
.loader-pct { color: var(--steel); font-size: 0.6rem; }

/* film grain */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 7s steps(10) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); }
  40% { transform: translate(2%,-3%); } 60% { transform: translate(-2%,-2%); }
  80% { transform: translate(3%,3%); }
}

/* ============ NAV ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 2.4rem;
  background: linear-gradient(to bottom, rgba(236,231,213,0.92), rgba(236,231,213,0));
}
.nav-brand { display: flex; align-items: center; gap: 0.7rem; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--ink); font-family: var(--mono);
  font-size: 0.7rem; letter-spacing: 0.08em;
}
.brand-word { font-weight: 600; letter-spacing: 0.22em; font-size: 0.82rem; }
.brand-word em { font-style: normal; font-weight: 200; color: var(--clay); }
.nav-links { display: flex; gap: 1.9rem; }
.nav-links a {
  position: relative;
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 500; opacity: 0.75; transition: opacity 0.25s, color 0.25s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -5px;
  width: 100%; height: 1px; background: var(--cinder);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-links a:hover { opacity: 1; color: var(--cinder); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-cta {
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 600; color: var(--smoke); background: var(--cinder);
  padding: 0.65rem 1.3rem; transition: background 0.2s;
}
.nav-cta:hover { background: #8a2c29; }

/* ============ HUD ============ */
.hud {
  position: fixed; left: 2.1rem; top: 50%; transform: translateY(-50%);
  z-index: 95; display: flex; flex-direction: column; gap: 1rem;
  opacity: 1; transition: opacity 0.45s;
}
.hud.off { opacity: 0; pointer-events: none; }
.hud-rail {
  position: absolute; left: 4px; top: 6px; bottom: 38px; width: 1px;
  background: rgba(43,36,31,0.25);
}
.hud-fill { width: 100%; height: 0%; background: var(--cinder); transition: height 0.1s linear; }
.hud-stops { list-style: none; display: flex; flex-direction: column; gap: 2rem; position: relative; }
.hud-stops li { display: flex; align-items: center; gap: 0.85rem; }
.hud-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto;
  border: 1px solid var(--ink); background: transparent;
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}
.hud-stops li.active .hud-dot { background: var(--cinder); border-color: var(--cinder); transform: scale(1.35); }
.hud-label {
  font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.18em;
  text-transform: uppercase; opacity: 0; transform: translateX(-6px);
  transition: opacity 0.3s, transform 0.3s; white-space: nowrap;
}
.hud-stops li.active .hud-label { opacity: 0.85; transform: translateX(0); }
.hud-readout { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.2em; opacity: 0.55; padding-left: 0; }

/* ============ SCRUB ============ */
.scrub { position: relative; height: 2600vh; }
.scrub-sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.scrub-sticky canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scrub-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(20,15,12,0.35), transparent 22%, transparent 72%, rgba(20,15,12,0.45)),
    radial-gradient(ellipse at center, transparent 55%, rgba(20,15,12,0.28));
}
.overlay { position: absolute; inset: 0; pointer-events: none; }
.reveal-line { position: absolute; opacity: 0; will-change: opacity, transform; }
.reveal-line .btn { pointer-events: auto; }

.ol-hero { left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; width: min(90vw, 900px); }
.ol-hero h1 {
  font-family: var(--display);
  font-weight: 200; font-size: clamp(2.8rem, 6.8vw, 5.8rem);
  letter-spacing: -0.01em; line-height: 1.02; color: var(--smoke);
  text-shadow: 0 2px 34px rgba(20,15,12,0.55);
  margin: 1.1rem 0 1rem;
}
.ol-hero .sub {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(1rem, 1.7vw, 1.25rem); color: rgba(236,231,213,0.92);
  text-shadow: 0 1px 18px rgba(20,15,12,0.6);
}
.scroll-hint {
  margin-top: 2.6rem; font-family: var(--mono); font-size: 0.62rem;
  letter-spacing: 0.32em; color: rgba(236,231,213,0.85);
  transition: opacity 0.5s;
}
.ol-left  { left: clamp(5rem, 9vw, 10rem); top: 50%; transform: translateY(-50%); max-width: 470px; }
.ol-right { right: clamp(2.4rem, 6vw, 7rem); top: 50%; transform: translateY(-50%); max-width: 470px; text-align: right; }
.ol-center { left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; width: min(88vw, 760px); }
.ol-left.small, .ol-right.small { max-width: 400px; }

.zone-tag {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.28em;
  color: var(--cinder); margin-bottom: 0.9rem;
  text-shadow: 0 1px 10px rgba(236,231,213,0.35);
}
.zone-tag.center { text-align: center; }
.overlay h2 {
  font-family: var(--display);
  font-weight: 200; font-size: clamp(2rem, 4.4vw, 3.7rem);
  line-height: 1.06; letter-spacing: -0.01em; color: var(--smoke);
  text-shadow: 0 2px 28px rgba(20,15,12,0.65); margin-bottom: 1.1rem;
}
.overlay .fact {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(0.95rem, 1.35vw, 1.12rem); line-height: 1.65;
  color: rgba(236,231,213,0.94); text-shadow: 0 1px 16px rgba(20,15,12,0.7);
}
.fact.center { margin-bottom: 1.9rem; }
.date-mark {
  display: inline-block; font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.16em; color: var(--smoke); background: var(--cinder);
  padding: 0.18rem 0.55rem; margin-right: 0.6rem; transform: translateY(-2px);
}
.museum-label {
  font-family: var(--mono); font-size: 0.66rem; line-height: 1.9;
  letter-spacing: 0.16em; color: rgba(236,231,213,0.9);
  border-left: 2px solid var(--cinder); padding-left: 1rem;
  text-shadow: 0 1px 12px rgba(20,15,12,0.7);
}
.ol-right .museum-label { border-left: none; border-right: 2px solid var(--cinder); padding-left: 0; padding-right: 1rem; }
.museum-label.quiet { color: rgba(236,231,213,0.8); }

.scrub-hudline {
  position: absolute; left: 0; right: 0; bottom: 1.3rem; z-index: 5;
  display: flex; justify-content: space-between; padding: 0 2.4rem;
  color: rgba(236,231,213,0.65);
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-block; font-size: 0.74rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
  padding: 0.95rem 2.1rem;
  transition: background 0.3s, color 0.3s, border-color 0.3s,
              transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-red { background: var(--cinder); color: var(--smoke); }
.btn-red:hover { background: #8a2c29; box-shadow: 0 10px 28px -12px rgba(163,54,51,0.55); }
.btn-red.big { padding: 1.15rem 2.8rem; }
.btn-outline { border: 1px solid rgba(236,231,213,0.5); color: var(--smoke); }
.btn-outline:hover { border-color: var(--cinder); color: var(--cinder); background: rgba(236,231,213,0.06); }

/* ============ SHARED SECTIONS ============ */
section { position: relative; }
.sec-head { text-align: center; margin-bottom: 4.6rem; }
.kicker {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.3em;
  color: var(--clay); display: flex; align-items: center; justify-content: center;
  gap: 0.8rem; margin-bottom: 1.2rem;
}
.kicker.light { color: rgba(236,231,213,0.75); }
.tick { display: inline-block; width: 26px; height: 1px; background: var(--clay); }
.tick.red { background: var(--cinder); }
.sec-head h2 {
  font-family: var(--display);
  font-weight: 300; font-size: clamp(1.8rem, 3.6vw, 3rem);
  line-height: 1.16; letter-spacing: -0.01em;
}
.sec-head .muted { color: var(--clay); font-family: var(--serif); font-style: italic; }

.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1), transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: none; }
/* whispered stagger for card grids */
.site-grid .reveal:nth-child(2), .visit-grid .reveal:nth-child(2) { transition-delay: 0.12s; }
.site-grid .reveal:nth-child(3), .visit-grid .reveal:nth-child(3) { transition-delay: 0.24s; }
.visit-grid .reveal:nth-child(4) { transition-delay: 0.36s; }
.stats-inner .reveal:nth-child(2) { transition-delay: 0.1s; }
.stats-inner .reveal:nth-child(3) { transition-delay: 0.2s; }
.stats-inner .reveal:nth-child(4) { transition-delay: 0.3s; }

/* ============ SITES ============ */
.sites { padding: 9.5rem 2.4rem 10rem; background: var(--smoke); }
.site-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem; max-width: 1180px; margin: 0 auto;
}
.site-card {
  background: rgba(255,255,255,0.45); border: 1px solid rgba(131,125,117,0.3);
  padding: 2.6rem 2.2rem 2.2rem; position: relative;
  transition: border-color 0.4s, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.site-card:hover {
  border-color: var(--cinder); transform: translateY(-5px);
  box-shadow: 0 24px 48px -30px rgba(43,36,31,0.35);
}
.site-card:hover .card-num { color: var(--ink); }
.card-num { transition: color 0.4s; }
.card-num { color: var(--cinder); margin-bottom: 1.6rem; }
.site-card h3 { font-family: var(--display); font-weight: 400; font-size: 1.45rem; margin-bottom: 0.4rem; }
.card-tag { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.24em; color: var(--steel); margin-bottom: 1.1rem; }
.site-card p:not(.card-tag):not(.card-meta) { font-family: var(--serif); font-weight: 300; font-size: 0.95rem; line-height: 1.7; color: #4a413a; }
.card-meta { margin-top: 1.5rem; color: var(--clay); font-size: 0.62rem; }

/* ============ STATS ============ */
.stats { padding: 9rem 2.4rem; background: var(--steel); color: var(--smoke); }
.stats-inner {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 3rem 2rem; max-width: 1180px; margin: 0 auto; text-align: center;
}
.stat-num {
  display: block; font-family: var(--display); font-weight: 300;
  font-size: clamp(2.4rem, 4.6vw, 3.8rem);
  letter-spacing: -0.02em; margin-bottom: 0.7rem; font-variant-numeric: tabular-nums;
}
.stat-label { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.8; line-height: 1.8; }
.stats-note { text-align: center; margin-top: 4rem; opacity: 0.75; }
.stats-note a { color: var(--smoke); border-bottom: 1px solid var(--cinder); }

/* ============ EXHIBITION ============ */
.exhibition {
  position: relative; overflow: hidden;
  padding: 10rem 2.4rem; background: var(--clay); color: var(--smoke);
}
.ex-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0.45;
}
.ex-shade {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(128,96,85,0.75), rgba(128,96,85,0.55) 45%, rgba(128,96,85,0.8));
}
.ex-inner { position: relative; z-index: 2; max-width: 760px; margin: 0 auto; text-align: center; }
.exhibition h2 { font-family: var(--display); font-weight: 200; font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1.1; margin-bottom: 1.5rem; }
.ex-dates { color: rgba(236,231,213,0.7); margin-bottom: 1.8rem; }
.ex-body { font-family: var(--serif); font-weight: 300; font-size: 1.08rem; line-height: 1.75; margin-bottom: 2.6rem; color: rgba(236,231,213,0.95); }

/* ============ VISIT ============ */
.visit { padding: 10rem 2.4rem; background: var(--smoke); }
.visit-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.4rem; max-width: 1180px; margin: 0 auto 3.6rem;
}
.visit-card { border: 1px solid rgba(131,125,117,0.35); padding: 2rem 1.8rem; background: rgba(255,255,255,0.4); }
.visit-card.admission { border-color: var(--cinder); }
.visit-card h3 { font-family: var(--display); font-weight: 400; font-size: 1.2rem; margin-bottom: 1.2rem; }
.visit-card ul { list-style: none; }
.visit-card li { font-size: 0.64rem; color: var(--clay); line-height: 2.2; }
.visit-cta { text-align: center; }
.visit-cta .mono { margin-top: 1.6rem; color: var(--steel); }

/* ============ FOOTER ============ */
.footer { padding: 5rem 2.4rem 3.4rem; background: var(--ink); color: var(--smoke); text-align: center; }
.foot-brand { font-weight: 600; letter-spacing: 0.26em; font-size: 0.95rem; margin-bottom: 1.4rem; }
.foot-brand em { font-style: normal; font-weight: 200; color: var(--steel); }
.footer p { font-family: var(--serif); font-weight: 300; max-width: 560px; margin: 0 auto 1.2rem; font-size: 0.92rem; line-height: 1.7; color: rgba(236,231,213,0.85); }
.foot-line { font-family: var(--mono); color: var(--cinder) !important; font-size: 0.62rem !important; letter-spacing: 0.22em; }
.foot-fine { font-family: var(--mono) !important; font-size: 0.58rem !important; color: rgba(236,231,213,0.45) !important; letter-spacing: 0.14em; }

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .site-card { transition: none; }
  .btn:hover, .site-card:hover { transform: none; }
  .ex-video { display: none; }
  html { scroll-behavior: auto; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hud-label { display: none; }
  .hud { left: 1rem; }
  .ol-left, .ol-right { left: 1.4rem; right: 1.4rem; max-width: none; text-align: left; }
  .ol-right .museum-label { border-right: none; border-left: 2px solid var(--cinder); padding-right: 0; padding-left: 1rem; }
  .scrub-hudline { padding: 0 1.4rem; }
}
