:root{
  /* Silver/chalk palette — ported from the salt-mine mockup, replacing
     the earlier warm gold theme (gold stays reserved for Moondog's own
     brand identity, not individual project sites) */
  --page-bg: #080808;
  --ink: #dde4e8;
  --ink-dim: #9aaab4;
  --ink-faint: #4a5a64;
  --accent: #c8d4da;
  --accent-hi: #eaf0f4;
  --tissue-shadow: rgba(8,10,12,0.55);
  --card-bg: #0a0b0c;
  --row-h: 300px;
}
*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }
html{ scroll-behavior: smooth; }
body{
  background: radial-gradient(ellipse at 50% -10%, #14181c 0%, #0c0e10 55%, #080808 100%);
  color: var(--ink);
  font-family: 'Iowan Old Style','Georgia', serif;
  /* TODO: replace with the real display/script/body face pairing once
     chosen — see the "type choice" note from the design pass. */
}
#top, #pages, #extras, #photographer, #notes, #booklet, #standalone{
  scroll-margin-top: 64px; /* keeps the sticky nav from covering the section head when jumped to */
}
[id^="fnref-"], [id^="fn-"]{
  scroll-margin-top: 90px; /* same idea, so footnote back-links don't land under the sticky nav */
}

img{ max-width:100%; display:block; }

.eyebrow{
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--accent);
}

/* ================= SITE NAV ================= */
.site-nav{
  position: sticky;
  top: 0;
  z-index: 60;
  display:flex;
  justify-content:center;
  gap: 28px;
  padding: 16px 20px;
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 300ms ease, border-color 300ms ease, backdrop-filter 300ms ease;
}
.site-nav.scrolled{
  background: rgba(10,8,7,0.82);
  backdrop-filter: blur(8px);
  border-bottom-color: rgba(200,212,218,0.16);
}
.site-nav a{
  /* rgba alpha here doubles as a visibility dial — bump the .62 up or
     down if it still needs adjusting */
  color: rgba(236,230,217,0.62);
  text-decoration: none;
  transition: color 200ms ease;
}
.site-nav a:hover,
.site-nav a.active{ color: var(--accent); }

#backToTop{
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(200,212,218,0.35);
  background: rgba(10,8,7,0.75);
  backdrop-filter: blur(6px);
  color: var(--accent);
  font-size: 16px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 300ms ease, transform 300ms ease, background 200ms ease;
}
#backToTop.visible{ opacity: 1; pointer-events: auto; transform: translateY(0); }
#backToTop:hover{ background: rgba(200,212,218,0.16); }

@media (max-width: 560px){
  .site-nav{ gap: 16px; font-size: 10px; padding: 12px 14px; overflow-x:auto; white-space:nowrap; justify-content:flex-start; }
}

/* ================= INTRO + ALBUM ================= */
.intro{ padding: 64px 20px 40px; }
.intro-inner{ max-width: 900px; margin: 0 auto; text-align:center; }
.intro .eyebrow{ margin-bottom: 8px; }
.intro h1{
  font-size: clamp(28px, 5vw, 46px);
  font-weight: 500;
  margin: 0 0 20px;
}
.intro-text{
  max-width: 560px;
  margin: 0 auto 44px;
  color: var(--ink-dim);
  font-size: 15.5px;
  line-height: 1.7;
}
.album-object{
  display:flex;
  flex-direction: column;
  gap: 22px;
}
.album-row{
  display:flex;
  gap: 22px;
  justify-content:center;
  flex-wrap: wrap;
}
.album-photo{
  margin:0;
  width: 220px;
}
.album-photo img{
  border-radius: 3px;
  box-shadow: 0 16px 40px -14px rgba(0,0,0,0.6);
}
.album-photo figcaption{
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-top: 10px;
  line-height: 1.4;
}
.album-emblem{ margin:0; width: 220px; }
.album-emblem img{
  border-radius: 3px;
  box-shadow: 0 16px 40px -14px rgba(0,0,0,0.6);
}
.album-emblem figcaption{
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-top: 10px;
  line-height: 1.4;
}

/* ================= SHARED SECTION HEAD ================= */
main{ max-width: 980px; margin: 0 auto; padding: 0 20px 120px; }
.section-head{ text-align:center; margin: 70px 0 44px; }
.section-sub{
  color: var(--ink-dim);
  font-size: 14.5px;
  max-width: 520px;
  margin: 10px auto 0;
  line-height: 1.6;
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
}
.section-sub em{ color: var(--ink-faint); font-style: italic; }

