/* ============================================================
   styles.css — Romantic Minimalist Website
   ============================================================ */

/* ── CSS Variables ── */
:root {
  --bg:           #0d0d0d;
  --bg-soft:      #111111;
  --surface:      #161616;
  --border:       #252525;
  --text:         #e8e0d8;
  --text-muted:   #6b635c;
  --text-faint:   #2e2a27;
  --accent:       #c9a98a;
  --accent-warm:  #e8c4a0;
  --heart:        #c97a7a;
  --heart-dim:    #4a2222;

  --font-mono:    'JetBrains Mono', 'Courier New', monospace;
  --font-script:  'Dancing Script', cursive;

  --radius-sm:    4px;
  --radius-md:    12px;
  --radius-lg:    24px;

  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:  cubic-bezier(0.45, 0, 0.55, 1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--accent-warm); }

button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── Utility ── */
.hidden { display: none !important; }
.active  { display: block !important; }

/* Gateway needs flex to centre — overrides the generic block above */
.gateway.active { display: flex !important; }

/* Gateway needs flex to centre — overrides the generic block above */
.gateway.active { display: flex !important; }

/* ============================================================
   1. PASSWORD GATEWAY
   ============================================================ */

.gateway {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.gateway.fade-out {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

/* Hearts canvas sits behind everything inside gateway */
#heartCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Card */
.gateway__card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 56px 48px;
  background: rgba(22, 22, 22, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-width: 480px;
  width: 90%;
  animation: floatIn 1s var(--ease-out) both;
}

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

.gateway__lock {
  font-size: 2rem;
  color: var(--heart);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%       { transform: scale(1.18); opacity: 0.7; }
}

.gateway__title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Hint — cursive / script font */
.gateway__hint {
  font-family: var(--font-script);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--accent);
  text-align: center;
  line-height: 1.6;
  max-width: 340px;
  font-style: italic;
}

/* Input row */
.gateway__input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.gateway__input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.12em;
  padding: 12px 18px;
  outline: none;
  transition: border-color 0.25s;
}

.gateway__input::placeholder { color: var(--text-faint); }
.gateway__input:focus { border-color: var(--accent); }

.gateway__input.shake {
  animation: shake 0.45s var(--ease-in-out);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-5px); }
  80%       { transform: translateX(5px); }
}

.gateway__btn {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--bg);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}

.gateway__btn:hover  { background: var(--accent-warm); transform: scale(1.06); }
.gateway__btn:active { transform: scale(0.96); }

.gateway__error {
  font-size: 0.72rem;
  color: var(--heart);
  letter-spacing: 0.1em;
  min-height: 1em;
  text-align: center;
}

/* ============================================================
   2. MAIN SITE
   ============================================================ */

.main-site {
  min-height: 100vh;
  animation: fadeUp 0.9s var(--ease-out) both;
}

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

/* ── Site Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 48px;
  background: rgba(13, 13, 13, 0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.site-header__logo {
  font-size: 1.2rem;
  color: var(--heart);
  animation: pulse 3s ease-in-out infinite;
}

.site-header__nav {
  display: flex;
  gap: 32px;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.site-header__nav a {
  color: var(--text-muted);
  transition: color 0.2s;
}
.site-header__nav a:hover { color: var(--text); }

/* ── Audio Player ── */
.audio-player {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audio-player__btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s, transform 0.15s;
}

.audio-player__btn:hover {
  border-color: var(--accent);
  transform: scale(1.1);
}

.audio-player__label {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 100px 24px 72px;
  border-bottom: 1px solid var(--text-faint);
}

.hero__sub {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.hero__title {
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text);
  position: relative;
  display: inline-block;
}

.hero__title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* ── Gallery Section ── */
.gallery-section {
  padding: 80px 48px;
  max-width: 1400px;
  margin: 0 auto;
}

.gallery-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  align-items: start;
}

/* ── Carousel ── */
.carousel {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  aspect-ratio: 4 / 3;
}

.carousel__track {
  width: 100%;
  height: 100%;
  position: relative;
}

.carousel__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s var(--ease-out);
  pointer-events: none;
}

.carousel__slide.active {
  opacity: 1;
  pointer-events: auto;
}

.carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
}

/* Placeholder when no image loaded */
.carousel__slide img[src=""],
.carousel__slide img:not([src]) {
  background: var(--surface);
}

/* Arrows */
.carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(13, 13, 13, 0.7);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  backdrop-filter: blur(8px);
}

.carousel__arrow--prev { left: 14px; }
.carousel__arrow--next { right: 14px; }

.carousel__arrow:hover {
  background: rgba(201, 169, 138, 0.15);
  border-color: var(--accent);
  transform: translateY(-50%) scale(1.08);
}

/* Dots */
.carousel__dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.carousel__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  border: none;
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
}

.carousel__dot.active {
  background: var(--accent);
  transform: scale(1.4);
}

/* ── Gallery Text Panel ── */
.gallery-text {
  position: sticky;
  top: 90px;
  padding: 32px 0;
  border-left: 1px solid var(--border);
  padding-left: 36px;
}

.gallery-text__number {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: var(--text-faint);
  display: block;
  margin-bottom: 24px;
}

.gallery-text__entry {
  display: none;
  animation: textIn 0.5s var(--ease-out) both;
}

