/* Home hero and editor-pick choreography.
   Markup lives in lib/pages/home/components/hero_section.dart and its part
   files. Keep selectors prefixed with `home-` or scoped by
   `data-editors-pick-variant` so this page-specific CSS stays contained. */

.home-hero-aurora {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 20% 30%, rgba(0, 109, 68, 0.20), transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 70%, rgba(246, 190, 59, 0.10), transparent 60%);
  animation: home-aurora-drift 18s ease-in-out infinite alternate;
}

@keyframes home-aurora-drift {
  0% {
    background-position: 0% 0%, 100% 100%;
    transform: scale(1);
  }

  50% {
    background-position: 10% 5%, 90% 95%;
    transform: scale(1.05);
  }

  100% {
    background-position: 0% 0%, 100% 100%;
    transform: scale(1);
  }
}

.home-breathe {
  animation: home-breathe 6s ease-in-out infinite;
}

.home-hero-proof-mobile-wrap {
  flex-wrap: wrap;
  row-gap: 6px;
}

.home-hero-proof-mobile-wrap .home-hero-proof-updated {
  flex-basis: 100%;
}

@keyframes home-breathe {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.006);
  }
}

@media (min-width: 768px) {
  .home-hero-grid {
    align-items: stretch;
    column-gap: clamp(32px, 4vw, 80px);
    grid-template-columns: minmax(380px, 1fr) minmax(0, clamp(300px, 39vw, 424px));
  }
}

.home-editors-pick-body {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  grid-template-areas: "img info" "desc desc";
  column-gap: 16px;
  row-gap: 14px;
  align-items: center;
}

.home-editors-pick-image-cell {
  grid-area: img;
}

.home-editors-pick-details {
  grid-area: info;
  min-width: 0;
}

.home-editors-pick-copy {
  grid-area: desc;
  min-width: 0;
}

.home-editors-pick-stage {
  background:
    radial-gradient(ellipse 70% 50% at 50% 60%, rgba(0, 109, 68, 0.55), transparent 70%),
    radial-gradient(ellipse 50% 40% at 35% 40%, rgba(246, 190, 59, 0.20), transparent 65%),
    #001a3a;
}

.home-editors-pick-amber {
  color: #8f6400;
}

.home-editors-pick-image {
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%),
    linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%);
  mask-composite: intersect;
}

.home-editors-pick-ivory-image {
  mix-blend-mode: multiply;
}

@media (min-width: 480px) and (max-width: 767.98px) {
  .home-editors-pick-body {
    grid-template-columns: 132px minmax(0, 1fr);
    grid-template-areas: "img info" "img desc";
    column-gap: 20px;
    row-gap: 12px;
    align-items: start;
  }
}

@media (min-width: 768px) and (max-width: 1023.98px) {
  .home-editors-pick-body {
    grid-template-columns: 76px minmax(0, 1fr);
    grid-template-areas: "img info" "desc desc";
    column-gap: 12px;
    row-gap: 18px;
    align-items: start;
  }

  [data-editors-pick-variant="edge-tint"] .home-editors-pick-header,
  [data-editors-pick-variant="ivory-paper"] .home-editors-pick-header {
    display: block;
    gap: 0;
    margin-bottom: 14px;
  }

  [data-editors-pick-variant="edge-tint"] .home-editors-pick-eyebrow,
  [data-editors-pick-variant="ivory-paper"] .home-editors-pick-eyebrow {
    font-size: 0.72rem;
    line-height: 1.25;
    letter-spacing: 0.08em;
    white-space: nowrap;
  }

  [data-editors-pick-variant="edge-tint"] .home-editors-pick-list,
  [data-editors-pick-variant="ivory-paper"] .home-editors-pick-list {
    display: block;
    font-size: 0.62rem;
    line-height: 1.25;
    letter-spacing: 0.16em;
    margin-top: 4px;
    white-space: nowrap;
  }

  [data-editors-pick-variant="edge-tint"] .home-editors-pick-title,
  [data-editors-pick-variant="ivory-paper"] .home-editors-pick-title {
    font-size: 1.125rem;
    line-height: 1.18;
    text-wrap: balance;
  }

  [data-editors-pick-variant="edge-tint"] .home-editors-pick-price,
  [data-editors-pick-variant="ivory-paper"] .home-editors-pick-price {
    font-size: 1.125rem;
    line-height: 1.28;
  }

  [data-editors-pick-variant="edge-tint"] .home-editors-pick-specs,
  [data-editors-pick-variant="ivory-paper"] .home-editors-pick-specs {
    font-size: 0.82rem;
    line-height: 1.35;
    white-space: nowrap;
  }

  [data-editors-pick-variant="edge-tint"] .home-editors-pick-copy,
  [data-editors-pick-variant="ivory-paper"] .home-editors-pick-copy {
    font-size: 0.875rem;
    line-height: 1.48;
    margin-top: 2px;
  }
}

