/**
 * Stella public landing, v4 visual system.
 * Loaded after the legacy homepage and component sheets so every visible
 * landing surface resolves to the v4 palette and Instrument Serif / Inter.
 */

body[data-page="home"] {
  --sh-surface: var(--hs4-bg);
  --hs4-header-pad-top: max(clamp(14px, 1.8vw, 22px), env(safe-area-inset-top, 0px));
  --hs4-header-pad-bottom: clamp(10px, 1.2vw, 14px);
  --sh-header-bg: var(--hs4-surface);
  --sh-header-deep: var(--hs4-ink);
  --sh-carousel-tag-bg: var(--hs4-ink);
  --sh-on-header: var(--hs4-text);
  --sh-on-header-muted: color-mix(in srgb, var(--hs4-text) 65%, transparent);
  --sh-header-active: var(--hs4-selected);
  --sh-on-header-active: var(--hs4-on-selected);
  --sh-accent: var(--hs4-text);
  --sh-accent-bright: var(--hs4-green);
  --sh-glow: color-mix(in srgb, var(--hs4-green) 28%, transparent);
  --sh-on-surface: var(--hs4-text);
  --sh-on-muted: color-mix(in srgb, var(--hs4-text) 72%, var(--hs4-bg));
  --sh-on-subtle: color-mix(in srgb, var(--hs4-text) 58%, var(--hs4-bg));
  --sh-card-fill: var(--hs4-surface);
  --sh-card-border: color-mix(in srgb, var(--hs4-text) 18%, transparent);
  --sh-card-soft: color-mix(in srgb, var(--hs4-green) 14%, var(--hs4-bg));
  --sh-pick-card-fill: var(--hs4-ink);
  --sh-on-card: var(--hs4-text);
  --sh-on-card-muted: var(--sh-on-muted);
  --sh-on-card-accent: color-mix(in srgb, var(--hs4-orange) 78%, var(--hs4-text));
  --sh-on-card-meta: var(--sh-on-subtle);
  --sh-on-scrim: var(--hs4-white);
  --sh-on-scrim-muted: rgba(255, 255, 255, 0.78);
  --sh-chip-fill: color-mix(in srgb, var(--hs4-yellow) 12%, var(--hs4-surface));
  --sh-on-chip: var(--hs4-text);
  --sh-chip-border: color-mix(in srgb, var(--hs4-text) 28%, transparent);
  --sh-speech-fill: color-mix(in srgb, var(--hs4-pink) 22%, var(--hs4-surface));
  --sh-trust-fill: color-mix(in srgb, var(--hs4-green) 22%, var(--hs4-bg));
  --sh-on-trust: var(--hs4-text);
  --sh-on-trust-muted: var(--sh-on-muted);
  --sh-primary: var(--hs4-action);
  --sh-on-primary: var(--hs4-on-action);
  --sh-primary-hover: var(--hs4-action-hover);
  --sh-primary-pressed: var(--hs4-action-press);
  --sh-secondary-border: var(--hs4-action);
  --sh-secondary-hover: color-mix(in srgb, var(--hs4-orange) 10%, transparent);
  --sh-focus: var(--hs4-focus);
  --sh-search-fill: var(--hs4-surface);
  --sh-on-search: var(--hs4-text);
  --sh-shadow: color-mix(in srgb, var(--hs4-text) 16%, transparent);
  --sh-border: var(--sh-card-border);
  --sh-font-geo: var(--hs4-font-serif);
  --sh-font-ui: var(--hs4-font-inter);
  --sh-font-body: var(--hs4-font-inter);
  --sh-font-input: var(--hs4-font-inter);
  --sh-font-display: var(--hs4-font-serif);
  --site-radius-point: 0px;
  --site-radius-pill: 999px;
  --site-radius-circle: 50%;
  /* The open search sheet keeps the pill's own curve on its bottom corners. */
  --sh-search-panel-radius: calc(var(--hs4-header-control-h) / 2);
  background: var(--hs4-bg);
  color: var(--hs4-text);
  font-family: var(--hs4-font-inter);
}

