/* miris.studio — Swiss Precision + Ethereal Blue */

:root {
  --celestine: #6BA3D6;
  --periwinkle: #A0C3E8;
  --deep-lapis: #2B4A7C;
  --swiss-white: #F4F6F9;
  --fog: #E8EDF4;
  --midnight-steel: #1A2B45;
  --pale-apricot: #F0D9C4;
  --electric-iris: #7B8CFF;
  --grid-line: rgba(160, 195, 232, 0.12);
  --grid-label-color: rgba(160, 195, 232, 0.4);
  --pulse-low: 0.08;
  --pulse-high: 0.14;
  --col-gap: 24px;
  --outer-margin: 64px;
  --max-width: 1440px;
  --section-spacing: 120px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  background-color: var(--swiss-white);
  color: var(--midnight-steel);
  overflow-x: hidden;
  line-height: 1.65;
  letter-spacing: 0.005em;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3 {
  font-family: 'Roboto Slab', serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--midnight-steel);
}

.hero-headline {
  font-size: clamp(3rem, 8vw, 6.5rem);
  margin-bottom: 0.5rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease-out 0.4s, transform 0.8s ease-out 0.4s;
}

.hero-headline.visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-tagline {
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--deep-lapis);
  margin: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease-out 0.7s, transform 0.8s ease-out 0.7s;
}

.hero-tagline.visible {
  opacity: 1;
  transform: translateY(0);
}

.statement-headline {
  font-size: clamp(1.6rem, 3.5vw, 2.8rem);
  line-height: 1.15;
  margin-bottom: 2rem;
  max-width: 800px;
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.statement-headline.visible {
  opacity: 1;
  transform: translateX(0);
}

.card-title {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  margin-bottom: 0.75rem;
  color: var(--midnight-steel);
}

.coda-headline {
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}

.coda-headline.visible {
  opacity: 1;
  transform: translateY(0);
}

body p {
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.65;
  color: var(--deep-lapis);
  margin-bottom: 1.25rem;
}

.card-description {
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  line-height: 1.6;
  color: var(--deep-lapis);
}

.coda-statement {
  font-size: clamp(1rem, 1.2vw, 1.15rem);
  line-height: 1.65;
  color: var(--deep-lapis);
  max-width: 600px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.8s ease-out 0.3s, transform 0.8s ease-out 0.3s;
}

.coda-statement.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger line animation */
.stagger-line {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.stagger-line.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Monospace accent */
.grid-label {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 300;
  font-size: clamp(0.7rem, 0.8vw, 0.8rem);
  color: var(--grid-label-color);
}

/* ============================================
   VISIBLE SWISS GRID OVERLAY
   ============================================ */

.grid-overlay {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  height: 100vh;
  padding: 0 var(--outer-margin);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--col-gap);
  pointer-events: none;
  z-index: 100;
}

.grid-column {
  position: relative;
  border-left: 1px solid var(--grid-line);
  border-right: 1px solid var(--grid-line);
}

.grid-column:first-child {
  border-left: 1px solid var(--grid-line);
}

.grid-column:last-child {
  border-right: 1px solid var(--grid-line);
}

.grid-label {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* ============================================
   SECTIONS BASE
   ============================================ */

.section {
  position: relative;
  overflow: hidden;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0 var(--outer-margin);
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  padding-top: 20vh;
}

.hero-mesh {
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(107, 163, 214, 0.3), transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(160, 195, 232, 0.25), transparent 50%),
    radial-gradient(ellipse at 40% 80%, rgba(123, 140, 255, 0.2), transparent 40%),
    radial-gradient(ellipse at 85% 20%, rgba(240, 217, 196, 0.15), transparent 45%);
  background-size: 200% 200%;
  animation: meshDrift 60s linear infinite;
  z-index: 0;
  transition: opacity 2s ease-out;
}

.hero-mesh.visible {
  opacity: 0.6;
}

@keyframes meshDrift {
  0% { background-position: 50% 50%; }
  25% { background-position: 55% 47%; }
  50% { background-position: 47% 55%; }
  75% { background-position: 54% 48%; }
  100% { background-position: 50% 50%; }
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 700px;
}

/* ============================================
   BLOBS
   ============================================ */

.blob {
  position: absolute;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  filter: blur(40px);
  pointer-events: none;
  animation: blobMorph 20s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

@keyframes blobMorph {
  0%, 100% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  }
  33% {
    border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
  }
  66% {
    border-radius: 50% 50% 30% 70% / 40% 60% 70% 30%;
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: var(--pulse-low);
  }
  50% {
    transform: scale(1.06);
    opacity: var(--pulse-high);
  }
}

.hero-blob {
  width: 40vw;
  height: 40vw;
  max-width: 500px;
  max-height: 500px;
  top: 10vh;
  left: 8%;
  background: linear-gradient(135deg, rgba(107, 163, 214, 0.12), rgba(240, 217, 196, 0.08));
  z-index: 1;
  animation: pulse 4s ease-in-out infinite;
}

.hero-blob-secondary {
  width: 25vw;
  height: 25vw;
  max-width: 320px;
  max-height: 320px;
  bottom: 15vh;
  right: 15%;
  background: linear-gradient(225deg, rgba(123, 140, 255, 0.08), rgba(160, 195, 232, 0.06));
  z-index: 1;
  animation: pulse 4s ease-in-out infinite, blobMorph 20s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  animation-delay: 2s, 5s;
}

/* ============================================
   STATEMENT SECTION
   ============================================ */

.statement {
  min-height: 80vh;
  display: flex;
  align-items: center;
  padding: var(--section-spacing) var(--outer-margin);
  position: relative;
  background-color: var(--swiss-white);
}

.statement-grid {
  max-width: 800px;
  width: 100%;
  position: relative;
  z-index: 2;
}

/* Interstitial Mesh Fields */
.interstitial-mesh {
  position: absolute;
  width: 450px;
  height: 450px;
  background:
    radial-gradient(circle at 30% 40%, rgba(107, 163, 214, 0.25), transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(123, 140, 255, 0.18), transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(160, 195, 232, 0.12), transparent 40%);
  border-radius: 50%;
  filter: blur(50px);
  pointer-events: none;
  z-index: 1;
}

#interstitialMesh1 {
  right: -80px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.7s ease-out;
}