@media (min-width: 1024px) {
  .home-editors-pick-body {
    display: flow-root;
    grid-template-columns: clamp(150px, 34%, 190px) minmax(0, 1fr);
    align-items: start;
  }

  .home-editors-pick-image-cell {
    float: left;
    width: clamp(150px, 34%, 190px);
    margin: 0 20px 12px 0;
  }
}

[data-editors-pick-variant="smart-pick"] {
  display: block;
  width: 100%;
}

@media (min-width: 768px) {
  [data-editors-pick-variant="smart-pick"] {
    max-width: clamp(300px, 39vw, 424px);
    margin-left: auto;
  }
}

.home-editors-pick-smart-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
}

.home-editors-pick-smart-body .home-editors-pick-image-cell {
  float: none;
  width: auto;
  margin: 0;
  grid-area: auto;
}

.home-editors-pick-smart-plate {
  aspect-ratio: 4 / 3;
  box-sizing: border-box;
  isolation: isolate;
  max-height: 252px;
  overflow: hidden;
  padding: 40px 0 20px;
  transition: padding 420ms cubic-bezier(.2, 0, 0, 1);
}

.home-editors-pick-ambient-image {
  display: none;
}

.home-editors-pick-smart-frame {
  position: relative;
  z-index: 1;
}

@media (prefers-color-scheme: dark) {
  :root[data-style="classic"][data-theme-preference="system"] [data-editors-pick-variant="smart-pick"] {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-on-surface) 6%, transparent);
  }

  :root[data-style="classic"][data-theme-preference="system"] .home-editors-pick-ambient-image {
    display: block;
    position: absolute;
    inset: -12%;
    width: 124%;
    height: 124%;
    object-fit: contain;
    opacity: 0.12;
    filter: blur(24px) saturate(1.18);
    transform: scale(1.08);
    pointer-events: none;
  }

}

:root[data-style="classic"][data-theme="dark"] [data-editors-pick-variant="smart-pick"] {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-on-surface) 6%, transparent);
}

:root[data-style="classic"][data-theme="dark"] .home-editors-pick-ambient-image {
  display: block;
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  object-fit: contain;
  opacity: 0.12;
  filter: blur(24px) saturate(1.18);
  transform: scale(1.08);
  pointer-events: none;
}

:root[data-style="city"] .home-hero {
  background: var(--city-home-sky);
  color: var(--city-home-accent-ink);
}

:root[data-style="city"] .home-hero-aurora {
  display: none;
}

:root[data-style="city"] .home-city-hero-scene {
  inset: 0;
  overflow: hidden;
}

:root[data-style="city"] .home-city-hero-sun {
  background: var(--color-tertiary);
  border: var(--fp-outline-width) solid var(--city-home-accent-ink);
  border-radius: 999px;
  height: clamp(150px, 22vw, 320px);
  position: absolute;
  right: clamp(-110px, -7vw, -40px);
  top: clamp(-130px, -9vw, -60px);
  width: clamp(150px, 22vw, 320px);
}

:root[data-style="city"] .home-city-hero-route {
  background: transparent;
  border: 0;
  bottom: 0;
  box-sizing: border-box;
  height: 10px;
  left: -2%;
  overflow: visible;
  position: absolute;
  rotate: -1.5deg;
  width: 104%;
}

:root[data-style="city"] .home-city-hero-route::before {
  background: var(--city-home-coral);
  border-block: var(--fp-outline-width) solid var(--city-home-accent-ink);
  box-sizing: border-box;
  content: "";
  height: 8px;
  left: 0;
  position: absolute;
  top: 1px;
  width: 100%;
}

:root[data-style="city"] .home-city-hero-route::after {
  display: none;
}

:root[data-style="city"] .home-city-hero-wire {
  display: none;
}

:root[data-style="city"] .home-city-hero-wire--one {
  rotate: 9deg;
}

:root[data-style="city"] .home-city-hero-wire--two {
  rotate: 14deg;
  top: 25%;
}

:root[data-style="city"] .home-hero-title,
:root[data-style="city"] .home-hero-body,
:root[data-style="city"] .home-hero-proof,
:root[data-style="city"] .home-hero-proof .font-semibold {
  color: var(--city-home-accent-ink);
}

