/* ─── Homepage sections (shared by all five layouts) ─────────────────────────
   Hero (+ variants), scenes, breathing pacer, manifesto, gentle day,
   topics rail, numbers, stacked featured, library, principles.
   Layout-specific arrangement lives in home-layouts.css.
   ────────────────────────────────────────────────────────────────────────── */

/* ── Hero ── */
.ha-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding: 100px 0 50px;

  @media (min-width: 640px) {
    justify-content: center;
    padding-top: 130px;
  }
}

.ha-hero__in {
  position: relative;
  width: 100%;
}

.ha-eyebrow {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-color) 70%, transparent);
  border: 1px solid var(--line);
  font: 400 10.5px var(--f-m);
  color: var(--muted);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sage);
    animation: ha-breathe 4s infinite;
  }

  @media (min-width: 640px) {
    padding: 7px 16px;
    font-size: 12px;
    letter-spacing: 0.06em;
  }
}

.ha-hero__title {
  max-width: 1000px;
  font-size: clamp(46px, 14vw, 74px);
  line-height: 0.95;
  letter-spacing: -0.045em;

  @media (min-width: 640px) {
    font-size: clamp(50px, 9.6vw, 150px);
  }

  em {
    padding-right: 0.06em;
    background: var(--grad-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  /* After fx.js splits letters, each char gets a step of the gradient. */
  em .ch {
    color: var(--sage-deep);
  }

  em .ch:nth-child(2) {
    color: color-mix(in oklch, var(--sage-deep) 70%, var(--sky-deep));
  }

  em .ch:nth-child(3) {
    color: color-mix(in oklch, var(--sky-deep) 50%, var(--lav-deep));
  }

  em .ch:nth-child(4) {
    color: var(--lav-deep);
  }

  em .ch:nth-child(5) {
    color: color-mix(in oklch, var(--lav-deep) 55%, var(--peach-deep));
  }

  em .ch:nth-child(n + 6) {
    color: var(--peach-deep);
  }
}

.ha-ln {
  display: block;
  padding-bottom: 0.06em;
}

.ha-w,
.ha-split .ch {
  display: inline-block;
}

.ha-hero__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  max-width: 1000px;
  margin-top: 36px;
}

.ha-hero__sub {
  max-width: 460px;
  font-size: 16px;
  color: var(--muted);

  @media (min-width: 640px) {
    font-size: 18px;
  }
}

.ha-hero__foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  margin-top: 36px;

  @media (min-width: 640px) {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 56px;
  }
}

.ha-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  a {
    display: block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    background: color-mix(in srgb, var(--surface-color) 65%, transparent);
    border: 1px solid var(--line);
    transition: box-shadow var(--hover-duration);

    &:hover {
      box-shadow: var(--shadow);
    }
  }

  .t0 a {
    background: var(--tint-green);
  }

  .t1 a {
    background: var(--tint-peach);
  }

  .t2 a {
    background: var(--tint-sky);
  }

  .t3 a {
    background: var(--tint-lav);
  }
}

.ha-scroll-hint {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: 400 11px var(--f-m);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);

  i {
    position: relative;
    width: 1px;
    height: 46px;
    background: var(--line);
    overflow: hidden;

    &::after {
      content: "";
      position: absolute;
      left: 0;
      top: -50%;
      width: 1px;
      height: 50%;
      background: var(--deep);
      animation: ha-fall 2.6s ease-in-out infinite;
    }
  }
}

@keyframes ha-fall {
  to {
    top: 100%;
  }
}

/* Hero: split (copy + form card) */
.ha-hero--split .ha-hero__in {
  display: grid;
  gap: 40px;
  align-items: center;

  @media (min-width: 992px) {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 56px;
  }
}

.ha-hero--split .ha-hero__title {
  font-size: clamp(46px, 7.4vw, 108px);
}

.ha-hero--split .ha-hero__sub {
  margin: 28px 0;
}

