@layer components {
  /* ===== SPLIT HERO ===== */
  .hero {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    padding-block: var(--sp-xl) var(--sp-lg);
    overflow: hidden;
    position: relative;
  }

  .hero__inner {
    display: grid;
    gap: var(--sp-2xl);
    align-items: center;
  }

  @media (min-width: 48em) {
    .hero__inner {
      grid-template-columns: 1.1fr 0.9fr;
      gap: var(--sp-3xl);
    }
  }

  /* --- Text side --- */
  .hero__content {
    display: flex;
    flex-direction: column;
    gap: var(--sp-md);
    position: relative;
    z-index: 2;
  }

  .hero__title {
    font-family: var(--ff-display);
    font-weight: 800;
    font-size: clamp(1.6rem, 1rem + 2vw, 2.8rem);
    line-height: 1.08;
    color: var(--clr-text);
    letter-spacing: -0.02em;
  }

  .hero__title--accent {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline;
  }

  .hero__sub {
    font-size: var(--fs-base);
    color: var(--clr-text-muted);
    max-width: 34ch;
    line-height: 1.6;
  }

  .hero__sub strong {
    color: inherit;
    font-weight: 700;
  }

  .hero__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-sm);
  }

  .hero__actions .btn {
    text-align: center;
    justify-content: center;
  }

  @media (min-width: 48em) {
    .hero__actions {
      flex-direction: row;
      align-items: center;
    }

    .hero__actions .btn {
      min-width: 17rem;
    }
  }

  /* --- Visual side: glow orb + geometric shapes --- */
  .hero__visual {
    position: relative;
    aspect-ratio: 1;
    max-width: 460px;
    margin-inline: auto;
    z-index: 2;
  }

  @media (max-width: 47.99em) {
    .hero__visual {
      max-width: 220px;
      margin-top: var(--sp-md);
    }
  }

  /* Glowing orb — the main visual element */
  .hero__orb {
    position: absolute;
    inset: 5%;
    border-radius: var(--radius-full);
    background: radial-gradient(
      circle at 40% 40%,
      rgba(59, 92, 198, 0.5) 0%,
      rgba(107, 140, 255, 0.2) 40%,
      transparent 70%
    );
    filter: blur(40px);
    animation: orbPulse 6s ease-in-out infinite;
  }

  @keyframes orbPulse {
    0%, 100% { scale: 1; opacity: 0.8; }
    50% { scale: 1.12; opacity: 0.5; }
  }

  /* Secondary smaller orb for depth */
  .hero__orb-secondary {
    position: absolute;
    width: 50%;
    height: 50%;
    bottom: 5%;
    right: 5%;
    border-radius: var(--radius-full);
    background: radial-gradient(
      circle,
      rgba(107, 140, 255, 0.3) 0%,
      transparent 70%
    );
    filter: blur(30px);
    animation: orbPulse 8s ease-in-out infinite 2s;
  }

  /* Rotating outlined square */
  .hero__shape--square {
    position: absolute;
    inset: 12%;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-xl);
    animation: heroRotate 20s linear infinite;
    filter: drop-shadow(0 0 8px rgba(59, 92, 198, 0.2));
  }

  /* Second square, offset rotation — accent colored */
  .hero__shape--square-2 {
    position: absolute;
    inset: 22%;
    border: 3px solid rgba(59, 92, 198, 0.4);
    border-radius: var(--radius-2xl);
    animation: heroRotate 25s linear infinite reverse;
    filter: drop-shadow(0 0 12px rgba(59, 92, 198, 0.3));
  }

  /* Pulsing ring */
  .hero__shape--circle {
    position: absolute;
    width: 35%;
    height: 35%;
    top: 32%;
    left: 32%;
    border: 2px solid rgba(107, 140, 255, 0.3);
    border-radius: var(--radius-full);
    animation: heroPulse 4s ease-in-out infinite;
  }

  /* Small accent dot */
  .hero__shape--dot {
    position: absolute;
    width: 10%;
    height: 10%;
    top: 14%;
    right: 18%;
    background: var(--gradient-accent);
    border-radius: var(--radius-full);
    animation: heroFloat 6s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(59, 92, 198, 0.5);
  }

  /* White floating dot */
  .hero__shape--dot-2 {
    position: absolute;
    width: 6%;
    height: 6%;
    bottom: 22%;
    left: 16%;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-full);
    animation: heroFloat 5s ease-in-out infinite 1s;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
  }

  /* Dot grid pattern */
  .hero__shape--grid {
    position: absolute;
    inset: 5%;
    background-image: radial-gradient(
      circle,
      rgba(255, 255, 255, 0.06) 1px,
      transparent 1px
    );
    background-size: 24px 24px;
    opacity: 0.8;
  }

  /* --- Full-width fixed background --- */
  .hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    clip-path: inset(0);
  }

  .hero__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to right,
      rgba(0, 0, 0, 0.72) 35%,
      rgba(0, 0, 0, 0.35) 100%
    );
    z-index: 1;
  }

  .hero__bg picture,
  .hero__bg img {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    object-fit: cover;
    display: block;
  }

  .hero__bg picture {
    height: 100vh;
  }

  .hero__bg picture img {
    position: absolute;
    height: 100%;
  }

  /* Code bracket decoration */
  .hero__shape--bracket {
    position: absolute;
    bottom: 10%;
    right: 10%;
    font-family: var(--ff-body);
    font-size: clamp(2.5rem, 5vw, 5rem);
    font-weight: 200;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.4;
    line-height: 1;
    animation: heroFloat 7s ease-in-out infinite 0.5s;
    filter: drop-shadow(0 0 16px rgba(59, 92, 198, 0.4));
  }

  /* --- Animations --- */
  @keyframes heroRotate {
    to { rotate: 360deg; }
  }

  @keyframes heroPulse {
    0%, 100% { scale: 1; opacity: 0.5; }
    50% { scale: 1.15; opacity: 0.2; }
  }

  @keyframes heroFloat {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -14px; }
  }

  @media (prefers-reduced-motion: reduce) {
    .hero__orb,
    .hero__orb-secondary,
    .hero__shape--square,
    .hero__shape--square-2,
    .hero__shape--circle,
    .hero__shape--dot,
    .hero__shape--dot-2 {
      animation: none;
    }
  }

  /* --- Section background image (mirrors .hero__bg) --- */
  .section--with-bg {
    isolation: isolate;
  }

  .section__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    clip-path: inset(0);
  }

  .section__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.78) 0%,
      rgba(0, 0, 0, 0.88) 100%
    );
    z-index: 1;
  }

  .section__bg picture,
  .section__bg img {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    object-fit: cover;
    display: block;
  }

  .section__bg picture {
    height: 100vh;
  }

  .section__bg picture img {
    position: absolute;
    height: 100%;
  }

  .section--with-bg > .container {
    position: relative;
    z-index: 1;
  }
}