.gallery-text__entry.active {
  display: block;
}

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

.gallery-text__caption {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.gallery-text__body {
  font-size: 0.8rem;
  line-height: 1.9;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.gallery-text__date {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
}

/* ── Thumbnail Strip ── */
.thumbnail-strip {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.thumbnail-strip::-webkit-scrollbar { height: 3px; }
.thumbnail-strip::-webkit-scrollbar-track { background: transparent; }
.thumbnail-strip::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.thumbnail {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
  background: var(--surface);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail.active { border-color: var(--accent); transform: scale(1.05); }
.thumbnail:hover  { border-color: var(--text-muted); }

/* ── Poems CTA ── */
.poems-cta {
  display: flex;
  justify-content: center;
  padding: 80px 24px;
  border-top: 1px solid var(--text-faint);
}

.poems-cta__btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 44px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--text);
  background: transparent;
  transition: background 0.25s, border-color 0.25s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.poems-cta__btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(201,169,138,0.08), rgba(201,169,138,0));
  opacity: 0;
  transition: opacity 0.3s;
}

.poems-cta__btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.poems-cta__btn:hover::before { opacity: 1; }

.poems-cta__btn-icon {
  color: var(--heart);
  font-size: 1rem;
  animation: pulse 2.4s ease-in-out infinite;
}

/* ── Site Footer ── */
.site-footer {
  text-align: center;
  padding: 40px;
  border-top: 1px solid var(--text-faint);
  color: var(--heart-dim);
  font-size: 1.4rem;
}

/* ============================================================
   3. POEMS OVERLAY
   ============================================================ */

.poems-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: var(--bg);
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}

.poems-overlay.visible {
  opacity: 1;
}

.poems-overlay__close {
  position: fixed;
  top: 28px;
  right: 32px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
  background: rgba(13,13,13,0.8);
  backdrop-filter: blur(8px);
}

.poems-overlay__close:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: rotate(90deg);
}

.poems-overlay__inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 100px 32px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 56px;
  font-family: var(--font-mono);
}

.poems-overlay__heading {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--text);
  text-align: center;
}

.poems-overlay__divider {
  color: var(--heart);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-align: center;
  opacity: 0.6;
}

.poems-overlay__divider--sm {
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* Individual poem */
.poem {
  width: 100%;
  text-align: left;
}

.poem__title {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.poem__body {
  font-size: 0.9rem;
  line-height: 2.1;
  color: var(--text);
  font-weight: 300;
  white-space: pre-line;
}

/* Poems footer */
.poems-overlay__footer {
  width: 100%;
  text-align: center;
  border-top: 1px solid var(--text-faint);
  padding-top: 56px;
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.poems-overlay__closing {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 300;
  line-height: 2;
  color: var(--text-muted);
  font-style: italic;
  max-width: 540px;
  text-align: center;
}

.poems-overlay__heart {
  font-size: 1.2rem;
  color: var(--heart);
  animation: pulse 2.4s ease-in-out infinite;
}

/* ============================================================
   RESPONSIVE — TABLET (<=960px)
   ============================================================ */

@media (max-width: 960px) {
  .gallery-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .gallery-text {
    position: static;
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 28px;
  }

  .gallery-section { padding: 56px 32px; }
}

/* ============================================================
   RESPONSIVE — MOBILE (<=640px)
   ============================================================ */

@media (max-width: 640px) {

  /* Header */
  .site-header {
    padding: 14px 18px;
    gap: 12px;
  }

  .site-header__nav {
    gap: 16px;
    font-size: 0.62rem;
  }

  .audio-player__label { display: none; }

  /* Hero */
  .hero { padding: 64px 20px 48px; }
  .hero__title { font-size: clamp(2rem, 10vw, 2.8rem); }

  /* Gateway card */
  .gateway__card {
    padding: 36px 22px;
    gap: 22px;
    width: 92%;
    border-radius: 16px;
  }

  .gateway__hint { font-size: 0.98rem; }

  .gateway__input {
    font-size: 0.95rem;
    padding: 11px 14px;
  }

  /* Gallery */
  .gallery-section { padding: 40px 18px; }

  /* Carousel: taller on portrait phones */
  .carousel { aspect-ratio: 3 / 4; }

  /* Bigger tap targets for arrows */
  .carousel__arrow {
    width: 38px;
    height: 38px;
    font-size: 0.85rem;
  }
  .carousel__arrow--prev { left: 8px; }
  .carousel__arrow--next { right: 8px; }

  /* Text panel */
  .gallery-text__caption { font-size: 1.05rem; }
  .gallery-text__body    { font-size: 0.78rem; }

  /* Thumbnails */
  .thumbnail { width: 64px; height: 48px; }

  /* Poems CTA */
  .poems-cta { padding: 56px 18px; }

  .poems-cta__btn {
    padding: 15px 28px;
    font-size: 0.8rem;
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }

  /* Poems overlay */
  .poems-overlay__inner {
    padding: 80px 22px 64px;
    gap: 40px;
  }

  .poems-overlay__heading { font-size: 1.5rem; }

  .poem__body {
    font-size: 0.83rem;
    line-height: 2;
  }

  .poems-overlay__closing { font-size: 0.78rem; }

  .poems-overlay__close {
    top: 16px;
    right: 16px;
  }
}
