/* =========================================================================
   The Marchmont — stylesheet
   =========================================================================
   Organized top-to-bottom in roughly the order things appear on the page:
     1. Design tokens (CSS custom properties) + resets
     2. Top nav
     3. Hero
     4. Buttons & section shell
     5. About section
     6. Floor-rail (side scroll-spy dots)
     7. Gallery grid + work "frame" cards
     8. Skeleton loading placeholders + room status text
     9. Load-more button & status row
     10. Lightbox (full-size viewer)
     11. Footer
     12. YouTube "now playing" rail
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Design tokens + resets
   ------------------------------------------------------------------------- */
:root {
  --wall-dark: #15120d;
  --wall-panel: #211b13;
  --wall-panel-2: #2a2318;
  --brass: #b4894f;
  --brass-bright: #d9ae72;
  --ivory: #efe6d3;
  --ivory-dim: #a89c85;
  --hairline: rgba(180, 137, 79, 0.22);
  --shadow: rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--wall-dark);
  color: var(--ivory);
  font-family: 'Spectral', serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
::selection {
  background: var(--brass);
  color: var(--wall-dark);
}
h1,
h2,
h3,
.display {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin: 0;
}
.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass-bright);
}
a {
  color: inherit;
}
img {
  max-width: 100%;
  display: block;
}

/* -------------------------------------------------------------------------
   2. Top nav
   ------------------------------------------------------------------------- */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(21, 18, 13, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 5vw;
}
.nav-mark {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 20px;
}
.nav-links {
  display: flex;
  gap: 26px;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-links button {
  background: none;
  border: none;
  color: var(--ivory-dim);
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.nav-links button:hover,
.nav-links button.active {
  color: var(--brass-bright);
  border-color: var(--brass);
}
@media (max-width: 820px) {
  .nav-links {
    display: none;
  }
}

/* -------------------------------------------------------------------------
   3. Hero
   ------------------------------------------------------------------------- */
.hero {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8vh 6vw;
  position: relative;
  background: radial-gradient(ellipse 60% 45% at 50% 30%, rgba(217, 174, 114, 0.14), transparent 70%),
    var(--wall-dark);
}
.hero-eyebrow {
  opacity: 0;
  animation: riseIn 0.9s ease forwards;
}
.hero h1 {
  font-size: clamp(38px, 6.5vw, 76px);
  font-style: italic;
  line-height: 1.05;
  margin: 16px 0 20px;
  opacity: 0;
  animation: riseIn 1s ease 0.15s forwards;
}
.hero h1 span {
  display: block;
  font-style: normal;
  font-weight: 300;
  font-size: 0.4em;
  letter-spacing: 0.06em;
  color: var(--ivory-dim);
  margin-top: 10px;
}
.hero p {
  max-width: 600px;
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--ivory-dim);
  opacity: 0;
  animation: riseIn 1s ease 0.3s forwards;
}
.hero-cta {
  margin-top: 34px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  animation: riseIn 1s ease 0.45s forwards;
}
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-eyebrow,
  .hero h1,
  .hero p,
  .hero-cta {
    animation: none;
    opacity: 1;
  }
}

/* -------------------------------------------------------------------------
   4. Buttons & section shell
   ------------------------------------------------------------------------- */
.btn {
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 30px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid var(--brass);
  background: transparent;
  color: var(--brass-bright);
}
.btn:hover {
  background: var(--brass);
  color: var(--wall-dark);
}
.btn.primary {
  background: var(--brass);
  color: var(--wall-dark);
}
.btn.primary:hover {
  background: var(--brass-bright);
  border-color: var(--brass-bright);
}

section {
  padding: 8vh 6vw;
}
.room-intro {
  max-width: 680px;
  margin-bottom: 40px;
}
.room-intro h2 {
  font-size: clamp(24px, 3.4vw, 36px);
  font-style: italic;
  margin: 12px 0 14px;
}
.room-intro p {
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--ivory-dim);
}
.room {
  border-top: 1px solid var(--hairline);
}

/* -------------------------------------------------------------------------
   5. About section
   ------------------------------------------------------------------------- */