#interstitialMesh1.visible {
  opacity: 1;
}

#interstitialMesh2 {
  left: -60px;
  bottom: -100px;
  width: 350px;
  height: 350px;
  opacity: 0;
  transition: opacity 0.7s ease-out;
}

#interstitialMesh2.visible {
  opacity: 1;
}

/* ============================================
   SHOWCASE SECTION
   ============================================ */

.showcase {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: var(--section-spacing) var(--outer-margin);
  background-color: var(--fog);
  position: relative;
}

.showcase-grid {
  max-width: 800px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  position: relative;
  z-index: 2;
}

.showcase-card {
  min-height: 280px;
  padding: 2rem;
  background: rgba(244, 246, 249, 0.7);
  border: 2px solid transparent;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1), transform 0.7s cubic-bezier(0.23, 1, 0.32, 1), border-color 0.3s ease;
}

.showcase-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.showcase-card.pulse-active {
  animation: cardBorderPulse 3s ease-in-out infinite;
}

@keyframes cardBorderPulse {
  0%, 100% {
    border-color: transparent;
    box-shadow: 0 0 0 0 transparent;
  }
  50% {
    border-color: rgba(107, 163, 214, 0.3);
    box-shadow: 0 0 16px rgba(107, 163, 214, 0.08);
  }
}

.card-mesh {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  z-index: 0;
}

.card-mesh-1 {
  background:
    radial-gradient(ellipse at 20% 30%, rgba(107, 163, 214, 0.15), transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(160, 195, 232, 0.1), transparent 50%);
}

.card-mesh-2 {
  background:
    radial-gradient(ellipse at 70% 20%, rgba(123, 140, 255, 0.12), transparent 55%),
    radial-gradient(ellipse at 30% 80%, rgba(107, 163, 214, 0.1), transparent 50%);
}

.card-mesh-3 {
  background:
    radial-gradient(ellipse at 50% 50%, rgba(160, 195, 232, 0.14), transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(107, 163, 214, 0.08), transparent 45%);
}

.card-mesh-4 {
  background:
    radial-gradient(ellipse at 30% 60%, rgba(123, 140, 255, 0.1), transparent 55%),
    radial-gradient(ellipse at 70% 40%, rgba(160, 195, 232, 0.12), transparent 50%);
}

.card-inner {
  position: relative;
  z-index: 1;
}

/* ============================================
   CODA SECTION
   ============================================ */

.coda {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--section-spacing) var(--outer-margin);
  position: relative;
  overflow: hidden;
}

.coda-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(107, 163, 214, 0.2), transparent 50%),
    radial-gradient(ellipse at 70% 40%, rgba(240, 217, 196, 0.18), transparent 45%),
    radial-gradient(ellipse at 50% 70%, rgba(123, 140, 255, 0.12), transparent 40%),
    radial-gradient(ellipse at 20% 80%, rgba(160, 195, 232, 0.1), transparent 50%);
  background-size: 200% 200%;
  animation: meshDrift 60s linear infinite;
  z-index: 0;
}

