/* Canonical P4 homepage Hero. */
body[data-page="home"] .home-opening {
  position: relative;
  isolation: isolate;
  overflow: clip;
  background: transparent;
}

body[data-page="home"] .home-hero {
  position: static;
  display: block;
  width: 100%;
  min-height: min(92svh, 940px);
  margin: 0;
  color: var(--theme-text-primary);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

body[data-page="home"] .hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  opacity: 1;
  background: none;
  transform: none;
  pointer-events: none;
}

body[data-page="home"] .hero-media::before,
body[data-page="home"] .hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: none;
  mix-blend-mode: normal;
  transition: opacity 400ms ease;
}

body[data-page="home"] .hero-media::before {
  background-image: url("./assets/hero/hero-night-flow-bg.webp");
  background-position: 50% center;
  opacity: 1;
}

body[data-page="home"] .hero-media::after {
  background-image: url("./assets/hero/hero-day-bg.webp");
  background-position: 58% center;
  opacity: 0;
}

@media (min-width: 981px) {
  body[data-page="home"] .hero-media::before,
  body[data-page="home"] .hero-media::after {
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 78%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 78%, transparent 100%);
  }
}

@media (max-width: 980px) {
  body[data-page="home"] .hero-media::before,
  body[data-page="home"] .hero-media::after {
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 84%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 84%, transparent 100%);
  }
}

body[data-page="home"] .hero-visual-space {
  display: none;
}

body[data-page="home"] .hero-inner {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  align-items: end;
  width: min(1280px, calc(100% - 64px));
  min-height: min(92svh, 940px);
  margin: 0 auto;
  padding: clamp(112px, 13vh, 148px) 0 clamp(118px, 15vh, 148px);
  box-sizing: border-box;
}

body[data-page="home"] .couple-status {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(150px, .8fr) minmax(170px, 1fr);
  align-items: center;
  justify-items: stretch;
  align-self: start;
  justify-self: center;
  gap: clamp(18px, 3vw, 44px);
  width: min(680px, 70%);
  max-width: none;
  margin: 0;
  transform: none;
}

body[data-page="home"] .couple-status::before {
  content: "";
  position: absolute;
  left: 72px;
  right: 72px;
  top: 50%;
  z-index: -1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--theme-border-strong) 18% 82%, transparent);
}

body[data-page="home"] .lover-card.mini {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: auto;
  min-width: 0;
  max-width: none;
  height: auto;
  padding: 0;
  gap: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  box-sizing: border-box;
}

:root[data-theme] body[data-page="home"] .lover-card.mini {
  background: transparent;
  box-shadow: none;
}

body[data-page="home"] .lover-card.mini.right {
  justify-content: flex-end;
  text-align: right;
}

body[data-page="home"] .lover-card div {
  min-width: 0;
}

body[data-page="home"] .lover-avatar,
body[data-page="home"] .lover-card img {
  width: 56px;
  height: 56px;
}

body[data-page="home"] .lover-avatar {
  position: relative;
  isolation: isolate;
  flex: 0 0 56px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, color-mix(in srgb, var(--theme-accent-gold) 24%, transparent), transparent 58%),
    var(--theme-surface-soft);
}

body[data-page="home"] .lover-card img {
  display: block;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
}

body[data-page="home"] .lover-avatar img {
  position: relative;
  z-index: 1;
}

body[data-page="home"] .lover-avatar::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: 0;
  border: 2px solid #fff4dd;
  border-radius: 50%;
  opacity: 0;
  box-shadow:
    0 0 9px rgba(255, 248, 235, .42),
    0 0 20px rgba(255, 255, 255, .16);
  transition: opacity .2s ease;
}

body[data-page="home"] .lover-avatar.is-online::before {
  opacity: 1;
  animation: presence-breathe 2.8s ease-in-out infinite;
}

body[data-page="home"] .lover-presence-dot {
  position: absolute;
  right: 0;
  bottom: 1px;
  z-index: 2;
  width: 9px;
  height: 9px;
  border: 2px solid rgba(255, 255, 255, .92);
  border-radius: 50%;
  background: #71c990;
  box-shadow: 0 0 8px rgba(113, 201, 144, .52);
  opacity: 0;
  transform: scale(.8);
  transition: opacity .2s ease, transform .2s ease;
}

body[data-page="home"] .lover-avatar.is-online .lover-presence-dot {
  opacity: 1;
  transform: scale(1);
}

body[data-page="home"] .lover-card strong {
  display: block;
  color: var(--theme-text-primary);
  font-family: var(--font-display);
  font-size: 16px;
}

body[data-page="home"] .lover-card span {
  display: block;
  margin-top: 4px;
  color: var(--theme-text-muted);
  font-size: 12px;
  white-space: nowrap;
}

