/* ══════════════════════════════════════════════════════════════════════
   wall-styles.css — Mesh gradient background + script labels + wall stage
   Dark/light adaptive via CSS custom properties.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Light mode (default) ─────────────────────────────────────────── */
:root {
  --svg-stroke: #36261c;
  --script-color: #5a4336;
  --script-glow: rgba(230, 206, 177, 0.65);
  --mesh-1: #e8bc71;
  --mesh-2: #d97d62;
  --mesh-3: #e6ceb1;
  --mesh-4: #bf6f57;
  --mesh-5: #f0dcc2;
  --mesh-6: #c7965d;
  --mesh-7: #ad5e48;
  --mesh-overlay: rgba(244, 238, 230, 0.52);
  --mesh-overlay-mid: rgba(244, 238, 230, 0.68);
}

/* ── Dark mode ────────────────────────────────────────────────────── */
.dark {
  --svg-stroke: #b8a08a;
  --script-color: #c4a88e;
  --script-glow: rgba(180, 140, 100, 0.45);
  --mesh-1: #5a3a1a;
  --mesh-2: #6b2e1a;
  --mesh-3: #4a3520;
  --mesh-4: #7a3a1a;
  --mesh-5: #3a2a18;
  --mesh-6: #5a3520;
  --mesh-7: #6a2a1a;
  --mesh-overlay: rgba(15, 12, 10, 0.55);
  --mesh-overlay-mid: rgba(15, 12, 10, 0.72);
}

/* ── Mesh background ──────────────────────────────────────────────── */
.wall-mesh-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.wall-mesh-bg::after {
  content: "";
  position: absolute;
  inset: -8%;
  background: radial-gradient(
    circle at 50% 58%,
    var(--mesh-overlay) 0%,
    var(--mesh-overlay-mid) 34%,
    transparent 76%
  );
}

.wall-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(98px);
  opacity: 0.44;
  animation: wallSwirl 28s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.wall-blob.c1 {
  top: -16%; left: -12%; width: 56vw; height: 56vw;
  min-width: 360px; min-height: 360px;
  background: var(--mesh-1); transform-origin: center right;
  animation-duration: 26s;
}
.wall-blob.c2 {
  top: 34%; left: 46%; width: 66vw; height: 66vw;
  min-width: 420px; min-height: 420px;
  background: var(--mesh-2); transform-origin: top left;
  animation-name: wallSwirlAlt; animation-delay: -6s; animation-duration: 31s;
}
.wall-blob.c3 {
  top: 62%; left: -24%; width: 50vw; height: 50vw;
  min-width: 320px; min-height: 320px;
  background: var(--mesh-3); transform-origin: top right;
  animation-delay: -11s; animation-duration: 34s;
}
.wall-blob.c4 {
  top: -18%; left: 56%; width: 34vw; height: 34vw;
  min-width: 220px; min-height: 220px;
  background: var(--mesh-4); transform-origin: left center;
  animation-name: wallSwirlAlt; animation-delay: -13s; animation-duration: 24s;
}
.wall-blob.c5 {
  top: 8%; left: 18%; width: 28vw; height: 28vw;
  min-width: 190px; min-height: 190px;
  background: var(--mesh-5); transform-origin: center bottom;
  animation-delay: -18s; animation-duration: 37s;
}
.wall-blob.c6 {
  top: 70%; left: 40%; width: 42vw; height: 42vw;
  min-width: 250px; min-height: 250px;
  background: var(--mesh-6); transform-origin: right top;
  animation-name: wallSwirlAlt; animation-delay: -8s; animation-duration: 29s;
}
.wall-blob.c7 {
  top: 46%; left: -14%; width: 24vw; height: 24vw;
  min-width: 170px; min-height: 170px;
  background: var(--mesh-7); transform-origin: center;
  animation-delay: -15s; animation-duration: 22s;
}

@keyframes wallSwirl {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
  50%  { transform: translate(8vw, -8vh) scale(1.11) rotate(92deg); }
  100% { transform: translate(-7vw, 7vh) scale(0.92) rotate(182deg); }
}

@keyframes wallSwirlAlt {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
  50%  { transform: translate(-7vw, -6vh) scale(1.08) rotate(-82deg); }
  100% { transform: translate(6vw, 7vh) scale(0.9) rotate(-168deg); }
}

