/* ═══════════════════════════════════════════════════════
   THE VERSE GALLERY
   Dark luxury literary aesthetic
   Cormorant Garamond + Raleway
   ═══════════════════════════════════════════════════════ */

:root {
  /* Palette */
  --bg:          #0c0a08;
  --surface:     #141210;
  --surface-2:   #1c1916;
  --paper:       #f0ead8;
  --paper-dim:   #e8e0ca;
  --ink:         #1a1614;
  --ink-2:       #352e28;
  --ink-3:       #6b5e52;
  --gold:        #b8935a;
  --gold-bright: #d4a96a;
  --gold-dim:    rgba(184, 147, 90, 0.18);
  --gold-line:   rgba(184, 147, 90, 0.28);
  --muted:       #7a6e62;
  --muted-light: #a09484;

  /* Layout */
  --nav-w: 68px;
  --section-py: 96px;
  --section-px: 72px;

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-ui:      'Raleway', 'Gill Sans', sans-serif;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--paper);
  font-family: var(--font-ui);
  font-weight: 300;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
a { color: inherit; text-decoration: none; }
.about-content a {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1px;
}
.about-signature {
  margin-top: 42px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.about-signature img {
  max-width: 220px;
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.84;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.16));
}
ul, ol { list-style: none; }

/* ── Grain overlay ───────────────────────────────── */
.grain {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}

/* ── Visit Shop Button ───────────────────────────── */
.visit-shop-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 250;
  background: var(--gold);
  color: var(--ink);
  padding: 12px 24px;
  border-radius: 8px;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  box-shadow: 0 4px 12px rgba(184, 147, 90, 0.3);
  transition: all 0.3s var(--ease-out);
  border: 1px solid var(--gold-bright);
}

.visit-shop-btn:hover {
  background: var(--gold-bright);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(184, 147, 90, 0.4);
}

/* ── Intro splash ────────────────────────────────── */
.intro {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  gap: 14px;
  animation: introExit 0.5s var(--ease-out) 1.5s forwards;
  pointer-events: none;
}

.intro__monogram {
  font-family: var(--font-display);
  font-size: 5.5rem;
  font-weight: 300;
  color: var(--gold);
  line-height: 1;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease-out) 0.1s forwards;
}

.intro__name {
  font-family: var(--font-ui);
  font-weight: 200;
  font-size: 0.65rem;
  letter-spacing: 0.55em;
  text-transform: uppercase;
  color: var(--muted-light);
  opacity: 0;
  animation: fadeUp 0.7s var(--ease-out) 0.4s forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes introExit {
  to { opacity: 0; pointer-events: none; }
}

/* ── Side navigation ─────────────────────────────── */
.sidenav {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--nav-w);
  background: var(--surface);
  border-right: 1px solid var(--gold-line);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 0 24px;
  gap: 0;
}

.sidenav__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 300;
  color: var(--gold);
  flex-shrink: 0;
  transition: color 0.2s;
  margin-bottom: 36px;
}

.sidenav__logo:hover { color: var(--gold-bright); }

.sidenav__list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.sidenav__item { position: relative; }

.sidenav__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 70px;
  border-radius: 3px;
  font-family: var(--font-ui);
  font-size: 0.56rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  writing-mode: vertical-rl;
  cursor: pointer;
  transition: color 0.25s, background 0.25s;
  border: none;
  background: none;
  position: relative;
}

.sidenav__link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 2px;
  height: 28px;
  background: var(--gold);
  transition: transform 0.25s var(--ease-out);
  border-radius: 0 1px 1px 0;
}

.sidenav__link:hover {
  color: var(--paper);
  background: var(--gold-dim);
}

.sidenav__link.is-active {
  color: var(--gold-bright);
}

.sidenav__link.is-active::before {
  transform: translateY(-50%) scaleY(1);
}

.sidenav__footer { margin-top: auto; padding-top: 24px; }

.sidenav__line {
  width: 1px;
  height: 32px;
  background: var(--gold-line);
}

