/* ============================================================
   SKY-BLUE SUNSET, blue-weighted - Silvia umbrella only (loads LAST).
   One continuous sky flows down the whole page (no per-section
   slabs): blue owns roughly the top three quarters of every
   gradient, and the warm sunset (lavender, pink, peach) lives in
   the last stretch as the horizon. Motion on backgrounds only.
   ============================================================ */

:root {
  /* Sky blue is the brand color. Readable deep-sky for text/buttons; the
     big light-blue sky + tints make blue the dominant area color. */
  --accent:        #1f7fd0;
  --accent-hover:  #1769bd;
  --accent-soft:   #e9f3ff;
  --accent-border: #bfe0ff;
  --focus-ring:    #2f9bf0;

  /* Blue-tinted surfaces: even the "white" reads as pale sky. */
  --bg:        #f2f8ff;
  --bg-subtle: #e4f0ff;
  --bg-sunken: #d4e6fb;
  --border:        #cfe2f7;
  --border-strong: #b3d1ef;

  /* Decorative gradient (icon chips): mostly blue, warm peach tail. */
  --grad-accent: linear-gradient(135deg, #5bb2ff 0%, #2f9bf0 48%, #1f7fd0 76%, #ff9e7a 100%);
}

/* ---------- ONE SKY, ONE LAYER ----------
   The entire sky (vivid blue washes + warm sunset horizon) is painted on a
   single fixed backdrop behind the whole page. Nothing is scoped to the hero
   box anymore, so there is no element edge where two backgrounds can meet -
   the "pasted rectangle" class of bug is impossible by construction. Blue
   owns the top ~70%; the sunset lives in the bottom stretch of the viewport. */
body { background: #cfe7ff; }
body::before {
  content: "";
  position: fixed;
  inset: -10%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(66% 54% at 20% -4%, rgba(74, 168, 255, 0.95), transparent 72%),  /* sky blue, top-left */
    radial-gradient(66% 54% at 82% -4%, rgba(96, 160, 255, 0.9), transparent 74%),   /* azure, top-right */
    radial-gradient(70% 46% at 50% 24%, rgba(140, 192, 255, 0.7), transparent 74%),  /* blue mid wash */
    radial-gradient(54% 34% at 50% 56%, rgba(47, 155, 240, 0.4), transparent 72%),   /* blue lower-mid */
    radial-gradient(40% 26% at 50% 96%, rgba(255, 178, 130, 0.62), transparent 62%), /* peach sun, horizon */
    radial-gradient(36% 24% at 86% 92%, rgba(255, 170, 120, 0.44), transparent 66%), /* peach, horizon right */
    radial-gradient(38% 26% at 12% 92%, rgba(150, 185, 250, 0.46), transparent 68%), /* soft blue, horizon left */
    linear-gradient(180deg, #a8d4ff 0%, #cfe7ff 36%, #eaf4ff 60%, #eef3fb 78%, #ffe9dd 100%);
  animation: sunsetSky 18s var(--ease-in-out) infinite alternate;
}
[data-theme="dark"] body { background: var(--bg); }
[data-theme="dark"] body::before { display: none; }

/* Everything floats on the shared sky - no per-section slabs. The .thesis
   and .vision overrides must name the classes: site.css sets their fill with
   higher specificity than a bare `section` selector. */
.hero { background: transparent; }
section,
section.section,
.section.thesis,
.section.vision {
  background: transparent;
}

[data-theme="dark"] {
  --accent:        #6cb8ff;
  --accent-hover:  #8cc8ff;
  --accent-soft:   #0e1f30;
  --accent-border: #1d3a54;
  --focus-ring:    #6cb8ff;

  --bg:        #0d1320;
  --bg-subtle: #121a2a;
  --bg-sunken: #0a0f18;
  --border:        #233247;
  --border-strong: #34465f;
}

/* ---------- The hero paints NOTHING of its own: the shared fixed sky
   (body::before above) shows through. No box-scoped wash, no bloom panel,
   no localized .hero-glow (which composited to a murky spot on dark navy),
   therefore no edges and no stray blobs in either theme. ---------- */
.hero::before,
.hero .hero-copy::before,
.hero-glow {
  content: none;
  display: none;
}
@keyframes sunsetSky {
  0%   { transform: translate3d(-0.8%, 0, 0) scale(1);    }
  100% { transform: translate3d(0.8%, -1%, 0) scale(1.04); }
}

/* ---------- The orbiting orb: a warm sun setting into the blue sky ---------- */
.hero-art .orb {
  background: radial-gradient(circle at 38% 34%, #fff3cf, #ffd97d 30%, #ff9e7a 72%, #ff8f6b 100%);
  animation: sunGlow 6s ease-in-out infinite;
}
@keyframes sunGlow {
  0%, 100% { box-shadow: 0 0 50px rgba(255, 176, 140, 0.4), inset 0 0 50px rgba(255,255,255,0.25); }
  50%      { box-shadow: 0 0 80px rgba(255, 150, 120, 0.5), inset 0 0 50px rgba(255,255,255,0.3); }
}

/* ---------- PRIMARY BUTTON: sky-blue gradient (blue is the main color) ---------- */
.btn-primary {
  background-image: linear-gradient(115deg, #3aa3f5 0%, #1f7fd0 100%);
  background-color: #1f7fd0;
  color: #fff;
  text-shadow: 0 1px 2px rgba(8, 48, 88, 0.3);
  box-shadow: 0 8px 22px -10px rgba(31, 127, 208, 0.55);
}

/* ---------- CTA BAND: blue for most of the run, sunset at the far edge ---------- */
.cta-band {
  background-image: linear-gradient(120deg, #17408f 0%, #1f6fd6 40%, #1f7fd0 64%, #2f9bf0 82%, #ff8f6b 100%);
  background-size: 220% 220%;
  animation: ctaDrift 16s var(--ease-in-out) infinite alternate;
}
@keyframes ctaDrift { to { background-position: 100% 50%; } }

@media (prefers-reduced-motion: reduce) {
  .hero::before, .hero-art .orb, .cta-band, .sunset-band { animation: none; }
}

/* ============================================================
   STRUCTURE 1 - full-bleed, centered hero with a setting sun
   ============================================================ */
.hero--centered {
  min-height: 82vh;
  display: grid;
  align-items: center;
  padding-block: clamp(4rem, 9vw, 7rem);
}
.hero--centered .hero-copy.hero-center {
  max-width: 56rem;
  margin-inline: auto;
  text-align: center;
}
.hero--centered .hero-sub { margin-inline: auto; max-width: 44rem; }
.hero--centered .hero-cta,
.hero--centered .hero-meta { justify-content: center; }
.hero--centered .hero-sun {
  width: clamp(96px, 13vw, 152px);
  height: clamp(96px, 13vw, 152px);
  margin: 0 auto clamp(1.25rem, 3vw, 2rem);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #fff3cf, #ffd97d 30%, #ff9e7a 72%, #ff8f6b 100%);
  box-shadow: 0 0 72px rgba(255, 176, 140, 0.45);
  animation: sunGlow 6s ease-in-out infinite;
}

/* ============================================================
   STRUCTURE 2 - bold featured Skyline panel + compact dev row
   ============================================================ */
.portfolio-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
}
.portfolio-stack .product-card.feature {
  display: grid;
  grid-column: 1;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: center;
  padding: clamp(1.75rem, 3vw, 2.75rem);
}
.portfolio-stack .product-card.feature .pc-prop { font-size: var(--fs-2xl); }

.dev-row {
  display: grid;
  grid-column: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}
.dev-compact { min-width: 0; padding: clamp(1.35rem, 2.2vw, 2rem); }
.dev-compact .pc-top { align-items: flex-start; flex-wrap: wrap; }
.dev-compact .pc-prop { font-size: var(--fs-lg); margin-top: var(--sp-3); }
.dev-compact .pc-desc {
  font-size: var(--fs-base);
  line-height: 1.65;
  margin-bottom: 0;
  max-width: 58ch;
}
.dev-compact .pc-foot,
.dev-compact > .text-muted { display: none; }   /* compact: hide footers + working-name notes */

@media (max-width: 980px) {
  .portfolio-stack .product-card.feature { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .dev-row { grid-template-columns: 1fr; }
  .nav .container { gap: 0.6rem; }
  .nav-actions { gap: 0.45rem; }
  .nav-actions .btn-primary { padding: 0.68rem 0.9rem; }
  .brand-logo { height: 27px; }
  .product-card,
  .dev-compact { padding: 1.25rem; }
  .portfolio-stack .product-card.feature { padding: 1.25rem; gap: 1.25rem; }
  .portfolio-stack .product-card.feature .pc-art { min-height: 132px; }
  .pc-top { align-items: flex-start; flex-wrap: wrap; }
  .pc-foot { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 480px) {
  .hero--centered {
    min-height: calc(100svh - var(--nav-h) - 1.5rem);
    padding-block: 1.5rem 2.75rem;
  }
  .hero--centered .hero-sun {
    width: 72px;
    height: 72px;
    margin-bottom: 0.85rem;
  }
  .hero--centered .eyebrow-row { margin-bottom: 0.75rem; }
  .hero--centered h1 {
    font-size: 2.35rem;
    line-height: 1.04;
    margin-bottom: 0.9rem;
  }
  .hero--centered .hero-sub {
    font-size: 1rem;
    line-height: 1.45;
    margin-bottom: 1rem;
  }
  .hero--centered .hero-cta {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
  }
  .hero--centered .hero-cta .btn {
    width: auto;
    padding: 0.78rem 1rem;
  }
  .hero--centered .hero-meta { display: none; }
  .portfolio-head { align-items: flex-start; }
  .portfolio-head > .flex { gap: 0.5rem; }
  .status { white-space: normal; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .nav .container { gap: 0.4rem; }
  .nav-actions { gap: 0.35rem; }
  .nav-actions .btn-primary {
    padding-inline: 0.7rem;
    font-size: 0.76rem;
  }
  .theme-toggle,
  .nav-burger { width: 36px; height: 36px; }
  .brand-logo { height: 25px; }
  .hero--centered h1 { font-size: 2.05rem; }
  .hero--centered .hero-sub { font-size: 0.94rem; }
  .hero--centered .hero-cta { gap: 0.6rem; }
  .hero--centered .hero-cta .btn { font-size: 0.82rem; padding-inline: 0.8rem; }
  .hero--centered .hero-cta .link-arrow { font-size: 0.78rem; }
}

@media (min-width: 721px) and (max-height: 700px) {
  .hero--centered {
    min-height: auto;
    padding-block: 2rem 2.75rem;
  }
  .hero--centered .hero-sun {
    width: 72px;
    height: 72px;
    margin-bottom: 0.8rem;
  }
  .hero--centered .eyebrow-row { margin-bottom: 0.8rem; }
  .hero--centered h1 {
    font-size: 3.15rem;
    margin-bottom: 0.9rem;
  }
  .hero--centered .hero-sub {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
  .hero--centered .hero-meta { margin-top: 1rem; }
}

/* ============================================================
   STRUCTURE 3 - full-bleed sunset statement band
   ============================================================ */
.sunset-band {
  padding-block: clamp(4rem, 8vw, 7rem);
  background-image: linear-gradient(120deg, #17408f 0%, #1f6fd6 40%, #1f7fd0 64%, #2f9bf0 82%, #ff8f6b 100%);
  background-size: 220% 220%;
  animation: ctaDrift 18s var(--ease-in-out) infinite alternate;
  color: #fff;
  text-align: center;
}
[data-theme="dark"] .sunset-band {
  background-image: linear-gradient(120deg, #111a2a 0%, #162a46 46%, #213b5f 76%, #3e385f 100%);
  border-block: 1px solid var(--border);
}
.sunset-band .eyebrow {
  color: rgba(255, 255, 255, 0.85);
  -webkit-text-fill-color: rgba(255, 255, 255, 0.85);
}
.sunset-band h2 {
  color: #fff;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: var(--sp-3) 0;
  text-shadow: 0 2px 18px rgba(20, 24, 70, 0.28);
}
.sunset-band p {
  color: rgba(255, 255, 255, 0.92);
  max-width: 56ch;
  margin: 0 auto;
  font-size: var(--fs-lg);
}
.band-domains {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
}
.band-domains span {
  padding: 0.4rem 0.9rem;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: var(--fs-sm);
  font-weight: 600;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
[data-theme="dark"] .band-domains span {
  background: rgba(108, 184, 255, 0.12);
  border-color: rgba(108, 184, 255, 0.22);
}

/* ============================================================
   SCROLL EXPERIENCE - scroll-driven 3D (Silvia homepage only).
   Browsers with CSS scroll timelines get: 3D card entrances,
   a hero that recedes into the sky, a sun that sets as you
   scroll, and daylight melting into dusk near the footer.
   Everything else falls back to the existing JS reveal.
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    /* Scroll timelines take over: neutralize the JS reveal so the two
       systems never animate the same element twice. */
    .reveal, .reveal.in {
      opacity: 1;
      transform: none;
      transition: none;
    }

    /* Cards swing up in 3D as they enter - bigger arc, longer on-screen
       travel, and alternating left/right twist so rows feel alive. */
    .product-card,
    .dev-compact,
    .card,
    .problem-card,
    .price-card,
    .trust-card,
    .domain-row {
      animation: rise3d cubic-bezier(0.22, 1, 0.36, 1) both;
      animation-timeline: view();
      animation-range: entry 0% cover 46%;
      backface-visibility: hidden;
    }
    @keyframes rise3d {
      from {
        opacity: 0;
        transform: perspective(900px) rotateX(26deg) translateY(110px) scale(0.86);
      }
      60% { opacity: 1; }
      to {
        opacity: 1;
        transform: perspective(900px) rotateX(0deg) translateY(0) scale(1);
      }
    }
    /* Alternating twist: odd cards arrive from the left, even from the right. */
    .card:nth-child(odd),
    .problem-card:nth-child(odd),
    .dev-compact:nth-child(odd),
    .domain-row:nth-child(odd) {
      animation-name: rise3d-left;
    }
    .card:nth-child(even),
    .problem-card:nth-child(even),
    .dev-compact:nth-child(even),
    .domain-row:nth-child(even) {
      animation-name: rise3d-right;
    }
    @keyframes rise3d-left {
      from {
        opacity: 0;
        transform: perspective(900px) rotateX(22deg) rotateY(-14deg) translateX(-70px) translateY(90px) scale(0.86);
      }
      60% { opacity: 1; }
      to   { opacity: 1; transform: perspective(900px) rotateX(0) rotateY(0) translateX(0) translateY(0) scale(1); }
    }
    @keyframes rise3d-right {
      from {
        opacity: 0;
        transform: perspective(900px) rotateX(22deg) rotateY(14deg) translateX(70px) translateY(90px) scale(0.86);
      }
      60% { opacity: 1; }
      to   { opacity: 1; transform: perspective(900px) rotateX(0) rotateY(0) translateX(0) translateY(0) scale(1); }
    }

    /* Section headings: the eyebrow sweeps in from the left, the heading
       rises with a twist, the intro line follows late - a visible cascade. */
    .section-head .eyebrow,
    .section-head .eyebrow-row {
      animation: fromLeft cubic-bezier(0.22, 1, 0.36, 1) both;
      animation-timeline: view();
      animation-range: entry 0% cover 30%;
    }
    .section-head h2 {
      animation: headTwist cubic-bezier(0.22, 1, 0.36, 1) both;
      animation-timeline: view();
      animation-range: entry 0% cover 40%;
    }
    .section-head p {
      animation: fadeUp cubic-bezier(0.22, 1, 0.36, 1) both;
      animation-timeline: view();
      animation-range: entry 10% cover 52%;
    }
    @keyframes fromLeft {
      from { opacity: 0; transform: translateX(-90px); }
      to   { opacity: 1; transform: none; }
    }
    @keyframes headTwist {
      from { opacity: 0; transform: perspective(900px) rotateX(32deg) translateY(70px); }
      to   { opacity: 1; transform: perspective(900px) rotateX(0) translateY(0); }
    }
    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(46px); }
      to   { opacity: 1; transform: none; }
    }

    /* Parallax: art panels and chips glide at their own depth while they
       cross the screen (moves the whole time, not just on entry). */
    .pc-art {
      animation: parallaxDrift linear both;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }
    @keyframes parallaxDrift {
      from { transform: translateY(56px) scale(1.04); }
      to   { transform: translateY(-56px) scale(1); }
    }

    /* The statement band's gradient slides as it crosses the viewport. */
    .sunset-band {
      animation: bandSlide linear both;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
      background-size: 260% 260%;
    }
    @keyframes bandSlide {
      from { background-position: 0% 50%; }
      to   { background-position: 100% 50%; }
    }

    /* The hero copy tilts back and recedes into the sky as you leave it. */
    .hero-copy {
      animation: heroAway linear both;
      animation-timeline: scroll(root);
      animation-range: 0vh 75vh;
    }
    @keyframes heroAway {
      to {
        opacity: 0;
        transform: perspective(900px) translateY(-12vh) rotateX(16deg) scale(0.84);
      }
    }

    /* The sun sets in a visible arc - drifting sideways as it sinks,
       growing warmer and larger like a real setting sun. */
    .hero--centered .hero-sun {
      animation: sunGlow 6s ease-in-out infinite, sunSet linear both;
      animation-timeline: auto, scroll(root);
      animation-range: normal, 0vh 100vh;
    }
    @keyframes sunSet {
      55% { opacity: 1; }
      to {
        transform: translate(-16vw, 58vh) scale(1.25);
        opacity: 0;
      }
    }

    /* Daylight melts into dusk as you approach the footer: a warm layer
       over the fixed sky whose strength is the scroll progress itself. */
    body::after {
      content: "";
      position: fixed;
      inset: 0;
      z-index: -1;
      pointer-events: none;
      background: linear-gradient(180deg,
        rgba(56, 105, 210, 0.16) 0%,
        rgba(120, 150, 225, 0.22) 45%,
        rgba(255, 140, 110, 0.44) 100%);
      opacity: 0;
      animation: duskIn linear both;
      animation-timeline: scroll(root);
    }
    @keyframes duskIn { to { opacity: 1; } }
    [data-theme="dark"] body::after { display: none; }
  }
}
