:root {
  --bg: #FBF7EF;
  --bg-2: #F3EDE1;
  --ink: #17140F;
  --muted: #6B645A;
  --line: rgba(23, 20, 15, 0.12);
  --lav: #C8B6FF;
  --pink: #FF9EC1;
  --lime: #D9F36B;
  --tang: #FF8A5B;
  --sky: #9ED8FF;
  --mint: #A8EBC9;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --hand: "Caveat", "Segoe Print", cursive;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  position: relative;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--lime); color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* film grain for warmth */
.grain {
  position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: .32; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .35 0 0 0 0 .3 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* first screen wrapper: its own stacking context so notes can pass behind the blob */
.top { position: relative; isolation: isolate; padding-bottom: 8px; overflow-x: clip; }

/* soft chromatic wash behind the first screen */
.top::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(40% 35% at 18% 78%, rgba(255, 158, 193, .22), transparent 70%),
    radial-gradient(35% 30% at 85% 70%, rgba(158, 216, 255, .25), transparent 70%),
    radial-gradient(30% 25% at 50% 95%, rgba(217, 243, 107, .22), transparent 70%);
}

#blob {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  z-index: 1; pointer-events: none; display: block;
}
.fallback-blob {
  position: absolute; z-index: 1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 35% 30%, #fff 0, var(--pink) 22%, var(--lav) 48%, var(--sky) 70%, var(--lime) 100%);
  filter: blur(2px); animation: morph 9s ease-in-out infinite;
}
@keyframes morph { 0%,100% { border-radius: 52% 48% 45% 55% / 50% 55% 45% 50%; } 50% { border-radius: 45% 55% 58% 42% / 55% 45% 55% 45%; } }

/* nav */
.nav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(16px, 4vw, 48px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -.01em; font-size: 17px; }
.brand-logo { display: block; height: 32px; width: auto; transition: transform .5s var(--ease); }
.brand:hover .brand-logo { transform: translateY(-1px); }
.nav-pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500;
  padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.6); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.nav-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tang); color: rgba(255,138,91,.6); animation: ping 2.2s infinite; }

main { position: relative; overflow-x: clip; }

/* hero */
.hero {
  position: relative; z-index: 3; text-align: center;
  padding: clamp(104px, 15vh, 150px) 16px 0;
}
.eyebrow {
  margin: 0 0 18px; font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
.headwrap { position: relative; display: inline-block; }
.headline {
  margin: 0; font-family: var(--serif); font-weight: 400; letter-spacing: -.02em;
  font-size: clamp(48px, 8.4vw, 118px); line-height: .95;
}
.headline .line { display: block; }
.headline em { font-style: italic; }
.sub {
  max-width: 520px; margin: 22px auto 0; color: var(--muted); font-size: clamp(15px, 1.4vw, 17px);
}
.status {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 22px;
  padding: 11px 20px; border-radius: 999px; background: var(--ink); color: var(--bg);
  font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px -12px rgba(23,20,15,.45);
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); color: rgba(217,243,107,.7); animation: ping 1.8s infinite; }

/* handwritten note */
.note {
  position: absolute; right: -150px; top: -46px; color: var(--tang);
  display: flex; flex-direction: column; align-items: flex-start; transform: rotate(-7deg);
}
.note-text {
  font-family: var(--hand); font-weight: 700; font-size: clamp(30px, 3vw, 40px); line-height: 1;
  clip-path: inset(0 100% 0 0); animation: write 1.3s steps(14, end) forwards; animation-delay: 1.5s;
}
.note-arrow { width: 96px; height: 56px; margin-left: -46px; transform: scaleX(-1) rotate(12deg); }
.note-arrow path { stroke-dasharray: 200; stroke-dashoffset: 200; animation: draw 1s var(--ease) forwards; animation-delay: 2.5s; }

/* rotating curved badge */
.badge {
  position: absolute; z-index: 3; left: clamp(16px, 7vw, 120px); top: 50%; margin-top: -75px; width: 150px; height: 150px;
  font-family: var(--hand); font-size: 19px; font-weight: 700; color: var(--ink); opacity: .75;
  animation: spin 22s linear infinite;
}
.badge svg { width: 100%; height: 100%; overflow: visible; }
.badge text { fill: currentColor; letter-spacing: .06em; }

/* invisible grab handle over the blob */
.blob-hit {
  position: absolute; z-index: 2; border-radius: 50%; cursor: grab;
  touch-action: pan-y; -webkit-tap-highlight-color: transparent; user-select: none;
}
.blob-hit.dragging { cursor: grabbing; }

/* stage for the 3D blob and floating thoughts */
.stage { position: relative; height: clamp(440px, 62vh, 640px); pointer-events: none; }
.blob-shadow {
  position: absolute; z-index: 0; left: 50%; width: 300px; height: 40px; transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(23,20,15,.22), transparent 70%); filter: blur(6px);
}

/* floating thought chips */
.chip {
  position: absolute; left: 0; top: 0; z-index: 3; white-space: nowrap; will-change: transform, opacity;
  font-family: var(--hand); font-weight: 700; font-size: 22px; line-height: 1; color: var(--ink);
  padding: 10px 16px 11px; border-radius: 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 12px 26px -14px rgba(23,20,15,.45);
}

/* sorted card */
.sorted {
  position: absolute; right: clamp(16px, 5vw, 80px); top: 50%; margin-top: -110px; z-index: 4; width: 230px;
  padding: 16px 18px 12px; border-radius: 20px; background: rgba(255,255,255,.72); border: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 24px 50px -28px rgba(23,20,15,.4);
  transform: rotate(2deg);
}
.sorted-title { margin: 0 0 8px; font-family: var(--serif); font-style: italic; font-size: 22px; }
.sorted ul { list-style: none; margin: 0; padding: 0; min-height: 132px; }
.sorted li {
  display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; border-top: 1px solid var(--line);
  animation: slidein .6s var(--ease) both;
}
.sorted li:first-child { border-top: 0; }
.tick { flex: none; width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; }
.tick svg { width: 12px; height: 12px; }
.tag { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }

