/* ==========================================================================
   Lumora One — product page
   Mobile-first. Breakpoints: 640px, 768px, 992px, 1280px.
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------ */

:root {
  /* Colors */
  --color-bg: #fbfaff;
  --color-surface: #ffffff;
  --color-surface-muted: #f3f0fd;
  --color-border: #e7e3f3;
  --color-text: #16141f;
  --color-text-muted: #5b5870;
  --color-text-subtle: #75728a;
  --color-primary: #5146e5;
  --color-primary-strong: #3f33c4;
  --color-accent: #7c5cff;
  --color-on-primary: #ffffff;
  --color-focus: #7c5cff;
  --color-backdrop: rgb(22 20 31 / 0.5);

  --color-success: #157347;
  --color-success-bg: #ebfaf1;
  --color-info: #1f4fd1;
  --color-info-bg: #eef3ff;
  --color-error: #b42318;
  --color-error-bg: #fef1f0;

  /* Typography */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: clamp(17px, 16px + 0.3vw, 20px);
  --text-xl: clamp(22px, 17.6px + 1.2vw, 32px);
  --text-section: clamp(28px, 19.2px + 2.4vw, 48px);
  --text-hero: clamp(44px, 22.4px + 6.5vw, 104px);

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --container-max: 1200px;
  --container-padding: clamp(16px, 4vw, 40px);
  --header-height: 64px;

  /* Radii */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgb(22 20 31 / 0.04), 0 4px 16px rgb(22 20 31 / 0.04);
  --shadow-md: 0 2px 6px rgb(22 20 31 / 0.05), 0 16px 40px rgb(63 51 196 / 0.1);
  --shadow-lg: 0 24px 64px rgb(22 20 31 / 0.18);
  --shadow-button: 0 8px 24px rgb(81 70 229 / 0.3);
  --shadow-button-hover: 0 12px 32px rgb(81 70 229 / 0.4);

  /* Motion */
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 700ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
}

/* --- Base --------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
  /* Keeps the layout from shifting when the modal locks scrolling. */
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

main {
  flex: 1;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

html.is-scroll-locked {
  overflow: hidden;
}

/* --- Utilities ---------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

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

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-text);
  color: var(--color-surface);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--duration-fast) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* --- Buttons ------------------------------------------------------------ */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-3) var(--space-5);
  border: 0;
  border-radius: var(--radius-pill);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-position var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    opacity var(--duration-fast) linear;
}

.button--primary {
  background-image: linear-gradient(120deg, var(--color-accent), var(--color-primary) 50%, var(--color-primary-strong));
  background-size: 200% 100%;
  background-position: 0 0;
  color: var(--color-on-primary);
  box-shadow: var(--shadow-button);
}

.button--primary:hover:not(:disabled) {
  background-position: 100% 0;
  box-shadow: var(--shadow-button-hover);
  transform: translateY(-1px);
}

.button--primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  box-shadow: none;
}

.button--small {
  min-height: 36px;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

.button--large {
  min-height: 52px;
  padding: var(--space-3) var(--space-6);
  font-size: 17px;
}

.button--block {
  width: 100%;
}

.button__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.button.is-loading .button__spinner {
  display: inline-block;
}

/* --- Header ------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: rgb(251 250 255 / 0.8);
  border-bottom: 1px solid rgb(231 227 243 / 0.7);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: var(--header-height);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
  text-decoration: none;
}

.logo__mark {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
}

.site-nav {
  margin-left: auto;
}

.site-nav__list {
  display: flex;
  gap: var(--space-1);
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--duration-fast) linear, background-color var(--duration-fast) linear;
}

.site-nav__link:hover {
  color: var(--color-text);
  background-color: var(--color-surface-muted);
}

/* On small phones the hero CTA is right below the header. */
.site-header__cta {
  display: none;
}

/* --- Hero --------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-7) var(--space-8);
  /* Full-width background; the glows are anchored to the centered content,
     so they stay next to it on very wide screens. */
  background:
    radial-gradient(960px 640px at calc(50% + min(35%, 480px)) 20%, rgb(185 164 255 / 0.28), transparent 60%),
    radial-gradient(576px 416px at calc(50% - min(42%, 544px)) 65%, rgb(124 200 255 / 0.16), transparent 60%);
}

