/* Fonts loaded via <link> in index.html (more reliable than @import). */

/* ── Homepage layout ───────────────────────────────────────────── */

.home-container {
  min-height: 100vh;
}

.home-main {
  flex: 1;
  background: #ffffff;
}

/* ── Header / navbar ───────────────────────────────────────────── */

.home-header {
  position: relative;
  z-index: 20;
  background: #ffffff;
  padding: 0;
}

.home-navbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 72px;
}

.home-nav-group {
  display: flex;
  align-items: center;
  gap: 0;
}

.home-nav-group--left {
  justify-content: space-evenly;
  padding-right: 0;
}

.home-nav-group--right {
  justify-content: space-evenly;
  padding-left: 0;
}

.home-container .dg-nav-item {
  padding: 0 24px;
}

.home-container .dg-nav-divider {
  width: 1px;
  height: 32px;
  background: #d0d0d0;
  opacity: 1;
  margin: 0;
  align-self: center;
  flex-shrink: 0;
}

/* Center logo with wider semi-circle badge overlapping the hero */

.home-nav-logo {
  position: relative;
  width: 280px;
  height: 72px;
  flex-shrink: 0;
}

.home-nav-logo-badge {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  box-sizing: border-box;
  width: 280px;
  height: 140px; /* half of width → semicircle */
  padding: 10px 32px 20px;
  background: #ffffff;
  border-radius: 0 0 140px 140px;
  text-decoration: none;
  box-shadow: none;
  z-index: 21;
}

.home-nav-logo-img {
  height: 104px;
  width: auto;
  display: block;
}

/* Phones only: wordmark set as text under the key-only logo image. */
.home-nav-logo-text {
  display: none;
}

/* ── Hero ──────────────────────────────────────────────────────── */

.home-hero {
  position: relative;
  padding: 0;
  height: auto;
  max-height: none;
  min-height: 0;
  background: #ffffff;
  overflow: visible;
  border-top: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
}

.home-hero-stage {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap: 0;
  overflow: hidden;
}

/*
 * Wide media band (~34vw tall) so the headline and the top of the next
 * section show below it; capped so it never pushes the headline off screen.
 */
.home-hero-media {
  position: relative;
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 6px;
  height: min(34vw, calc(100dvh - 72px - 150px));
  min-height: 0;
  overflow: hidden;
  z-index: 1;
}

.home-hero-left,
.home-hero-right {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #ffffff;
}

.home-hero-image,
.home-hero-video,
.home-hero-left-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  background: transparent;
}

.home-hero-image.is-active {
  opacity: 1;
  z-index: 1;
}

/* Active video (and its MP4 first-frame poster) shows immediately. */
.home-hero-video.is-active {
  opacity: 1;
  z-index: 1;
}

/* Phone-only left-panel clip; see the max-width: 980px block. */
.home-hero-left-video {
  display: none;
}

.home-hero-left-video.is-active {
  opacity: 1;
  z-index: 2;
}

/*
 * hero-1 (ex canning): tall portrait (1152×2048). Framed artwork sits in
 * the top ~17–43% and faces at ~30–50%; bias crop up to 16% so the frame,
 * picture light, and both faces stay in the wide short hero band.
 */
.home-hero-image--1 {
  object-position: center 16%;
}

/*
 * hero-2 (ex harlequin, 2400×1792): frames at ~15–43%, child at ~58–91%.
 * Bias to 45% and zoom so frames + child stay in the visible slice.
 */
.home-hero-image--2 {
  object-position: center 45%;
  transform: scale(1.22);
  transform-origin: 50% 24%;
}

/*
 * hero-3: tall interior — centre the picture lamp + framed artwork in the
 * wide short hero band (woman stays on the right edge of the crop).
 */
.home-hero-image--3 {
  object-fit: cover;
  object-position: 46% 30%;
  transform: scale(1.35);
  transform-origin: 46% 28%;
}

.home-hero-fade {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
}

.home-hero-nav {
  position: absolute;
  top: 50%;
  z-index: 6;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #2a2a2a;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.home-hero-nav:hover,
.home-hero-nav:focus-visible {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.95);
  color: #111111;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
  outline: none;
}

