/**
 * Helix Health — UI layer (buttons, overlays)
 * Plus Jakarta Sans: self-hosted (similar geometric sans to Roobert; OFL via Bunny source files).
 * Brand color tokens (OKLCH).
 */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/plus-jakarta-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../assets/fonts/plus-jakarta-sans-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2");
}

:root {
  --brand-charcoal: oklch(14.89% 0.0027 248.08);
  --brand-green: oklch(39.56% 0.0812 166.85);
  --brand-green-hover: oklch(34% 0.075 166.85);
  --brand-blue: oklch(83.46% 0.0735 257.42);
  --brand-white-fr: oklch(100% 0 0);
  --brand-off-white: oklch(98.21% 0 129.63);
  --brand-grey: oklch(88.22% 0 0);
  --brand-pewter: oklch(55.55% 0 0);
  --brand-graphite: oklch(33.1% 0.0104 253.98);
  --brand-greenlight: oklch(87.91% 0.0171 166.85);
  --brand-pink: oklch(87.47% 0.114 327.97);
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --helix-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ----- Interactive panel cards (lift + shadow ramp on hover) ----- */
.helix-panel-card {
  position: relative;
  transition:
    transform 0.42s var(--helix-ease),
    box-shadow 0.42s var(--helix-ease),
    border-color 0.3s ease;
  will-change: transform;
}

.helix-panel-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 20px 50px -14px oklch(14.89% 0.0027 248.08 / 0.16),
    0 8px 24px -8px oklch(39.56% 0.0812 166.85 / 0.12);
}

/* Preserve colored left + thick right rails on hover */
.helix-panel-card:not(.helix-rail-card):hover {
  border-color: color-mix(in oklch, var(--brand-green) 42%, var(--brand-grey)) !important;
}

/* Softer lift — hero metrics & dense grids */
.helix-panel-card--soft:hover {
  transform: translateY(-4px);
  box-shadow:
    0 14px 40px -12px oklch(14.89% 0.0027 248.08 / 0.12),
    0 6px 18px -6px oklch(39.56% 0.0812 166.85 / 0.08);
}

/* Dark panel — teal/green glow on hover */
.helix-panel-card--inverse:hover {
  transform: translateY(-5px);
  box-shadow:
    0 24px 56px -12px oklch(39.56% 0.0812 166.85 / 0.35),
    0 0 0 1px oklch(83.46% 0.0735 257.42 / 0.12);
}

/* Floating tiles (hero orbit cards) */
.helix-float-card {
  transition:
    transform 0.5s var(--helix-ease),
    box-shadow 0.45s var(--helix-ease);
}

.helix-float-card:hover {
  transform: translateY(-6px) rotate(-0.5deg);
  box-shadow: 0 22px 48px -16px oklch(14.89% 0.0027 248.08 / 0.22);
}

@media (prefers-reduced-motion: reduce) {
  .helix-panel-card:hover,
  .helix-panel-card--soft:hover,
  .helix-panel-card--inverse:hover,
  .helix-float-card:hover {
    transform: none;
  }
}

/* Strip pills — chip hover motion */
.helix-pill {
  transition:
    transform 0.3s var(--helix-ease),
    background-color 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease;
}

.helix-pill:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklch, var(--brand-green) 50%, var(--brand-grey));
  background-color: color-mix(in oklch, var(--brand-blue) 55%, var(--brand-white-fr));
  color: var(--brand-charcoal);
}

@media (prefers-reduced-motion: reduce) {
  .helix-pill:hover {
    transform: none;
  }
}

/* ----- Unified buttons (comfortable tap targets, pill “bezel”) ----- */
.helix-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.8125rem;
  padding: 0.625rem 1.75rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  border-radius: 9999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    opacity 0.2s ease,
    box-shadow 0.2s ease;
  white-space: nowrap;
  max-width: 100%;
}

.helix-btn:focus-visible {
  outline: 2px solid var(--brand-green);
  outline-offset: 2px;
}

