/* Veilio Co. — 3D preview additions (layered on top of ../css/style.css) */

/* ---------- Intro / loading sequence ---------- */
.veilio-intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--pearl);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, transform 0.7s cubic-bezier(.6,0,.2,1);
}
.veilio-intro--out {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}
body.veilio-intro-active { overflow: hidden; }

.veilio-intro-word {
  display: block;
  width: clamp(160px, 22vw, 280px);
  height: auto;
  opacity: 0;
  transform: scale(0.94);
  animation: veilio-intro-word-in 0.9s ease forwards 0.15s;
}
@keyframes veilio-intro-word-in {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.veilio-intro-bar {
  position: absolute;
  bottom: 14%;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 2px;
  background: rgba(30,35,40,0.12);
  overflow: hidden;
  border-radius: 2px;
}
.veilio-intro-bar span {
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
  animation: veilio-intro-bar-sweep 1.1s ease-in-out infinite;
}
@keyframes veilio-intro-bar-sweep {
  0% { transform: translateX(-250%); }
  100% { transform: translateX(350%); }
}

.veilio-intro-corner {
  position: absolute;
  color: var(--ink-soft);
  opacity: 0.4;
  font-size: 1rem;
}
.veilio-intro-corner--tl { top: 24px; left: 24px; }
.veilio-intro-corner--tr { top: 24px; right: 24px; }
.veilio-intro-corner--bl { bottom: 24px; left: 24px; }
.veilio-intro-corner--br { bottom: 24px; right: 24px; }

/* ---------- Bold hero entrance ---------- */
.scene-copy h1.veilio-hero-reveal,
.page-hero h1.veilio-hero-reveal {
  font-size: clamp(2.6rem, 5.4vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  transform: translateY(60px);
  opacity: 0;
  transition: transform 0.9s cubic-bezier(.16,1,.3,1), opacity 0.9s ease;
}
.veilio-hero-reveal--play {
  transform: translateY(0) !important;
  opacity: 1 !important;
}

.preview-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  text-align: center;
  font-size: 0.85rem;
  padding: 8px 16px;
  letter-spacing: 0.01em;
}
.preview-banner a { color: var(--gold); text-decoration: underline; }

.scene-hero {
  position: relative;
  width: 100%;
  height: 78vh;
  min-height: 480px;
  max-height: 780px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--pearl) 0%, var(--pearl-deep) 100%);
}
.scene-hero.scene-hero--tall { height: 88vh; }
.scene-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
video.scene-canvas {
  object-fit: cover;
  background: var(--ink);
}

.scene-overlay {
  position: absolute;
  z-index: 5;
  pointer-events: none;
}
.scene-overlay a, .scene-overlay button { pointer-events: auto; }

.scene-copy {
  top: 8%;
  left: 6%;
  max-width: 520px;
}
.scene-copy .glass-panel,
.glass-panel {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 18px;
  padding: 28px 30px;
  box-shadow: 0 20px 50px -20px rgba(30,35,40,0.25);
}

/* ---------- Glassmorphism: cursor-reactive glow ---------- */
/* Follows the pointer with a soft gold glow — applied to .glass-panel and
   .card-photo elements via the .glow-cursor class. Deliberately uses
   ::after, not ::before — .card-photo already owns ::before for its
   gradient legibility scrim (see style.css), and stacking a second
   background on the same pseudo-element would silently replace it.
   Pure CSS + a small JS listener that updates --gx/--gy; degrades
   gracefully to a static (no glow) panel if JS doesn't run. */
.glow-cursor { position: relative; isolation: isolate; }
.glow-cursor::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: radial-gradient(260px circle at var(--gx, 50%) var(--gy, 50%), rgba(237,201,103,0.4), transparent 62%);
  pointer-events: none;
}
.glow-cursor:hover::after { opacity: 1; }
.glow-cursor > * { position: relative; z-index: 1; }
.card-photo.glow-cursor::after {
  /* z-index intentionally left at the base rule's default (0): the CSS
     box-order spec paints ::before first, then normal children, then
     ::after — with all three at the same z-index this naturally stacks
     scrim (bottom) → glow (middle) → text (top, via the existing
     `.card-photo > * { z-index: 1 }` rule in style.css). Do not raise
     this above 0 or the glow will paint over the heading/body text. */
  background: radial-gradient(220px circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,0.28), transparent 65%);
}

.scene-hint {
  bottom: 6%;
  right: 6%;
  background: rgba(30,35,40,0.78);
  color: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.scene-hint svg { width: 16px; height: 16px; stroke: var(--gold); }

.scene-cycle-label {
  top: 6%;
  right: 6%;
  background: rgba(30,35,40,0.78);
  color: #fff;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.scene-blind-controls {
  bottom: 6%;
  left: 6%;
  display: flex;
  gap: 10px;
}
.scene-blind-controls button {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--ink);
  box-shadow: 0 12px 30px -10px var(--gold-glow);
}
.scene-blind-controls button.secondary {
  background: rgba(255,255,255,0.85);
  color: var(--ink);
  box-shadow: none;
  border: 1px solid var(--hairline);
}

.scene-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  background: var(--pearl);
  z-index: 4;
  transition: opacity 0.4s ease;
}
.scene-loading .spinner {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 3px solid var(--gold-soft);
  border-top-color: var(--gold-dark);
  animation: scene-spin 0.9s linear infinite;
}
@keyframes scene-spin { to { transform: rotate(360deg); } }

/* ---------- Instant estimate calculator (Products page) ---------- */
.estimate-widget {
  margin-top: 40px;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  padding: 40px 36px;
}
.estimate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  text-align: left;
  margin-bottom: 32px;
}
.estimate-field label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  display: block;
  margin-bottom: 10px;
}
.estimate-value { font-weight: 700; color: var(--ink); }

.estimate-field input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--hairline);
  outline: none;
  margin: 6px 0 10px;
}
.estimate-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  cursor: pointer;
  box-shadow: 0 4px 14px -4px var(--gold-glow);
  border: 2px solid #fff;
}
.estimate-field input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  cursor: pointer;
  border: 2px solid #fff;
}

.estimate-toggle {
  display: inline-flex;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}
.estimate-toggle button {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}
.estimate-toggle button.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--ink);
}

.estimate-stepper {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  background: rgba(255,255,255,0.55);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 6px 10px;
}
.estimate-stepper button {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.estimate-stepper span { min-width: 24px; text-align: center; font-weight: 700; color: var(--ink); }

.estimate-total {
  border-top: 1px solid var(--hairline);
  padding-top: 24px;
  margin-bottom: 24px;
}
.estimate-total-label { display: block; font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 6px; }
.estimate-total-value {
  display: block;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  color: var(--ink);
  font-family: var(--font-head);
}
.estimate-disclaimer { font-size: 0.78rem; color: var(--ink-soft); margin-top: 14px; max-width: 480px; margin-left: auto; margin-right: auto; }

@media (max-width: 720px) {
  .estimate-grid { grid-template-columns: 1fr; }
}

/* Accent (small, ambient, non-hero) scenes used on About / Projects / Contact */
.scene-accent {
  position: relative;
  width: 100%;
  height: 360px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--pearl) 0%, var(--pearl-deep) 100%);
  border: 1px solid var(--hairline);
}

@media (max-width: 760px) {
  .scene-hero { height: 92vh; }
  .scene-copy { left: 5%; right: 5%; max-width: none; top: 6%; }
  .scene-copy .glass-panel { padding: 22px 20px; }
  .scene-hint { display: none; }
  .scene-blind-controls { left: 5%; right: 5%; justify-content: center; }
  .scene-accent { height: 280px; }
}
