/* devil.quest — Coastal Cyberpunk Design System */

/* ===================================================
   COLOR VARIABLES
   =================================================== */
:root {
  --abyssal-midnight: #050F17;
  --coastal-dark-teal: #0D2B35;
  --tidal-slate: #1A3D4F;
  --phosphor-teal: #00C9B1;
  --electric-coral: #FF6B6B;
  --warm-sand: #C9A87C;
  --sea-spray-white: #E8F4F8;
  --depth-violet: #7B2FBE;

  /* Z-index layers */
  --z-abyss: -2;
  --z-bio: -1;
  --z-surface: 0;
  --z-content: 1;
  --z-interaction: 2;
  --z-nav: 10;

  /* Typography */
  --font-display: 'Libre Baskerville', Georgia, serif;
  --font-accent: 'IM Fell English', Georgia, serif;
  --font-utility: 'DM Sans', system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--abyssal-midnight);
  color: var(--sea-spray-white);
  font-family: var(--font-accent);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* ===================================================
   SCAN-LINE OVERLAY
   =================================================== */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background: repeating-linear-gradient(
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
}

/* ===================================================
   BLOB LAYER SYSTEM — 6 DEPTH PLANES
   =================================================== */
.blob-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob-layer--abyss {
  z-index: var(--z-abyss);
}

.blob-layer--bio {
  z-index: var(--z-bio);
}

/* Blob base */
.blob {
  position: absolute;
  border-radius: 60% 40% 30% 70% / 50% 60% 40% 50%;
  animation: blob-breathe 15s ease-in-out infinite alternate;
}

/* Class C — Depth Shadow (Violet, very large, 4% opacity) */
.blob-c {
  background: var(--depth-violet);
  opacity: 0.04;
  width: 800px;
  height: 700px;
  border-radius: 45% 55% 60% 40% / 50% 40% 60% 50%;
  animation-duration: 22s;
}
.blob-c--1 {
  top: -200px;
  left: -200px;
  animation-delay: 0s;
}
.blob-c--2 {
  bottom: -300px;
  right: -200px;
  animation-delay: -9s;
  width: 900px;
  height: 800px;
}

/* Class A — Phosphor Pulse (Teal, 6-10% opacity) */
.blob-a {
  background: var(--phosphor-teal);
  opacity: 0.08;
  width: 500px;
  height: 480px;
}
.blob-a--1 {
  top: 10vh;
  right: 5vw;
  animation-duration: 17s;
  animation-delay: -3s;
}
.blob-a--2 {
  top: 60vh;
  left: 10vw;
  animation-duration: 12s;
  animation-delay: -6s;
  width: 420px;
  height: 460px;
  opacity: 0.06;
}
.blob-a--3 {
  top: 130vh;
  right: 15vw;
  animation-duration: 19s;
  animation-delay: -11s;
  width: 460px;
  height: 430px;
}

/* Blob breathing animation — morphs border-radius */
@keyframes blob-breathe {
  0%   { border-radius: 60% 40% 30% 70% / 50% 60% 40% 50%; }
  25%  { border-radius: 40% 60% 70% 30% / 40% 50% 60% 40%; }
  50%  { border-radius: 50% 50% 40% 60% / 60% 40% 50% 50%; }
  75%  { border-radius: 35% 65% 55% 45% / 55% 35% 65% 45%; }
  100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

/* ===================================================
   NAVIGATION
   =================================================== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 48px;
  background: rgba(5, 15, 23, 0.80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.35s ease;
}

.site-nav.nav-hidden {
  transform: translateY(-100%);
  opacity: 0;
}

.nav-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--sea-spray-white);
  text-decoration: none;
  text-shadow: 0 0 16px rgba(255, 107, 107, 0.35);
  transition: text-shadow 0.3s ease;
}
.nav-wordmark:hover {
  text-shadow: 0 0 24px rgba(255, 107, 107, 0.6);
}

.nav-dive {
  font-family: var(--font-utility);
  font-size: 14px;
  font-weight: 500;
  color: var(--phosphor-teal);
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  transition: color 0.25s, text-shadow 0.25s;
}
.nav-dive:hover {
  color: var(--sea-spray-white);
  text-shadow: 0 0 12px rgba(0, 201, 177, 0.6);
}

/* ===================================================
   SLIDE-REVEAL ANIMATION SYSTEM
   =================================================== */
.slide-reveal {
  opacity: 0;
  transform: translateY(40px) rotate(-1deg);
  transition: opacity 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-reveal.revealed {
  opacity: 1;
  transform: translateY(0) rotate(0deg);
}

/* Stagger delays via CSS custom property */
.slide-reveal[style*="--stagger: 1"] { transition-delay: 80ms; }
.slide-reveal[style*="--stagger: 2"] { transition-delay: 160ms; }
.slide-reveal[style*="--stagger: 3"] { transition-delay: 240ms; }

/* ===================================================
   SECTION 1 — HERO (INLET)
   =================================================== */
.section-hero {
  min-height: 100vh;
  background: var(--abyssal-midnight);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%);
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: var(--z-content);
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-right: 12vw;
}

/* Background blob behind wordmark */
.hero-blob-bg {
  position: absolute;
  width: 520px;
  height: 500px;
  background: var(--phosphor-teal);
  opacity: 0.07;
  border-radius: 70% 30% 55% 45% / 45% 60% 40% 55%;
  top: 50%;
  right: 8vw;
  transform: translateY(-50%);
  animation: blob-breathe 14s ease-in-out infinite alternate;
  z-index: -1;
}

.hero-content {
  text-align: right;
}

.hero-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(52px, 8vw, 96px);
  letter-spacing: -0.02em;
  color: var(--sea-spray-white);
  line-height: 1;
  text-shadow: 0 0 24px rgba(255, 107, 107, 0.4);
}

