/* Home page — Hero + Package 1+ sections (tokens from config.css :root) */

/* —— Hero (locked) —— */

.home-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - var(--header-height));
  width: 100%;
  padding: clamp(1.5rem, 5vh, 3.5rem) var(--chrome-pad-x);
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: -12%;
  z-index: -1;
  background:
    radial-gradient(
      95% 75% at 50% 38%,
      rgba(94, 58, 140, 0.36),
      transparent 60%
    ),
    radial-gradient(
      60% 50% at 82% 18%,
      rgba(0, 174, 239, 0.18),
      transparent 52%
    ),
    radial-gradient(
      50% 45% at 14% 78%,
      rgba(212, 175, 55, 0.14),
      transparent 50%
    ),
    radial-gradient(
      40% 35% at 48% 62%,
      rgba(0, 174, 239, 0.06),
      transparent 55%
    ),
    radial-gradient(
      35% 30% at 55% 28%,
      rgba(212, 175, 55, 0.07),
      transparent 50%
    );
  background-size: 118% 118%;
  background-position: 50% 50%;
  animation: home-hero-drift calc(var(--motion-ambient) * 1.25) ease-in-out
    infinite alternate;
}

.home-hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(1.75rem, 4.5vh, 2.75rem);
  max-width: min(56rem, 100%);
  width: 100%;
}

.home-hero__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.home-hero__banner {
  display: block;
  width: min(40rem, 92vw);
  max-width: 100%;
  height: auto;
  animation:
    home-enter var(--motion-enter) var(--ease-out) both,
    home-lockup-breath calc(var(--motion-ambient) * 0.13) ease-in-out 0.8s 2
      alternate forwards;
}

.home-hero__cta {
  margin: 0;
  animation: home-enter var(--motion-enter) var(--ease-out) 100ms both;
}

/* .home-hero__cta-link paint → .site-cta in config.css */

@media (max-width: 40rem) {
  .home-hero__banner {
    width: min(22rem, 88vw);
  }

  .home-hero__inner {
    gap: 1.5rem;
  }
}

/* —— Shared section chrome —— */

.home-section {
  width: 100%;
  padding: clamp(3rem, 8vh, 5.5rem) var(--chrome-pad-x);
  border-top: 1px solid var(--color-border);
  /* Header veil bleeds past the phone side padding; clip it at the viewport edge */
  overflow-x: clip;
}

.home-section__inner {
  max-width: 64rem;
  margin: 0 auto;
}

.home-section__inner--narrow {
  max-width: 40rem;
}

.home-section__header {
  margin: 0 0 clamp(1.75rem, 4vh, 2.5rem);
  max-width: 36rem;
}

.home-section__eyebrow {
  margin: 0 0 0.65rem;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-gold);
}

.home-section__title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.9375rem, 3.7vw, 2.5625rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
}

.home-section__lead {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* —— Hurdles —— */

/* Worries: misty glass forms in a loose constellation; a gold thread leads into the title. */
.home-hurdles__bubbles {
  position: relative;
  list-style: none;
  max-width: 54rem;
  margin: 0 auto clamp(4rem, 9vh, 5rem);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
}

.home-hurdles__bubbles::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(-1 * clamp(3.25rem, 7.5vh, 4.25rem));
  width: 1px;
  height: clamp(3rem, 7vh, 4rem);
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(226, 201, 106, 0.55) 70%,
    var(--color-gold-soft)
  );
  pointer-events: none;
}

.home-hurdles__bubbles::before {
  content: "";
  position: absolute;
  left: calc(50% - 0.2rem);
  bottom: calc(-1 * clamp(3.25rem, 7.5vh, 4.25rem) - 0.2rem);
  width: 0.45rem;
  height: 0.45rem;
  background: var(--color-gold-soft);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14);
  transform: rotate(45deg);
  pointer-events: none;
}

.home-hurdles__bubble {
  align-self: start;
}

.home-hurdles__bubble:nth-child(1) {
  grid-column: 1 / 6;
}

.home-hurdles__bubble:nth-child(2) {
  grid-column: 7 / 12;
  margin-top: 2.25rem;
}

.home-hurdles__bubble:nth-child(3) {
  grid-column: 2 / 7;
  margin-top: 0.5rem;
}

.home-hurdles__bubble:nth-child(4) {
  grid-column: 8 / 13;
  margin-top: 1.75rem;
}

