/* Achromatic depth · chronotype-sensitive UI · fluid morph layers */

:root {
  --color-primary: #2c2c54;
  --color-secondary: #fdf5e6;
  --color-muted: #967bb6;
  --color-surface: rgba(44, 44, 84, 0.55);
  --color-glass: rgba(253, 245, 230, 0.08);
  --font-primary: "Albert Sans", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --space-xs: 0.35rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 3.5rem;
  --radius-md: 0.5rem;
  --radius-lg: 1.125rem;
  --shadow-soft: 0 0.5rem 2rem rgba(0, 0, 0, 0.25);
  --transition-fast: 0.3s ease;
  --transition-slow: 0.8s ease;
  --focus-ring: 0.125rem solid var(--color-secondary);
  --focus-offset: 0.125rem;
  --lumen-bg: #1a1228;
  --lumen-mid: #f5e6c8;
  --lumen-end: #f7f4ea;
  --header-shift: 0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-primary);
  background: radial-gradient(120% 80% at 50% 0%, var(--color-muted) 0%, var(--color-primary) 45%, #0f0f24 100%);
  color: var(--color-secondary);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

body.phase-warmup {
  background: radial-gradient(130% 90% at 40% 10%, #3d2a55 0%, var(--lumen-bg) 55%, #0f0f24 100%);
}

body.phase-peak {
  background: radial-gradient(140% 100% at 50% 0%, var(--lumen-mid) 0%, #e8ddc8 40%, #cfc4b2 100%);
  color: var(--color-primary);
}

body.phase-cooldown {
  background: radial-gradient(120% 85% at 50% 15%, #eef3f8 0%, var(--lumen-end) 55%, #dcd8cf 100%);
  color: var(--color-primary);
}

body.phase-peak .glass-panel,
body.phase-cooldown .glass-panel {
  background: rgba(44, 44, 84, 0.08);
  border-color: rgba(44, 44, 84, 0.15);
}

body.phase-peak .site-title-link,
body.phase-cooldown .site-title-link {
  color: var(--color-primary);
}

body.phase-peak .primary-navigation a,
body.phase-cooldown .primary-navigation a {
  color: var(--color-primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:focus-visible,
button:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

.shell-page {
  width: min(112rem, 94%);
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 95;
  padding-block: var(--space-md);
  transition: padding-block var(--transition-fast);
}

.site-header.is-compact {
  padding-block: calc(var(--space-md) - 0.25rem);
}

.header-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--color-glass);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(253, 245, 230, 0.12);
}

.header-cluster > nav {
  display: flex;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

.site-title-link {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  letter-spacing: 0.02em;
  text-decoration: none;
}

.primary-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  align-items: center;
  justify-content: flex-end;
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-navigation li {
  list-style: none;
}

.primary-navigation a {
  font-size: 0.92rem;
  text-decoration: none;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}

.primary-navigation a:hover {
  border-color: rgba(253, 245, 230, 0.25);
}

.burger-toggle {
  order: 999;
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid rgba(253, 245, 230, 0.35);
  background: rgba(150, 123, 182, 0.25);
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.burger-icon {
  width: 1.35rem;
  height: 1rem;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
}

.burger-icon span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

@media (max-width: 63.9375rem) {
  .header-cluster {
    backdrop-filter: none;
    background: rgba(44, 44, 84, 0.88);
  }

  .burger-toggle {
    display: inline-flex;
    margin-left: auto;
    position: relative;
    z-index: 120;
  }

  .primary-navigation {
    position: fixed;
    inset: 0;
    z-index: 110;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: stretch;
    align-content: flex-start;
    gap: var(--space-sm);
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: max(var(--space-xl), env(safe-area-inset-top, 0px)) var(--space-lg)
      max(var(--space-xl), env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    background: rgba(15, 15, 36, 0.94);
    backdrop-filter: blur(16px);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
  }

  .primary-navigation li {
    flex-shrink: 0;
    width: 100%;
    max-width: 22rem;
    margin-inline: auto;
  }

  .primary-navigation a {
    display: block;
    width: 100%;
    text-align: center;
    padding: var(--space-md) var(--space-lg);
    box-sizing: border-box;
  }

  .primary-navigation.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  body.phase-peak .primary-navigation,
  body.phase-cooldown .primary-navigation {
    background: rgba(247, 244, 234, 0.96);
  }
}

@media (min-width: 64rem) {
  .primary-navigation {
    flex: 1;
    justify-content: flex-end;
  }
}

.page-main {
  padding-bottom: var(--space-xl);
}

.morph-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.morph-blob {
  position: absolute;
  border-radius: 45% 55% 60% 40% / 55% 45% 55% 45%;
  filter: blur(48px);
  opacity: 0.35;
  animation: morphPulse 18s ease-in-out infinite alternate;
}

.morph-blob-one {
  width: 42vw;
  height: 42vw;
  max-width: 520px;
  max-height: 520px;
  top: 8%;
  left: -8%;
  background: #6e5a9a;
}

.morph-blob-two {
  width: 38vw;
  height: 38vw;
  max-width: 460px;
  max-height: 460px;
  bottom: 5%;
  right: -6%;
  background: #4c6fa8;
  animation-delay: -6s;
}

@keyframes morphPulse {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.28;
  }
  100% {
    transform: translate3d(3%, -2%, 0) scale(1.06);
    opacity: 0.42;
  }
}

.hero-fullwidth {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0;
  position: relative;
  overflow: hidden;
}

.hero-fullwidth.section-standard {
  padding-block: 0;
}

.hero-canvas {
  position: relative;
  display: grid;
  align-items: end;
  isolation: isolate;
  min-height: min(54vh, 32rem);
}

.hero-media-slot {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
  overflow: hidden;
}

.hero-media-slot img {
  width: 100%;
  height: 100%;
  min-height: min(54vh, 32rem);
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    185deg,
    rgba(15, 15, 36, 0.2) 0%,
    rgba(15, 15, 36, 0.45) 38%,
    rgba(15, 15, 36, 0.82) 72%,
    rgba(15, 15, 36, 0.92) 100%
  );
}

.hero-stack {
  position: relative;
  display: flex;
  justify-content: center;
  z-index: 2;
  max-width: 112rem;
  margin-inline: auto;
  width: 100%;
  padding: calc(var(--space-xl) + var(--space-sm)) var(--space-md) var(--space-xl);
}

.hero-copy-block {
  max-width: 44rem;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: rgba(44, 44, 84, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(253, 245, 230, 0.22);
  box-shadow: var(--shadow-soft);
  color: var(--color-secondary);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.hero-copy-block h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  margin: 0;
  line-height: 1.15;
}

.hero-copy-block .section-heading {
  margin: 0;
}

.hero-copy-block .pill-tag,
.hero-copy-block .section-heading,
.hero-copy-block .hero-lede {
  color: inherit;
}

.hero-copy-block .hero-lede {
  font-size: 1.05rem;
  opacity: 0.94;
  margin: 0;
}

.hero-lede {
  font-size: 1.05rem;
  opacity: 0.92;
  margin: 0;
}

body.phase-peak .hero-copy-block,
body.phase-cooldown .hero-copy-block {
  background: rgba(35, 32, 52, 0.82);
  border-color: rgba(253, 245, 230, 0.28);
  color: var(--color-secondary);
}

@media (min-width: 48rem) {
  .hero-canvas {
    min-height: min(50vh, 36rem);
  }

  .hero-media-slot img {
    min-height: min(50vh, 36rem);
  }
}

@media (min-width: 64rem) {
  .grid-two .media-frame {
    max-width: 88%;
    justify-self: center;
    align-self: center;
  }

  .grid-three .product-card .media-frame {
    max-width: 92%;
    margin-inline: auto;
  }

  .mood-panel .media-frame {
    max-width: min(40rem, 100%);
  }
}

.section-standard {
  padding-block: var(--space-xl);
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0 0 var(--space-md);
}

.section-lede {
  max-width: 40rem;
  margin: 0 0 var(--space-lg);
  opacity: 0.92;
}

.grid-two {
  display: grid;
  gap: var(--space-lg);
}

@media (min-width: 48rem) {
  .grid-two {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.grid-three {
  display: grid;
  gap: var(--space-lg);
}

@media (min-width: 48rem) {
  .grid-three {
    grid-template-columns: repeat(3, 1fr);
  }
}

.glass-panel {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(253, 245, 230, 0.12);
}

.pill-tag {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  border-radius: 999px;
  border: 1px solid rgba(253, 245, 230, 0.25);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.media-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(253, 245, 230, 0.12);
}

.media-frame img {
  width: 100%;
  object-fit: cover;
}

.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid rgba(253, 245, 230, 0.25);
  background: rgba(150, 123, 182, 0.35);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.button-primary:hover {
  transform: translateY(-1px);
  background: rgba(150, 123, 182, 0.5);
}

.button-ghost {
  display: inline-flex;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: 1px dashed rgba(253, 245, 230, 0.35);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.site-footer {
  padding: var(--space-lg) var(--space-md) calc(var(--space-xl) + 2rem);
  border-top: 1px solid rgba(253, 245, 230, 0.12);
  margin-top: var(--space-xl);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  justify-content: space-between;
  align-items: flex-start;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav a {
  font-size: 0.88rem;
  text-decoration: none;
}

.footer-meta {
  font-size: 0.82rem;
  opacity: 0.85;
  max-width: 22rem;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  list-style: none;
  padding: 0;
  margin: var(--space-md) 0 0;
}

.footer-legal a {
  font-size: 0.82rem;
  text-decoration: none;
  opacity: 0.9;
}

/* Contact */
.form-grid {
  display: grid;
  gap: var(--space-md);
  max-width: 36rem;
}

.form-grid label {
  display: grid;
  gap: var(--space-xs);
  font-size: 0.92rem;
}

.form-grid input,
.form-grid textarea {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid rgba(253, 245, 230, 0.25);
  background: rgba(15, 15, 36, 0.35);
  color: inherit;
  font: inherit;
}

body.phase-peak .form-grid input,
body.phase-cooldown .form-grid input,
body.phase-peak .form-grid textarea,
body.phase-cooldown .form-grid textarea {
  background: rgba(255, 255, 255, 0.65);
  color: var(--color-primary);
}

.checkbox-row {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  font-size: 0.88rem;
}

.map-frame {
  margin-top: var(--space-lg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(253, 245, 230, 0.15);
  min-height: 16rem;
}

.map-frame iframe {
  width: 100%;
  height: 18rem;
  border: 0;
}

/* Mood portal */
.mood-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.mood-panel {
  display: none;
  animation: fadeUp 0.5s ease;
}

.mood-panel.is-visible {
  display: block;
}

.mood-trigger.is-selected,
.lumen-phase-button.is-selected {
  border-style: solid;
  background: rgba(150, 123, 182, 0.55);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Live studio presence */
.presence-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  margin-top: var(--space-md);
}

.presence-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: #c8e6c9;
  box-shadow: 0 0 12px rgba(200, 230, 200, 0.9);
  opacity: 0.35;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.presence-dot.is-active {
  opacity: 1;
  transform: scale(1.15);
}

/* Habit score composer */
.score-stage {
  margin-top: var(--space-lg);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(253, 245, 230, 0.25);
  background: rgba(15, 15, 36, 0.35);
}

body.phase-peak .score-stage,
body.phase-cooldown .score-stage {
  background: rgba(255, 255, 255, 0.45);
}

.score-rail {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-sm);
  min-height: 8rem;
  align-items: end;
}

.score-slot {
  border-radius: var(--radius-md);
  border: 1px solid rgba(253, 245, 230, 0.2);
  min-height: 4rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-sm);
  background: rgba(253, 245, 230, 0.05);
}

.score-chip {
  cursor: grab;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  background: rgba(150, 123, 182, 0.45);
  border: 1px solid rgba(253, 245, 230, 0.25);
  font-size: 0.82rem;
  text-align: center;
  touch-action: none;
}

.score-chip:active {
  cursor: grabbing;
}

.score-palette {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

/* Lumen controls */
.lumen-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.lumen-toolbar button.is-selected {
  border-style: solid;
  background: rgba(150, 123, 182, 0.55);
}

/* Products */
.product-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  height: 100%;
}

.product-price {
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Privacy overlay */
.consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: rgba(10, 10, 24, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.consent-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.consent-dialog {
  max-width: 32rem;
  width: 100%;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: rgba(44, 44, 84, 0.92);
  border: 1px solid rgba(253, 245, 230, 0.18);
  box-shadow: var(--shadow-soft);
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.page-404 {
  text-align: center;
  padding-block: var(--space-xl);
}

.thankyou-panel {
  max-width: 38rem;
  margin-inline: auto;
  text-align: center;
}

.legal-document {
  max-width: 46rem;
}

.legal-document h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-top: var(--space-lg);
}

.legal-document p,
.legal-document ul {
  font-size: 0.95rem;
}

.legal-document ul {
  padding-left: 1.2rem;
}

.date-display {
  font-size: 0.88rem;
  opacity: 0.85;
  margin-bottom: var(--space-md);
}

@media (max-width: 30rem) {
  .header-cluster {
    align-items: stretch;
  }

  .site-title-link {
    text-align: center;
  }
}
