/* === Custom Properties === */
:root {
  --deep-umber: #3D2B1F;
  --terracotta: #C17F59;
  --parchment: #F2E8DC;
  --kiln-amber: #D4943A;
  --sage: #7A8B6F;
  --burnt-cocoa: #2A1A10;
  --wet-clay: #A67B5B;
  --foam: #FBF7F2;
  --slide-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === Reset === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--parchment);
  color: var(--deep-umber);
  font-family: 'DM Sans', -apple-system, Arial, sans-serif;
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.75;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

.mono {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  color: #8B6F47;
}

/* === Typography === */
.section-heading {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.6rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: clamp(3.2rem, 9vw, 7.5rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--foam);
}

.hero-sub {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  color: var(--kiln-amber);
}

.hero-tagline {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: var(--wet-clay);
  margin-top: 2rem;
  text-align: center;
}

.card-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* === Sections === */
.section {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 5vw, 6rem);
  overflow: hidden;
}

.section-1 { background: var(--parchment); }
.section-2 { background: var(--deep-umber); color: var(--parchment); }
.section-3 { background: var(--parchment); }
.section-4 { background: var(--terracotta); color: var(--foam); }
.section-5 { background: var(--foam); }

/* === Inflated Forms === */
.inflated-hero {
  width: clamp(280px, 70vw, 700px);
  padding: clamp(3rem, 6vw, 6rem);
  text-align: center;
  background: radial-gradient(ellipse at 30% 25%, var(--terracotta), var(--wet-clay));
  border-radius: 32px 40px 36px 44px;
  box-shadow:
    12px 16px 40px rgba(42, 26, 16, 0.2),
    inset -4px -6px 20px rgba(251, 247, 242, 0.15),
    inset 4px 4px 12px rgba(42, 26, 16, 0.1);
  opacity: 0;
  transform: translateY(60px) scale(0.85);
  transition: opacity 0.8s ease-out, transform 0.8s var(--slide-ease);
}

.inflated-hero.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.inflated-hero:hover {
  transform: scale(1.02);
  transition: transform 0.4s var(--spring);
  box-shadow:
    16px 20px 56px rgba(42, 26, 16, 0.25),
    inset -4px -6px 20px rgba(251, 247, 242, 0.2),
    inset 4px 4px 12px rgba(42, 26, 16, 0.08);
}

/* === Reversal Layout === */
.reversal-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 4vw, 5rem);
  flex-wrap: wrap;
  max-width: 1100px;
}

.inflated-form {
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 25%, var(--terracotta), var(--wet-clay));
  border-radius: 36px 44px 40px 32px;
  box-shadow:
    8px 10px 30px rgba(42, 26, 16, 0.3),
    inset -3px -4px 12px rgba(251, 247, 242, 0.15);
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s var(--slide-ease);
}

.inflated-form.revealed { opacity: 1; transform: translateY(0); }

.deflating {
  animation: deflate 4s ease-in-out infinite alternate;
}

@keyframes deflate {
  0% { transform: scale(1); border-radius: 36px 44px 40px 32px; }
  100% { transform: scale(0.8); border-radius: 50%; }
}

.inflating {
  animation: inflate 4s ease-in-out infinite alternate;
}

@keyframes inflate {
  0% { transform: scale(0.8); border-radius: 50%; }
  100% { transform: scale(1); border-radius: 36px 44px 40px 32px; }
}

.form-label { color: var(--foam); }

.reversal-text {
  max-width: 420px;
  text-align: center;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s var(--slide-ease);
}

.reversal-text.revealed { opacity: 1; transform: translateY(0); }

.mono-accent {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.875rem;
  color: var(--kiln-amber);
  letter-spacing: 0.04em;
  margin-top: 1.5rem;
}

/* === Card Cluster === */
.flow-heading {
  opacity: 0;
  transform: translateX(-80px);
  transition: opacity 0.8s ease-out, transform 0.8s var(--slide-ease);
}

.flow-heading.revealed {
  opacity: 1;
  transform: translateX(0);
}

.card-cluster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  max-width: 1000px;
  width: 100%;
}

.inflated-card {
  background: radial-gradient(ellipse at 25% 20%, var(--foam), var(--parchment));
  border-radius: 32px 38px 36px 42px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow:
    10px 14px 36px rgba(42, 26, 16, 0.12),
    inset -3px -4px 14px rgba(251, 247, 242, 0.3),
    inset 3px 3px 10px rgba(42, 26, 16, 0.05);
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.8s ease-out, transform 0.8s var(--slide-ease), box-shadow 0.6s ease;
}

.inflated-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.inflated-card:hover {
  transform: scale(1.02);
  transition: transform 0.4s var(--spring), box-shadow 0.4s ease;
  box-shadow:
    14px 18px 56px rgba(42, 26, 16, 0.18),
    inset -3px -4px 14px rgba(251, 247, 242, 0.35),
    inset 3px 3px 10px rgba(42, 26, 16, 0.05);
}

/* Stagger cards */
.card-1 { transition-delay: 0s; }
.card-2 { transition-delay: 0.12s; transform: rotate(1deg) translateY(60px); }
.card-2.revealed { transform: rotate(1deg) translateY(0); }
.card-3 { transition-delay: 0.24s; transform: rotate(-1.5deg) translateY(60px); }
.card-3.revealed { transform: rotate(-1.5deg) translateY(0); }
.card-4 { transition-delay: 0.36s; transform: rotate(2deg) translateY(60px); }
.card-4.revealed { transform: rotate(2deg) translateY(0); }

/* === Band Content (Section 4) === */
.band-content {
  max-width: 700px;
  text-align: center;
  opacity: 0;
  transform: translateX(80px);
  transition: opacity 0.8s ease-out, transform 0.8s var(--slide-ease);
}

.band-content.revealed {
  opacity: 1;
  transform: translateX(0);
}

.section-4 .section-heading { color: var(--foam); }

/* === Calm (Section 5) === */
.calm-content {
  text-align: center;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s var(--slide-ease);
}

.calm-content.revealed { opacity: 1; transform: translateY(0); }

.calm-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 3rem);
  text-transform: uppercase;
  color: var(--deep-umber);
  margin-bottom: 1rem;
}

.calm-domain {
  color: var(--wet-clay);
}

/* === Flowing Curves === */
.flowing-curves {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.flow-curve {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  transition: stroke-dashoffset 100ms linear;
}

/* === Bubble Container === */
.bubble-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(251, 247, 242, 0.4), rgba(193, 127, 89, 0.08));
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-shadow: inset 0 -4px 8px rgba(42, 26, 16, 0.06), 0 2px 12px rgba(193, 127, 89, 0.1);
  animation: bubbleRise var(--duration, 10s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0;
  pointer-events: none;
}

@keyframes bubbleRise {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 0.6; }
  80% { opacity: 0.4; }
  100% { transform: translateY(-100vh) translateX(var(--wobble, 20px)); opacity: 0; }
}

/* === Noise Overlay === */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.04;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 256px;
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  .bubble { animation: none; display: none; }
  .deflating, .inflating { animation: none; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .flow-curve { stroke-dashoffset: 0; }
}

/* === Responsive === */
@media (max-width: 768px) {
  .reversal-layout { flex-direction: column; }
  .inflated-form { width: 120px; height: 120px; }
}