/* Hero: compact (centered, search + chips) */
.ha-hero--compact {
  min-height: 0;
  padding: 130px 0 40px;
  text-align: center;

  .ha-hero__copy {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .ha-hero__title {
    font-size: clamp(42px, 7vw, 96px);
  }

  .ha-hero__sub {
    margin: 24px auto 28px;
  }

  .ha-chips {
    justify-content: center;
    margin: 22px 0 0;
  }
}

/* Hero: centered */
.ha-hero--centered {
  text-align: center;

  .ha-hero__copy {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .ha-hero__title {
    margin: 0 auto;
  }

  .ha-hero__sub {
    margin: 30px auto;
  }

  .ha-cta {
    justify-content: center;
  }

  .ha-hero__foot {
    align-items: center;
    justify-content: center;
  }
}

/* Hero: feature (copy + lead story) */
.ha-hero--feature {
  justify-content: center;

  .ha-hero__in {
    display: grid;
    gap: 36px;
    align-items: center;

    @media (min-width: 992px) {
      grid-template-columns: 1fr 1fr;
      gap: 56px;
    }
  }

  .ha-hero__title {
    font-size: clamp(44px, 7vw, 104px);
  }

  .ha-hero__sub {
    margin: 26px 0;
  }
}

.ha-hero__lead {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 14px 26px;
  border-radius: var(--r-lg);
  background: var(--card-strong);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  > *:not(.ha-hero__lead-media) {
    margin: 0 12px;
  }

  h2 {
    font-size: clamp(26px, 2.8vw, 38px);

    a:hover {
      color: var(--deep);
    }
  }
}

.ha-hero__lead-media {
  aspect-ratio: 16 / 10;
  border-radius: 26px;
}

.ha-hero__lead-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ha-hero__stats {
  margin-top: 48px;
}

/* ── Scenes ── */
.ha-scene {
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding-bottom: 12vh;

  @media (min-width: 640px) {
    align-items: center;
    padding-bottom: 0;
  }
}

.ha-scene__txt {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px;
  border-radius: 26px;
  background: color-mix(in srgb, var(--surface-color) 80%, transparent);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  h2 {
    margin-bottom: 16px;
    font-size: clamp(34px, 4.4vw, 58px);
  }

  p {
    font-size: 16px;
    color: var(--muted);
  }

  @media (min-width: 640px) {
    padding: 38px;
    border-radius: 32px;
    background: color-mix(in srgb, var(--surface-color) 62%, transparent);

    p {
      font-size: 17.5px;
    }
  }

  @media (min-width: 992px) {
    margin: 0;

    &.is-right {
      margin-left: auto;
    }
  }
}

.ha-scene--1 .ha-kick {
  color: var(--lav-deep);
}

.ha-scene--2 .ha-kick {
  color: var(--peach-deep);
}

.ha-scene--3 .ha-kick {
  color: var(--sky-deep);
}

.ha-scenes__prog {
  display: none;
  position: fixed;
  left: 26px;
  top: 34vh;
  z-index: 5;
  width: 2px;
  height: 32vh;
  border-radius: 2px;
  background: var(--line);
  opacity: 0;
  transition: opacity 0.8s;

  i {
    display: block;
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(var(--sage), var(--lav), var(--peach), var(--sky));
    transform: scaleY(0);
    transform-origin: top;
  }

  @media (min-width: 992px) {
    display: block;
  }
}

.in-scenes .ha-scenes__prog {
  opacity: 1;
}

/* ── Breathing pacer ── */
.ha-breathe {
  position: relative;
  padding: 80px 0;

  @media (min-width: 640px) {
    padding: 120px 0;
  }
}

.ha-breathe__in {
  display: grid;
  gap: 50px;
  align-items: center;

  @media (min-width: 992px) {
    grid-template-columns: 1fr 1fr;
  }
}

.ha-breathe__copy {
  h2 {
    margin-bottom: 18px;
    font-size: clamp(36px, 4.6vw, 62px);
  }

  p {
    max-width: 460px;
    font-size: 17px;
    color: var(--muted);
  }
}

.ha-breathe__ctl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 28px;
}

.ha-breathe__count {
  font: 400 12.5px var(--f-m);
  color: var(--muted);
}

.ha-breathe__stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1;
  margin: 0 auto;

  @media (min-width: 992px) {
    max-width: 440px;
  }
}

.ha-breathe__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--primary-color) 30%, transparent);
  animation: ha-spin 60s linear infinite;

  &.r2 {
    inset: 16%;
    border-style: solid;
    border-color: color-mix(in srgb, var(--secondary-color) 35%, transparent);
    animation-direction: reverse;
    animation-duration: 80s;
  }
}

@keyframes ha-spin {
  to {
    transform: rotate(360deg);
  }
}