/* ── Script labels (Ge'ez + Arabic corners) ───────────────────────── */
.wall-script-labels {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-top: var(--wall-script-pad-top, -2vh);
  padding-right: var(--wall-script-pad-side, 4vw);
  padding-bottom: 0;
  padding-left: var(--wall-script-pad-side, 4vw);
  box-sizing: border-box;
  pointer-events: none;
}

.wall-script-label {
  font-size: clamp(2.4rem, 5vw, 5.5rem);
  font-weight: 400;
  line-height: 1;
  color: var(--script-color);
  text-shadow: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 440ms ease, transform 560ms cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.wall-script-label.visible {
  opacity: 1;
  transform: translateY(0);
}

.wall-script-label.left {
  font-family: "Noto Sans Ethiopic", "Abyssinica SIL", sans-serif;
  text-align: left;
}

.wall-script-label.right {
  font-family: "Playpen Sans Arabic", "Noto Sans Arabic", sans-serif;
  text-align: right;
  direction: rtl;
  unicode-bidi: isolate;
  letter-spacing: 0;
}

/* Typing caret */
.wall-script-label::after {
  content: "";
  display: inline-block;
  width: 0.08em;
  height: 0.92em;
  margin-inline-start: 0.18em;
  background: currentColor;
  opacity: 0;
  transform: translateY(0.08em);
}

.wall-script-label.typing::after {
  opacity: 0.8;
  animation: wallCaretBlink 1s steps(1) infinite;
}

.wall-script-label.done::after {
  opacity: 0;
  animation: none;
}

@keyframes wallCaretBlink {
  0%, 49% { opacity: 0.8; }
  50%, 100% { opacity: 0; }
}

/* ── SVG wall stage ───────────────────────────────────────────────── */
.wall-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
  padding: var(--wall-stage-pad-top, 6vh) var(--wall-stage-pad-side, 4vw) 0;
  box-sizing: border-box;
}

#wall {
  width: 100%;
  height: 100%;
  max-height: 100%;
  opacity: 0.7;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.12));
}

.dark #wall {
  filter: drop-shadow(2px 2px 6px rgba(0, 0, 0, 0.25));
}

#wall path {
  fill: none;
  stroke: var(--svg-stroke);
  opacity: 0;
}

/* ── Hero content overlay (centered text) ─────────────────────────── */
.wall-hero-content {
  position: absolute;
  z-index: 10;
  text-align: center;
  left: 50%;
  top: 55%;
  transform: translateX(-50%);
  width: min(90vw, 600px);
}

.wall-hero-content h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 16px;
  line-height: 1.1;
}

/* Staggered stack title */
.hero-stagger {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-line-1 {
  display: block;
  margin-left: -2em;
}
.hero-line-2 {
  display: block;
  margin-left: 2em;
  margin-top: 0.08em;
}

.wall-hero-content .wall-subtext {
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  font-weight: 400;
  color: var(--text-secondary, #8f7d70);
  margin: 0 0 24px;
}

.dark .wall-hero-content .wall-subtext {
  color: #a89888;
}

/* ── Responsive: mobile ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .wall-mesh-bg::after { inset: -2%; }

  .wall-blob { filter: blur(56px); opacity: 0.32; }
  .wall-blob.c5, .wall-blob.c7 { display: none; }

  #wall {
    filter: drop-shadow(1px 2px 3px rgba(0, 0, 0, 0.2));
    height: 80%;
    max-height: 80%;
    transform: translateY(-8vh);
  }

  .dark #wall {
    filter: drop-shadow(1px 2px 4px rgba(0, 0, 0, 0.5));
  }

  .wall-script-label {
    font-size: clamp(2rem, 8vw, 3.5rem);
  }

  .wall-script-labels {
    padding-top: 12vh;
  }

  .wall-hero-content {
    top: auto;
    bottom: 6vh;
    transform: translateX(-50%);
    width: min(92vw, 500px);
  }

  .wall-hero-content h1 {
    font-size: clamp(1.8rem, 9vw, 3rem);
  }

  .hero-line-1 { margin-left: -1em; }
  .hero-line-2 { margin-left: 1em; }
}

/* ── Reduced motion ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .wall-blob { animation: none; }
  .wall-script-label.typing::after { animation: none; }
}