.helix-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.helix-btn--primary {
  background-color: var(--brand-green);
  color: var(--brand-white-fr);
  border-color: transparent;
  box-shadow:
    0 0 0 1px color-mix(in oklch, var(--brand-charcoal) 18%, transparent),
    0 3px 14px oklch(39.56% 0.0812 166.85 / 0.32);
}

.helix-btn--primary:hover {
  background-color: var(--brand-green-hover);
}

.helix-btn--outline {
  background-color: transparent;
  color: var(--brand-charcoal);
  border-color: color-mix(in oklch, var(--brand-graphite) 38%, transparent);
}

.helix-btn--outline:hover {
  background-color: var(--brand-off-white);
  border-color: color-mix(in oklch, var(--brand-green) 45%, transparent);
}

.helix-btn--glass {
  background-color: rgba(255, 255, 255, 0.14);
  color: var(--brand-white-fr);
  border-color: rgba(255, 255, 255, 0.22);
}

.helix-btn--glass:hover {
  background-color: rgba(255, 255, 255, 0.22);
}

.helix-btn--inverse {
  background-color: var(--brand-white-fr);
  color: var(--brand-green);
  border-color: transparent;
}

.helix-btn--inverse:hover {
  opacity: 0.93;
}

.helix-btn--sm {
  min-height: 1.75rem;
  padding: 0 1rem;
  font-size: 0.8125rem;
}

.helix-btn--block {
  width: 100%;
}

@media (max-width: 380px) {
  .helix-btn {
    white-space: normal;
    text-align: center;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    line-height: 1.25;
  }
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100000;
  padding: 0.65rem 1.15rem;
  background: var(--brand-green);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0 0 0.375rem 0;
}

.skip-link:focus {
  left: 0;
}

/* Store badge vectors — crisp at small sizes */
.helix-store-badge__icon {
  display: block;
}

/* Reference-style rail: pronounced colored left bar (Tailwind `border` is 1px — override width) */
.helix-rail-card {
  border-left-width: 0.9375rem !important; /* ~15px — visible rail without dominating */
  border-left-style: solid !important;
  box-shadow: 0 2px 16px oklch(14.89% 0.0027 248.08 / 0.06);
}

.helix-rail-card.helix-panel-card--soft:hover,
.helix-rail-card.helix-panel-card:hover {
  box-shadow:
    0 14px 40px -12px oklch(14.89% 0.0027 248.08 / 0.12),
    0 6px 18px -6px oklch(39.56% 0.0812 166.85 / 0.08);
}

.helix-hero-wash {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 55% at 85% -15%, oklch(39.56% 0.0812 166.85 / 0.11), transparent 52%),
    radial-gradient(ellipse 70% 50% at 0% 80%, oklch(83.46% 0.0735 257.42 / 0.14), transparent 48%);
}

.hx-reveal {
  opacity: 0;
  transform: translateY(1.25rem);
  transition:
    opacity 0.75s var(--helix-ease),
    transform 0.75s var(--helix-ease);
}

.hx-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered reveal — cascading tiles when scrolling */
.hx-stagger > .hx-reveal.is-visible:nth-child(1) {
  transition-delay: 0ms;
}
.hx-stagger > .hx-reveal.is-visible:nth-child(2) {
  transition-delay: 65ms;
}
.hx-stagger > .hx-reveal.is-visible:nth-child(3) {
  transition-delay: 130ms;
}
.hx-stagger > .hx-reveal.is-visible:nth-child(4) {
  transition-delay: 195ms;
}
.hx-stagger > .hx-reveal.is-visible:nth-child(5) {
  transition-delay: 260ms;
}
.hx-stagger > .hx-reveal.is-visible:nth-child(6) {
  transition-delay: 325ms;
}

@media (prefers-reduced-motion: reduce) {
  .hx-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hx-stagger > .hx-reveal.is-visible {
    transition-delay: 0ms !important;
  }
}