/* the overlay pop-up, a nod to the product */
.overlay {
  position: relative; z-index: 6; margin: -36px auto 0;
  width: min(580px, calc(100% - 32px));
  display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 18px; border-radius: 999px;
  background: rgba(255,255,255,.74); border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 30px 60px -30px rgba(23,20,15,.5), 0 0 0 6px rgba(255,255,255,.35);
  transition: box-shadow .4s var(--ease), transform .4s var(--ease);
}
.overlay:focus-within { box-shadow: 0 30px 60px -30px rgba(23,20,15,.55), 0 0 0 6px rgba(200,182,255,.45); transform: translateY(-2px); }
.mic { display: inline-flex; align-items: center; gap: 3px; height: 22px; }
.mic i { display: block; width: 3px; height: 8px; border-radius: 3px; animation: wave 1.1s var(--ease) infinite; }
.mic i:nth-child(1) { background: var(--lav); animation-delay: 0s; }
.mic i:nth-child(2) { background: var(--pink); animation-delay: .12s; }
.mic i:nth-child(3) { background: var(--tang); animation-delay: .24s; }
.mic i:nth-child(4) { background: var(--lime); animation-delay: .36s; }
.mic i:nth-child(5) { background: var(--sky); animation-delay: .48s; }
.overlay input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink);
  font: 500 15px/1.2 var(--sans); padding: 10px 0;
}
.overlay input::placeholder { color: #8C857A; }
.overlay button {
  flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--ink); color: var(--bg); display: grid; place-items: center;
  transition: transform .3s var(--ease), background .3s;
}
.overlay button:hover { transform: rotate(-12deg) scale(1.06); background: #2A251D; }
.overlay button:focus-visible { outline: 3px solid var(--lav); outline-offset: 3px; }
.overlay button svg { width: 20px; height: 20px; }
.toast {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 10px); margin: 0; text-align: center;
  font-family: var(--hand); font-weight: 700; font-size: 26px; color: var(--ink);
  opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s var(--ease); pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }

/* tilted marquee ribbon */
.ribbon {
  position: relative; z-index: 3; margin-top: 90px; padding: 14px 0;
  background: var(--ink); color: var(--bg); transform: rotate(-2.2deg); overflow: hidden;
  box-shadow: 0 20px 40px -24px rgba(23,20,15,.6);
}
.ribbon-track { display: flex; gap: 28px; width: max-content; align-items: center; animation: marquee 38s linear infinite; }
.ribbon span { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2.6vw, 34px); white-space: nowrap; }
.ribbon b { font-size: 18px; font-weight: 400; }
.ribbon b:nth-of-type(3n+1) { color: var(--lime); }
.ribbon b:nth-of-type(3n+2) { color: var(--pink); }
.ribbon b:nth-of-type(3n) { color: var(--sky); }

/* the loop */
.loop {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  max-width: 1100px; margin: 110px auto 0; padding: 0 clamp(16px, 4vw, 48px);
}
.step {
  position: relative; padding: 28px 26px 30px; border-radius: 28px; background: var(--bg-2);
  border: 1px solid var(--line); transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.step:hover { transform: translateY(-6px) rotate(-.6deg); box-shadow: 0 28px 50px -30px rgba(23,20,15,.45); }
.step-num { font-family: var(--hand); font-weight: 700; font-size: 46px; line-height: 1; }
.step:nth-child(1) .step-num { color: var(--tang); }
.step:nth-child(2) .step-num { color: #9A7BFF; }
.step:nth-child(3) .step-num { color: #6BAF2E; }
.step h2 { margin: 10px 0 8px; font-family: var(--serif); font-weight: 400; font-size: 40px; letter-spacing: -.01em; line-height: 1; }
.step p { margin: 0; color: var(--muted); }

.foot {
  position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  max-width: 1100px; margin: 90px auto 0; padding: 26px clamp(16px, 4vw, 48px) 36px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 13px;
}
.foot-hand { font-family: var(--hand); font-weight: 700; font-size: 22px; color: var(--ink); }

/* motion */
.reveal { opacity: 0; filter: blur(12px); transform: translateY(18px); animation: rise 1.1s var(--ease) forwards; animation-delay: calc(var(--d) * 130ms + 150ms); }
.note.reveal { transform: rotate(-7deg) translateY(18px); animation-name: rise-note; }
@keyframes rise { to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes rise-note { to { opacity: 1; filter: blur(0); transform: rotate(-7deg); } }
@keyframes write { to { clip-path: inset(0 0 0 0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes wave { 0%, 100% { height: 6px; } 50% { height: 20px; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 currentColor; } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
@keyframes slidein { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

/* responsive */
@media (max-width: 1100px) {
  .note { right: -40px; top: -64px; }
}
@media (max-width: 960px) {
  .sorted { display: none; }
  .badge { width: 110px; height: 110px; font-size: 16px; margin-top: -55px; top: 78%; }
}
@media (max-width: 720px) {
  .eyebrow { margin-bottom: 54px; }
  .note { right: 0; top: -58px; }
  .note-arrow { width: 70px; height: 42px; margin-left: -24px; }
  .badge { display: none; }
  .loop { grid-template-columns: 1fr; margin-top: 80px; }
  .foot { justify-content: center; text-align: center; }
  .chip { font-size: 18px; padding: 8px 12px 9px; }
  .stage { height: clamp(380px, 56vh, 480px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal, .note-text, .note-arrow path { animation-delay: 0s !important; }
}