html[data-theme="dark"] body[data-page="home"] {
  --sh-card-fill: #262626;
  --sh-card-soft: #1c1c1c;
  --sh-chip-fill: transparent;
  --sh-speech-fill: color-mix(in srgb, var(--hs4-pink) 16%, var(--hs4-surface));
  --sh-trust-fill: var(--hs4-bg);
  --sh-on-card-accent: color-mix(in srgb, var(--hs4-orange) 70%, var(--hs4-white));
  /* --sh-primary also colours text and edges; on charcoal those need the
     brighter step. Filled buttons read --hs4-action directly. */
  --sh-primary: var(--hs4-orange-text);
  --sh-secondary-border: var(--hs4-orange-text);
  /* Beat legacy Interior Vintage dark tokens in stella-home.css (same specificity). */
  --sh-search-fill: var(--hs4-surface);
  --sh-on-search: var(--hs4-text);
}

/* Product-ready v4 header */
.sh-header.hs4-header {
  position: sticky;
  top: 0;
  z-index: 110;
  height: auto;
  box-sizing: border-box;
  padding-top: var(--hs4-header-pad-top, var(--hs4-header-pad-y));
  padding-bottom: var(--hs4-header-pad-bottom, var(--hs4-header-pad-y));
  padding-inline: var(--hs4-header-pad-x);
  min-height: calc(
    var(--hs4-header-control-h) +
    var(--hs4-header-pad-top, var(--hs4-header-pad-y)) +
    var(--hs4-header-pad-bottom, var(--hs4-header-pad-y))
  );
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  grid-template-columns: none;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--hs4-text) 12%, transparent);
  color: var(--hs4-text);
}

.sh-header.hs4-header .sh-wordmark {
  flex: 0 0 auto;
  order: 1;
}

.sh-header.hs4-header .sh-product-nav.hs4-header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  order: 3;
  height: var(--hs4-header-control-h);
}

.sh-header .sh-wordmark img {
  display: block;
  height: 100%;
  max-height: var(--hs4-header-control-h);
}

.sh-header .sh-search {
  flex: 1 1 auto;
  order: 2;
  max-width: 560px;
  margin-inline: auto;
  border-radius: calc(var(--hs4-header-control-h) / 2);
  --sh-search-outline-w: 3px;
  --sh-search-outline-color: var(--hs4-green);
  --sh-search-halo-near: color-mix(in srgb, var(--hs4-green) 34%, transparent);
  --sh-search-halo-far: color-mix(in srgb, var(--hs4-green) 16%, transparent);
  --sh-search-halo-breathe-near: color-mix(in srgb, var(--hs4-blue) 28%, transparent);
  --sh-search-halo-breathe-far: color-mix(in srgb, var(--hs4-blue) 14%, transparent);
}

html[data-theme="dark"] .sh-header .sh-search {
  --sh-search-halo-near: color-mix(in srgb, var(--hs4-green) 48%, transparent);
  --sh-search-halo-far: color-mix(in srgb, var(--hs4-green) 28%, transparent);
  --sh-search-halo-breathe-near: color-mix(in srgb, var(--hs4-blue) 40%, transparent);
  --sh-search-halo-breathe-far: color-mix(in srgb, var(--hs4-blue) 22%, transparent);
}

.sh-header .sh-search-form {
  min-height: var(--hs4-header-control-h);
  padding-inline: clamp(12px, 1.4vw, 20px);
  border: 3px solid var(--hs4-search-edge);
  border-radius: calc(var(--hs4-header-control-h) / 2);
  background: var(--hs4-surface);
  color: var(--hs4-text);
}

.sh-header .sh-search:has(.sh-search-input:focus-visible) {
  box-shadow:
    0 0 0 1px var(--hs4-search-glow-ring),
    0 0 10px 2px var(--hs4-search-glow-near),
    0 0 24px 6px var(--hs4-search-glow-far);
}

/* Cued: drop-shadow halo on .sh-search.is-cued takes over; suppress the
   closed-state focus box-shadow so they do not stack. */
.sh-header .sh-search.is-cued:has(.sh-search-input:focus-visible) {
  box-shadow: none;
}

.sh-header .sh-search.is-cued .sh-search-form {
  border-color: var(--hs4-search-edge);
  border-bottom-color: transparent;
  border-radius:
    calc(var(--hs4-header-control-h) / 2)
    calc(var(--hs4-header-control-h) / 2)
    0 0;
}

/* Keep the open sheet fill identical to the field so the outline seam is continuous. */
.sh-header .sh-search-panel,
html[data-theme="dark"] .sh-header .sh-search-panel {
  background: var(--hs4-surface);
}