body[data-page="home"] .distance-core {
  position: relative;
  display: grid;
  place-items: center;
  justify-content: center;
  justify-items: center;
  align-content: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 8px 12px;
  color: var(--theme-text-secondary);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-shadow: 0 0 18px rgba(232, 207, 142, .24);
}

body[data-page="home"] .distance-core svg {
  display: block;
  width: 18px;
  height: 18px;
  margin-inline: auto;
  fill: var(--theme-accent-gold);
  stroke: var(--theme-accent-gold);
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--theme-accent-gold) 24%, transparent));
  transform-origin: 50% 50%;
  will-change: transform, filter;
  animation: homeHeartBreath 3.2s cubic-bezier(.42, 0, .24, 1) infinite;
}

body[data-page="home"] .distance-core span {
  display: block;
  width: auto;
  margin-top: 5px;
  color: var(--theme-text-secondary);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}


body[data-page="home"] .hero-story {
  position: relative;
  z-index: 4;
  align-self: end;
  width: min(780px, 72%);
  padding: clamp(54px, 9vh, 92px) 0 22px;
}

body[data-page="home"] .home-hero h1 {
  position: relative;
  width: min(760px, 100%);
  z-index: 4;
  max-width: none;
  margin: 0;
  padding: 0;
  color: var(--theme-text-primary);
  font: var(--type-display-xl);
  letter-spacing: var(--type-tracking);
  text-wrap: balance;
  text-shadow: 0 16px 48px color-mix(in srgb, var(--theme-bg-secondary) 18%, transparent);
}

body[data-page="home"] .hero-title-accent {
  color: inherit;
}

body[data-page="home"] .clock-card {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(180px, .7fr) minmax(420px, 1.3fr);
  align-items: end;
  gap: clamp(30px, 5vw, 72px);
  width: min(760px, 72%);
  max-width: none;
  margin: 0;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid var(--theme-border-soft);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body[data-page="home"] .clock-card > span {
  color: var(--theme-text-muted);
  font-size: 12px;
  line-height: 1.6;
}

body[data-page="home"] .clock-card > span b {
  color: var(--theme-text-secondary);
  font-weight: 600;
  letter-spacing: .03em;
}

body[data-page="home"] .clock-card > span time {
  color: inherit;
}

body[data-page="home"] .clock-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
  gap: clamp(12px, 2vw, 28px);
}

body[data-page="home"] .clock-grid div {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-content: start;
  gap: 5px;
  min-width: 0;
  padding: 2px 24px 0;
  border-left: 1px solid rgba(255, 248, 238, .22);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-page="home"] .clock-grid b {
  color: var(--theme-text-primary);
  font-family: var(--font-display);
  font-size: clamp(27px, 2.6vw, 40px);
  line-height: 1;
  text-shadow: 0 14px 36px rgba(0, 0, 0, .38);
}

body[data-page="home"] .clock-grid em {
  margin-top: 9px;
  color: var(--theme-text-muted);
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: .16em;
}

body[data-page="home"] .hero-section-hint {
  position: absolute;
  right: 2px;
  bottom: clamp(42px, 6vh, 70px);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  color: var(--theme-text-muted);
  font-size: 11px;
  opacity: .42;
}

body[data-page="home"] .hero-section-hint svg {
  width: 14px;
  height: 14px;
}

:root[data-theme="light"] body[data-page="home"] .hero-media::before {
  opacity: 0;
  filter: none;
  mix-blend-mode: normal;
}

:root[data-theme="light"] body[data-page="home"] .hero-media::after {
  opacity: 1;
  filter: none;
  mix-blend-mode: normal;
}


:root[data-theme="light"] body[data-page="home"] .home-hero h1 {
  color: #617f98;
  text-shadow: 0 14px 38px rgba(101, 82, 70, .10);
}

:root[data-theme="light"] body[data-page="home"] .home-hero {
  background: transparent;
}

:root[data-theme="light"] body[data-page="home"] .lover-card.mini {
  border-color: rgba(178, 135, 61, .30);
}

:root[data-theme="light"] body[data-page="home"] .clock-grid div:not(:last-child) {
  border-color: var(--theme-border-soft);
}

:root[data-theme="light"] body[data-page="home"] .hero-title-accent {
  color: #b88945;
}

:root[data-theme="light"] body[data-page="home"] .clock-grid b {
  color: #587892;
}

:root[data-theme="light"] body[data-page="home"] .clock-grid em {
  color: #788c9c;
}

:root[data-theme="light"] body[data-page="home"] .clock-card > span b {
  color: #9a7654;
}