.hero__inner {
  display: grid;
  gap: var(--space-7);
  align-items: center;
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fade-up var(--duration-slow) var(--ease-out) both;
}

.hero__eyebrow {
  margin-bottom: var(--space-3);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background-color: var(--color-surface-muted);
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.56px;
  text-transform: uppercase;
}

.hero__title {
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 1;
  letter-spacing: calc(var(--text-hero) * -0.035);
  background-image: linear-gradient(120deg, var(--color-text) 30%, var(--color-primary) 75%, var(--color-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* Keeps descenders inside the clipped background. */
  padding-bottom: calc(var(--text-hero) * 0.08);
}

.hero__tagline {
  margin-top: var(--space-3);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: calc(var(--text-xl) * -0.015);
}

.hero__text {
  max-width: 544px;
  margin-top: var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-lg);
}

.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.hero__note {
  color: var(--color-text-subtle);
  font-size: var(--text-sm);
}

.hero__media {
  display: flex;
  justify-content: center;
  animation: fade-in var(--duration-slow) var(--ease-out) 150ms both;
}

.hero__image {
  width: min(100%, 416px);
  filter: drop-shadow(0 30px 40px rgb(63 51 196 / 0.15));
  animation: float 8s ease-in-out 1s infinite;
}

/* Color swatches */

.swatches {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--color-surface);
  box-shadow: 0 0 0 1px var(--color-border), var(--shadow-sm);
}