.sh-search-input {
  color: var(--hs4-text);
  /* 16px floor: iOS Safari zooms focused inputs below 16px computed size */
  font: 400 clamp(16px, 1.2vw, 17px) / 1.2 var(--hs4-font-inter);
}

.sh-search-input::placeholder {
  color: var(--hs4-muted-text);
  opacity: 1;
}

.sh-search-live-badge {
  background: color-mix(in srgb, var(--hs4-green) 16%, transparent);
  color: var(--hs4-text);
}

.sh-product-nav {
  gap: clamp(8px, 1.4vw, 20px);
}

.hs4-login,
.hs4-signin {
  text-decoration: none;
}

.sh-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--hs4-header-control-h);
  height: var(--hs4-header-control-h);
  border: 1.5px solid var(--hs4-field-edge);
  border-radius: 50%;
  background: transparent;
  color: var(--hs4-text);
  cursor: pointer;
}

.sh-theme-toggle:hover {
  background: var(--hs4-selected-soft);
  border-color: var(--hs4-selected-edge);
}

.sh-theme-toggle:focus-visible {
  outline: 2px solid var(--hs4-focus);
  outline-offset: 2px;
}

.sh-theme-toggle .hs4-theme-icon {
  width: 19px;
  height: 19px;
}

/* V4 hero on the public page */
.sh-hero-v4 {
  background: var(--hs4-bg);
}

.sh-hero-v4 .hs4-marquee {
  padding-top: clamp(18px, 2.4vw, 34px);
}

.sh-hero-v4 .hs4-band {
  margin-top: 34px;
}

.sh-hero-v4 .hs4-join {
  text-decoration: none;
}

/* Section rhythm and typography */
.sh-section {
  position: relative;
  padding-block: clamp(64px, 8vw, 112px);
  border-top: 0;
}

.sh-section:nth-of-type(4n + 2) {
  background: color-mix(in srgb, var(--hs4-blue) 6%, var(--hs4-bg));
}

.sh-section:nth-of-type(4n + 3) {
  background: color-mix(in srgb, var(--hs4-pink) 8%, var(--hs4-bg));
}

/* Dark: accent tints over black turn muddy, so sections step between the
   two neutral surfaces instead. */
html[data-theme="dark"] .sh-section:nth-of-type(4n + 2) {
  background: var(--hs4-bg);
}

html[data-theme="dark"] .sh-section:nth-of-type(4n + 3) {
  background: var(--hs4-surface);
}

.sh-section-title,
.sh-waitlist-title {
  margin-bottom: 14px;
  font-family: var(--hs4-font-serif);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--hs4-text);
}

.sh-section-body,
.sh-waitlist-body {
  max-width: 52rem;
  margin-bottom: 32px;
  font: 400 clamp(1rem, 1.4vw, 1.2rem) / 1.65 var(--hs4-font-inter);
  color: var(--sh-on-muted);
}

/* Import tiles */
.sh-source-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (min-width: 540px) {
  .sh-source-grid {
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 10px;
  }
}

@media (min-width: 900px) {
  .sh-source-grid {
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 12px;
  }
}

.sh-source-chip {
  min-height: 0;
  padding: 8px 10px;
  gap: 8px;
  border: 2px solid color-mix(in srgb, var(--hs4-text) 18%, transparent);
  border-radius: 0;
  background: var(--hs4-surface);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--hs4-green) 35%, transparent);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.sh-source-chip:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 0 color-mix(in srgb, var(--hs4-green) 48%, transparent);
}

.sh-source-icon-tile {
  width: 32px;
  height: 32px;
  border-radius: 0;
  background: var(--hs4-white);
}

.sh-source-chip > span + span {
  min-width: 0;
}