.home-hero-nav:active {
  transform: translateY(-50%) scale(0.97);
}

.home-hero-nav--prev {
  left: 14px;
}

.home-hero-nav--next {
  right: 14px;
}

.home-hero-nav svg {
  display: block;
}

.home-hero-fade-logo {
  width: clamp(130px, 15vw, 220px);
  height: auto;
  opacity: 0;
  transform: translateY(8px);
  will-change: opacity, transform;
}

/* Absolute so it cannot affect grid sizing; overlaps bottom of hero media. */
.home-hero-bottom-curve {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 5;
  width: 104%;
  height: clamp(14px, 1.8vw, 28px);
  transform: translateX(-50%);
  background: #ffffff;
  border-radius: 50% 50% 0 0;
  pointer-events: none;
}

/* ── Tagline ───────────────────────────────────────────────────── */

.home-tagline {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 6px clamp(28px, 5vw, 56px) 40px;
  background: #ffffff;
  text-align: center;
  overflow: visible;
}

.home-tagline-title {
  position: relative;
  z-index: 7;
  margin: 0 calc(-1 * clamp(28px, 5vw, 56px));
  font-family: "Parkinsans", sans-serif;
  font-weight: 300;
  font-style: normal;
  font-synthesis: none;
  color: #8c8c8c;
  letter-spacing: -0.04em;
  line-height: 1.25;
  /* The one-line headline is ~32.2em wide, so 2.55vw spans ~82% of the window. */
  font-size: min(2.55vw, 52px);
  max-width: none;
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.home-tagline-title em {
  font-style: italic;
  font-weight: inherit;
}

/* ── How it works / steps (hidden for now) ─────────────────────── */

.home-steps {
  display: none;
  position: relative;
  z-index: 6;
  width: 100%;
  margin: 0;
  padding: 0 0 clamp(40px, 6vw, 72px);
  background: #ffffff;
}

.home-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr);
  align-items: start;
  gap: clamp(8px, 1.2vw, 14px);
  padding: clamp(12px, 2vw, 20px) clamp(32px, 6vw, 96px);
  border-bottom: 1px solid #c8c8c8;
}

.home-step:last-child {
  border-bottom: none;
}

.home-step-side {
  display: flex;
  align-items: flex-start;
  align-self: start;
  min-width: 0;
  min-height: 0;
}

.home-step-side--left {
  justify-content: flex-end;
}

.home-step-side--right {
  justify-content: flex-start;
}

.home-step-side:has(.home-step-video) {
  overflow: hidden;
}

.home-step-image {
  display: block;
  width: 100%;
  max-width: 500px;
  max-height: clamp(170px, 19vw, 240px);
  height: auto;
  object-fit: contain;
  background: transparent;
}

.home-step-video {
  object-fit: cover;
  transform: scale(1.03);
  transform-origin: center center;
}

.home-step-copy {
  align-self: start;
  min-width: 0;
  max-width: 24em;
}

.home-step:nth-child(odd) .home-step-copy {
  text-align: left;
  justify-self: start;
}

.home-step:nth-child(even) .home-step-copy {
  text-align: right;
  justify-self: end;
}

.home-step-title {
  margin: 0 0 6px;
  font-family: "Lora", Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #8c8c8c;
}

.home-step-title.is-playing {
  color: #1a1a1a;
}

.home-step-text {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: clamp(15px, 1.35vw, 17px);
  line-height: 1.55;
  color: #6b6b6b;
}

/* ── Responsive ────────────────────────────────────────────────── */

/* Hamburger only on the phone/tablet layout where desktop nav is hidden. */
.home-nav-menu-btn {
  display: none;
}

