/* 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;
}

/* ── 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 {
  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,
.home-hero-video.is-active {
  opacity: 1;
  z-index: 1;
}

/*
 * home-hero-canning is a tall portrait (1152×2048): the framed artwork
 * sits in the top ~17–43% of the frame and the faces at ~30–50%, so a
 * centred cover crop of this wide, short hero band would cut the frame
 * off. Biasing the crop up to 16% keeps the whole frame, the picture
 * light above it, and both faces in view (the child's lower body /
 * stool is what gets cropped instead).
 */
.home-hero-image--canning {
  object-position: center 16%;
}

/*
 * home-hero-harlequin (2400×1792): the two framed artworks hang at
 * ~15–43% of the frame height and the child sits below at ~58–91%,
 * so the subject spans most of the image vertically. Biasing the crop
 * to 45% keeps the whole frames and the child (down to the feet) in
 * the visible slice when the hero band crops top/bottom; horizontally
 * the frames + child sit at ~30–69%, so centring is safe.
 */
.home-hero-image--harlequin {
  object-position: center 45%;
  /* Zoom in on the frames + child: cover alone shows the whole room,
     so scale up around a point high in the frame. The visible slice
     starts above the brass picture light, keeps the frames in full,
     and shows the child down to the lap/drawing paper. */
  transform: scale(1.22);
  transform-origin: 50% 24%;
}

.home-hero-fade {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
}

.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 ────────────────────────────────────────────────── */

@media (max-width: 980px) {
  .home-header {
    padding: 0;
  }

  .home-navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
    padding: 6px 12px 4px;
    box-sizing: border-box;
    border-bottom: 1px solid #d0d0d0;
  }

  .home-nav-group--left,
  .home-nav-group--right {
    display: none;
  }

  .home-nav-logo {
    width: auto;
    height: auto;
    display: flex;
    justify-content: center;
  }

  /* Flat logo on mobile — no semicircle badge (client-view keeps its own). */
  .home-nav-logo-badge {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: auto;
    height: auto;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

  .home-nav-logo-img {
    height: 72px;
  }

  .home-nav-scroll.main-nav-scroll {
    display: block;
    border-bottom: 1px solid #eee;
  }

  .home-hero {
    padding: 0;
    height: auto;
    max-height: none;
    min-height: 0;
  }

  .home-hero-stage {
    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;
  }

  .home-hero-left,
  .home-hero-right {
    min-height: 260px;
  }

  /* Bias crop slightly above center so more of the upper frame is visible. */
  .home-hero-image {
    object-position: center 35%;
  }

  /* Portrait canning shot on a wide, short mobile panel: 23% is the
     bias that still contains the full frame (top at ~17%) and the
     child's face/head (bottom at ~51%) in the visible slice. */
  .home-hero-image--canning {
    object-position: center 23%;
  }

  /* Mobile panels crop more vertically, so aim higher than desktop:
     this keeps the brass picture light and the frames in view, with
     the child cropped below the waist. */
  .home-hero-image--harlequin {
    object-position: center 28%;
    transform: scale(1.12);
    transform-origin: 50% 18%;
  }

  .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;
  }
}