.about {
  background: var(--wall-panel);
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 50px;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.about-in {
  padding: 8vh 6vw;
}
.about p {
  font-size: 16px;
  line-height: 1.9;
  color: var(--ivory-dim);
  margin: 0 0 16px;
}
.about p:first-of-type {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-style: italic;
  color: var(--ivory);
  line-height: 1.6;
}
.plaque-stats {
  display: grid;
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
}
.stat {
  background: var(--wall-panel-2);
  padding: 20px 24px;
}
.stat .num {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  color: var(--brass-bright);
}
.stat .lab {
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  margin-top: 4px;
}
@media (max-width: 860px) {
  .about {
    grid-template-columns: 1fr;
  }
}

/* -------------------------------------------------------------------------
   6. Floor-rail (side scroll-spy dots) — see js/nav.js
   ------------------------------------------------------------------------- */
.floor-rail {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.floor-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--brass);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}
.floor-dot.active {
  background: var(--brass-bright);
  box-shadow: 0 0 0 3px rgba(217, 174, 114, 0.18);
}
.floor-dot .tip {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.floor-dot:hover .tip {
  opacity: 1;
}
@media (max-width: 820px) {
  .floor-rail {
    display: none;
  }
}

/* -------------------------------------------------------------------------
   7. Gallery grid + work "frame" cards — see js/gallery.js
   ------------------------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 36px 28px;
}
.frame {
  cursor: pointer;
  background: var(--wall-panel);
  border: 1px solid var(--hairline);
  padding: 12px 12px 0;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.frame:hover {
  transform: translateY(-5px);
  border-color: var(--brass);
  box-shadow: 0 22px 40px -18px var(--shadow);
}
.canvas-wrap {
  border: 1px solid var(--hairline);
  box-shadow: inset 0 0 0 6px var(--wall-dark);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wall-panel-2);
}
.canvas-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.plaque {
  padding: 13px 4px 15px;
  text-align: center;
}
.plaque .t-title {
  font-family: 'Fraunces', serif;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ivory);
  line-height: 1.3;
}
.plaque .t-artist {
  font-family: 'Spectral', serif;
  font-style: italic;
  font-size: 12.5px;
  color: var(--brass-bright);
  margin-top: 3px;
}
.plaque .t-year {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.09em;
  color: var(--ivory-dim);
  margin-top: 5px;
}

/* -------------------------------------------------------------------------
   8. Skeleton loading placeholders + room status text
   ------------------------------------------------------------------------- */
.skeleton {
  aspect-ratio: 4 / 5;
  background: linear-gradient(100deg, var(--wall-panel-2) 30%, var(--wall-panel) 50%, var(--wall-panel-2) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border: 1px solid var(--hairline);
}
@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
.room-status {
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ivory-dim);
  margin-bottom: 20px;
}
.room-status.error {
  color: #c98a7c;
}

/* -------------------------------------------------------------------------
   9. Load-more button & status row — see js/gallery.js
   ------------------------------------------------------------------------- */
.load-more-status {
  grid-column: 1 / -1;
  text-align: center;
  padding: 26px 0 4px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ivory-dim);
}
.load-more-status .spinner {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--brass);
  border-top-color: transparent;
  margin-right: 8px;
  vertical-align: -1px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.load-more-wrap {
  text-align: center;
  margin-top: 34px;
}
.load-more-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.load-more-btn:disabled:hover {
  background: transparent;
  color: var(--brass-bright);
}

/* -------------------------------------------------------------------------
   10. Lightbox (full-size viewer) — see js/lightbox.js
   ------------------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 8, 5, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 5vh 4vw;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.lightbox.open {
  display: flex;
  opacity: 1;
}
.lb-inner {
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  background: var(--wall-panel);
  border: 1px solid var(--brass);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  transform: scale(0.96);
  transition: transform 0.3s ease;
}
.lightbox.open .lb-inner {
  transform: scale(1);
}
.lb-art {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wall-dark);
  min-height: 260px;
}
.lb-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 80vh;
}
.lb-text {
  padding: 38px 38px 38px 8px;
  position: relative;
}
.lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: 1px solid var(--hairline);
  color: var(--ivory-dim);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: all 0.2s ease;
}
.lb-close:hover {
  border-color: var(--brass);
  color: var(--brass-bright);
}
.lb-text .t-title {
  font-size: 23px;
  font-style: italic;
  margin-bottom: 6px;
  line-height: 1.25;
}
.lb-text .t-artist {
  font-family: 'Spectral', serif;
  font-style: italic;
  color: var(--brass-bright);
  font-size: 14.5px;
}
.lb-facts {
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  color: var(--ivory-dim);
  margin: 18px 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 14px 0;
}
.lb-facts div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 5px 0;
  line-height: 1.5;
}
.lb-facts .k {
  color: var(--ivory-dim);
  opacity: 0.75;
  flex-shrink: 0;
}
.lb-facts .v {
  text-align: right;
  color: var(--ivory);
}
.lb-source {
  margin-top: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  letter-spacing: 0.05em;
}
.lb-source a {
  color: var(--brass-bright);
  text-decoration: none;
  border-bottom: 1px solid var(--brass);
}
.lb-source a:hover {
  color: var(--ivory);
}
.lb-history {
  margin-top: 20px;
  border-top: 1px solid var(--hairline);
  padding-top: 16px;
}
.lb-history h4 {
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass-bright);
  margin-bottom: 8px;
}
.lb-history p {
  font-family: 'Spectral', serif;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ivory-dim);
  margin: 0 0 10px;
}
.lb-history a {
  color: var(--brass-bright);
  text-decoration: none;
  border-bottom: 1px solid var(--brass);
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
}
.lb-history a:hover {
  color: var(--ivory);
}
.lb-history .hist-loading {
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  color: var(--ivory-dim);
  opacity: 0.75;
}
.lb-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.lb-nav button {
  background: none;
  border: none;
  color: var(--brass-bright);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.lb-nav button:hover {
  color: var(--ivory);
}
@media (max-width: 760px) {
  .lb-inner {
    grid-template-columns: 1fr;
  }
  .lb-text {
    padding: 26px;
  }
}

/* -------------------------------------------------------------------------
   11. Footer
   ------------------------------------------------------------------------- */