.hero-tagline {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 22px;
  color: var(--warm-sand);
  margin-top: 16px;
  letter-spacing: 0.02em;
}

.hero-scroll-hint {
  margin-top: 80px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.hero-scroll-text {
  font-family: var(--font-utility);
  font-size: 12px;
  font-weight: 500;
  color: rgba(0, 201, 177, 0.6);
  letter-spacing: 0.12em;
  text-transform: lowercase;
  animation: scroll-pulse 2.5s ease-in-out infinite;
}

@keyframes scroll-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ===================================================
   SECTION 2 — THE SHALLOWS
   =================================================== */
.section-shallows {
  background: var(--coastal-dark-teal);
  position: relative;
  padding: 160px 0 120px;
  overflow: hidden;
}

.shallows-inner {
  position: relative;
  z-index: var(--z-content);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.shallows-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: -0.02em;
  color: var(--sea-spray-white);
  margin-bottom: 32px;
}

.shallows-body {
  font-family: var(--font-accent);
  font-size: 18px;
  line-height: 1.75;
  color: var(--sea-spray-white);
  margin-bottom: 24px;
}

.shallows-label {
  font-family: var(--font-accent);
  font-size: 16px;
  color: var(--warm-sand);
  margin-top: 32px;
}

/* Organic "pool" cards — blob-shaped containers */
.shallows-cards-col {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.pool-card {
  background: var(--tidal-slate);
  padding: 32px 36px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--phosphor-teal),
              0 0 20px rgba(0, 201, 177, 0.15);
  transition: box-shadow 0.4s ease, transform 0.4s ease;
}
.pool-card--1 {
  border-radius: 60% 40% 30% 70% / 50% 60% 40% 50%;
  padding: 48px 44px 40px;
}
.pool-card--2 {
  border-radius: 40% 60% 70% 30% / 60% 40% 50% 40%;
  padding: 44px 48px 44px 40px;
  margin-left: 24px;
}
.pool-card--3 {
  border-radius: 55% 45% 40% 60% / 45% 55% 45% 55%;
  padding: 40px 40px 48px 44px;
  margin-right: 16px;
}

.pool-card:hover {
  box-shadow: 0 0 0 1px var(--phosphor-teal),
              0 0 40px rgba(0, 201, 177, 0.3);
  transform: translateY(-4px);
}

.pool-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--sea-spray-white);
  margin-bottom: 12px;
}

.pool-card-desc {
  font-family: var(--font-accent);
  font-size: 15px;
  line-height: 1.65;
  color: rgba(232, 244, 248, 0.8);
  margin-bottom: 16px;
}

.pool-card-tag {
  font-family: var(--font-utility);
  font-size: 12px;
  font-weight: 500;
  color: var(--warm-sand);
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.wave-divider {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  line-height: 0;
}
.wave-divider svg {
  width: 100%;
  height: 100%;
}

/* ===================================================
   SECTION 3 — THE DEEP
   =================================================== */
.section-deep {
  background: var(--abyssal-midnight);
  position: relative;
  padding: 160px 0 140px;
  overflow: hidden;
}

.deep-inner {
  position: relative;
  z-index: var(--z-content);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
}

/* Chromatic aberration heading effect */
.deep-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 5.5vw, 64px);
  letter-spacing: -0.02em;
  color: var(--sea-spray-white);
  position: relative;
  display: inline-block;
  margin-bottom: 80px;
}