@keyframes helix-float-soft {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.hx-float-soft {
  animation: helix-float-soft 9s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .hx-float-soft {
    animation: none;
  }
}

.hx-nav-drawer {
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 0.3s var(--helix-ease),
    visibility 0.3s;
}

.hx-nav-drawer.is-open {
  visibility: visible;
  opacity: 1;
}

.hx-nav-drawer-inner {
  transform: translateX(100%);
  transition: transform 0.38s var(--helix-ease);
}

.hx-nav-drawer.is-open .hx-nav-drawer-inner {
  transform: translateX(0);
}

body.hx-lock {
  overflow: hidden;
}

.hx-modal[hidden] {
  display: none !important;
}

.hx-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.hx-modal-backdrop {
  position: absolute;
  inset: 0;
  background: oklch(14.89% 0.0027 248.08 / 0.52);
  backdrop-filter: blur(8px);
}

.hx-modal-sheet {
  position: relative;
  width: min(100%, 42rem);
  max-height: min(92vh, 46rem);
  overflow-y: auto;
  border-radius: 1rem;
  background: var(--brand-white-fr);
  box-shadow:
    0 0 0 1px oklch(39.56% 0.0812 166.85 / 0.08),
    0 28px 90px -24px oklch(14.89% 0.0027 248.08 / 0.35);
}

.hx-cookie[hidden] {
  display: none !important;
}

.hx-cookie {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10040;
  border-top: 1px solid color-mix(in oklch, var(--brand-grey) 70%, transparent);
  background: color-mix(in oklch, var(--brand-white-fr) 94%, transparent);
  backdrop-filter: blur(12px);
}

.hx-prefs[hidden] {
  display: none !important;
}

.hx-prefs {
  position: fixed;
  inset: 0;
  z-index: 10045;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.hx-prefs-card {
  position: relative;
  width: min(22rem, 100%);
  border-radius: 1rem;
  background: var(--brand-white-fr);
  padding: 1.75rem;
  box-shadow:
    0 0 0 1px oklch(39.56% 0.0812 166.85 / 0.06),
    0 24px 70px -20px oklch(14.89% 0.0027 248.08 / 0.28);
}

.hx-field:focus {
  outline: none;
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px oklch(39.56% 0.0812 166.85 / 0.22);
}

/* Invalid required fields — after blur (touched) or after submit attempt */
.hx-field.hx-touched:invalid:not(:focus) {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.22);
}

form.hx-form--attempted .hx-field:invalid:not(:focus) {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.22);
}

form.hx-form--attempted input[type="checkbox"].hx-field:invalid {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

/* Device shell — realistic phone proportions (~iPhone 14 logical 390×844) */
.helix-phone-frame {
  position: relative;
  width: min(17.25rem, 90vw);
  max-width: 100%;
  aspect-ratio: 390 / 844;
  max-height: min(82vh, 38.5rem);
  margin-left: auto;
  margin-right: auto;
  padding: 0.65rem;
  border-radius: 2.75rem;
  background: linear-gradient(155deg, #3d3d44 0%, #232326 38%, #0e0e10 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.1),
    inset 0 -3px 16px rgba(0, 0, 0, 0.45),
    0 28px 56px -12px oklch(14.89% 0.0027 248.08 / 0.38),
    0 12px 28px -8px oklch(14.89% 0.0027 248.08 / 0.22);
}

.helix-phone-frame__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 2.15rem;
  overflow: hidden;
  background: #0a0a0c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.helix-phone-frame__inner::before {
  content: "";
  position: absolute;
  top: 0.45rem;
  left: 50%;
  z-index: 5;
  width: 32%;
  height: 1.05rem;
  transform: translateX(-50%);
  border-radius: 9999px;
  background: #080809;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.helix-phone-frame .helix-chat-demo {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  border-radius: 0;
  border: none;
  display: flex;
  flex-direction: column;
  box-shadow: none;
}

.helix-phone-frame .helix-chat-demo__header {
  padding-top: 1.5rem;
  flex-shrink: 0;
}

.helix-phone-frame .helix-chat-demo__thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* Animated hero chat (also used inside phone frame) */
.helix-chat-demo {
  position: relative;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
  border-radius: 1.75rem;
  border: 1px solid oklch(88.22% 0 0);
  background: oklch(100% 0 0);
  box-shadow:
    0 4px 24px oklch(14.89% 0.0027 248.08 / 0.1),
    0 0 0 1px oklch(14.89% 0.0027 248.08 / 0.04);
  overflow: hidden;
}

.helix-chat-demo__header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  background: linear-gradient(180deg, oklch(98.21% 0 0), oklch(100% 0 0));
  border-bottom: 1px solid oklch(88.22% 0 0);
}

