:root{
  --ink-900:#161C2E;
  --ink-700:#303A57;
  --ink-500:#5B6478;
  --paper-50:#FAF9F1;
  --paper-100:#F3EEE1;
  --card-border:#E3DAC3;

  --brass-600:#93691F;
  --brass-500:#B9873B;
  --brass-100:#F0DFB8;

  --moss-600:#3F5A50;
  --moss-100:#DCE6DF;

  --slate-600:#435776;
  --slate-100:#DDE3ED;

  --wine-600:#8B4A3D;
  --wine-100:#EFDAD2;

  --teal-600:#2F6C72;
  --teal-100:#D8E8E7;

  --shadow-card: 0 10px 24px rgba(22,28,46,0.10);
  --shadow-lift: 0 16px 32px rgba(22,28,46,0.16);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  background: var(--paper-100);
  color: var(--ink-900);
  font-family: 'IBM Plex Sans', sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3{
  font-family: 'Fraunces', serif;
  font-weight: 600;
  margin: 0;
  color: var(--ink-900);
}
p{ margin: 0; }
button{ font-family: inherit; }
img,svg{ display:block; }
a{ color: inherit; }

:focus-visible{
  outline: 2.5px solid var(--brass-500);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap{
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Masthead ---------- */
.masthead{
  padding: 28px 0 18px;
  border-bottom: 1px solid var(--card-border);
}
.masthead .wrap{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.wordmark{
  font-family:'Fraunces', serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  display:flex;
  align-items:center;
  gap:10px;
}
.wordmark .dot{
  width:9px; height:9px; border-radius:50%;
  background: var(--brass-500);
  display:inline-block;
}

.filter-row{
  padding: 16px 0 0;
}

/* ---------- Hero ---------- */
.hero{
  padding: 36px 0 8px;
  max-width: 620px;
}
.hero h1{
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.15;
}
.hero p{
  margin-top: 14px;
  color: var(--ink-700);
  font-size: 1.02rem;
  max-width: 54ch;
}

/* ---------- Grid ---------- */
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  padding: 32px 0 64px;
}
.card{
  background: var(--paper-50);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  padding: 0;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover, .card:focus-visible{
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: var(--card-border);
}
.card-figure{
  aspect-ratio: 4/3;
  background: var(--card-bg, var(--paper-100));
  display:flex; align-items:center; justify-content:center;
  padding: 10px;
}
.card-figure svg, .card-figure img{ width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.card-body{
  padding: 16px 18px 18px;
  border-top: 1px solid var(--card-border);
}
.card-title{
  font-size: 1.12rem;
  margin-bottom: 8px;
}
.card-meta{
  display:flex;
  align-items:center;
  gap: 6px;
  color: var(--ink-500);
  font-size: 0.82rem;
}
.icon-sm{ width: 15px; height: 15px; flex-shrink:0; }

/* ---------- Detail view ---------- */
#detailView{ padding: 32px 0 72px; }
.back-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:none;
  border:none;
  color: var(--ink-700);
  font-size: 0.92rem;
  cursor:pointer;
  padding: 6px 4px;
  margin-bottom: 26px;
}
.back-btn:hover{ color: var(--ink-900); }
.back-btn svg{ width:16px; height:16px; }

.detail-layout{
  display:grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: start;
}
@media (max-width: 800px){
  .detail-layout{ grid-template-columns: 1fr; gap: 32px; }
}

.detail-figure{
  margin:0;
  background: var(--card-bg, var(--paper-50));
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.zoomable-image{
  border:none;
  background:none;
  padding:0;
  margin:0;
  width:100%;
  cursor: zoom-in;
  display:block;
}
.zoomable-image svg, .zoomable-image img{ width:100%; height:auto; max-height: 420px; border-radius: 10px; transition: transform .18s ease; }
.zoomable-image:hover svg, .zoomable-image:hover img{ transform: scale(1.03); }
.zoomable-image .zoom-hint{
  display:flex;
  align-items:center;
  gap:6px;
  justify-content:center;
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--ink-500);
}
.zoomable-image .zoom-hint svg{ width:14px; height:14px; }

.detail-figure figcaption{
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--card-border);
  font-size: 0.9rem;
  font-style: italic;
  color: var(--ink-500);
}

.detail-title{
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 14px 0 14px;
}
.detail-notes{
  color: var(--ink-700);
  font-size: 1rem;
  margin-bottom: 26px;
  max-width: 46ch;
}

/* ---------- Lightbox / Image Zoom ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 32px;

  background: rgba(12, 16, 28, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  cursor: zoom-out;

  animation: lightboxFadeIn 0.2s ease;
  overflow: hidden;
}

@keyframes lightboxFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.lightbox-inner {
  position: relative;
  width: auto;
  max-width: min(1100px, 94vw);
  max-height: 90vh;
  padding: 6px;
  background: var(--lightbox-bg, var(--paper-50));
  border-radius: 18px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45),
    0 8px 24px rgba(0, 0, 0, 0.25);
  cursor: default;
  overflow: hidden;
  animation: lightboxImageIn 0.25s ease;
}

@keyframes lightboxImageIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

#lightboxImageWrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: 88vh;
  overflow: hidden;
  border-radius: 13px;
}

.lightbox-zoom-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 12px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
  transform:
    translate3d(0, 0, 0)
    scale(1);
  transform-origin: center center;
  transition:
    transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: zoom-in;
}

.lightbox-zoom-image.is-zoomed {
  cursor: grab;
}

.lightbox-zoom-image.is-dragging {
  cursor: grabbing;
  transition: none;
}

/* ---------- Zoom indicator ---------- */
.lightbox-zoom-indicator {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 30px;
  padding: 0 10px;
  background: rgba(22, 28, 46, 0.78);
  color: white;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.lightbox-zoom-indicator.visible {
  opacity: 1;
}

/* ---------- Zoom hint ---------- */

.lightbox-zoom-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 7px 13px;
  background: rgba(22, 28, 46, 0.78);
  color: white;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  font-size: 0.72rem;
  white-space: nowrap;
  pointer-events: none;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0.9;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.lightbox-zoom-hint.hidden {
  opacity: 0;
  transform: translate(-50%, 8px);
}

/* ---------- Close button ---------- */

.lightbox-close {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 110;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(250, 249, 241, 0.96);
  color: var(--ink-900);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  cursor: pointer;
  box-shadow:
    0 8px 24px rgba(0,0,0,0.25);
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.lightbox-close:hover {
  transform: scale(1.06);
  background: white;
  box-shadow:
    0 10px 30px rgba(0,0,0,0.32);
}

.lightbox-close:active {
  transform: scale(0.94);
}

.lightbox-close svg {
  width: 18px;
  height: 18px;
}


/* ---------- Mobile / iPad ---------- */

@media (max-width: 800px) {
  .lightbox {
    padding: 18px;
  }

  .lightbox-inner {
    max-width: 96vw;
    max-height: 90vh;
    padding: 5px;
    border-radius: 15px;
  }

  #lightboxImageWrap {
    max-height: 87vh;
    border-radius: 11px;
  }

  .lightbox-zoom-image {
    max-width: 100%;
    max-height: 87vh;
    border-radius: 10px;
  }

  .lightbox-close {
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
  }

  .lightbox-zoom-indicator {
    top: 10px;
    left: 10px;
  }

  .lightbox-zoom-hint {
    bottom: 10px;
    font-size: 0.68rem;
    padding: 6px 11px;
  }
}


/* ---------- Small phones ---------- */

@media (max-width: 600px) {
  .lightbox {
    padding: 10px;
  }

  .lightbox-inner {
    max-width: 97vw;
    max-height: 91vh;
    padding: 4px;
    border-radius: 13px;
  }

  #lightboxImageWrap {
    max-height: 89vh;
    border-radius: 9px;
  }

  .lightbox-zoom-image {
    max-width: 100%;
    max-height: 89vh;
    border-radius: 8px;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
  }

  .lightbox-zoom-hint {
    font-size: 0.64rem;
    bottom: 8px;
  }
}


/* ---------- Touch devices ---------- */

@media (hover: none) and (pointer: coarse) {

  .lightbox-close:hover {
    transform: none;
    background: rgba(250, 249, 241, 0.96);
  }

  .lightbox-zoom-image {
    cursor: zoom-in;
  }

  .lightbox-zoom-image.is-zoomed {
    cursor: grab;
  }
}

/* ---------- Audio player ---------- */
.player{
  background: var(--ink-900);
  border-radius: var(--radius-lg);
  padding: 24px 24px 20px;
  color: var(--paper-50);
}
.player-label{
  display:flex;
  align-items:center;
  gap:8px;
  font-size: 0.8rem;
  color: #C7CBDB;
  margin-bottom: 16px;
}
.player-label svg{ width:14px; height:14px; }

.seek-row{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom: 6px;
}
.time{
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  color: #C7CBDB;
  width: 40px;
  flex-shrink:0;
}
.time.end{ text-align: right; }

input[type="range"]{
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: #3A4160;
  flex: 1;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none;
  width: 14px; height:14px;
  border-radius: 50%;
  background: var(--brass-500);
  cursor: pointer;
  border: 2px solid var(--paper-50);
}
input[type="range"]::-moz-range-thumb{
  width: 14px; height:14px;
  border-radius: 50%;
  background: var(--brass-500);
  cursor: pointer;
  border: 2px solid var(--paper-50);
}
#seekBar::-webkit-slider-runnable-track{
  height:4px; border-radius:999px;
  background: linear-gradient(to right, var(--brass-500) var(--seek-pct,0%), #3A4160 0%);
}

.transport{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 18px;
  margin: 18px 0 20px;
}
.transport button{
  background: none;
  border: none;
  color: var(--paper-50);
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 6px;
  border-radius: 50%;
  transition: background .15s ease;
}
.transport button:hover{ background: rgba(255,255,255,0.08); }
.transport svg{ width:20px; height:20px; }
#playBtn{
  width: 52px; height:52px;
  background: var(--brass-500);
  color: var(--ink-900);
}
#playBtn:hover{ background: var(--brass-500); filter: brightness(1.08); }
#playBtn svg{ width:22px; height:22px; }
#stopBtn svg{ width:18px; height:18px; }

.player-controls-row{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid #2C3352;
}
.speed-group{
  display:flex;
  gap:4px;
  background: #212845;
  border-radius: 999px;
  padding: 3px;
}
.speed-btn{
  background:none;
  border:none;
  color:#C7CBDB;
  font-size: 0.76rem;
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
}
.speed-btn.active{
  background: var(--paper-50);
  color: var(--ink-900);
  font-weight: 600;
}
.volume-group{
  display:flex;
  align-items:center;
  gap:8px;
  min-width: 130px;
}
.volume-group svg{ width:16px; height:16px; flex-shrink:0; color:#C7CBDB; }
#volumeBar{ max-width: 90px; }
#volumeBar::-webkit-slider-runnable-track{
  height:4px; border-radius:999px;
  background: linear-gradient(to right, var(--paper-50) var(--vol-pct,70%), #3A4160 0%);
}

footer{
  border-top: 1px solid var(--card-border);
  padding: 26px 0 40px;
  color: var(--ink-500);
  font-size: 0.85rem;
}
.footer-content{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.copyright{
  display:inline-flex;
  align-items:center;
  gap:6px;
  white-space: nowrap;
}
.copyright svg{ width:14px; height:14px; }

[hidden]{ display:none !important; }

@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; scroll-behavior: auto !important; }
}

/* =========================================================
   RESPONSIVE DESIGN
   Tablets, iPads and mobile phones
   ========================================================= */

/* ---------- Large tablets / small laptops ---------- */

@media (max-width: 1000px) {

  .wrap {
    padding-left: 24px;
    padding-right: 24px;
  }

  .detail-layout {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }

  .card-body {
    padding: 14px 16px 16px;
  }

  .card-title {
    font-size: 1.05rem;
  }

  .player {
    padding: 20px;
  }

}


/* ---------- Tablets / iPads ---------- */

@media (max-width: 800px) {

  .wrap {
    padding-left: 20px;
    padding-right: 20px;
  }

  .masthead {
    padding: 22px 0 16px;
  }

  .wordmark {
    font-size: 1.2rem;
  }

  .hero {
    padding-top: 28px;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 5vw, 2.35rem);
  }

  .hero p {
    font-size: 0.98rem;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding-top: 26px;
    padding-bottom: 48px;
  }

  .card-figure {
    aspect-ratio: 4 / 3;
    padding: 8px;
  }

  .card-figure img {
    border-radius: 8px;
  }

  .card-body {
    padding: 14px 15px 15px;
  }

  .card-title {
    font-size: 1.02rem;
    line-height: 1.25;
    margin-bottom: 7px;
  }

  /* Detail page */

  #detailView {
    padding-top: 24px;
    padding-bottom: 56px;
  }

  .back-btn {
    margin-bottom: 20px;
  }

  .detail-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .detail-figure {
    padding: 12px;
  }

  .zoomable-image svg,
  .zoomable-image img {
    max-height: none;
  }

  .detail-title {
    margin-top: 0;
    font-size: clamp(1.55rem, 5vw, 2rem);
  }

  .detail-notes {
    max-width: none;
    margin-bottom: 22px;
  }

  /* Audio player */

  .player {
    padding: 20px;
  }

  .player-controls-row {
    gap: 14px;
  }

  .speed-group {
    max-width: 100%;
  }

  .speed-btn {
    padding: 6px 8px;
  }

  .volume-group {
    min-width: 120px;
  }

}