/* ── Mobile top bar ──────────────────────────────── */
.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--surface);
  border-bottom: 1px solid var(--gold-line);
  padding: 12px 20px;
  flex-direction: column;
  gap: 10px;
}

.topbar__logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 300;
  font-style: italic;
  color: var(--gold);
}

.topbar__nav {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.topbar__nav::-webkit-scrollbar { display: none; }

.topbar__nav-link {
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  border: none;
  background: none;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.topbar__nav-link:hover { color: var(--paper); background: var(--gold-dim); }
.topbar__nav-link.is-active { color: var(--gold-bright); }

/* ── Gallery layout ──────────────────────────────── */
.gallery {
  margin-left: var(--nav-w);
  min-height: 100vh;
}

/* ── Language section ────────────────────────────── */
.lang-section {
  padding: var(--section-py) var(--section-px);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
}

.lang-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Section header with large numeral + title */
.lang-section__header {
  display: flex;
  align-items: flex-end;
  gap: 28px;
  margin-bottom: 56px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--gold-line);
  position: relative;
}

/* Decorative ruled line above section number */
.lang-section__header::before {
  content: '';
  position: absolute;
  top: -32px;
  left: 0;
  width: 56px;
  height: 1px;
  background: var(--gold);
  opacity: 0.5;
}

.lang-section__number {
  font-family: var(--font-display);
  font-size: 7rem;
  font-weight: 300;
  color: var(--surface-2);
  line-height: 1;
  letter-spacing: -0.03em;
  user-select: none;
  flex-shrink: 0;
}

.lang-section__label {
  padding-bottom: 12px;
}

.lang-section__native {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.lang-section__title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4vw, 3.8rem);
  font-weight: 300;
  font-style: italic;
  color: var(--paper);
  line-height: 1;
  letter-spacing: -0.01em;
}

/* ── Genre tabs ──────────────────────────────────── */
.genre-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--gold-line);
}

.genre-tab {
  padding: 9px 18px 9px;
  background: none;
  border: none;
  font-family: var(--font-ui);
  font-size: 0.58rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.genre-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}

.genre-tab:hover { color: var(--muted-light); }

.genre-tab.is-active {
  color: var(--paper);
}

.genre-tab.is-active::after {
  transform: scaleX(1);
}

/* ── Genre panels ────────────────────────────────── */
.genre-panel { display: none; }
.genre-panel.is-active { display: block; }

/* ── Poem grid ───────────────────────────────────── */
.poem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
  align-items: start;
}

/* ── Poem card ───────────────────────────────────── */
.poem-card {
  background: var(--paper);
  color: var(--ink);
  padding: 36px 32px 28px;
  position: relative;
  cursor: pointer;
  transition:
    transform 0.4s var(--ease-spring),
    box-shadow 0.4s var(--ease-out);
  outline: none;
}

/* Subtle corner fold */
.poem-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 20px 20px;
  border-color: transparent transparent var(--paper-dim) transparent;
  transition: border-width 0.3s;
}

/* Paper sheen */
.poem-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.28) 0%,
    transparent 55%
  );
  pointer-events: none;
}

.poem-card:hover {
  transform: translateY(-7px) rotate(-0.4deg);
  box-shadow:
    0 28px 64px rgba(0,0,0,0.55),
    0 0 0 1px var(--gold),
    inset 0 1px 0 rgba(255,255,255,0.15);
}

.poem-card:hover::after {
  border-width: 0 0 28px 28px;
}

.poem-card:focus-visible {
  box-shadow: 0 0 0 2px var(--gold-bright);
}

.poem-card__badge {
  font-family: var(--font-ui);
  font-size: 0.55rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
}

.poem-card__title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 6px;
}

.poem-card__meta {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 300;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  margin-bottom: 24px;
}

.poem-card__divider {
  width: 32px;
  height: 1px;
  background: rgba(26, 22, 20, 0.2);
  margin-bottom: 20px;
}

.poem-card__preview {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-style: italic;
  line-height: 1.85;
  color: var(--ink-2);
}

.poem-card__preview-line {
  display: block;
  white-space: pre;
}