:root[data-theme="light"] body[data-page="home"] .clock-card > span time {
  color: #708596;
}

@media (max-width: 980px) and (min-width: 761px) {
  body[data-page="home"] .home-hero {
    position: relative;
    width: calc(100% - 28px);
    margin-top: 14px;
    border-radius: 22px;
    background: transparent;
    overflow: clip;
    isolation: isolate;
  }

  body[data-page="home"] .hero-inner {
    width: min(100% - 48px, 920px);
  }

  body[data-page="home"] .couple-status {
    width: min(620px, 84%);
  }

  body[data-page="home"] .hero-story,
  body[data-page="home"] .clock-card {
    width: 76%;
  }

  body[data-page="home"] .clock-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 760px) {
  body[data-page="home"] .home-hero {
    position: relative;
    width: 100%;
    min-height: auto;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: clip;
    isolation: isolate;
  }

  body[data-page="home"] .hero-media::before {
    background-position: 55% center;
    background-size: cover;
  }

  body[data-page="home"] .hero-media::after {
    background-position: 70% center;
  }

  body[data-page="home"] .hero-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: calc(100% - 32px);
    min-height: auto;
    padding: 94px 0 calc(var(--mobile-overlay-safe-space) + 24px);
  }

  body[data-page="home"] .couple-status {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 62px minmax(0, 1fr);
    align-items: center;
    justify-items: stretch;
    order: 1;
    width: 100%;
    height: 60px;
    max-width: none;
    gap: 10px;
  }

  body[data-page="home"] .couple-status::before {
    left: 46px;
    right: 46px;
  }

  body[data-page="home"] .lover-card.mini {
    width: auto;
    min-width: 0;
    height: auto;
    padding: 0;
    gap: 8px;
    background: transparent;
    box-shadow: none;
  }

  body[data-page="home"] .lover-avatar,
  body[data-page="home"] .lover-card img {
    width: 44px;
    height: 44px;
  }

  body[data-page="home"] .lover-avatar {
    flex-basis: 44px;
  }

  body[data-page="home"] .lover-card strong {
    font-size: 13px;
  }

  body[data-page="home"] .lover-card span {
    max-width: 72px;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
  }

  body[data-page="home"] .distance-core {
    width: 62px;
    min-width: 0;
    padding: 7px 3px;
  }

  body[data-page="home"] .distance-core span {
    display: block;
    font-size: 9px;
  }

  body[data-page="home"] .hero-visual-space {
    position: relative;
    display: block;
    order: 2;
    width: calc(100% + 32px);
    height: clamp(176px, 46vw, 198px);
    margin: 24px -16px 16px;
  }

  body[data-page="home"] .hero-story {
    order: 3;
    width: 100%;
    padding: 0;
  }

  body[data-page="home"] .home-hero h1 {
    width: 100%;
    font: var(--type-display-xl);
    text-wrap: balance;
  }

  body[data-page="home"] .clock-card {
    position: relative;
    order: 4;
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    margin-top: 18px;
    padding-top: 10px;
    gap: 10px;
  }

  body[data-page="home"] .clock-card > span {
    font-size: 10px;
  }

  body[data-page="home"] .clock-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  body[data-page="home"] .clock-grid div {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 3px;
    padding: 2px 6px 0;
  }

  body[data-page="home"] .clock-grid b {
    font-size: clamp(25px, 8vw, 32px);
  }

  body[data-page="home"] .clock-grid em {
    margin-top: 7px;
    font-size: 9px;
  }

  body[data-page="home"] .hero-section-hint {
    position: relative;
    right: auto;
    bottom: auto;
    order: 5;
    align-self: flex-end;
    margin-top: 8px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="home"] .hero-media::before,
  body[data-page="home"] .hero-media::after,
  body[data-page="home"] .hero-section-hint svg {
    transition: none;
    animation: none;
  }

  body[data-page="home"] .distance-core svg,
  body[data-page="home"] .lover-avatar.is-online::before {
    animation: none;
  }
}

@keyframes presence-breathe {
  0%, 100% {
    opacity: .68;
    box-shadow:
      0 0 6px rgba(255, 248, 235, .26),
      0 0 14px rgba(255, 255, 255, .08);
  }
  50% {
    opacity: 1;
    box-shadow:
      0 0 9px rgba(255, 248, 235, .42),
      0 0 20px rgba(255, 255, 255, .16);
  }
}

@keyframes homeHeartBreath {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 18px rgba(255, 230, 168, .34));
  }
  42% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 22px rgba(255, 230, 168, .46));
  }
  62% {
    transform: scale(1.025);
    filter: drop-shadow(0 0 18px rgba(255, 230, 168, .34));
  }
}