.swatch--lilac { background-color: #cdbff3; }
.swatch--mist { background-color: #c9e3f5; }
.swatch--sand { background-color: #eadfcc; }
.swatch--graphite { background-color: #3a3846; }

/* --- Highlights --------------------------------------------------------- */

.highlights {
  padding-block: var(--space-8) var(--space-9);
}

.section-title {
  max-width: 20ch;
  margin-inline: auto;
  font-size: var(--text-section);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: calc(var(--text-section) * -0.025);
  text-align: center;
}

.highlights__list {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-7);
}

.feature-card {
  padding: var(--space-6) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-card__icon {
  width: 48px;
  height: 48px;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background-color: var(--color-surface-muted);
  color: var(--color-primary);
}

.feature-card__title {
  margin-top: var(--space-5);
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.2px;
}

.feature-card__text {
  margin-top: var(--space-2);
  color: var(--color-text-muted);
}

/* --- Footer ------------------------------------------------------------- */

.site-footer {
  padding-block: var(--space-6);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-subtle);
  font-size: var(--text-sm);
  text-align: center;
}

/* --- Modal -------------------------------------------------------------- */

.modal {
  width: calc(100% - 2 * var(--space-4));
  max-width: 448px;
  max-height: calc(100% - 2 * var(--space-4));
  padding: 0;
  border: 0;
  border-radius: var(--radius-xl);
  background: transparent;
  color: var(--color-text);
  overflow: visible;
}

.modal[open] {
  animation: modal-in var(--duration-base) var(--ease-out);
}

.modal::backdrop {
  background-color: var(--color-backdrop);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal[open]::backdrop {
  animation: fade-in var(--duration-base) var(--ease-out);
}

.modal.is-closing {
  animation: modal-out var(--duration-fast) var(--ease-in) forwards;
}

.modal.is-closing::backdrop {
  animation: fade-out var(--duration-fast) var(--ease-in) forwards;
}

.modal__panel {
  position: relative;
  max-height: calc(100vh - 2 * var(--space-4));
  max-height: calc(100dvh - 2 * var(--space-4));
  overflow-y: auto;
  padding: var(--space-7) var(--space-5) var(--space-5);
  border-radius: inherit;
  background-color: var(--color-surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.modal__close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: var(--color-surface-muted);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background-color var(--duration-fast) linear, color var(--duration-fast) linear;
}

.modal__close:hover {
  background-color: var(--color-border);
  color: var(--color-text);
}

.modal__close svg {
  width: 20px;
  height: 20px;
}

.modal__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-inline: auto;
  border-radius: var(--radius-lg);
  background-image: linear-gradient(135deg, var(--color-accent), var(--color-primary));
  color: var(--color-on-primary);
  box-shadow: var(--shadow-button);
}

.modal__icon svg {
  width: 28px;
  height: 28px;
}

.modal__title {
  margin-top: var(--space-5);
  font-size: clamp(22px, 19.2px + 0.8vw, 26px);
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.modal__text {
  margin-top: var(--space-3);
  color: var(--color-text-muted);
}

/* --- Subscription form -------------------------------------------------- */

.notify-form {
  display: flex;
  flex-direction: column;
  margin-top: var(--space-5);
  text-align: left;
}

.notify-form__label {
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
}

.notify-form__input {
  width: 100%;
  min-height: 52px;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  /* 16px+ prevents iOS from zooming into the field. */
  font-size: 16px;
  transition: border-color var(--duration-fast) linear, box-shadow var(--duration-fast) linear;
}

.notify-form__input::placeholder {
  color: var(--color-text-subtle);
}

.notify-form__input:hover {
  border-color: #cdc7e3;
}

.notify-form__input:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgb(124 92 255 / 0.2);
}

.notify-form__input[aria-invalid="true"] {
  border-color: var(--color-error);
}

.notify-form__input[aria-invalid="true"]:focus-visible {
  box-shadow: 0 0 0 4px rgb(180 35 24 / 0.15);
}

.notify-form__input:disabled {
  background-color: var(--color-surface-muted);
  cursor: not-allowed;
}

.notify-form__error {
  min-height: 24px;
  margin-top: var(--space-1);
  color: var(--color-error);
  font-size: var(--text-sm);
}

.notify-form__submit {
  margin-top: var(--space-2);
}

.notify-form__note {
  margin-top: var(--space-4);
  color: var(--color-text-subtle);
  font-size: var(--text-sm);
  text-align: center;
}

.form-alert {
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background-color: var(--color-error-bg);
  color: var(--color-error);
  font-size: var(--text-sm);
  font-weight: 500;
}

/* --- Toast notifications ------------------------------------------------ */

.toast-region {
  position: fixed;
  inset: auto var(--space-4) var(--space-4);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--toast-color);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in var(--duration-base) var(--ease-out);
}

.toast.is-leaving {
  animation: fade-out var(--duration-base) var(--ease-in) forwards;
}

.toast--success {
  --toast-color: var(--color-success);
  --toast-bg: var(--color-success-bg);
}

.toast--info {
  --toast-color: var(--color-info);
  --toast-bg: var(--color-info-bg);
}

.toast--error {
  --toast-color: var(--color-error);
  --toast-bg: var(--color-error-bg);
}

.toast__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 6px;
  border-radius: 50%;
  background-color: var(--toast-bg);
  color: var(--toast-color);
}

.toast__body {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.toast__title {
  font-weight: 600;
  line-height: 1.4;
}

.toast__message {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.toast__close {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-subtle);
  cursor: pointer;
  transition: background-color var(--duration-fast) linear;
}

.toast__close:hover {
  background-color: var(--color-surface-muted);
  color: var(--color-text);
}

.toast__close svg {
  width: 16px;
  height: 16px;
}

/* --- Animations --------------------------------------------------------- */

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes fade-out {
  to { opacity: 0; }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

@keyframes float {
  50% { transform: translateY(-12px); }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
}

@keyframes modal-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes toast-in-side {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Responsive --------------------------------------------------------
   Mobile first. Required breakpoints: 440 / 640 (mobile), 768 / 992 (tablet),
   1024 / 1920 (desktop). 1280px is an extra step for wide laptops.
   ------------------------------------------------------------------------ */

/* Mobile, large phones: more breathing room. */
@media (min-width: 440px) {
  .site-nav__link {
    padding-inline: var(--space-3);
  }

  .swatches {
    gap: var(--space-4);
  }

  .swatch {
    width: 24px;
    height: 24px;
  }

  .feature-card {
    padding: var(--space-6);
  }

  .modal__panel {
    padding: var(--space-7) var(--space-6) var(--space-6);
  }
}

/* Mobile, landscape / small tablets: header CTA, inline hero actions, side toasts. */
@media (min-width: 640px) {
  .site-nav__list {
    gap: var(--space-2);
  }

  .site-header__cta {
    display: inline-flex;
  }

  .hero__actions {
    flex-direction: row;
    gap: var(--space-5);
  }

  .modal__panel {
    padding: var(--space-8) var(--space-7) var(--space-6);
  }

  .toast-region {
    /* Aligned with the right edge of the centered content on wide screens. */
    inset: calc(var(--header-height) + var(--space-4))
      max(var(--space-5), calc((100% - var(--container-max)) / 2 + var(--container-padding))) auto auto;
    width: 384px;
  }

  .toast {
    animation-name: toast-in-side;
  }
}

/* Tablet, portrait: three feature cards in a row, larger phone image. */
@media (min-width: 768px) {
  .hero {
    padding-block: var(--space-8) var(--space-9);
  }

  .highlights__list {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
  }

  .feature-card {
    padding: var(--space-5);
  }

  .feature-card__title {
    font-size: 18px;
  }

  .hero__image {
    width: min(100%, 480px);
  }
}

/* Tablet, landscape: two-column hero; the text column gets a little more room. */
@media (min-width: 992px) {
  .hero {
    padding-block: var(--space-8);
  }

  .hero__inner {
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--space-5);
  }

  .hero__content {
    align-items: flex-start;
    text-align: left;
  }

  .hero__actions {
    align-items: center;
  }

  .hero__image {
    width: 100%;
    max-width: 448px;
  }

  .highlights__list {
    gap: var(--space-5);
  }
}

/* Desktop: taller header, full-height hero, balanced columns. */
@media (min-width: 1024px) {
  :root {
    --header-height: 72px;
  }

  .logo {
    font-size: 20px;
  }

  .site-nav__link {
    font-size: var(--text-base);
  }

  .hero {
    display: flex;
    align-items: center;
    min-height: min(calc(100vh - var(--header-height)), 960px);
  }

  .hero__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-7);
  }

  .hero__image {
    max-width: 544px;
  }

  .feature-card {
    padding: var(--space-7) var(--space-6);
  }

  .feature-card__title {
    font-size: 20px;
  }
}

/* Wide laptops (extra step). */
@media (min-width: 1280px) {
  .hero__inner {
    grid-template-columns: 1.05fr 1fr;
    gap: var(--space-8);
  }

  .hero__image {
    max-width: 608px;
  }
}

/* Large desktop: wider content and larger type. Wider screens keep this
   layout and only add side space, so the content stays centered. */
@media (min-width: 1920px) {
  :root {
    --container-max: 1320px;
    --text-hero: 120px;
    --text-section: 56px;
    --text-lg: 22px;
  }

  .hero__text {
    max-width: 608px;
  }

  .hero__image {
    max-width: 672px;
  }

  .highlights__list {
    gap: var(--space-6);
  }
}

/* --- Reduced motion ----------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .button__spinner {
    /* Keep a static indicator instead of spinning. */
    border-right-color: currentColor;
    opacity: 0.6;
  }
}
