@font-face {
  font-family: "Montserrat";
  src: url("./assets/montserrat-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Open Sans";
  src: url("./assets/open-sans-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --white: #fff;
  --charcoal: #343536;
  --rose: #e87da5;
  --rose-ink: #b34d77;
  --rose-tint: #fdf3f7;
  --error: #b0285e;
  --display: "Montserrat", "Avenir Next", "Segoe UI", Arial, sans-serif;
  --text: "Open Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 64px;
  --gutter: clamp(20px, 6vw, 96px);
  --view-w: min(44vw, 640px);
  --view-h: clamp(220px, 100svh - 520px, 560px);
  --meta-h: 36px;
  --cue-space: 64px;
  --butterfly-w: clamp(44px, 6vw, 72px);
  color-scheme: light;
  scroll-behavior: smooth;
  scroll-padding-top: 0;
  scroll-snap-type: none;
  scrollbar-color: rgb(52 53 54 / 0.35) transparent;
  -webkit-text-size-adjust: 100%;
}

:root[data-journey-snap] { scroll-snap-type: y mandatory; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  --bg: var(--white);
  --ink: var(--charcoal);
  --muted: #5d5e60;
  --line: rgb(52 53 54 / 0.14);
  --line-strong: rgb(52 53 54 / 0.36);
  --focus: var(--charcoal);
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}


::selection { background: #f6c9da; color: var(--charcoal); }

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

h1, h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  text-wrap: balance;
}

p { margin: 0; }

a svg, button svg, .scroll-cue svg {
  flex: none;
  width: 1.125em;
  height: 1.125em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--charcoal);
  color: var(--white);
  font: 600 0.875rem var(--display);
  text-decoration: none;
  transform: translateY(-160%);
}

.skip:focus { transform: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Header */

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: var(--header-h);
  padding: 0 var(--gutter);
  border-bottom: 1px solid #f2d8e3;
  background: var(--bg);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: inherit;
  font: 700 0.9375rem var(--display);
  letter-spacing: 0.2em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand img { display: block; width: 120px; height: auto; }
.site-footer .brand img { width: 100px; }
body[data-butterfly] .site-header .brand img { clip-path: inset(0 0 0 40%); }

/* Product journey and stage */

#product-journey { position: relative; }

.hero, .feature, .choose {
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.product-stage {
  --dx: 0px;
  --dy: calc(100svh - var(--view-h) - var(--meta-h) - var(--cue-space));
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 0;
  height: 100svh;
  pointer-events: none;
}

body[data-scene] .product-stage {
  position: sticky;
  margin-bottom: -100svh;
}

body[data-scene="fit"] .product-stage,
body[data-scene="adjust"] .product-stage,
body[data-scene="ready"] .product-stage {
  --view-w: min(53vw, 800px);
  --view-h: clamp(340px, 70svh, 760px);
  --dx: 20vw;
  --dy: calc((100svh - var(--view-h) - var(--meta-h) + var(--header-h)) / 2);
}

.stage-frame {
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--view-w);
  height: calc(var(--view-h) + var(--meta-h));
  transform: translate3d(calc(-50% + var(--dx)), var(--dy), 0);
  transition: transform 0.85s var(--ease);
}

#product-view {
  position: relative;
  height: var(--view-h);
  border-radius: 20px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body[data-scene="hero"] #product-view { pointer-events: auto; cursor: grab; }
body[data-scene="hero"] #product-view:active { cursor: grabbing; }
#product-view[data-dragging="true"] { outline: none; }

#product-canvas-host { position: absolute; inset: 0; }

#product-canvas-host canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

#model-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  perspective: 900px;
}

.fallback-object {
  position: relative;
  width: min(58%, calc(var(--view-h) * 1.1 - 40px), 320px);
  aspect-ratio: 1;
}

.fallback-shadow {
  position: absolute;
  inset: 62% 4% -18%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(52 53 54 / 0.3), transparent);
  filter: blur(8px);
}

/* Extrusion offsets follow the slab's rotation so its thickness reads straight down. */
.fallback-slab {
  position: absolute;
  inset: 0;
  border-radius: 24%;
  background: linear-gradient(145deg, #fff 0%, #fbe5ee 48%, #f3c1d4 100%);
  transform: rotateX(56deg) rotateZ(-32deg);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.9),
    -1.6px 2.5px 0 #f3bcd0,
    -3.1px 5px 0 #f0afc7,
    -4.7px 7.5px 0 #eca3be,
    -6.3px 10px 0 #e898b6,
    -7.8px 12.5px 0 #e38eae,
    -9.4px 15px 0 #dd85a6,
    -10.9px 17.5px 0 #d67c9e,
    -12.5px 20px 0 #cf7496,
    -14.1px 22.5px 0 #c86c8e,
    -15.6px 25px 0 #c06486,
    -17.2px 27.5px 0 #b85d7e,
    -18.8px 30px 0 #b05677;
}

.stage-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 14px;
  min-height: var(--meta-h);
  color: var(--muted);
  font-size: 0.78125rem;
  line-height: 1.3;
  text-align: center;
}

