:root {
  --bg-deep: #0f172a;
  --text-primary: #f8fafc;
  --text-muted: rgba(248, 250, 252, 0.65);
  --accent-gold: #fbbf24;
  --scroll-bar-color: #1f2b47;
  --accent-gold-soft: rgba(251, 191, 36, 0.35);
  --border-subtle: rgba(248, 250, 252, 0.18);
  --glass-bg: rgba(15, 23, 42, 0.55);
  --glass-blur: 12px;
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --transition-fast: 0.2s ease;
  --transition-image: opacity 1.5s ease-in-out;
  --section-title-line-color: rgba(148, 163, 184, 0.45);
  --section-title-pill-bg: rgba(96, 125, 191, 0.65);
  --section-title-pill-border: rgba(148, 163, 184, 0.28);
  --section-title-pill-color: #e2e8f0;
  --section-title-pill-radius: 8px;
  --section-title-pill-padding-y: 0.18rem;
  --section-title-pill-padding-x: 0.9rem;
  --section-title-font-size: 0.78rem;
  --section-title-letter-spacing: 0.03em;
  --section-title-gap: 0.8rem;
  --start-overlay-bg-image-desktop: url("assets/images/intro/cover-desktop.png");
  --start-overlay-bg-image-mobile: url("assets/images/intro/cover-mobile.png");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

.app {
  display: flex;
  width: 100vw;
  height: 100vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.app.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.panel--left {
  flex: 0 0 30%;
  width: 30%;
  max-width: 30%;
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  overflow: hidden;
  border-right: 1px solid var(--border-subtle);
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.98) 0%, var(--bg-deep) 100%);
}

.panel__header {
  flex-shrink: 0;
  /* margin-bottom: 1.5rem; */
}

.panel__collection {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.poem {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.5rem;
  scrollbar-width: thin;
  /* scrollbar-color: var(--accent-gold-soft) transparent; */
  scrollbar-color: var(--scroll-bar-color) transparent;
}

.poem::-webkit-scrollbar {
  width: 6px;
}

.poem::-webkit-scrollbar-thumb {
  background: var(--accent-gold-soft);
  border-radius: 3px;
}

.poem__title {
  margin: 0 0 1.25rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  line-height: 1.25;
  color: var(--text-primary);
}

.poem__body {
  font-family: var(--font-serif);
  font-size: clamp(0.95rem, 1.35vw, 1.05rem);
  line-height: 1.75;
  color: var(--text-muted);
  white-space: normal;
  text-align: center;
}

.poem__body p {
  margin: 0 0 1rem;
}

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

.poem__body .verse {
  /* white-space: pre-line; */
  line-height: 1.35;
  
}

.poem__body .verse-line {
  display: block;
}

.poem__body .verse-line + .verse-line {
  margin-top: 0.12rem;
}

.poem-section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  /* gap: var(--section-title-gap); */
  /* margin: 1.25rem 0 0.9rem; */
  margin: 1.25rem 3rem 0.9rem 3rem;
}

.poem-section-title::before,
.poem-section-title::after {
  content: "";
  flex: 1 1 auto;
  min-width: 1.8rem;
  height: 1px;
  background: var(--section-title-line-color);
}

.poem-section-title span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--section-title-pill-padding-y) var(--section-title-pill-padding-x);
  border-radius: var(--section-title-pill-radius);
  background: var(--section-title-pill-bg);
  border: 1px solid var(--section-title-pill-border);
  color: var(--section-title-pill-color);
  font-family: var(--font-sans);
  font-size: var(--section-title-font-size);
  letter-spacing: var(--section-title-letter-spacing);
  line-height: 1.2;
}

.nav-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.audio-controls {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0;
  border: 0;
}

.audio-progress {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.audio-progress__bar {
  width: 100%;
  margin: 0;
  accent-color: var(--accent-gold);
}

.audio-progress__time {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}

.btn.nav-bar__btn {
  flex: 0 1 auto;
  border-radius: 12px;
}

.nav-bar__counter {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent-gold);
}

.nav-bar__icon-btn {
  width: 2.45rem;
  min-width: 2.45rem;
  height: 2.45rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: normal;
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: 400;
  font-style: normal;
  font-size: 1.2rem;
  display: inline-block;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}

.btn {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.btn:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 3px;
}

.btn--ghost {
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-primary);
}

.btn--ghost:hover:not(:disabled) {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  box-shadow: 0 0 0 1px var(--accent-gold-soft);
}

.btn--ghost:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn--primary {
  border: 1px solid var(--accent-gold);
  background: var(--accent-gold);
  color: #ffffff;
  padding: 0.85rem 2rem;
  font-size: 0.85rem;
}

.btn--primary:hover {
  background: #f59e0b;
  border-color: #f59e0b;
  box-shadow: 0 10px 24px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3);
}

.panel--right {
  flex: 1 1 70%;
  width: 70%;
  position: relative;
  overflow: hidden;
  background: #020617;
}

.image-controls {
  position: absolute;
  right: clamp(0.8rem, 1.8vw, 1.4rem);
  bottom: clamp(0.8rem, 1.8vw, 1.4rem);
  z-index: 3;
  padding: 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.image-stack {
  position: absolute;
  inset: 0;
}

.image-stack__layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: var(--transition-image);
  pointer-events: none;
}

.image-stack__layer.is-visible {
  opacity: 1;
  z-index: 1;
}

.image-stack__layer.is-hidden {
  opacity: 0;
  z-index: 0;
}

.image-stack__img {
  width: 100%;
  height: 100%;
  /* object-fit: cover; */
  object-fit: contain;
  display: block;
}

.start-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0b1120;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.start-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--start-overlay-bg-image-desktop);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

@media (max-width: 680px) {
  .start-overlay::before {
    background-image: var(--start-overlay-bg-image-mobile);
    background-size: contain;
  }
}

.start-overlay.is-dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-overlay__inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  max-width: 28rem;
}

.start-overlay__eyebrow {
  margin: 0 0 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.start-overlay__title {
  margin: 0 0 2rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.15;
  color: var(--text-primary);
}

@media (max-width: 980px) {
  .app {
    flex-direction: column;
  }

  .panel--left {
    flex: 0 0 45%;
    width: 100%;
    max-width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem;
  }

  .panel--right {
    flex: 1 1 55%;
    width: 100%;
    min-height: 0;
  }
}

@media (max-width: 680px) {
  .panel--left {
    flex: 0 0 52%;
    padding: 0.85rem;
  }

  .panel__header {
    margin-bottom: 0.8rem;
  }

  .poem__title {
    margin-bottom: 0.85rem;
  }

  .poem__body {
    line-height: 1.6;
  }

  .nav-bar {
    margin-top: 0.85rem;
    padding: 0.65rem 0.75rem;
    gap: 0.5rem;
  }

  .audio-controls {
    margin-top: 0.85rem;
    padding: 0;
    gap: 0.5rem;
  }

  .btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.75rem;
  }

  .image-controls {
    right: 0.6rem;
    bottom: 0.6rem;
    padding: 0.35rem;
  }
}