.home-hurdles__quote {
  position: relative;
  margin: 0;
  padding: 1.05rem 1.35rem;
  border: 1px solid var(--color-border);
  border-radius: 1.25rem 1.25rem 1.25rem 0.35rem;
  background: linear-gradient(
    160deg,
    rgba(20, 18, 26, 0.82),
    rgba(11, 10, 15, 0.62)
  );
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow:
    inset 0 1px 0 rgba(226, 201, 106, 0.28),
    0 14px 32px -18px rgba(0, 174, 239, 0.35);
  font-family: var(--font-ui);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--color-text-muted);
  animation: home-hurdles-drift calc(var(--motion-ambient) * 0.15) ease-in-out 2
    alternate forwards;
}

.home-hurdles__bubble:nth-child(even) .home-hurdles__quote {
  border-radius: 1.25rem 1.25rem 0.35rem 1.25rem;
}

.home-hurdles__bubble:nth-child(2) .home-hurdles__quote {
  animation-delay: -0.9s;
}

.home-hurdles__bubble:nth-child(3) .home-hurdles__quote {
  animation-delay: -1.65s;
}

.home-hurdles__bubble:nth-child(4) .home-hurdles__quote {
  animation-delay: -0.45s;
}

.home-hurdles__quote::before {
  content: "";
  position: absolute;
  bottom: -0.3rem;
  left: 0.2rem;
  width: 0.55rem;
  height: 0.55rem;
  border: 1px solid var(--color-border);
  border-top: none;
  border-left: none;
  background: var(--color-obsidian);
  transform: rotate(45deg);
}

.home-hurdles__bubble:nth-child(even) .home-hurdles__quote::before {
  left: auto;
  right: 0.2rem;
}

.home-hurdles .home-section__header {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* Answers: clear, lit cards with a gold-to-cyan edge and a star-point marker. */
.home-hurdles__solutions {
  list-style: none;
  max-width: 54rem;
  margin: 0 auto;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.home-hurdles__solution {
  position: relative;
  padding: 1.1rem 1.35rem 1.1rem 2.85rem;
  border: 1px solid var(--color-border);
  border-radius: 0.35rem;
  background: linear-gradient(
    135deg,
    rgba(212, 175, 55, 0.09),
    rgba(0, 174, 239, 0.05) 55%,
    rgba(20, 18, 26, 0.6)
  );
  font-family: var(--font-ui);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--color-text);
}

.home-hurdles__solution::after {
  content: "";
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: -1px;
  width: 2px;
  border-radius: 0.35rem 0 0 0.35rem;
  background: linear-gradient(
    to bottom,
    var(--color-gold-soft),
    var(--color-cyan-soft)
  );
}

.home-hurdles__solution::before {
  content: "";
  position: absolute;
  left: 1.25rem;
  top: 1.55rem;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--color-gold-soft);
  box-shadow:
    0 0 0 3px rgba(212, 175, 55, 0.14),
    0 0 10px rgba(92, 207, 245, 0.35);
  transform: rotate(45deg);
}

/* Two out-and-back breaths, then rest on the first keyframe (WCAG 2.2.2: still within ~5s) */
@keyframes home-hurdles-drift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-5px);
  }
}

/* —— Security —— */

.home-security {
  background: radial-gradient(
    70% 60% at 10% 20%,
    rgba(94, 58, 140, 0.16),
    transparent 55%
  );
}

.home-security__list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.home-security__item {
  position: relative;
  padding: 0.35rem 0 0.35rem 1.35rem;
  font-family: var(--font-ui);
  font-size: 1.1875rem;
  line-height: 1.5;
  color: var(--color-text);
}

.home-security__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--color-cyan);
  box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.18);
}

.home-security__note {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.home-security__note a {
  font-weight: 500;
}

/* —— Tier teaser —— */

.home-tiers__list {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.home-tiers__item {
  padding: 1.35rem 1.4rem 1.5rem;
  border: 1px solid var(--color-border);
  background: rgba(20, 18, 26, 0.55);
}

.home-tiers__name {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-gold-soft);
}

.home-tiers__fit {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.home-tiers__aside {
  margin: 0 0 clamp(2rem, 4.5vh, 2.5rem);
}

.home-tiers__cta {
  margin: 0;
}

/* .home-tiers__cta-link paint → .site-cta in config.css */

/* —— How we work —— */

.home-process__list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: home-process;
}

.home-process__step {
  counter-increment: home-process;
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 14rem) minmax(0, 1fr);
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--color-border-strong);
}

.home-process__step:last-child {
  border-bottom: 1px solid var(--color-border-strong);
}

