:root {
  --bg: #f6f5f2;
  --text: #0d0d0d;
  --muted: #4a4a4a;
  --accent: #c66b3d;
  --border: rgba(13, 13, 13, 0.1);
  --card-bg: rgba(255, 255, 255, 0.7);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

section[id] {
  scroll-margin-top: 6rem;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 4vw;
  background: rgba(246, 245, 242, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-weight: 600;
  letter-spacing: 0.08em;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
}

.site-nav a {
  position: relative;
  padding-bottom: 0.2rem;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 50%;
  background: transparent;
}

.nav-toggle span {
  display: block;
  width: 1.2rem;
  height: 2px;
  background: var(--text);
}

main {
  padding: 4rem 4vw 6rem;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 3rem;
  align-items: center;
  margin-bottom: 3rem;
}

.hero-text h1 {
  font-size: clamp(2.8rem, 8vw, 4.8rem);
  margin: 0.5rem 0;
}

.hero-text p {
  margin: 0;
  color: var(--muted);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-links a {
  display: block;
  width: 24px;
  height: 24px;
  opacity: 0.7;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.social-links img {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-photo {
  position: relative;
  padding-top: 120%;
  overflow: hidden;
  border-radius: 1.5rem;
  background: var(--card-bg);
}

.hero-photo img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--accent);
}

.section-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.section-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card-bg);
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.section-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}

.content-section {
  margin-bottom: 5rem;
}

.section-heading h2 {
  margin: 0.5rem 0;
  font-size: clamp(2rem, 5vw, 3rem);
}

.section-heading .eyebrow {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin: 0.5rem 0;
}

.video-list {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin-top: 2rem;
}

.video-composition {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "media title"
    "media details";
  column-gap: clamp(1.5rem, 3vw, 3rem);
  row-gap: 0.5rem;
  padding: clamp(1.5rem, 3vw, 2.75rem);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
  align-items: start;
  scroll-margin-top: 6rem;
}

.video-heading {
  grid-area: title;
}

.video-heading h3 {
  margin: 0;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
}

.video-media,
.video-details {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.video-media {
  grid-area: media;
}

.video-details {
  grid-area: details;
}

.video-details .annotation {
  font-size: 1rem;
}

.video-gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.video-gallery .annotation-gallery {
  margin: 0;
}

.video-gallery .gallery-stack {
  width: 100%;
  margin: 0;
}

.annotation {
  color: var(--muted);
  font-size: 0.95rem;
}

.annotation p {
  margin: 0 0 0.6rem;
}

.annotation p:last-child {
  margin-bottom: 0;
}

.annotation ul,
.annotation ol {
  margin: 0 0 0.6rem 1.2rem;
  padding: 0;
  color: inherit;
}

.annotation li {
  margin-bottom: 0.35rem;
}

.annotation img {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid var(--border);
  margin: 0.75rem 0;
  display: block;
}

.annotation-gallery {
  margin: 1rem 0;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.annotation-gallery:hover {
  transform: scale(1.02);
}

.gallery-stack {
  position: relative;
  width: calc(100% - 16px);
  padding-top: 60%;
  margin: 8px 8px 0 0;
}

.gallery-stack img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.gallery-stack img:nth-child(2) {
  transform: translate(6px, 6px);
  z-index: -1;
}

.gallery-stack img:nth-child(3) {
  transform: translate(12px, 12px);
  z-index: -2;
}

.gallery-stack img:nth-child(n+4) {
  display: none;
}

.annotation-gallery:hover .gallery-stack img:first-child {
  transform: translate(-3px, -3px);
}

.gallery-hint {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.card button,
.card a.button {
  align-self: flex-start;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 500;
  cursor: pointer;
}

.video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: inherit;
}


.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.gallery button {
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.gallery img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 1.2rem;
  border: 1px solid var(--border);
  transition: transform 0.4s ease;
  will-change: transform;
}

.gallery img:hover {
  transform: scale(1.02);
}

.poem-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.poem-list {
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.8);
  padding: 1rem;
}

.poem-item {
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  padding: 1rem;
  border-radius: 0.8rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.poem-item:hover,
.poem-item[aria-pressed="true"] {
  background: rgba(198, 107, 61, 0.12);
}

.poem-detail {
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  min-height: 320px;
  scroll-margin-top: 6rem;
}

.poem-detail h3 {
  margin-top: 0;
}

.poem-detail pre {
  white-space: pre-wrap;
  font-family: inherit;
  margin: 1rem 0 0;
}

.site-footer {
  text-align: center;
  padding: 2rem 4vw 3rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.modal[aria-hidden="false"] {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.modal-content {
  position: relative;
  background: #fff;
  border-radius: 1.2rem;
  padding: 1.5rem;
  margin: 1.5rem;
  max-width: 900px;
  width: min(90vw, 900px);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

.modal-close {
  position: absolute;
  top: 2.25rem;
  right: 2.25rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 3;
}

.modal-close img {
  width: 24px;
  height: 24px;
  display: block;
}

.photo-modal {
  width: 100vw;
  max-width: none;
  max-height: 100vh;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow-y: auto;
  scrollbar-width: none;
  pointer-events: none;
}

.photo-modal .photo-stack,
.photo-modal .photo-stage img,
.photo-modal .photo-nav,
.photo-modal .modal-close {
  pointer-events: auto;
}

.photo-modal::-webkit-scrollbar {
  display: none;
}

.photo-modal.no-meta {
  overflow: hidden;
}

.photo-modal.no-meta .photo-stage img {
  max-height: 92vh;
}

.photo-modal.no-meta .photo-meta {
  display: none;
}

.photo-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.photo-modal.no-meta .photo-stage {
  align-items: center;
  justify-content: center;
}

.photo-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.2rem 0.5rem 0.75rem;
  overflow: visible;
  max-width: 100%;
}

.photo-stage img {
  width: auto;
  max-width: 100%;
  max-height: 80vh;
  height: auto;
  border-radius: 0.5rem;
  object-fit: contain;
}

.photo-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 20;
}

.photo-nav:hover {
  background: rgba(0, 0, 0, 0.8);
}

.photo-nav img {
  width: 20px;
  height: 20px;
  display: block;
}

.photo-nav.prev {
  left: 1rem;
}

.photo-nav.next {
  right: 1rem;
}

.photo-meta {
  width: min(92vw, 1100px);
  padding: 0.4rem 1rem 0.75rem;
  text-align: left;
  color: #fff;
}

.photo-meta h3 {
  margin: 0.15rem 0;
  font-size: 1rem;
  text-align: center;
  color: #fff;
}

.photo-modal .annotation {
  max-height: none;
  overflow-y: visible;
}

[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .site-nav {
    position: fixed;
    top: 70px;
    right: 4vw;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    transform: scale(0.95);
    transform-origin: top right;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .site-nav.open {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-photo {
    order: -1;
  }

  .video-composition {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "media"
      "details"
      "gallery";
    padding: 1.25rem;
    gap: 1.25rem;
  }

  .video-media {
    display: contents;
  }

  .video-embed {
    grid-area: media;
  }

  .video-gallery {
    grid-area: gallery;
  }

  .gallery img {
    height: 240px;
  }

  .photo-modal .modal-close {
    display: none;
  }

  .photo-nav {
    display: none;
  }
}