.sh-source-chip-name {
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.sh-source-chip-note {
  margin-top: 1px;
  font-size: 11px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.sh-import-icon-mask {
  width: 18px;
  height: 18px;
}

/* Profile card: remap the embedded v13 token layer. */
.sh-taste-showcase {
  --s13-coral: var(--hs4-orange);
  --s13-charcoal: var(--hs4-ink);
  --s13-cream: var(--hs4-white);
  --s13-sage: var(--hs4-green);
  --s13-gold: var(--hs4-yellow);
  --s13-paper: var(--hs4-bg);
  --s13-paper-deep: color-mix(in srgb, var(--hs4-blue) 7%, var(--hs4-bg));
  --s13-card: var(--hs4-surface);
  --s13-panel-face: var(--hs4-surface);
  --s13-ink: var(--hs4-text);
  --s13-ink-soft: var(--sh-on-muted);
  --s13-ink-faint: var(--sh-on-subtle);
  --s13-line: color-mix(in srgb, var(--hs4-text) 18%, transparent);
  --s13-line-strong: color-mix(in srgb, var(--hs4-text) 42%, transparent);
  --s13-sage-tint: color-mix(in srgb, var(--hs4-green) 18%, transparent);
  --s13-sage-panel: color-mix(in srgb, var(--hs4-green) 20%, var(--hs4-bg));
  --s13-chip-paper: var(--hs4-surface);
  --s13-chip-outline: color-mix(in srgb, var(--hs4-text) 40%, transparent);
  --s13-speech-base: var(--hs4-surface);
  /* Status bubble: plain surface, so mint is the only tint on the rail */
  --s13-speech-fill: var(--hs4-surface);
  --s13-font-display: var(--hs4-font-serif);
  --s13-font-ui: var(--hs4-font-inter);
  --s13-font-body: var(--hs4-font-inter);
  --s13-radius-point: 0px;
}

html[data-theme="dark"] .sh-taste-showcase {
  --s13-paper: var(--hs4-surface);
  --s13-paper-deep: var(--hs4-surface);
  --s13-card: #2b2b2b;
  --s13-panel-face: color-mix(in srgb, var(--hs4-surface) 92%, var(--hs4-white));
  --s13-ink: var(--hs4-text);
  --s13-ink-soft: var(--sh-on-muted);
  --s13-ink-faint: var(--sh-on-subtle);
  --s13-line: color-mix(in srgb, var(--hs4-text) 18%, transparent);
  --s13-line-strong: color-mix(in srgb, var(--hs4-text) 44%, transparent);
  --s13-sage-panel: color-mix(in srgb, var(--hs4-green) 12%, #2b2b2b);
  --s13-chip-paper: var(--hs4-surface);
  --s13-chip-outline: color-mix(in srgb, var(--hs4-text) 40%, transparent);
  --s13-speech-base: var(--hs4-surface);
  --s13-speech-fill: var(--hs4-surface);
}

.f13-card {
  border-radius: 0;
}

/* Principles and final conversion */
.sh-trust {
  padding-block: clamp(52px, 7vw, 88px);
  background: var(--sh-trust-fill);
}

.sh-trust-icon {
  color: var(--hs4-green);
}

.sh-trust-label {
  font-family: var(--hs4-font-serif);
  font-size: 1.55rem;
  font-weight: 400;
}

.sh-waitlist {
  padding-block: clamp(72px, 10vw, 132px);
  border: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--hs4-pink) 24%, transparent), transparent 55%),
    color-mix(in srgb, var(--hs4-yellow) 18%, var(--hs4-bg));
}

/* Dark: the page opens on the green hero band and closes on a flat pink
   block with ink text. No gradient, and the scroll-depth glow is off. */
html[data-theme="dark"] .sh-waitlist {
  --hs4-text: var(--hs4-btn-ink);
  --sh-on-muted: color-mix(in srgb, var(--hs4-btn-ink) 82%, var(--hs4-pink));
  --sh-focus: var(--hs4-btn-ink);
  background: var(--hs4-pink);
  color: var(--hs4-btn-ink);
}

html[data-theme="dark"] body[data-page="home"] .sh-waitlist.sd-glow::after {
  display: none;
}

html[data-theme="dark"] .sh-waitlist .sh-btn--primary {
  background: var(--hs4-btn-ink);
  color: var(--hs4-white);
  box-shadow: none;
}

html[data-theme="dark"] .sh-waitlist .sh-btn--primary:hover {
  background: var(--hs4-ink);
  box-shadow: none;
}

.sh-btn {
  border-radius: 999px;
  font-family: var(--hs4-font-inter);
}

.sh-btn--primary {
  background: var(--hs4-action);
  color: var(--hs4-on-action);
}

/* Site footer: brand + three link columns, then copyright and social icons. */
.sh-footer.hs4-footer {
  padding: 56px clamp(16px, 5vw, 64px) 28px;
  border: 0;
  background: var(--hs4-ink);
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--hs4-font-inter);
  font-size: 14px;
  line-height: 1.5;
}