@media (max-width: 980px) {
  .home-header {
    position: relative;
    z-index: 40;
    padding: 0;
  }

  /* Slim bar: compact logo centred, hamburger on the right. */
  .home-navbar {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 6px 10px 3px;
  }

  .home-nav-group--left,
  .home-nav-group--right {
    display: none;
  }

  .home-nav-logo {
    grid-column: 2;
    justify-self: center;
    width: auto;
    height: auto;
  }

  .home-nav-logo-badge {
    position: static;
    transform: none;
    flex-direction: column;
    align-items: center;
    width: auto;
    height: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
  }

  /* logo-key.svg: horizontal key, handle on the left. */
  .home-nav-logo-img {
    height: 25px;
  }

  .home-nav-logo-text {
    display: block;
    margin-top: 4px;
    font-family: "Parkinsans", sans-serif;
    font-weight: 300;
    font-synthesis: none;
    font-size: 16px;
    line-height: 1;
    color: #8c8c8c;
  }

  .home-nav-menu-btn {
    display: inline-flex;
    grid-column: 3;
    justify-self: end;
  }

  /* Home uses the shared hamburger panel below the slim logo bar. */
  .home-header .site-hamburger {
    display: block;
  }

  .home-hero {
    padding: 0;
    height: auto;
    max-height: none;
    min-height: 0;
    border-top: none;
  }

  .home-hero-stage {
    /* 85vw keeps 48% of the 9:16 hero-1-left clip visible at full width. */
    --home-hero-left-h: clamp(260px, 85vw, 380px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  /* Flatten wrapper so we can order: image → headline → video */
  .home-hero-media {
    display: contents;
  }

  /* Media uses display:contents, so arrows position against the stage;
     pin them to the vertical centre of the top photo panel. */
  .home-hero-nav {
    top: calc(var(--home-hero-left-h) / 2);
    width: 40px;
    height: 40px;
  }

  .home-hero-nav--prev {
    left: 10px;
  }

  .home-hero-nav--next {
    right: 10px;
  }

  .home-hero-left,
  .home-hero-right {
    min-height: 260px;
  }

  .home-hero-left {
    min-height: var(--home-hero-left-h);
  }

  /* Bias crop slightly above center so more of the upper frame is visible. */
  .home-hero-image {
    object-position: center 35%;
  }

  /*
   * hero-1 on phones is the hero-1-left clip (the <img> shows its first
   * frame). Picture frame spans 19.6–41.6% of the height; the child's head
   * dips to 57–65% in the first half-second. 36% shows ~19–67%. The clip
   * then pans steadily to 13% (~7–55%) so the lamp (11.8–16.5%) is in view
   * when it is switched on at ~3.4s; see data-pan-* on the video.
   */
  .home-hero-image--1,
  .home-hero-left-video--1 {
    object-position: center 36%;
  }

  .home-hero-left-video {
    display: block;
  }

  /*
   * hero-2 on phones is the square hero-2-left clip (the <img> shows its
   * first frame). Lamp from 7.5%, child and cat to ~79%, KlingAI watermark at
   * 95–98%: 30% shows ~4.5–89.5% at full width.
   */
  .home-hero-image--2,
  .home-hero-left-video--2 {
    object-position: center 30%;
    transform: none;
  }

  /* hero-3 mobile: light zoom, centered on lamp + frame. */
  .home-hero-image--3 {
    object-position: center center;
    transform: scale(1.06);
    transform-origin: center center;
  }

  .home-hero-left {
    order: 1;
  }

  .home-tagline {
    order: 2;
    justify-content: center;
    padding: 8px 20px 12px;
    text-align: center;
  }

  .home-hero-right {
    order: 3;
  }

  .home-hero-bottom-curve,
  .home-hero-fade {
    display: none;
  }

  .home-tagline-title {
    margin: 0;
    font-size: clamp(20px, 5vw, 26px);
    line-height: 1.4;
    white-space: normal;
    text-wrap: balance;
  }

  .home-steps {
    padding: 0 0 48px;
  }

  .home-step {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px 20px;
    text-align: center;
  }

  .home-step-side--left:not(:empty),
  .home-step-side--right:not(:empty) {
    order: -1;
    justify-content: center;
  }

  .home-step-side--left:empty,
  .home-step-side--right:empty {
    display: none;
  }

  .home-step-copy,
  .home-step:nth-child(odd) .home-step-copy,
  .home-step:nth-child(even) .home-step-copy {
    text-align: center;
  }

  .home-step-image {
    max-width: 320px;
    max-height: 190px;
    margin: 0 auto;
  }

  .home-step-text {
    max-width: 28em;
    margin-left: auto;
    margin-right: auto;
  }

  .home-step:nth-child(even) .home-step-text {
    margin-left: auto;
    margin-right: auto;
  }
}