.coda-blob,
.coda-blob-secondary {
  position: absolute;
  pointer-events: none;
  filter: blur(40px);
}

.blob-large {
  width: 60vw;
  height: 60vw;
  max-width: 700px;
  max-height: 700px;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  animation: blobMorph 30s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.coda-blob {
  bottom: -15vh;
  left: 15%;
  background: linear-gradient(180deg, rgba(107, 163, 214, 0.12), rgba(240, 217, 196, 0.1));
  opacity: 0.15;
  z-index: 1;
  animation-delay: -10s;
}

.coda-blob-secondary {
  top: -10vh;
  right: 10%;
  width: 45vw;
  height: 45vw;
  max-width: 550px;
  max-height: 550px;
  background: linear-gradient(135deg, rgba(123, 140, 255, 0.1), rgba(160, 195, 232, 0.08));
  opacity: 0.12;
  z-index: 1;
  animation-delay: -15s;
}

.coda-content {
  position: relative;
  z-index: 3;
  max-width: 900px;
  margin: 0 auto;
}

/* Coda dissolution effect - bottom fade to white */
.coda-dissolution {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30vh;
  background: linear-gradient(to bottom, transparent, var(--swiss-white));
  z-index: 4;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.coda-dissolution.active {
  opacity: 1;
}

/* ============================================
   RESPONSIVE - TABLET (768px)
   ============================================ */

@media (max-width: 768px) {
  :root {
    --outer-margin: 24px;
  }

  .grid-overlay {
    grid-template-columns: repeat(6, 1fr);
    padding: 0 var(--outer-margin);
  }

  .grid-column:nth-child(n+7) {
    display: none;
  }

  .hero {
    padding: 0 var(--outer-margin);
    padding-top: 20vh;
  }

  .statement {
    padding: 80px var(--outer-margin);
  }

  .showcase {
    padding: 80px var(--outer-margin);
    justify-content: center;
  }

  .showcase-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .coda {
    padding: 80px var(--outer-margin);
  }

  .hero-blob {
    width: 50vw;
    height: 50vw;
    max-width: 300px;
    max-height: 300px;
  }

  .hero-blob-secondary {
    width: 30vw;
    height: 30vw;
    max-width: 200px;
    max-height: 200px;
  }

  .blob-large {
    width: 70vw;
    height: 70vw;
    max-width: 400px;
    max-height: 400px;
  }

  #interstitialMesh1 {
    width: 300px;
    height: 300px;
    right: -50px;
  }

  #interstitialMesh2 {
    width: 250px;
    height: 250px;
  }
}

/* ============================================
   RESPONSIVE - MOBILE (480px)
   ============================================ */

@media (max-width: 480px) {
  :root {
    --outer-margin: 16px;
  }

  .grid-overlay {
    display: none;
  }

  .hero {
    padding: 0 var(--outer-margin);
    padding-top: 25vh;
  }

  .hero-headline {
    font-size: 2.5rem;
  }

  .statement {
    padding: 60px var(--outer-margin);
  }

  .statement-headline {
    font-size: 1.4rem;
  }

  .showcase {
    padding: 60px var(--outer-margin);
  }

  .showcase-card {
    min-height: 240px;
    padding: 1.5rem;
  }

  .coda {
    padding: 60px var(--outer-margin);
  }

  .coda-headline {
    font-size: 2rem;
  }

  .hero-blob {
    width: 80vw;
    height: 80vw;
    max-width: 200px;
    max-height: 200px;
  }

  .hero-blob-secondary {
    display: none;
  }

  .blob-large {
    width: 80vw;
    height: 80vw;
    max-width: 250px;
    max-height: 250px;
  }

  .coda-blob-secondary {
    display: none;
  }

  #interstitialMesh1 {
    display: none;
  }

  #interstitialMesh2 {
    display: none;
  }

  .hero-mesh {
    background:
      radial-gradient(ellipse at 30% 40%, rgba(107, 163, 214, 0.25), transparent 50%),
      radial-gradient(ellipse at 70% 60%, rgba(160, 195, 232, 0.2), transparent 50%);
  }

  .coda-mesh {
    background:
      radial-gradient(ellipse at 50% 50%, rgba(107, 163, 214, 0.15), transparent 50%),
      radial-gradient(ellipse at 70% 40%, rgba(240, 217, 196, 0.1), transparent 45%);
  }
}