.helix-chat-demo__avatar {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a4676;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.helix-chat-demo__title {
  min-width: 0;
  flex: 1;
}

.helix-chat-demo__title strong {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: oklch(14.89% 0.0027 248.08);
}

.helix-chat-demo__title span {
  font-size: 0.6875rem;
  color: oklch(55.55% 0 0);
}

.helix-chat-demo__live {
  flex-shrink: 0;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 9999px;
  background: oklch(87.91% 0.0171 166.85);
  color: oklch(39.56% 0.0812 166.85);
}

.helix-chat-demo__thread {
  min-height: 16.5rem;
  padding: 0.75rem 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: oklch(98.21% 0 0);
}

.helix-chat-demo__msg {
  max-width: 92%;
  padding: 0.55rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(0.5rem) scale(0.98);
  transition:
    opacity 0.42s var(--helix-ease),
    transform 0.42s var(--helix-ease);
}

.helix-chat-demo__msg--in {
  align-self: flex-start;
  background: oklch(100% 0 0);
  border: 1px solid oklch(88.22% 0 0);
  color: oklch(33.1% 0.0104 253.98);
  border-bottom-left-radius: 0.25rem;
}

.helix-chat-demo__msg--out {
  align-self: flex-end;
  background: rgb(171, 203, 249);
  color: #0f172a;
  border: 1px solid color-mix(in oklch, #0f172a 12%, transparent);
  border-bottom-right-radius: 0.25rem;
}

.helix-chat-demo__msg--show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.helix-chat-demo__meta {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: oklch(55.55% 0 0);
  margin-bottom: 0.15rem;
}

.helix-chat-demo__typing {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.35rem 0.75rem;
  align-self: flex-start;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.helix-chat-demo__typing--on {
  opacity: 1;
}

.helix-chat-demo__typing span {
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 9999px;
  background: oklch(55.55% 0 0);
  animation: helix-typing 1.1s ease-in-out infinite;
}

.helix-chat-demo__typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.helix-chat-demo__typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes helix-typing {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .helix-chat-demo__msg {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .helix-chat-demo__typing span {
    animation: none;
  }

  .helix-chat-demo__typing--on {
    opacity: 0;
  }
}

/* Soft footer backdrop — slow drifting color wash (no grid squares) */
.helix-footer-slab {
  position: relative;
  isolation: isolate;
  background-color: var(--brand-off-white);
  overflow: hidden;
}

.helix-footer-slab::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -45%;
  opacity: 0.9;
  background:
    radial-gradient(ellipse 55% 45% at 15% 35%, oklch(87.91% 0.0171 166.85 / 0.42), transparent 58%),
    radial-gradient(ellipse 50% 42% at 85% 25%, oklch(83.46% 0.0735 257.42 / 0.28), transparent 52%),
    radial-gradient(ellipse 45% 38% at 70% 85%, oklch(87.47% 0.114 327.97 / 0.2), transparent 50%),
    radial-gradient(ellipse 40% 35% at 30% 90%, oklch(92.75% 0.1157 97.52 / 0.2), transparent 48%);
  animation: helix-footer-drift 28s ease-in-out infinite alternate;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .helix-footer-slab::before {
    animation: none;
    opacity: 0.75;
  }
}

@keyframes helix-footer-drift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(3%, -2%) scale(1.04);
  }
}

.helix-footer-slab-inner {
  position: relative;
  z-index: 1;
}