:root[data-style="city"] .home-hero-body,
:root[data-style="city"] .home-hero-proof {
  opacity: 0.78;
}

:root[data-style="city"] .home-hero [data-rotator] {
  color: var(--city-home-accent-ink);
}

/* The motion runtime turns this span into an inline-block; decorating the
   line itself keeps the coral underline present before and after hydration. */
:root[data-style="city"] .home-hero [data-rotator-line] {
  text-decoration: underline;
  text-decoration-color: var(--city-home-coral);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.08em;
}

:root[data-style="city"] .home-hero-grid:not(:has(.home-editors-pick-card)) {
  grid-template-columns: minmax(0, 1fr);
}

:root[data-style="city"] .home-editors-pick-card {
  position: relative;
  rotate: 1.5deg;
  z-index: 2;
}

:root[data-style="city"] [data-editors-pick-variant="smart-pick"] {
  background: var(--color-surface);
  border-color: var(--fp-ink);
  box-shadow: 7px 8px 0 color-mix(in srgb, var(--fp-ink) 28%, transparent);
}

:root[data-style="city"] .home-editors-pick-smart-plate {
  background: color-mix(in srgb, var(--city-home-sky) 22%, var(--color-surface));
}

@media (max-width: 1023.98px) {
  :root[data-style="city"] .home-editors-pick-card {
    rotate: none;
  }

  :root[data-style="city"] .home-city-hero-route {
    left: 0;
    rotate: none;
    width: 100%;
  }
}

[data-editors-pick-variant="smart-pick"]:hover .home-editors-pick-smart-plate,
[data-editors-pick-variant="smart-pick"]:focus-visible .home-editors-pick-smart-plate {
  padding: 56px 0 20px;
}

.home-editors-pick-smart-image {
  display: block;
  height: 100%;
  max-height: 180px;
  max-width: 64%;
  object-fit: contain;
  width: auto;
}

@media (min-width: 1024px) {
  .home-editors-pick-smart-plate {
    max-height: 320px;
  }

  .home-editors-pick-smart-image {
    max-height: 188px;
  }
}