/* ================= THE PAGES ================= */
.page-row{
  display:flex;
  align-items: stretch;
  gap: 34px;
  height: var(--row-h);
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(200,212,218,0.14);
}
.page-row:nth-child(even){ flex-direction: row-reverse; }
.page-row:last-child{ border-bottom:none; }

.scan-col{
  position: relative;
  flex: 0 0 auto;
  width: min(44vw, 420px);
  height: 100%;
  perspective: 1800px;
}
.note-col{
  flex: 1 1 auto;
  display:flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.page-row:nth-child(even) .note-col{ text-align: right; align-items: flex-end; }

.page-index{
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.page-tag{
  display:inline-block;
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border: 1px solid rgba(166,153,124,0.35);
  padding: 2px 7px;
  border-radius: 2px;
  margin-bottom: 14px;
}
.note-quote{
  font-family:'CaptionHand', 'Bradley Hand', cursive;
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink);
  max-width: 380px;
}
.note-body{ transition: filter 600ms ease, opacity 600ms ease; }
.note-body.veiled{ filter: blur(7px); opacity: .28; user-select: none; pointer-events: none; }
.note-sub{
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 16px;
  margin-bottom: 4px;
}
.note-plain{
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-dim);
  max-width: 380px;
  margin-top: 0;
}
.zoom-hint{
  margin-top: 16px;
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 10.5px;
  letter-spacing:.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display:flex;
  align-items:center;
  gap: 6px;
  opacity: 0;
  transition: opacity .5s ease;
}
.page-row.uncovered .zoom-hint{ opacity: 1; }
.page-row:nth-child(even) .zoom-hint{ flex-direction: row-reverse; }

/* -- page scan stack (tissue + page) -- */
.page{
  position:absolute; inset:0;
  border-radius: 3px;
  box-shadow: 0 20px 50px -14px rgba(0,0,0,0.7);
  background: var(--card-bg);
  transform-style: preserve-3d;
  transition: transform 900ms cubic-bezier(.6,.1,.15,1);
  cursor: pointer;
}
.page.flat{ transform-style: flat; }
.page.flipped{ transform: rotateY(180deg); }
.face{
  position:absolute; inset:0;
  backface-visibility:hidden;
  border-radius: 3px;
  overflow:hidden;
}
.face img{
  width:100%; height:100%; object-fit:contain;
  filter: sepia(.1) contrast(1.03);
}
.face.back{ transform: rotateY(180deg); }
.no-back .face.back{ display:none; }

.flip-btn, .zoom-btn{
  position:absolute; bottom:8px;
  z-index: 3;
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 10px;
  letter-spacing:.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 5px 9px;
  border-radius: 3px;
  cursor:pointer;
  opacity:0;
  transition: opacity .3s ease;
  pointer-events:none;
}
.flip-btn{ right:8px; }
.zoom-btn{ left:8px; }
.scan-col.uncovered .flip-btn,
.scan-col.uncovered .zoom-btn{ opacity:1; pointer-events:auto; }

.tissue-wrap{
  position:absolute;
  inset: -3% -3%;
  z-index: 5;
  transform-style: preserve-3d;
  transform-origin: 0% 50%;
  cursor: grab;
  touch-action: none;
  transition: transform 620ms cubic-bezier(.55,.05,.15,1), opacity 620ms ease 260ms;
}
.tissue-wrap.dragging{ cursor: grabbing; transition: none; }
.tissue-wrap.turned{
  transform: rotateY(-172deg) translateX(-6%);
  opacity: 0;
  pointer-events: none;
}
.tissue-face{
  position:absolute; inset:0;
  border-radius: 3px;
  backface-visibility: hidden;
  box-shadow: 0 16px 40px -10px var(--tissue-shadow);
}
.tissue-face img{
  width:100%; height:100%; object-fit:contain;
  border-radius: 3px;
  opacity: 0.94;
}
.tissue-face::after{
  content:"";
  position:absolute; inset:0;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15), inset 0 0 30px rgba(255,255,255,0.06);
  pointer-events:none;
}
.tissue-face.back{ transform: rotateY(180deg); }
.tissue-face.back img{ transform: scaleX(-1); filter: brightness(0.9); }
.tissue-wrap .grip{
  position:absolute; top:6px; right:8px;
  width: 26px; height: 26px;
  display:flex; align-items:center; justify-content:center;
  color: rgba(30,25,20,0.55);
  font-size: 15px;
  pointer-events:none;
  z-index: 2;
}

/* ================= EXTRAS ================= */
.subhead{
  font-family: 'Iowan Old Style','Georgia', serif;
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 6px;
}
.subhead-note{
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  color: var(--ink-dim);
  margin: 0 0 22px;
  max-width: 480px;
}
.booklet-block{ margin-bottom: 64px; }