#reset-view {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 600 0.78125rem var(--display);
  cursor: pointer;
}

body[data-scene="hero"] #reset-view { pointer-events: auto; }

body:not([data-scene="hero"]) #interaction-hint,
body:not([data-scene="hero"]) #reset-view { visibility: hidden; }

/* Hero */

.hero {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  padding: calc(var(--header-h) + clamp(16px, 5svh, 64px)) var(--gutter) 0;
  text-align: center;
  pointer-events: none;
}

.hero-copy {
  max-width: 46rem;
  margin: 0 auto;
  pointer-events: auto;
}

h1 {
  font-weight: 700;
  font-size: clamp(2.25rem, 1.1rem + 3vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h1 span { color: var(--rose-ink); white-space: nowrap; }

.lead {
  max-width: 34rem;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.1875rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.cta-soft {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px 0 24px;
  border: 1px solid var(--rose);
  border-radius: 999px;
  background: var(--rose-tint);
  color: inherit;
  font: 600 0.9375rem var(--display);
  text-decoration: none;
  transition: border-color 0.3s var(--ease);
}

.cta-explore { border-color: var(--line-strong); background: var(--white); }
.cta-soft svg { transition: transform 0.4s var(--ease); }
.cta-soft:hover { border-color: currentColor; }
.cta-soft:hover svg { transform: translateY(3px); }

.scroll-cue {
  position: absolute;
  bottom: 18px;
  left: 50%;
  display: grid;
  color: var(--muted);
  font-size: 1.375rem;
  transform: translateX(-50%);
  transition: opacity 0.2s ease-out;
}

body[data-scrolled] .scroll-cue { opacity: 0; }

/* Features */

.feature {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding: calc(var(--header-h) + 32px) var(--gutter) 48px;
  pointer-events: none;
}

.feature-copy {
  width: min(38vw, 34rem);
  pointer-events: auto;
}


.feature h2 {
  font-size: clamp(1.75rem, 1.2rem + 2vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.feature p {
  max-width: 34rem;
  margin-top: 20px;
  color: var(--muted);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.15rem);
}

.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 24px 0 0;
  padding: 0;
  border: 0;
}

.color-picker label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font: 500 0.9375rem var(--display);
  cursor: pointer;
}

.color-picker input {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1px solid rgb(52 53 54 / 0.25);
  border-radius: 50%;
  background: var(--rose);
  cursor: inherit;
}

.color-picker input[value="blue"] { background: #529bc5; }
.color-picker input[value="purple"] { background: #9c72c7; }
.color-picker input:checked { outline: 1px solid var(--charcoal); outline-offset: 3px; }
.color-picker input:focus-visible { outline: 3px solid var(--charcoal); }
.color-picker label:has(:disabled) { opacity: 0.5; cursor: default; }

/* One source butterfly follows the journey, then stays with the order heading. */

.butterfly-stop { position: absolute; }
#fit .butterfly-stop { left: 44%; top: 24%; }
#adjust .butterfly-stop { left: 89%; top: 76%; }
#ready .butterfly-stop { left: 48%; top: 27%; }

#butterfly-perch {
  position: relative;
  width: var(--butterfly-w);
  aspect-ratio: 108 / 132;
  margin: 0 auto 28px;
}

#butterfly-flight {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

#butterfly-flight img { display: block; width: 266.6667%; height: auto; max-width: none; }

#butterfly-flight[data-flying] {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 11;
  width: var(--butterfly-w);
  height: auto;
  aspect-ratio: 108 / 132;
}

/* Closing order preview */

.choose,
.site-footer {
  --bg: var(--white);
  --ink: var(--charcoal);
  --muted: #5d5e60;
  --line: rgb(52 53 54 / 0.14);
  --line-strong: rgb(52 53 54 / 0.36);
  --focus: var(--charcoal);
  position: relative;
  z-index: 1;
  background: var(--bg);
  color: var(--ink);
}

.choose { padding: clamp(96px, 16svh, 176px) var(--gutter) 48px; }

.choose h2 {
  max-width: 11ch;
  margin: 0 auto;
  font-size: clamp(2.5rem, 1.4rem + 4.4vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-align: center;
}

#order-preview {
  display: grid;
  gap: 28px;
  max-width: 34rem;
  margin: clamp(40px, 6svh, 64px) auto 0;
}

.options {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend,
.quantity label {
  display: block;
  margin-bottom: 12px;
  padding: 0;
  font: 600 0.9375rem var(--display);
}

.option {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}

.option:hover { border-color: rgb(52 53 54 / 0.6); }

.option:has(input:checked) {
  border-color: var(--ink);
  background: var(--rose-tint);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.option:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }

.option input {
  appearance: none;
  display: grid;
  place-content: center;
  grid-row: span 2;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  outline: none;
}

.option input::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink);
  transform: scale(0);
  transition: transform 0.25s var(--ease);
}

.option input:checked::before { transform: scale(1); }

.option-name { font: 600 1.0625rem/1.3 var(--display); }
.option-detail { color: var(--muted); font-size: 0.9375rem; }

.is-invalid .option,
.is-invalid .stepper { border-color: var(--error); }

.field-error {
  margin-top: 8px;
  color: var(--error);
  font-size: 0.875rem;
  font-weight: 600;
}

.stepper {
  display: inline-grid;
  grid-template-columns: 48px 72px 48px;
  align-items: center;
  height: 52px;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

.stepper button {
  display: grid;
  place-items: center;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 1.125rem;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), opacity 0.2s var(--ease);
}

.stepper button:hover:not(:disabled) { background: rgb(52 53 54 / 0.07); }
.stepper button:disabled { opacity: 0.32; cursor: default; }

.stepper input {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  caret-color: var(--ink);
  font: 600 1.0625rem var(--display);
  font-variant-numeric: tabular-nums;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }

.summary {
  margin: 0;
  border-block: 1px solid var(--line);
}

.summary div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.summary div + div { border-top: 1px solid var(--line); }
.summary dt { color: var(--muted); }

.summary dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.cta-strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--rose);
  color: var(--charcoal);
  font: 600 1.0625rem var(--display);
  cursor: pointer;
  box-shadow: 0 10px 24px -12px rgb(176 40 94 / 0.55);
  transition: background-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.cta-strong svg { transition: transform 0.4s var(--ease); }