.deep-heading-text {
  position: relative;
  display: inline-block;
}

.deep-heading-text::before {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--electric-coral);
  opacity: 0.5;
  transform: translateX(2px);
  pointer-events: none;
}

.deep-heading-text::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--phosphor-teal);
  opacity: 0.5;
  transform: translateX(-2px);
  pointer-events: none;
}

/* Feature clusters — non-grid free-flowing layout */
.deep-features {
  position: relative;
  min-height: 520px;
}

.feature-cluster {
  position: relative;
  max-width: 340px;
}
.feature-cluster--1 {
  margin-left: 0;
  margin-top: 0;
}
.feature-cluster--2 {
  margin-left: 38%;
  margin-top: -40px;
}
.feature-cluster--3 {
  margin-left: 12%;
  margin-top: 48px;
}

.feature-blob {
  position: absolute;
  inset: -20px;
  border-radius: 55% 45% 60% 40% / 40% 60% 40% 60%;
  background: rgba(0, 201, 177, 0.05);
  animation: blob-breathe 16s ease-in-out infinite alternate;
  pointer-events: none;
}

.feature-cluster--2 .feature-blob {
  background: rgba(255, 107, 107, 0.04);
  animation-duration: 13s;
  animation-delay: -5s;
}
.feature-cluster--3 .feature-blob {
  background: rgba(0, 201, 177, 0.05);
  animation-duration: 19s;
  animation-delay: -8s;
}

.feature-content {
  position: relative;
  z-index: 1;
  padding: 32px;
  border-left: 2px solid rgba(0, 201, 177, 0.3);
}

.feature-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--sea-spray-white);
  margin-bottom: 12px;
}

.feature-desc {
  font-family: var(--font-accent);
  font-size: 16px;
  line-height: 1.7;
  color: rgba(232, 244, 248, 0.8);
}

/* ===================================================
   SECTION 4 — SURF (SOCIAL PROOF)
   =================================================== */
.section-surf {
  background: var(--tidal-slate);
  position: relative;
  padding: 160px 0 140px;
  overflow: hidden;
}

.surf-inner {
  position: relative;
  z-index: var(--z-content);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
}

.surf-wave-highlight {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 25%;
  background: linear-gradient(
    180deg,
    rgba(0, 201, 177, 0.05) 0%,
    transparent 100%
  );
  clip-path: polygon(0 0, 100% 0, 100% 60%, 0 100%);
  pointer-events: none;
}

.surf-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 4.5vw, 52px);
  letter-spacing: -0.02em;
  color: var(--sea-spray-white);
  text-align: center;
  margin-bottom: 80px;
}

.surf-quotes {
  display: flex;
  flex-direction: column;
  gap: 48px;
  align-items: center;
}

.quote-block {
  position: relative;
  max-width: 620px;
  text-align: center;
  padding: 40px 48px;
}
.quote-block--1 { align-self: flex-start; }
.quote-block--2 { align-self: center; }
.quote-block--3 { align-self: flex-end; }

.quote-blob {
  position: absolute;
  inset: 0;
  background: rgba(255, 107, 107, 0.06);
  border-radius: 55% 45% 50% 50% / 45% 55% 50% 50%;
  pointer-events: none;
  z-index: 0;
  animation: blob-breathe 18s ease-in-out infinite alternate;
}
.quote-block--2 .quote-blob {
  animation-delay: -7s;
  animation-duration: 14s;
  background: rgba(255, 107, 107, 0.05);
}
.quote-block--3 .quote-blob {
  animation-delay: -12s;
  animation-duration: 21s;
}

.quote-text {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 18px;
  line-height: 1.75;
  color: var(--sea-spray-white);
  position: relative;
  z-index: 1;
  margin: 0;
}

.quote-cite {
  display: block;
  font-family: var(--font-utility);
  font-size: 13px;
  font-weight: 500;
  color: var(--warm-sand);
  margin-top: 16px;
  letter-spacing: 0.04em;
  position: relative;
  z-index: 1;
  font-style: normal;
}

/* ===================================================
   SECTION 5 — SHORE (CTA)
   =================================================== */
.section-shore {
  background: var(--abyssal-midnight);
  position: relative;
  padding: 160px 0 0;
  overflow: hidden;
}