/* ---------- Phones ---------- */

@media (max-width: 600px) {

  body {
    font-size: 15px;
  }

  .wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Header */

  .masthead {
    padding: 18px 0 14px;
  }

  .wordmark {
    font-size: 1.08rem;
    gap: 8px;
  }

  .wordmark .dot {
    width: 8px;
    height: 8px;
  }

  /* Hero */

  .hero {
    padding: 24px 0 4px;
  }

  .hero h1 {
    font-size: 1.8rem;
    line-height: 1.12;
    letter-spacing: -0.015em;
  }

  .hero p {
    margin-top: 10px;
    font-size: 0.92rem;
    line-height: 1.45;
  }

  /* Gallery */

  .grid {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 22px 0 40px;
  }

  .card {
    border-radius: 14px;
    position: relative;
    margin-bottom: 2rem;

  }

  .card:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -11px;
    height: 1px;
    background: var(--card-border);
  }

  .card-figure {
    aspect-ratio: 16 / 9;
    padding: 7px;
  }

  .card-body {
    padding: 13px 14px 14px;
  }

  .card-title {
    font-size: 1.02rem;
    margin-bottom: 6px;
  }

  .card-meta {
    font-size: 0.8rem;
  }

  /* Detail */

  #detailView {
    padding: 18px 0 44px;
  }

  .back-btn {
    font-size: 0.9rem;
    margin-bottom: 16px;
    padding: 8px 4px;
  }

  .detail-layout {
    gap: 24px;
  }

  .detail-figure {
    border-radius: 14px;
    padding: 8px;
  }

  .zoomable-image .zoom-hint {
    margin-top: 10px;
    font-size: 0.75rem;
  }

  .detail-figure figcaption {
    margin-top: 12px;
    padding-top: 12px;
    font-size: 0.84rem;
    line-height: 1.45;
  }

  .detail-title {
    font-size: 1.65rem;
    line-height: 1.18;
    margin-bottom: 10px;
  }

  .detail-notes {
    font-size: 0.92rem;
    line-height: 1.5;
    margin-bottom: 18px;
  }

  /* Audio player */

  .player {
    border-radius: 14px;
    padding: 17px 15px 15px;
  }

  .player-label {
    font-size: 0.75rem;
    margin-bottom: 14px;
  }

  .seek-row {
    gap: 7px;
  }

  .time {
    width: 34px;
    font-size: 0.72rem;
  }

  .transport {
    gap: 14px;
    margin: 16px 0 17px;
  }

  .transport button {
    padding: 8px;
  }

  #playBtn {
    width: 50px;
    height: 50px;
  }

  .transport svg {
    width: 19px;
    height: 19px;
  }

  #playBtn svg {
    width: 21px;
    height: 21px;
  }

  /* Put playback speed and volume on separate rows */

  .player-controls-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 13px;
    padding-top: 14px;
  }

  .speed-group {
    width: 100%;
    justify-content: space-between;
    padding: 3px;
  }

  .speed-btn {
    flex: 1;
    padding: 7px 4px;
    font-size: 0.72rem;
  }

  .volume-group {
    width: 100%;
    min-width: 0;
    justify-content: space-between;
  }

  #volumeBar {
    max-width: none;
    width: 100%;
  }

  /* Footer */
  footer {
    padding: 20px 0 28px;
    font-size: 0.78rem;
  }

}


/* ---------- Very small phones ---------- */

@media (max-width: 380px) {
  .wrap {
    padding-left: 13px;
    padding-right: 13px;
  }

  .wordmark {
    font-size: 1rem;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .hero p {
    font-size: 0.88rem;
  }

  .detail-title {
    font-size: 1.5rem;
  }

  .player {
    padding: 15px 12px 13px;
  }

  .transport {
    gap: 9px;
  }

  #playBtn {
    width: 48px;
    height: 48px;
  }

  .speed-btn {
    font-size: 0.68rem;
    padding-left: 2px;
    padding-right: 2px;
  }

}


/* ---------- Touch devices ---------- */

@media (hover: none) and (pointer: coarse) {

  .card:hover {
    transform: none;
    box-shadow: none;
  }

  .zoomable-image:hover img,
  .zoomable-image:hover svg {
    transform: none;
  }

  /* Larger touch targets */

  .back-btn {
    min-height: 40px;
  }

  .transport button {
    min-width: 42px;
    min-height: 42px;
  }

  .speed-btn {
    min-height: 34px;
  }

  .lightbox-close {
    min-width: 44px;
    min-height: 44px;
  }

}
