/* ============================================================
   LEVEL JOINERY — motion layer
   GSAP ScrollTrigger drives .reveal / .reveal-stagger via JS
   (adding/removing .is-visible). This file defines the states
   only — timing/easing lives in the GSAP calls in each page's
   inline <script>, per the "considered, unhurried" brief:
   power2/power3/power4 easing only, never elastic or bounce.
   ============================================================ */

/* ============ SCROLL REVEAL STATES ============ */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s cubic-bezier(.22,1,.36,1), transform 0.9s cubic-bezier(.22,1,.36,1);
  filter: blur(0);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(.22,1,.36,1), transform 0.7s cubic-bezier(.22,1,.36,1);
}
.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.09s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.18s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.27s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.36s; }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 0.45s; }
.reveal-stagger.is-visible > * { opacity: 1; transform: translateY(0); }

/* ============ HERO LOAD SEQUENCE ============ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: scale(1); } }

.load-seq > * { opacity: 0; animation: fadeUp 1s cubic-bezier(.22,1,.36,1) forwards; }
.load-seq > *:nth-child(1) { animation-delay: 0.05s; }
.load-seq > *:nth-child(2) { animation-delay: 0.2s; }
.load-seq > *:nth-child(3) { animation-delay: 0.35s; }
.load-seq > *:nth-child(4) { animation-delay: 0.5s; }
.hero-bg-img.load-img { opacity: 0; animation: scaleIn 1.6s cubic-bezier(.22,1,.36,1) forwards; animation-delay: 0.1s; }

@media (prefers-reduced-motion: reduce) {
  .load-seq > *, .hero-bg-img.load-img, .reveal, .reveal-stagger > * {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}

/* ============ STAT NUMBER COUNT-UP TARGET ============ */
.count-target { font-variant-numeric: tabular-nums; }

/* ============ DIMENSION-LINE / TIMELINE DRAW TARGET ============ */
/* stroke-dashoffset animated via GSAP ScrollTrigger scrub in-page */
.draw-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
}

/* ============ CURSOR-FOLLOW ACCENT (subtle, desktop only) ============ */
.glow-card { position: relative; overflow: hidden; }
.glow-card::before {
  content: '';
  position: absolute;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(185,131,90,0.12) 0%, transparent 70%);
  border-radius: 50%;
  left: var(--mx, 50%);
  top: var(--my, 50%);
  transform: translate(-50%,-50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.glow-card:hover::before { opacity: 1; }
@media (hover: none) { .glow-card::before { display: none; } }

/* ============ BUTTON RIPPLE (Anime.js triggers this class) ============ */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(244,239,230,0.22);
  transform: scale(0);
  pointer-events: none;
}

/* ============ INTERACTIVE PROJECT GALLERY (tabs + stage) ============ */
.gallery-section { padding: 110px 0; }
.gallery-shell { display: grid; grid-template-columns: 320px 1fr; gap: 0; border: 1px solid var(--line-strong); background: var(--bg-0); }
.gallery-tabs { display: flex; flex-direction: column; border-right: 1px solid var(--cream-line-strong); }
.gallery-tab {
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--cream-line);
  color: rgba(244,239,230,0.55);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  padding: 26px 28px;
  cursor: pointer;
  transition: color 0.3s ease, background 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}
.gallery-tab:last-child { border-bottom: none; }
.gallery-tab .gt-num { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; opacity: 0.6; }
.gallery-tab:hover { color: var(--paper); background: rgba(244,239,230,0.04); }
.gallery-tab.active { color: var(--paper); background: rgba(244,239,230,0.06); }
.gallery-tab.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--oak); }
.gallery-tab .gt-meta { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(244,239,230,0.4); margin-top: 4px; display: block; }

.gallery-stage { position: relative; aspect-ratio: 16/10; overflow: hidden; }
.gallery-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.6s ease, transform 1.2s cubic-bezier(.22,1,.36,1);
}
.gallery-img.active { opacity: 1; transform: scale(1); }
.gallery-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 28px 32px;
  background: linear-gradient(transparent, rgba(28,26,23,0.85));
  color: var(--paper);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease 0.15s, transform 0.5s ease 0.15s;
}
.gallery-caption.active { opacity: 1; transform: translateY(0); }
.gallery-caption .gc-title { font-family: var(--font-display); font-size: 22px; font-weight: 500; margin-bottom: 4px; }
.gallery-caption .gc-meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(244,239,230,0.6); }

@media (max-width: 980px) {
  .gallery-shell { grid-template-columns: 1fr; }
  .gallery-tabs { flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--cream-line-strong); }
  .gallery-tab { white-space: nowrap; border-bottom: none; border-right: 1px solid var(--cream-line); padding: 16px 20px; }
  .gallery-tab .gt-meta { display: none; }
  .gallery-tab.active::before { left: 0; right: 0; bottom: 0; top: auto; width: auto; height: 3px; }
}

/* ============ BEFORE/AFTER SLIDER ============ */
.ba-slider { position: relative; aspect-ratio: 16/9; overflow: hidden; cursor: ew-resize; user-select: none; border: 1px solid var(--line-strong); touch-action: pan-y; }
.ba-slider img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ba-after { z-index: 1; }
.ba-before { z-index: 2; clip-path: inset(0 50% 0 0); }
.ba-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; background: var(--paper); z-index: 3; transform: translateX(-50%); pointer-events: none; box-shadow: 0 0 0 1px rgba(28,26,23,0.2); }
.ba-handle::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--paper);
  background-image: linear-gradient(135deg, transparent 47%, var(--ink) 47%, var(--ink) 53%, transparent 53%), linear-gradient(45deg, transparent 47%, var(--ink) 47%, var(--ink) 53%, transparent 53%);
  background-size: 14px 14px, 14px 14px;
  background-position: center 35%, center 65%;
  background-repeat: no-repeat;
  box-shadow: 0 4px 16px rgba(28,26,23,0.25);
}
.ba-label { position: absolute; top: 16px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--paper); background: rgba(28,26,23,0.55); padding: 6px 12px; z-index: 4; }
.ba-label.before { left: 16px; }
.ba-label.after { right: 16px; }