.poem-card__cta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  font-family: var(--font-ui);
  font-size: 0.58rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-3);
  transition: color 0.2s;
}

.poem-card__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 22px;
}

.poem-card__buy,
.modal__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  border-radius: 999px;
  transition: background-color 0.2s, transform 0.2s;
}

.poem-card__buy:hover,
.modal__link:hover {
  background: var(--ink-2);
}

.poem-card__cta svg {
  transition: transform 0.3s var(--ease-out);
  flex-shrink: 0;
}

.poem-card:hover .poem-card__cta {
  color: var(--ink);
}

.poem-card:hover .poem-card__cta svg {
  transform: translateX(4px);
}

.modal__actions {
  margin-top: 32px;
}

.modal__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  border-radius: 999px;
  transition: background-color 0.2s, transform 0.2s;
}

.modal__link:hover {
  background: var(--ink-2);
}

/* ── Placeholder notice strip ────────────────────── */
.placeholder-banner {
  background: var(--surface-2);
  border: 1px solid var(--gold-line);
  border-left: 3px solid var(--gold);
  padding: 14px 24px;
  margin: 32px 0 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.placeholder-banner__label {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  flex-shrink: 0;
}

.placeholder-banner__text {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--muted-light);
}

.placeholder-banner__text code {
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  color: var(--gold-bright);
  background: rgba(184, 147, 90, 0.08);
  padding: 1px 5px;
  border-radius: 2px;
}

/* ── Full poem modal ─────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 0.35s, opacity 0.35s var(--ease-out);
}

.modal.is-open {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 6, 4, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal__panel {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  width: min(580px, calc(100vw - 40px));
  max-height: 88vh;
  overflow-y: auto;
  padding: 56px 52px 60px;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.4s var(--ease-spring);
  scrollbar-width: thin;
  scrollbar-color: rgba(26,22,20,0.2) transparent;
}

.modal__panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.22) 0%,
    transparent 50%
  );
  pointer-events: none;
}

.modal.is-open .modal__panel {
  transform: translateY(0) scale(1);
}

/* Ruled corner decoration */
.modal__panel::after {
  content: '';
  position: absolute;
  top: 0;
  left: 52px;
  right: 52px;
  height: 2px;
  background: var(--gold);
  opacity: 0.6;
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--ink-3);
  cursor: pointer;
  border-radius: 2px;
  transition: color 0.2s, background 0.2s;
}

.modal__close:hover {
  color: var(--ink);
  background: rgba(26,22,20,0.07);
}

.modal__badge {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 16px;
}

.modal__title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 8px;
}

.modal__meta {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 300;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  margin-bottom: 36px;
}

.modal__rule {
  width: 40px;
  height: 1px;
  background: rgba(26,22,20,0.2);
  margin-bottom: 32px;
}

.modal__poem {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.95;
  color: var(--ink-2);
}

.modal__stanza {
  margin-bottom: 1.6em;
}

.modal__stanza:last-child { margin-bottom: 0; }

.modal__line {
  display: block;
  white-space: pre;
}

/* ── Responsive: tablet ──────────────────────────── */
@media (max-width: 1024px) {
  :root {
    --section-px: 48px;
    --section-py: 72px;
  }
}

/* ── Responsive: mobile ──────────────────────────── */
@media (max-width: 720px) {
  :root {
    --nav-w: 0px;
  }

  .sidenav { display: none; }
  .topbar  { display: flex; }

  .gallery { margin-left: 0; }

  :root {
    --section-px: 20px;
    --section-py: 56px;
  }

  .lang-section__number {
    font-size: 4.5rem;
  }

  .modal__panel {
    padding: 44px 28px 48px;
  }

  .modal__panel::after {
    left: 28px;
    right: 28px;
  }

  .visit-shop-btn {
    right: auto;
    left: 20px;
    top: 80px;
  }
}

@media (max-width: 480px) {
  .poem-grid {
    grid-template-columns: 1fr;
  }

  .poem-card {
    padding: 28px 24px 22px;
  }
}