.cta-strong:hover { background: #ee93b5; }
.cta-strong:hover svg { transform: translateX(3px); }
.cta-strong:active { transform: translateY(1px); }

#order-result:empty { display: none; }

#order-result {
  margin-top: -12px;
  font-weight: 600;
  text-align: center;
}

.demo-note {
  margin-top: -16px;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

/* Product discovery stays in the freely scrolling part of the page. */

.explore {
  padding: clamp(64px, 10svh, 112px) var(--gutter);
  border-top: 1px solid var(--line);
}

.explore-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.explore h2 { font-size: clamp(1.75rem, 1.2rem + 2vw, 3.25rem); line-height: 1.08; letter-spacing: -0.025em; }
.carousel-controls { display: flex; flex: none; gap: 8px; }

.carousel-controls button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
}

.carousel-controls button:hover:not(:disabled) { background: var(--rose-tint); }
.carousel-controls button:disabled { opacity: 0.3; cursor: default; }

.product-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(80vw, 34rem);
  gap: 24px;
  overflow-x: auto;
  margin: 0;
  padding: 4px 4px 16px;
  list-style: none;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 4px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}

.product-carousel li { min-width: 0; scroll-snap-align: start; }
.product-carousel a { display: block; color: inherit; text-decoration: none; }
.product-carousel a:hover h3 { text-decoration: underline; text-underline-offset: 5px; }
.product-image { aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.product-image img { display: block; width: 100%; height: 100%; padding: 24px; object-fit: contain; }
.product-carousel h3 { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 20px 0 4px; font: 600 1.375rem/1.3 var(--display); }
.product-carousel p { color: var(--muted); }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 28px var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8125rem;
}

.site-footer .brand { color: var(--ink); font-size: 0.8125rem; }

/* Mobile: text on top, model in the lower viewport. */

@media (max-width: 759px) {
  :root {
    --header-h: 56px;
    --view-w: calc(100vw - 2 * var(--gutter));
    --view-h: clamp(190px, 100svh - 500px, 360px);
    --meta-h: 48px;
    --cue-space: 44px;
  }

  body[data-scene="fit"] .product-stage,
  body[data-scene="adjust"] .product-stage,
  body[data-scene="ready"] .product-stage {
    --view-w: calc(100vw - 32px);
    --view-h: clamp(190px, 100svh - 410px, 430px);
    --dx: 0px;
    --dy: calc(100svh - var(--view-h) - var(--meta-h) - 16px);
  }

  .site-header .brand img { width: 104px; }
  .hero { padding-top: calc(var(--header-h) + clamp(12px, 4svh, 40px)); }
  .lead { margin-top: 16px; }
  .hero-actions { margin-top: 24px; }
  .scroll-cue { bottom: 12px; }
  #fit .butterfly-stop { left: 86%; top: 47%; }
  #adjust .butterfly-stop { left: 14%; top: 52%; }
  #ready .butterfly-stop { left: 86%; top: 48%; }

  .feature {
    align-items: flex-start;
    padding-top: calc(var(--header-h) + 24px);
  }

  .feature-copy { width: auto; }
  .site-footer { flex-direction: column; }
  .explore-header { align-items: flex-end; gap: 16px; }
  .product-image img { padding: 16px; }
}

/* Short desktop windows: keep the headline and model apart. */

@media (min-width: 760px) and (max-height: 700px) {
  :root {
    --view-h: clamp(180px, 100svh - 440px, 260px);
    --cue-space: 24px;
  }

  h1 { font-size: clamp(2rem, 7svh, 3rem); }
  .scroll-cue { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  :root, :root[data-journey-snap] { scroll-behavior: auto; scroll-snap-type: none; }
  .product-carousel { scroll-behavior: auto; }

  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}