.home-process__step::before {
  content: counter(home-process, decimal-leading-zero);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--color-amethyst-soft);
}

.home-process__label {
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text);
}

.home-process__desc {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--color-text-muted);
}

/* —— Closing CTA —— */

.home-close {
  text-align: center;
  background: radial-gradient(
    80% 70% at 50% 100%,
    rgba(212, 175, 55, 0.1),
    transparent 55%
  );
}

.home-close .home-section__header,
.home-close__inner .home-section__title,
.home-close__inner .home-section__lead {
  margin-left: auto;
  margin-right: auto;
}

.home-close__inner .home-section__title {
  margin-bottom: 0.75rem;
}

.home-close__inner .home-section__lead {
  margin-bottom: 1.75rem;
}

.home-close__cta {
  margin: 0;
}

/* .home-close__cta-link paint → .site-cta in config.css */

/* —— Responsive —— */

@media (max-width: 52rem) {
  .home-tiers__list {
    grid-template-columns: 1fr;
  }

  .home-process__step {
    grid-template-columns: 2.75rem minmax(0, 1fr);
    padding: 1rem 0;
  }

  .home-process__desc {
    grid-column: 2;
  }
}

@media (max-width: 40rem) {
  .home-hurdles__bubbles {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }

  .home-hurdles__bubble:nth-child(n) {
    grid-column: 1;
    width: 88%;
    margin-top: 0;
    justify-self: start;
  }

  .home-hurdles__bubble:nth-child(even) {
    justify-self: end;
  }

  .home-hurdles__solutions {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .home-tiers__item {
    padding: 1.1rem 1.15rem;
  }
}

/* —— Motion: entrance + scroll reveals —— */

@keyframes home-enter {
  from {
    opacity: 0;
    transform: translateY(0.65rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes home-hero-drift {
  from {
    background-position: 42% 46%;
    transform: scale(1);
  }
  to {
    background-position: 58% 54%;
    transform: scale(1.045);
  }
}

@keyframes home-section-veil {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  40% {
    opacity: 0.85;
    transform: scale(1.02);
  }
  100% {
    opacity: 0.32;
    transform: scale(1);
  }
}

/* Two out-and-back breaths, then rest on the first keyframe (WCAG 2.2.2: still within ~5s) */
@keyframes home-lockup-breath {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(1.02);
    opacity: 0.97;
  }
}

[data-reveal] {
  opacity: 0;
  transform: translateY(0.85rem);
  transition:
    opacity var(--motion-enter) var(--ease-out),
    transform var(--motion-enter) var(--ease-out);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* C — section veil: faint amethyst wash behind header, settles then calm */
.home-section[data-reveal] .home-section__header {
  position: relative;
  isolation: isolate;
}

.home-section[data-reveal] .home-section__header::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -1.25rem -1.5rem -0.75rem -1rem;
  border-radius: 0.35rem;
  background: radial-gradient(
    70% 80% at 20% 40%,
    rgba(94, 58, 140, 0.38),
    transparent 68%
  );
  opacity: 0;
  pointer-events: none;
}

.home-section[data-reveal].is-revealed .home-section__header::before {
  animation: home-section-veil calc(var(--motion-enter) * 1.35) var(--ease-out)
    both;
}

[data-reveal-stagger] > * {
  opacity: 0;
  transform: translateY(0.55rem);
  transition:
    opacity var(--motion-enter) var(--ease-out),
    transform var(--motion-enter) var(--ease-out);
}

[data-reveal].is-revealed [data-reveal-stagger] > *:nth-child(1) {
  transition-delay: 0ms;
}
[data-reveal].is-revealed [data-reveal-stagger] > *:nth-child(2) {
  transition-delay: 70ms;
}
[data-reveal].is-revealed [data-reveal-stagger] > *:nth-child(3) {
  transition-delay: 140ms;
}
[data-reveal].is-revealed [data-reveal-stagger] > *:nth-child(4) {
  transition-delay: 210ms;
}
[data-reveal].is-revealed [data-reveal-stagger] > *:nth-child(5) {
  transition-delay: 280ms;
}

[data-reveal].is-revealed [data-reveal-stagger] > * {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .home-hero::before,
  .home-hero__banner,
  .home-hero__cta {
    animation: none !important;
  }

  .home-hero__banner,
  .home-hero__cta {
    opacity: 1;
    transform: none;
  }

  .home-section[data-reveal] .home-section__header::before {
    animation: none !important;
    opacity: 0.22;
  }

  .home-hurdles__quote {
    animation: none !important;
    transform: none;
  }
}