.ha-breathe__orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--surface-color), var(--tint-green) 40%, var(--tint-green-2) 70%);
  box-shadow: 0 30px 80px -20px color-mix(in srgb, var(--primary-color) 45%, transparent), inset 0 -10px 30px color-mix(in srgb, var(--secondary-color) 35%, transparent);
  font: 400 22px var(--f-h);
  color: var(--deep);
  text-align: center;
  transition: transform 4s cubic-bezier(0.45, 0, 0.55, 1), background 1s;
  animation: ha-idle 6s ease-in-out infinite;

  &.is-in,
  &.is-hold {
    transform: scale(1.55);
    animation: none;
  }

  &.is-hold {
    background: radial-gradient(circle at 35% 30%, var(--surface-color), var(--tint-lav) 45%, var(--tint-lav-2) 75%);
  }

  &.is-out {
    transform: scale(1);
    animation: none;
    background: radial-gradient(circle at 35% 30%, var(--surface-color), var(--tint-peach) 45%, var(--tint-peach-2) 75%);
  }

  @media (prefers-reduced-motion: reduce) {
    transition: transform 0.01s !important;
  }
}

/* stacked variant (layout 4): centered column, orb first */
.ha-breathe--stacked {
  .ha-breathe__in {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 30px;
  }

  .ha-breathe__stage {
    order: -1;
    max-width: 320px;
  }

  .ha-breathe__copy p {
    margin: 0 auto;
  }

  .ha-breathe__ctl {
    justify-content: center;
  }
}

/* ── Manifesto ── */
.ha-manifesto {
  padding: 12vh 0;

  @media (min-width: 640px) {
    padding: 18vh 0;
  }
}

.ha-manifesto__text {
  max-width: 1080px;
  font: 300 clamp(28px, 4vw, 56px)/1.25 var(--f-h);
  letter-spacing: -0.025em;
}

/* ── Gentle day ── */
.ha-rhythm {
  padding: 40px 0 120px;
}

.ha-rhythm__list {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;

  @media (min-width: 640px) {
    grid-template-columns: repeat(2, 1fr);
  }

  @media (min-width: 1200px) {
    grid-template-columns: repeat(4, 1fr);

    &::before {
      content: "";
      position: absolute;
      left: 6%;
      right: 6%;
      top: 38px;
      height: 1px;
      background: var(--grad-line);
      opacity: 0.6;
    }
  }
}

.ha-rhythm__item {
  position: relative;
  padding: 28px 24px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.8s var(--timing);

  &:hover {
    transform: translateY(-8px);
  }

  small {
    font: 400 11.5px var(--f-m);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
  }

  h3 {
    margin: 6px 0 8px;
    font-size: 24px;
  }

  p {
    font-size: 15px;
    color: var(--muted);
  }
}

.ha-rhythm__ic {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  border-radius: 50%;
  background: var(--tint-green);

  .t1 & {
    background: var(--tint-sky);
  }

  .t2 & {
    background: var(--tint-peach);
  }

  .t3 & {
    background: var(--tint-lav);
  }

  svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: var(--ink);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}

/* ── Topics ── */
.ha-topics {
  position: relative;
  padding: 60px 0;
}

.ha-topics__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 34px;

  h2 {
    font-size: clamp(36px, 5vw, 68px);
  }
}

.ha-topics__viewport {
  padding: 24px 0 30px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;

  &::-webkit-scrollbar {
    display: none;
  }
}

.pinned-topics .ha-topics--rail {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100vh;
  padding: 0;

  .ha-topics__viewport {
    overflow: visible;
  }
}

.ha-topics__track {
  display: flex;
  gap: 24px;
  width: max-content;
  padding: 0 var(--gutter);
  will-change: transform;
}

.ha-topic {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(400px, 80vw);
  min-height: 460px;
  padding: 26px;
  border-radius: var(--r-lg);
  background: var(--card);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow);
  overflow: hidden;
  scroll-snap-align: center;
  transform-style: preserve-3d;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  &::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background: radial-gradient(380px circle at var(--gx, 50%) var(--gy, 0%), color-mix(in srgb, var(--pastel-green) 22%, transparent), transparent 50%);
    opacity: 0;
    transition: opacity 0.8s;
    pointer-events: none;
  }

  > * {
    position: relative;
    z-index: 1;
  }

  &:hover::before {
    opacity: 1;
  }

  h3 {
    font-size: 30px;
  }

  p {
    font-size: 15px;
    color: var(--muted);
  }

  ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  li {
    padding-top: 8px;
    border-top: 1px solid var(--line);
    font-size: 14px;
  }

  @media (min-width: 640px) {
    min-height: 500px;
  }
}