html[data-theme="dark"] .sh-footer.hs4-footer {
  background: var(--hs4-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hs4-footer-inner,
.hs4-footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
}

.hs4-footer-inner {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 2fr;
  gap: 40px;
}

.hs4-footer-logo img {
  display: block;
  height: 32px;
  width: auto;
}

.sh-footer .hs4-footer-tagline {
  margin: 14px 0 0;
  max-width: 26ch;
  font: 400 22px / 28px var(--hs4-font-serif);
  color: var(--hs4-white);
}

.hs4-footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.hs4-footer-heading {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hs4-white);
}

.hs4-footer-col ul,
.hs4-footer-social {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hs4-footer-col li + li {
  margin-top: 10px;
}

.sh-footer.hs4-footer a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}

.sh-footer.hs4-footer a:hover {
  color: var(--hs4-white);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sh-footer.hs4-footer a:focus-visible {
  outline: 2px solid var(--hs4-white);
  outline-offset: 2px;
  border-radius: 4px;
}

.hs4-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.sh-footer .hs4-footer-copy {
  margin: 0;
  font-size: 13px;
}

.hs4-footer-social {
  display: flex;
  gap: 8px;
}

.sh-footer.hs4-footer .hs4-footer-social a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.sh-footer.hs4-footer .hs4-footer-social a:hover {
  border-color: var(--hs4-white);
  text-decoration: none;
}

.hs4-footer-social svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 880px) {
  .hs4-footer-inner {
    grid-template-columns: 1fr;
  }
}

/* Clear the fixed mobile call-to-action bar (.sh-sticky-cta, <=600px). */
@media (max-width: 600px) {
  .sh-footer.hs4-footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 520px) {
  .sh-footer.hs4-footer {
    padding-top: 40px;
  }

  .hs4-footer-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 32px;
  }

  .hs4-footer-bottom {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
}

.sh-sticky-cta {
  background: color-mix(in srgb, var(--hs4-surface) 92%, transparent);
  backdrop-filter: blur(12px);
}

@media (max-width: 880px) {
  .sh-header.hs4-header {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .sh-header.hs4-header .sh-wordmark {
    order: 1;
  }

  .sh-header.hs4-header .sh-product-nav.hs4-header-actions {
    order: 2;
    margin-left: auto;
    justify-content: flex-end;
  }

  .sh-header .sh-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
    margin-inline: 0;
  }
}

/* The shared search stylesheet hides the header field under 680px because it
   expects a separate mobile search row. The landing has no such row, so keep
   the field as a full-width third line instead of dropping search entirely. */
@media (max-width: 680px) {
  .sh-header.hs4-header .sh-search {
    display: block;
  }
}

@media (max-width: 560px) {
  .sh-header.hs4-header {
    padding-inline: 14px;
    gap: 8px;
  }

  .hs4-login {
    display: none;
  }

  .hs4-signin {
    padding-inline: 12px;
    font-size: 14px;
  }

  .sh-theme-toggle {
    width: 44px;
    height: 44px;
  }

  .sh-section-title,
  .sh-waitlist-title {
    font-size: clamp(2.25rem, 12vw, 3.5rem);
  }
}

@media (max-width: 420px) {
  /* Keep the wordmark and the actions on one line at phone widths. */
  .sh-header .sh-wordmark img {
    max-height: 34px;
  }
}

/* Touch: 44px minimum hit area on every landing control */
@media (pointer: coarse) {
  .hs4-login,
  .hs4-signin,
  .sh-theme-toggle,
  .sh-search-suggest-remove-btn {
    box-sizing: border-box;
    min-width: 44px;
    min-height: 44px;
  }

  .sh-search-filter,
  .sh-search--filters-v4 .sh-search-filter {
    min-width: 44px;
    min-height: 44px;
  }

  /* Underline text buttons: overlay the tap area so the coral rule
     stays the width of the label. */
  .f13-shelf-btn,
  .f13-shelf-close,
  .f13-filter-btn {
    position: relative;
  }

  .f13-shelf-btn::after,
  .f13-shelf-close::after,
  .f13-filter-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: max(100%, 44px);
    height: 44px;
    transform: translate(-50%, -50%);
  }
}