.home-editors-pick-badge {
  align-items: center;
  background:
    radial-gradient(circle at 50% 45%, rgba(252, 249, 244, 0.08), transparent 54%),
    linear-gradient(145deg, #000a1e 0%, #00142f 100%);
  box-shadow: 0 10px 22px rgba(0, 10, 30, 0.18), inset 0 0 0 1px rgba(252, 249, 244, 0.14);
  box-sizing: border-box;
  gap: 0;
  height: 24px;
  isolation: isolate;
  justify-content: flex-start;
  max-width: 24px;
  min-width: 24px;
  padding: 0 5px;
  pointer-events: none;
  transition:
    max-width 420ms cubic-bezier(.2, 0, 0, 1),
    gap 420ms cubic-bezier(.2, 0, 0, 1),
    padding 420ms cubic-bezier(.2, 0, 0, 1),
    background 420ms cubic-bezier(.2, 0, 0, 1),
    box-shadow 420ms cubic-bezier(.2, 0, 0, 1),
    transform 420ms cubic-bezier(.2, 0, 0, 1);
  white-space: nowrap;
  width: max-content;
}

.home-editors-pick-badge-mark {
  align-items: center;
  background: rgba(252, 249, 244, 0.08);
  border-radius: 999px;
  box-shadow:
    inset 0 0 0 2px rgba(252, 249, 244, 0.18),
    inset 0 0 0 6px rgba(252, 249, 244, 0.05);
  display: inline-flex;
  flex: 0 0 14px;
  height: 14px;
  justify-content: center;
  position: relative;
  transition: transform 420ms cubic-bezier(.2, 0, 0, 1);
  width: 14px;
  z-index: 1;
}

.home-editors-pick-badge-dot {
  background: #f6be3b;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(246, 190, 59, 0.18), 0 0 10px rgba(246, 190, 59, 0.18);
  height: 6px;
  width: 6px;
}

.home-editors-pick-badge-label {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  text-overflow: clip;
  transform: translateX(-4px);
  transition:
    max-width 420ms cubic-bezier(.2, 0, 0, 1),
    opacity 260ms ease,
    transform 420ms cubic-bezier(.2, 0, 0, 1);
  white-space: nowrap;
  z-index: 1;
}

.home-editors-pick-badge-glint {
  background: linear-gradient(110deg, transparent 0%, rgba(252, 249, 244, 0.28) 45%, transparent 70%);
  height: 100%;
  left: -48px;
  position: absolute;
  top: 0;
  transform: translateX(0) skewX(-18deg);
  transition: transform 640ms cubic-bezier(.2, 0, 0, 1);
  width: 42px;
  z-index: 0;
}

[data-editors-pick-variant="smart-pick"]:hover .home-editors-pick-badge,
[data-editors-pick-variant="smart-pick"]:focus-visible .home-editors-pick-badge {
  background: linear-gradient(135deg, #000a1e 0%, #002c28 62%, #006d44 140%);
  box-shadow: 0 14px 30px rgba(0, 10, 30, 0.22), inset 0 0 0 1px rgba(252, 249, 244, 0.18);
  gap: 6px;
  max-width: 126px;
  padding: 0 9px 0 5px;
  transform: translateY(-1px);
}

[data-editors-pick-variant="smart-pick"]:hover .home-editors-pick-badge-mark,
[data-editors-pick-variant="smart-pick"]:focus-visible .home-editors-pick-badge-mark {
  transform: scale(1.04);
}

[data-editors-pick-variant="smart-pick"]:hover .home-editors-pick-badge-label,
[data-editors-pick-variant="smart-pick"]:focus-visible .home-editors-pick-badge-label {
  max-width: 108px;
  opacity: 1;
  transform: translateX(0);
}

[data-editors-pick-variant="smart-pick"]:hover .home-editors-pick-badge-glint,
[data-editors-pick-variant="smart-pick"]:focus-visible .home-editors-pick-badge-glint {
  transform: translateX(188px) skewX(-18deg);
}

@media (hover: none) {
  .home-editors-pick-badge {
    gap: 6px;
    max-width: 126px;
    padding: 0 9px 0 5px;
  }

  .home-editors-pick-smart-plate {
    padding: 56px 0 18px;
  }

  .home-editors-pick-badge-label {
    max-width: 108px;
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero-aurora,
  .home-breathe {
    animation: none;
  }

  .home-editors-pick-badge,
  .home-editors-pick-smart-plate,
  .home-editors-pick-badge-mark,
  .home-editors-pick-badge-label,
  .home-editors-pick-badge-glint {
    transition: none;
  }

  .home-editors-pick-badge-glint {
    display: none;
  }

  :root[data-style="city"] .home-editors-pick-card {
    rotate: none;
  }

  :root[data-style="city"] .home-city-hero-route {
    rotate: none;
  }
}

/* City hero legibility: the proof row sits on a warm-paper ticket above the
   route, and the Editor's Pick tab is always expanded (see the 2026-08-22
   City Home route/budget refinement design). These rules come after the
   collapsed-badge declarations above so they win. */
:root[data-style="city"] .home-hero-proof {
  align-self: flex-start;
  background: var(--color-surface);
  border: var(--fp-outline-width) solid var(--fp-ink);
  border-radius: var(--fp-card-radius);
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--fp-ink) 20%, transparent);
  color: var(--color-on-surface);
  max-width: 100%;
  opacity: 1;
  padding: 8px 12px;
  position: relative;
  width: fit-content;
  z-index: 3;
}

:root[data-style="city"] .home-hero-proof .font-semibold,
:root[data-style="city"] .home-hero-proof-updated {
  color: var(--color-on-surface);
}

:root[data-style="city"] .home-city-hero-route {
  bottom: 0;
}

:root[data-style="city"] .home-editors-pick-badge {
  background: var(--city-home-coral);
  border: var(--fp-outline-width) solid var(--city-home-accent-ink);
  border-radius: var(--fp-card-radius);
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--city-home-accent-ink) 24%, transparent);
  color: var(--city-home-accent-ink);
  gap: 6px;
  height: 28px;
  max-width: 132px;
  padding: 0 9px 0 5px;
  rotate: -3deg;
}

:root[data-style="city"] .home-editors-pick-badge-label {
  max-width: 108px;
  opacity: 1;
  transform: none;
}

:root[data-style="city"] .home-editors-pick-badge-glint {
  display: none;
}

@media (max-width: 767.98px) {
  :root[data-style="city"] .home-hero-proof {
    width: 100%;
  }

  :root[data-style="city"] .home-editors-pick-badge {
    height: 24px;
    max-width: 120px;
    padding: 0 7px 0 4px;
    rotate: none;
  }
}

@media (min-width: 768px) and (max-width: 1023.98px) {
  :root[data-style="city"] .home-hero-proof {
    translate: 0 -16px;
  }

  :root[data-style="city"] .home-editors-pick-badge {
    rotate: none;
    top: -8px;
  }
}

@media (min-width: 1024px) {
  :root[data-style="city"] .home-hero-proof {
    translate: 0 -24px;
  }
}
