/* ============================================
   GOOGLE STITCH AI AESTHETIC - MSR PLATFORM
   ============================================ */

/* ── Cinematic Hero ── */
.hero-cinematic {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 160px 24px 100px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at top, #F0FDFA 0%, #FAFAF9 60%, var(--bg-body) 100%);
}

.hero-cinematic::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(15,118,110,0.06) 0%, transparent 60%);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  animation: pulseSlow 8s infinite alternate;
}

@keyframes pulseSlow {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

.hero-cinematic-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
}

.hero-cinematic h1 {
  font-size: 4.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-cinematic .subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 48px;
  line-height: 1.6;
}

.hero-spatial-showcase {
  position: relative;
  margin-top: 60px;
  width: 100%;
  max-width: 1000px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
}

.spatial-device {
  width: 400px;
  position: relative;
  z-index: 5;
  filter: drop-shadow(0 40px 80px rgba(15,118,110,0.15));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0px); }
}

.spatial-widget {
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.4);
  padding: 20px 24px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  z-index: 4;
  text-align: left;
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease);
}

.spatial-widget:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 32px 80px rgba(15,118,110,0.12);
}

.widget-tl { top: 10%; left: -60px; }
.widget-tr { top: 20%; right: -40px; }
.widget-bl { bottom: 20%; left: -80px; }
.widget-br { bottom: 10%; right: -60px; }

@media (max-width: 1024px) {
  .hero-cinematic { padding: 120px 20px 60px; min-height: auto; }
  .hero-cinematic h1 { font-size: 3.2rem; }
  .spatial-device { width: 300px; }
  .spatial-widget { position: relative; inset: auto !important; margin: 12px auto; display: inline-block; }
  .hero-spatial-showcase { flex-direction: column; margin-top: 40px; }
}

@media (max-width: 600px) {
  .hero-cinematic h1 { font-size: 2.4rem; }
  .spatial-device { width: 240px; }
  .spatial-widget { min-width: 200px; text-align: center; }
}

/* ── Bento Grid System ── */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(280px, auto);
  gap: 24px;
  margin-top: 40px;
}

.bento-box {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 32px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s var(--ease);
}

.bento-box:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.bento-large {
  grid-column: span 2;
  grid-row: span 2;
}

.bento-wide {
  grid-column: span 2;
  grid-row: span 1;
}

.bento-tall {
  grid-column: span 1;
  grid-row: span 2;
}

@media (max-width: 900px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .bento-large, .bento-wide { grid-column: span 2; }
}

@media (max-width: 600px) {
  .bento-grid { grid-template-columns: 1fr; }
  .bento-large, .bento-wide, .bento-tall { grid-column: span 1; grid-row: span 1; }
}

.bento-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; background: var(--primary-pale); color: var(--primary);
  margin-bottom: 24px;
}

/* ── Sticky Storytelling ── */
.story-scroll-container {
  display: flex;
  gap: 60px;
  align-items: flex-start;
  position: relative;
}

.story-sticky-sidebar {
  position: sticky;
  top: 120px;
  flex: 0 0 400px;
  padding-right: 40px;
}

.story-content-stream {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.story-card {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateY(40px);
  animation: slideUpFade 0.8s var(--ease-out) forwards;
}

@keyframes slideUpFade {
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .story-scroll-container { flex-direction: column; }
  .story-sticky-sidebar { position: relative; top: 0; flex: 1; padding-right: 0; margin-bottom: 40px; }
}

/* ============================================
   MOTION GRAPHICS ENGINE STATES
   ============================================ */

/* Base config for elements that will be revealed */
[data-stitch] {
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: var(--delay, 0ms);
  will-change: opacity, transform;
}

/* Types of motions */
[data-stitch="reveal"] {
}

[data-stitch="zoom"] {
}

[data-stitch="fade-left"] {
}

[data-stitch="fade-right"] {
}

[data-stitch="flow-up"] {
}

/* Visibility State triggered by stitch-motion.js */
[data-stitch].is-visible {
  opacity: 1;
  transform: translate(0) scale(1);
  filter: blur(0);
}

/* Story cards with data-stitch use the motion engine instead of static animation */
.story-card[data-stitch] {
  animation: none;
}

/* Ensure story-card visibility wins when triggered by the motion engine */
.story-card[data-stitch].is-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
  filter: blur(0) !important;
}

/* RESPONSIVE FIXES */
@media (max-width: 1024px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .bento-large, .bento-wide { grid-column: span 2 !important; }
    .hero-spatial-showcase { flex-direction: column !important; }
    .spatial-widget { position: relative !important; inset: auto !important; margin: 10px auto; width: 100%; max-width: 300px; text-align: center; }
}
@media (max-width: 768px) {
    .bento-grid { grid-template-columns: 1fr !important; }
    .bento-large, .bento-wide, .bento-tall { grid-column: span 1 !important; grid-row: span 1 !important; }
    .story-scroll-container { flex-direction: column !important; }
    .story-sticky-sidebar { position: relative !important; top: 0 !important; width: 100%; margin-bottom: 24px; padding-right: 0 !important; }
}