footer {
  border-top: 1px solid var(--hairline);
  padding: 56px 6vw 36px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  background: var(--wall-panel);
}
footer h3 {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass-bright);
  margin-bottom: 12px;
}
footer p,
footer li {
  font-size: 14px;
  color: var(--ivory-dim);
  line-height: 1.85;
}
footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.fine {
  grid-column: 1 / -1;
  border-top: 1px solid var(--hairline);
  padding-top: 22px;
  margin-top: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: var(--ivory-dim);
  opacity: 0.75;
  line-height: 1.7;
}

/* -------------------------------------------------------------------------
   12. YouTube "now playing" rail — see js/youtube-rail.js
   ------------------------------------------------------------------------- */
.youtube-rail {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  background: rgba(21, 18, 13, 0.92);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  box-shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.8);
}
.youtube-badge {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass-bright);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 6px 10px;
}
.youtube-meta {
  display: flex;
  flex-direction: column;
  min-width: 170px;
}
.youtube-title {
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: var(--ivory);
}
.youtube-sub {
  font-size: 11px;
  color: var(--ivory-dim);
}
.youtube-toggle {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 12px;
  border: 1px solid var(--brass);
  background: transparent;
  color: var(--brass-bright);
  cursor: pointer;
  border-radius: 999px;
}
.youtube-toggle:hover {
  background: var(--brass);
  color: var(--wall-dark);
}
.youtube-player {
  display: none;
  margin-left: 8px;
  width: min(320px, 38vw);
  height: 56px;
  border: none;
  border-radius: 14px;
  overflow: hidden;
}
.youtube-rail.expanded .youtube-player {
  display: block;
}

/* "What are you playing?" paste-a-link editing state */
.youtube-edit-btn {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  border: 1px solid var(--brass);
  background: transparent;
  color: var(--brass-bright);
  cursor: pointer;
  border-radius: 999px;
  white-space: nowrap;
}
.youtube-edit-btn:hover {
  background: var(--brass);
  color: var(--wall-dark);
}
.youtube-paste-form {
  display: none;
  align-items: center;
  gap: 8px;
}
.youtube-rail.editing .youtube-paste-form {
  display: flex;
}
.youtube-rail.editing .youtube-meta,
.youtube-rail.editing .youtube-edit-btn {
  display: none;
}
.youtube-paste-form input {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--ivory);
  padding: 8px 10px;
  border-radius: 999px;
  width: 190px;
  outline: none;
}
.youtube-paste-form input:focus {
  border-color: var(--brass);
}
.youtube-paste-form input::placeholder {
  color: var(--ivory-dim);
}
.youtube-set-btn,
.youtube-cancel-btn {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  border: 1px solid var(--brass);
  background: transparent;
  color: var(--brass-bright);
  cursor: pointer;
  border-radius: 999px;
  white-space: nowrap;
}
.youtube-set-btn:hover {
  background: var(--brass);
  color: var(--wall-dark);
}
.youtube-cancel-btn {
  border-color: var(--hairline);
  color: var(--ivory-dim);
}

@media (max-width: 760px) {
  .youtube-rail {
    left: 12px;
    right: 12px;
    transform: none;
    bottom: 12px;
    justify-content: space-between;
    border-radius: 16px;
    padding: 10px 12px;
  }
  .youtube-player {
    display: none !important;
  }
  .youtube-paste-form input {
    width: auto;
    flex: 1;
    min-width: 0;
  }
}