.ha-topic__n {
  font: italic 300 60px/1 var(--f-h);
  color: var(--deep);
  opacity: 0.5;
}

.ha-topic__art {
  height: 150px;
  border-radius: 22px;
}

.ha-topic__go {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  font: 400 12px var(--f-m);
  color: var(--deep);

  i {
    font-style: normal;
    transition: transform 0.8s;
  }

  .ha-topic:hover & i {
    transform: translateX(8px);
  }
}

/* grid variant: static wrapped cards */
.ha-topics--grid {
  .ha-topics__viewport {
    overflow: visible;
    padding: 0;
  }

  .ha-topics__track {
    display: grid;
    grid-template-columns: 1fr;
    width: auto;
    max-width: var(--wrap);
    margin: 0 auto;

    @media (min-width: 640px) {
      grid-template-columns: repeat(2, 1fr);
    }

    @media (min-width: 992px) {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  .ha-topic {
    width: auto;
    min-height: 0;
  }
}

/* ── Numbers ── */
.ha-nums-sec {
  padding: 80px 0;

  @media (min-width: 640px) {
    padding: 110px 0;
  }
}

.ha-nums {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  text-align: center;

  @media (min-width: 992px) {
    grid-template-columns: repeat(4, 1fr);
  }

  b {
    display: block;
    padding-bottom: 6px;
    font: 300 clamp(56px, 7vw, 104px)/1 var(--f-h);
    letter-spacing: -0.04em;
    background: linear-gradient(160deg, var(--sage-deep), var(--lav-deep));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  .t1 b {
    background-image: linear-gradient(160deg, var(--lav-deep), var(--peach-deep));
  }

  .t2 b {
    background-image: linear-gradient(160deg, var(--sky-deep), var(--sage-deep));
  }

  .t3 b {
    background-image: linear-gradient(160deg, var(--peach-deep), var(--lav-deep));
  }

  > div > span {
    font: 400 12px var(--f-m);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
  }
}

.ha-nums--compact b {
  font-size: clamp(40px, 5vw, 72px);
}

/* ── Stacked featured ── */
.ha-stackset {
  padding: 80px 0 60px;
}

.ha-stack {
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.ha-stk {
  position: sticky;
  top: 84px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 22px;
  border-radius: 30px;
  overflow: hidden;
  transform-origin: center top;
  box-shadow: var(--shadow-deep);
  background: linear-gradient(150deg, var(--tint-green), var(--tint-green-2));

  &.t1 {
    background: linear-gradient(150deg, var(--tint-lav), var(--tint-lav-2));
  }

  &.t2 {
    background: linear-gradient(150deg, var(--tint-peach), var(--tint-peach-2));
  }

  &.t3 {
    background: linear-gradient(150deg, var(--tint-sky), var(--tint-sky-2));
  }

  h3 {
    font-size: clamp(30px, 3.4vw, 46px);

    a:hover {
      color: var(--deep);
    }
  }

  p {
    font-size: 17px;
    color: var(--muted);
  }

  .ha-pill {
    background: color-mix(in srgb, var(--surface-color) 75%, transparent);
  }

  .ha-btn {
    align-self: flex-start;
  }

  @media (min-width: 640px) {
    padding: 36px;
    border-radius: 40px;
  }

  @media (min-width: 992px) {
    top: 110px;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    min-height: min(540px, 70vh);
  }
}

.ha-stk__c {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 16px;
}

.ha-stk__n {
  margin-bottom: auto;
  font: 400 12px var(--f-m);
  color: var(--muted);
}

.ha-stk__art {
  order: -1;
  height: 220px;
  border-radius: 30px;

  @media (min-width: 992px) {
    order: 0;
    height: auto;
    min-height: 260px;
  }
}

/* ── Library ── */
.ha-news-zone {
  position: relative;
  z-index: 1;
}

.ha-one {
  display: block;
}

/* ── Principles ── */
.ha-prin {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;

  @media (min-width: 992px) {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ha-pr {
  padding: 32px;
  border-radius: var(--r);
  background: var(--card);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow);

  span {
    font: italic 300 34px var(--f-h);
    color: var(--deep);
  }

  h3 {
    margin: 18px 0 8px;
    font-size: 28px;
  }

  p {
    color: var(--muted);
  }
}

.ha-notice {
  margin-top: 30px;
  padding: 16px 20px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--surface-color) 60%, transparent);
  border: 1px solid var(--line);
}