.shore-inner {
  position: relative;
  z-index: var(--z-content);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.shore-blob-bg {
  position: absolute;
  width: 600px;
  height: 580px;
  background: var(--phosphor-teal);
  opacity: 0.07;
  border-radius: 40% 60% 55% 45% / 55% 40% 60% 45%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: blob-breathe 16s ease-in-out infinite alternate;
  pointer-events: none;
}

.shore-content {
  position: relative;
  z-index: var(--z-content);
}

.shore-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 5vw, 52px);
  letter-spacing: -0.02em;
  color: var(--sea-spray-white);
  margin-bottom: 20px;
}

.shore-sub {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 20px;
  color: var(--warm-sand);
  margin-bottom: 60px;
}

/* CTA Wrapper */
.cta-wrapper {
  position: relative;
  display: inline-block;
}

.cta-blob-b {
  position: absolute;
  width: 140px;
  height: 130px;
  background: var(--electric-coral);
  opacity: 0.18;
  border-radius: 70% 30% 50% 50% / 30% 70% 50% 50%;
  top: -20px;
  right: -30px;
  z-index: var(--z-interaction);
  pointer-events: none;
  transition: transform 0.4s ease-out, opacity 0.4s ease-out;
  animation: blob-breathe 10s ease-in-out infinite alternate;
}

.cta-wrapper:hover .cta-blob-b {
  transform: scale(1.08);
  opacity: 0.25;
}

.cta-clip-shape {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Organic blob-shaped CTA button via clip-path */
.cta-btn {
  position: relative;
  z-index: var(--z-interaction);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 22px 64px;
  background: linear-gradient(135deg, var(--phosphor-teal) 0%, var(--electric-coral) 100%);
  border: none;
  cursor: pointer;
  color: var(--sea-spray-white);
  box-shadow: 0 0 0 1px var(--phosphor-teal),
              0 0 20px rgba(0, 201, 177, 0.3);
  clip-path: polygon(
    8% 20%, 18% 5%,
    40% 0%, 62% 2%,
    80% 5%, 92% 16%,
    100% 38%, 98% 60%,
    92% 78%, 80% 92%,
    60% 100%, 38% 98%,
    18% 92%, 6% 78%,
    0% 58%, 2% 36%
  );
  transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.cta-btn:hover {
  box-shadow: 0 0 0 1px var(--phosphor-teal),
              0 0 40px rgba(0, 201, 177, 0.5);
  transform: scale(1.04);
  clip-path: polygon(
    6% 22%, 16% 4%,
    40% 2%, 64% 1%,
    82% 6%, 94% 17%,
    100% 40%, 99% 62%,
    93% 80%, 82% 94%,
    60% 100%, 36% 99%,
    16% 93%, 4% 79%,
    0% 56%, 3% 34%
  );
}

.cta-btn-text {
  font-family: var(--font-utility);
  font-size: 18px;
  font-weight: 700;
  color: var(--sea-spray-white);
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
}

/* ===================================================
   FOOTER
   =================================================== */
.site-footer {
  padding: 60px 48px;
  text-align: center;
  border-top: 1px solid rgba(0, 201, 177, 0.1);
  margin-top: 120px;
}

.footer-text {
  font-family: var(--font-accent);
  font-variant: small-caps;
  font-size: 13px;
  color: var(--warm-sand);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.footer-copy {
  font-family: var(--font-utility);
  font-size: 12px;
  color: rgba(232, 244, 248, 0.3);
  letter-spacing: 0.04em;
}

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 900px) {
  .shallows-inner {
    grid-template-columns: 1fr;
    gap: 60px;
  }
  .deep-features {
    min-height: unset;
  }
  .feature-cluster {
    position: relative;
    max-width: 100%;
    margin-left: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 48px;
  }
  .quote-block--1,
  .quote-block--2,
  .quote-block--3 {
    align-self: center;
  }
  .site-nav {
    padding: 16px 24px;
  }
  .hero-inner {
    padding-right: 24px;
    padding-left: 24px;
    align-items: center;
  }
  .hero-content {
    text-align: center;
  }
  .hero-scroll-hint {
    align-items: center;
  }
  .shallows-inner,
  .deep-inner,
  .surf-inner,
  .shore-inner {
    padding: 0 24px;
  }
  .site-footer {
    padding: 48px 24px;
  }
}

@media (max-width: 600px) {
  .hero-wordmark {
    font-size: 44px;
  }
  .pool-card--1,
  .pool-card--2,
  .pool-card--3 {
    border-radius: 16px;
    margin-left: 0;
    margin-right: 0;
    padding: 32px 28px;
  }
}