.filmstrip-wrap{
  position: relative;
  display:flex;
  align-items:center;
  gap: 8px;
}
.filmstrip{
  display:flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  padding: 8px 4px 22px;
  flex: 1 1 auto;
  /* thin, quiet scrollbar rather than the browser default */
  scrollbar-width: thin;
  scrollbar-color: rgba(200,212,218,0.35) transparent;
}
.filmstrip::-webkit-scrollbar{ height: 6px; }
.filmstrip::-webkit-scrollbar-thumb{ background: rgba(200,212,218,0.35); border-radius: 3px; }

.fs-frame{
  position: relative;
  flex: 0 0 auto;
  height: 400px;
  scroll-snap-align: center;
  display:flex;
  flex-direction: column;
  align-items:center;
}
.fs-frame img{
  height: 100%;
  width: auto;
  max-width: 60vw;
  display:block;
  border-radius: 3px;
  box-shadow: 0 18px 40px -14px rgba(0,0,0,0.65);
  cursor: pointer;
  /* deliberately no sepia/contrast filter here — the booklet stays
     in its real color, unlike the grayscale album photos */
}
.fs-frame .fs-caption{
  margin-top: 10px;
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 12px;
  color: var(--ink-dim);
  text-align:center;
  max-width: 220px;
}
.fs-nav{
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(200,212,218,0.35);
  background: rgba(0,0,0,0.3);
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.fs-nav:hover{ background: rgba(200,212,218,0.14); border-color: var(--accent); }

/* ================= PHOTOGRAPHER (warmer, free-form) ================= */
.photographer-section{
  padding-top: 20px;
}
.photographer-body{ max-width: 640px; margin: 0 auto; text-align:center; }
.photographer-text{
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
  max-width: 480px;
  margin: 0 auto 40px;
}
.photographer-grid{
  display:flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content:center;
  align-items:flex-end;
}
.photographer-grid img{
  border-radius: 2px;
  box-shadow: 0 16px 40px -14px rgba(0,0,0,0.6);
  /* TODO: vary widths/rotations slightly per image for the loose,
     free-form feel — this is intentionally not a rigid grid */
}
.photographer-item{ margin: 0; width: 200px; }
.photographer-item img{ cursor: pointer; }
.photographer-item figcaption{
  margin-top: 10px;
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-dim);
  display:flex;
  flex-direction: column;
  gap: 3px;
}
.ph-caption.guess{ font-style: italic; color: var(--ink-faint); }
.ph-source{
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ================= CURATOR'S NOTES ================= */
.curator-section{ padding-top: 20px; }
.curator-body{
  max-width: 620px;
  margin: 0 auto;
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.8;
}

/* ================= ZOOM MODAL ================= */
.modal-backdrop{
  position: fixed; inset:0;
  background: rgba(6,5,4,0.92);
  z-index: 100;
  display:none;
  align-items:center; justify-content:center;
  overscroll-behavior: contain;
}
.modal-backdrop.open{ display:flex; }
.modal-stage{
  position: relative;
  width: min(92vw, 1100px);
  height: min(86vh, 900px);
  overflow: hidden;
  border-radius: 4px;
  background: #030405;
  touch-action: none;
  cursor: grab;
}
.modal-stage.panning{ cursor: grabbing; }
.modal-img{
  position:absolute;
  top:50%; left:50%;
  max-width:100%;
  max-height:100%;
  width:auto;
  height:auto;
  transform: translate(-50%,-50%) scale(1);
  transition: transform 180ms ease-out;
  user-select:none;
  -webkit-user-drag:none;
  filter: sepia(.1) contrast(1.03);
}
.modal-img.no-anim{ transition:none; }
.modal-img.true-color{ filter: none; }
.modal-face-label{
  position:absolute; left:14px; top:14px; z-index:4;
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 11px; letter-spacing:.1em; text-transform:uppercase;
  color: rgba(255,255,255,0.85); background: rgba(0,0,0,0.5);
  padding: 5px 10px; border-radius: 3px; pointer-events:none;
}
.modal-controls{
  position:absolute; top:10px; right:10px;
  display:flex; gap:8px;
  z-index: 5;
}
.modal-controls button{
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 11px;
  letter-spacing:.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 7px 11px;
  border-radius: 3px;
  cursor:pointer;
}
.modal-controls button:hover{ background: rgba(0,0,0,0.75); }
.modal-hint{
  position:absolute; bottom:10px; left:50%; transform:translateX(-50%);
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 10.5px;
  color: rgba(255,255,255,0.55);
  background: rgba(0,0,0,0.4);
  padding: 5px 10px;
  border-radius: 3px;
  pointer-events:none;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 720px){
  :root{ --row-h: 230px; }
  .page-row, .page-row:nth-child(even){
    flex-direction: column;
    gap: 14px;
    height: auto;
  }
  .scan-col{ width: 100%; height: var(--row-h); }
  .note-col, .page-row:nth-child(even) .note-col{ text-align:left; align-items:flex-start; }
  .note-quote, .note-plain{ max-width: none; }
  .album-row{ flex-direction: column; align-items:center; }
  .fs-frame{ height: 300px; }
  .fs-frame img{ max-width: 80vw; }
  .fs-nav{ display:none; } /* rely on native touch scroll on mobile */
}

@media (prefers-reduced-motion: reduce){
  .tissue-wrap, .page, .modal-img{ transition: none !important; }
}
.fn-ref a{ color: var(--accent); text-decoration: none; font-size: .75em; }
.fn-ref a:hover{ text-decoration: underline; }
.footnotes-block{ margin-top: 40px; text-align: left; }
.footnotes-list{ font-size: 13px; color: var(--ink-dim); line-height: 1.7; padding-left: 20px; }
.footnotes-list li{ margin-bottom: 10px; }
.fn-back{ color: var(--accent); text-decoration: none; margin-left: 4px; }
.fn-inline-link{ color: var(--accent); text-decoration: underline; }
.fn-inline-link:hover{ color: var(--ink); }

/* ================= FRONT/BACK FACE LABEL ================= */
.face-label{
  position:absolute; top:8px; left:50%;
  transform: translateX(-50%);
  bottom: auto;
  z-index:2;
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 10px; letter-spacing:.08em; text-transform:uppercase;
  color: rgba(255,255,255,0.85); background: rgba(0,0,0,0.45);
  padding: 3px 7px; border-radius: 2px; pointer-events:none;
}

/* ================= EXTRAS FILMSTRIP (standalone items) ================= */
.extra-frame{
  display:flex;
  flex-direction: column;
  align-items:center;
}
.extra-face{
  position:absolute; inset:0;
  backface-visibility: hidden;
  border-radius: 3px;
  overflow:hidden;
  box-shadow: 0 18px 40px -14px rgba(0,0,0,0.65);
  transition: transform 700ms cubic-bezier(.6,.1,.15,1);
  transform-style: preserve-3d;
}
.extra-face img{ width:100%; height:100%; object-fit:contain; background: var(--card-bg); }
.extra-face.back{ transform: rotateY(180deg); }
.no-back .extra-face.back{ display:none; }

.extra-card-wrap{
  position: relative;
  height: 100%;
  max-width: 60vw;
  aspect-ratio: 3 / 4;
  perspective: 1400px;
}
.extra-card{
  position: absolute;
  inset: 0;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 700ms cubic-bezier(.6,.1,.15,1);
}
.extra-card.no-back{ cursor: default; }
.extra-card.flipped{ transform: rotateY(180deg); }

.extra-frame .flip-btn,
.extra-frame .zoom-btn{
  opacity: 1;
  pointer-events: auto;
}

/* ================= ABOUT & RIGHTS (ported from the postcards project's
   curator-license block — same structure/Moondog credit, remapped from
   its light sunset palette onto this site's dark ink/accent tokens) ================= */
.curator-license{
  max-width: 34rem;
  margin: 40px auto 0;
  padding: 3rem 20px 60px;
  text-align: center;
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
}
.curator-license__label{
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}
.curator-license__block{
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(200,212,218,0.14);
  border-radius: 4px;
  padding: 1.6rem;
  text-align: left;
}
.curator-license__block p{
  color: var(--ink-dim);
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 .75rem;
}
.curator-license__block p:last-of-type{ margin-bottom: 0; }
.contact-link{ color: var(--accent); text-decoration: underline; cursor: pointer; }
.contact-link:hover{ color: var(--ink); }

.curator-license__credit{
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(200,212,218,0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  text-align: left;
}
.curator-license__logo{
  height: 50px;
  width: auto;
  flex-shrink: 0;
  border-radius: 2px;
}
.curator-license__credit-text{
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .1rem;
  font-size: 10.5px;
  letter-spacing: .05em;
  color: var(--ink-faint);
}
.curator-license__credit-text a{ color: var(--accent); }

@media (max-width: 500px){
  .curator-license__credit{ flex-direction: column; text-align: center; }
}

/* ================= SECTION DIVIDER (ported from the salt-mine mockup) ================= */
.section-divider{
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  opacity: 0.85;
}
.section-divider svg{ display:block; width:100%; height:24px; }
