/* ---------- Design tokens ---------- */
:root {
  --bg: #000;
  --text: #f5f1ea;
  --text-dim: rgba(245, 241, 234, 0.72);
  --text-faint: rgba(245, 241, 234, 0.5);
  --hairline: rgba(245, 241, 234, 0.18);

  --font-display: "Cormorant Garamond", "Hoefler Text", Georgia, serif;
  --font-fa: "Vazirmatn", "Iran Sans", Tahoma, sans-serif;

  --pad-x: 24px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  min-height: 100vh;
}
button {
  font: inherit; color: inherit;
  background: transparent; border: 0; padding: 0; margin: 0;
  cursor: pointer;
}
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }

/* ---------- Section sizing ---------- */
.splash, .painting {
  min-height: 100vh;
  min-height: 100svh;          /* iOS safe small-viewport */
}

/* ---------- Splash ---------- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 28px) var(--pad-x) calc(var(--safe-bottom) + 28px);
  opacity: 1;
  transition: opacity 600ms ease;
}
.splash.is-dismissed {
  opacity: 0;
  pointer-events: none;
}
.splash__top {
  text-align: center;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.splash__center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.splash__title-fa {
  font-family: var(--font-fa);
  font-size: 22px;
  color: var(--text-dim);
  margin-bottom: 20px;
}
.splash__title {
  font-style: italic;
  font-weight: 500;
  font-size: 62px;
  line-height: 1;
  letter-spacing: 1px;
}
.splash__by {
  margin-top: 18px;
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.splash__hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(245, 241, 234, 0.45);
}
.splash__hint svg {
  width: 14px;
  height: 14px;
  opacity: 0.85;
  flex-shrink: 0;
}
.splash__enter {
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text);
  animation: bob 2s ease-in-out infinite;
}
.splash__enter-text {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.splash__enter svg {
  width: 22px;
  height: 28px;
  opacity: 0.8;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50%      { transform: translateY(3px); opacity: 1; }
}

/* ---------- Painting hero ---------- */
.painting {
  position: relative;
  background-image: url("ocean.jpg");
  background-size: cover;
  background-position: center;
  background-color: #050a14;          /* fallback while image loads */
  color: #fff;
}
.painting__bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 100px var(--pad-x) calc(var(--safe-bottom) + 28px);
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.92) 25%,
    rgba(0, 0, 0, 0.55) 65%,
    transparent
  );
}
.painting__poem-fa {
  font-family: var(--font-fa);
  font-size: 17px;
  line-height: 1.85;
  color: #f7f3ec;
}
.painting__poem-en {
  font-style: italic;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(247, 243, 236, 0.88);
  margin-top: 8px;
}
.painting__divider {
  width: 32px; height: 1px;
  background: rgba(255, 255, 255, 0.32);
  margin: 16px 0;
}
.painting__title {
  font-style: italic;
  font-weight: 500;
  font-size: 34px;
  line-height: 1;
}
.painting__by {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}
.painting__chevron {
  position: absolute;
  bottom: calc(var(--safe-bottom) + 10px);
  left: 0; right: 0;
  display: flex; justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  animation: bob 2s ease-in-out infinite;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.6));
  pointer-events: none;
}
.painting__chevron svg { width: 28px; height: 34px; }
@media (max-height: 720px) {
  /* On short viewports the painting's bottom text block crowds the bottom edge
     and the chevron overlaps the artist credit. The gradient itself signals
     "more below" — hide the chevron rather than fight for space. */
  .painting__chevron { display: none; }
}

/* ---------- Reflection ---------- */
.reflection {
  position: relative;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(20, 30, 50, 0.7), rgba(0, 0, 0, 1) 70%),
    var(--bg);
  padding: 0 var(--pad-x) calc(var(--safe-bottom) + 28px);
}
.reflection::before {
  /* faded painting bleed at the top for visual continuity */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 30vh;
  background-image: url("ocean.jpg");
  background-size: cover;
  background-position: bottom center;
  opacity: 0.45;
  mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
  pointer-events: none;
}
.reflection__inner {
  position: relative;          /* sit above the ::before bleed */
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding-top: 24vh;
}
.reflection__body {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(245, 241, 234, 0.92);
}
.reflection__body p {
  margin: 0 0 14px;
}
.reflection__body p:last-child { margin-bottom: 0; }
.reflection__footer {
  margin-top: 40px;
  padding: 18px 0 0;
  border-top: 1px solid var(--hairline);
  text-align: center;
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-faint);
  line-height: 1.8;
}
.reflection__footer strong {
  display: block;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.reflection__footer span { display: block; }

/* ---------- Mute button ---------- */
.mute {
  position: fixed;
  top: calc(var(--safe-top) + 16px);
  right: 16px;
  z-index: 50;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 200ms ease;
}
.mute:hover { background: rgba(0, 0, 0, 0.65); }
.mute .icon { width: 18px; height: 18px; }
.mute .icon-off { display: none; }
.mute.is-muted .icon-on { display: none; }
.mute.is-muted .icon-off { display: block; }
