/* Selfmology scroll story. Single visual world (sunlit photo + brand washes), so colours are set explicitly. */
:root {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sun: #FBBA1F;
  --night: #14110a;
  --cream: #fffaf0;
  --gutter: clamp(20px, 4.2vw, 64px);
  /* per-product tokens, overridden on each .detail from products.js */
  --wash-a: rgb(92 201 195 / 0.7);
  --wash-b: rgb(40 150 148 / 0.78);
  --glow: rgb(190 244 238 / 0.55);
  --deep: #0c4f4c;
  --ink: #06302e;
  --hl: rgb(251 186 31 / 0.9);
  --chip-ink: #0c4f4c;
  --fact-bg: rgb(6 48 46 / 0.78);
  --shadow: 5 70 68;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--cream); }
body { font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; background: var(--cream); color: var(--night); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: none; }

/* ---------- pinned stage ---------- */
.story { position: relative; }
.stage { position: sticky; top: 0; width: 100%; height: 100vh; height: 100svh; overflow: hidden; isolation: isolate; background: #9cc7ee; }
.layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; pointer-events: none; }
.cam { position: absolute; inset: 0; transform-origin: 52% 40%; will-change: transform; }
.clip { opacity: 0; transition: opacity 260ms linear; }
.clip.show { opacity: 1; }
.cam .poster { z-index: -1; }

/* ---------- header ---------- */
.top {
  position: absolute; z-index: 30; inset: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: calc(26px + env(safe-area-inset-top, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px)) 0 max(var(--gutter), env(safe-area-inset-left, 0px));
}
.top .logo { height: 38px; width: auto; }
.top nav { display: flex; gap: 10px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  font: 700 13px/1 'Manrope', system-ui, sans-serif; letter-spacing: -0.01em; text-decoration: none; cursor: pointer;
  color: var(--night); background: rgb(255 255 255 / 0.78); border: 1px solid rgb(255 255 255 / 0.9);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform 300ms var(--ease), background 300ms;
}
.pill:hover { transform: translateY(-1px); background: #fff; }
.pill.solid { background: var(--night); color: #fff; border-color: var(--night); }
.pill svg { width: 17px; height: 17px; flex: none; }
.icon-btn {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  color: var(--night); background: rgb(255 255 255 / 0.78); border: 1px solid rgb(255 255 255 / 0.9);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform 300ms var(--ease), background 300ms;
}
.icon-btn:hover { transform: translateY(-1px); background: #fff; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn[aria-pressed="true"] { background: var(--sun); border-color: var(--sun); }
.icon-btn[aria-pressed="true"]::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--sun);
  animation: ping 1.8s var(--ease) infinite;
}
@keyframes ping { from { opacity: 0.8; transform: scale(0.9); } to { opacity: 0; transform: scale(1.35); } }

/* ---------- intro ---------- */
.intro {
  position: absolute; z-index: 12; inset: 0; display: flex; flex-direction: column; justify-content: center;
  padding: 0 max(var(--gutter), env(safe-area-inset-right, 0px)) 0 max(var(--gutter), env(safe-area-inset-left, 0px));
  opacity: calc(1 - var(--out, 0)); transform: translateY(calc(var(--out, 0) * -60px));
  pointer-events: none; transition: visibility 0s linear 400ms; visibility: hidden;
}
.intro.on { visibility: visible; transition-delay: 0s; }
.intro.on > * { pointer-events: auto; }
.intro::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgb(255 250 240 / 0.78) 0%, rgb(255 250 240 / 0.4) 34%, transparent 58%);
}
.kicker { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #6a4a00; }
.kicker i { width: 34px; height: 2px; background: var(--sun); display: block; }
.intro h1 {
  margin-top: 18px; max-width: 9ch;
  font-size: clamp(56px, 8.4vw, 136px); font-weight: 800; letter-spacing: -0.06em; line-height: 0.88; color: var(--night);
  text-wrap: balance;
}
.intro h1 em { font-style: normal; background: linear-gradient(transparent 64%, var(--sun) 64%); }
.intro h1 span { display: inline-block; opacity: 0; transform: translateY(0.4em); filter: blur(10px); animation: rise 1100ms var(--ease) forwards; }
.intro h1 span:nth-child(2) { animation-delay: 120ms; }
.intro h1 span:nth-child(3) { animation-delay: 240ms; }
@keyframes rise { to { opacity: 1; transform: none; filter: none; } }
.ticker { position: relative; list-style: none; margin-top: 26px; height: 54px; max-width: 440px; }
.ticker li {
  position: absolute; inset: 0; display: flex; align-items: center; gap: 12px;
  font-size: 17px; line-height: 1.35; font-weight: 600; letter-spacing: -0.015em; color: #2a2414;
  opacity: 0; transform: translateY(16px); filter: blur(6px);
  transition: opacity 600ms var(--ease), transform 700ms var(--ease), filter 600ms var(--ease);
}
.ticker li.on { opacity: 1; transform: none; filter: none; }
.ticker li b { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--sun); font-size: 13px; font-weight: 800; color: var(--night); }
.cue {
  margin-top: 30px; align-self: flex-start; display: inline-flex; align-items: center; gap: 12px;
  font: 700 13px/1 'Manrope', system-ui, sans-serif; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--night); background: none; border: 0; cursor: pointer;
}
.cue .mouse { width: 22px; height: 34px; border: 2px solid currentColor; border-radius: 12px; position: relative; }
.cue .mouse::after { content: ""; position: absolute; left: 50%; top: 6px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: currentColor; animation: wheel 1.6s var(--ease) infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(-3px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(10px); } }

/* ---------- product checkpoint ---------- */
.details { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.detail { position: absolute; inset: 0; visibility: hidden; transition: visibility 0s linear 700ms; --t: 0; }
.detail.on { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.detail .scene {
  position: absolute; inset: 0; transform-origin: 52% 40%;
  opacity: 0; transform: scale(1.07);
  transition: opacity 650ms var(--ease), transform 1200ms var(--ease);
}
.detail.on .scene { opacity: 1; transform: scale(calc(1 + var(--t) * 0.035)); transition: opacity 650ms var(--ease), transform 1400ms var(--ease); }
.detail .wash {
  background:
    radial-gradient(var(--glow-size, 90% 70%) at var(--glow-pos, 70% 35%), var(--glow), transparent 60%),
    linear-gradient(160deg, var(--wash-a), var(--wash-b));
}
.detail .word {
  position: absolute; left: 0; right: 0; top: 8%;
  text-align: center; font-weight: 800; letter-spacing: -0.055em; line-height: 0.82;
  font-size: clamp(76px, 14.2vw, 240px); color: #fff; white-space: nowrap; text-transform: uppercase;
  text-shadow: 0 10px 60px rgb(var(--shadow) / 0.22);
}
.detail .word span { display: block; opacity: 0; transform: translateY(60px); filter: blur(14px); transition: opacity 900ms var(--ease), transform 1100ms var(--ease), filter 900ms var(--ease); }
.detail.on .word span { opacity: 1; transform: translateY(calc(var(--t) * -26px)); filter: none; transition-delay: 220ms; }

.detail .product {
  position: absolute; z-index: 2; right: var(--p-right, 3%); top: var(--p-top, 57%); height: var(--p-height, 76%); width: auto;
  filter: drop-shadow(0 46px 38px rgb(var(--shadow) / 0.34)) drop-shadow(0 6px 10px rgb(var(--shadow) / 0.22));
  opacity: 0; transform: translateY(-36%) rotate(calc(var(--p-rot, -1deg) + 14deg)) scale(0.82);
  transition: opacity 700ms var(--ease), transform 1300ms var(--ease);
}
.detail.on .product {
  opacity: 1; transition-delay: 380ms;
  transform: translateY(calc(-50% - var(--t) * 48px)) rotate(calc(var(--p-rot, -1deg) + var(--t) * -4deg));
}

.detail .info {
  position: absolute; z-index: 3; left: max(var(--gutter), env(safe-area-inset-left, 0px)); top: 35%; width: min(420px, 33vw);
  color: var(--ink);
}
.detail .info > * { opacity: 0; transform: translateX(-28px); transition: opacity 500ms var(--ease), transform 700ms var(--ease); }
.detail.on .info > * { opacity: 1; transform: none; }
.detail.on .info > :nth-child(1) { transition-delay: 520ms; }
.detail.on .info > :nth-child(2) { transition-delay: 600ms; }
.detail.on .info > :nth-child(3) { transition-delay: 680ms; }
.detail.on .info > :nth-child(4) { transition-delay: 760ms; }
.detail.on .info > :nth-child(5) { transition-delay: 840ms; }
.detail.on .info > :nth-child(6) { transition-delay: 920ms; }
.detail.on .info > :nth-child(7) { transition-delay: 1000ms; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--deep); }
.eyebrow i { width: 34px; height: 2px; background: var(--hl); display: block; }
.info h2 { margin-top: 14px; font-size: clamp(34px, 3.4vw, 52px); font-weight: 800; letter-spacing: -0.045em; line-height: 0.98; text-wrap: balance; }
.info h2 em { font-style: normal; background: linear-gradient(transparent 62%, var(--hl) 62%); }
.lead { margin-top: 16px; font-size: 16px; line-height: 1.45; font-weight: 500; letter-spacing: -0.015em; }
.chips { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: -0.01em;
  background: rgb(255 255 255 / 0.84); color: var(--chip-ink); border: 1px solid rgb(255 255 255 / 0.9); box-shadow: 0 6px 18px rgb(var(--shadow) / 0.12);
  opacity: 0; transform: scale(0.6); transition: opacity 400ms var(--ease), transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.detail.on .chip { opacity: 1; transform: none; transition-delay: calc(820ms + var(--i) * 90ms); }
.facts { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fact {
  padding: 12px 12px 11px; border-radius: 16px; background: var(--fact-bg); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(14px); transition: opacity 500ms var(--ease), transform 700ms var(--ease);
}
.detail.on .fact { opacity: 1; transform: none; transition-delay: calc(940ms + var(--i) * 110ms); }
.fact b { display: block; font-size: 15px; font-weight: 800; letter-spacing: -0.03em; }
.fact small { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.25; opacity: 0.85; font-weight: 500; }
.buy { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px;
  font-weight: 700; font-size: 15px; letter-spacing: -0.02em; text-decoration: none; background: #fff;
  transition: transform 300ms var(--ease), box-shadow 300ms;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgb(var(--shadow) / 0.25); }
.btn.shopee { color: #d83a1c; } .btn.tokped { color: #028a0d; }
.btn svg { width: 20px; height: 20px; flex: none; }
.note { margin-top: 12px; font-size: 12px; font-weight: 600; letter-spacing: 0.01em; color: var(--deep); opacity: 0.9; }

/* ---------- routine rail ---------- */
.rail {
  position: absolute; z-index: 25; left: max(var(--gutter), env(safe-area-inset-left, 0px)); bottom: calc(clamp(20px, 4vh, 44px) + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 18px; transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
.rail.hidden { opacity: 0; transform: translateY(12px); pointer-events: none; }
.rail-step { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; font: 700 12px/1 'Manrope', system-ui, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; color: rgb(20 17 10 / 0.55); }
.rail-step b { width: 26px; height: 6px; border-radius: 999px; background: rgb(255 255 255 / 0.6); transition: width 500ms var(--ease), background 500ms; }
.rail-step.done b { background: rgb(20 17 10 / 0.45); }
.rail-step.on { color: var(--night); }
.rail-step.on b { width: 46px; background: var(--sun); }

/* ---------- outro ---------- */
.outro {
  position: absolute; z-index: 20; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  padding: 90px max(var(--gutter), env(safe-area-inset-right, 0px)) 40px max(var(--gutter), env(safe-area-inset-left, 0px));
  background: radial-gradient(70% 60% at 50% 40%, rgb(255 236 170 / 0.8), rgb(251 186 31 / 0.88));
  opacity: 0; visibility: hidden; transition: opacity 700ms var(--ease), visibility 0s linear 700ms;
}
.outro.on { opacity: 1; visibility: visible; transition-delay: 0s; }
.outro h2 { font-size: clamp(44px, 6.4vw, 104px); font-weight: 800; letter-spacing: -0.06em; line-height: 0.9; color: var(--night); text-wrap: balance; }
.outro p { margin-top: 14px; max-width: 54ch; font-size: 17px; line-height: 1.45; font-weight: 500; color: #3a2a00; }
.outro-grid { margin-top: 34px; display: grid; grid-template-columns: repeat(4, minmax(0, 200px)); gap: 16px; }
.card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 14px 16px; border-radius: 22px;
  background: rgb(255 255 255 / 0.82); box-shadow: 0 18px 40px rgb(110 66 0 / 0.18);
  opacity: 0; transform: translateY(40px) scale(0.94);
  transition: opacity 600ms var(--ease), transform 900ms var(--ease);
}
.outro.on .card { opacity: 1; transform: none; transition-delay: calc(250ms + var(--i) * 110ms); }
.card img { height: 120px; width: auto; max-width: 100%; object-fit: contain; filter: drop-shadow(0 12px 14px rgb(110 66 0 / 0.25)); margin-bottom: 8px; }
.card-step { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #8a6200; }
.card h3 { font-size: 16px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.card-size { font-size: 12px; font-weight: 600; color: #6a5a3a; }
.card-buy { margin-top: 10px; display: flex; gap: 6px; }
.card-buy a { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px 6px 7px; border-radius: 999px; font-size: 12px; font-weight: 700; text-decoration: none; background: #fff; color: var(--night); box-shadow: inset 0 0 0 1px rgb(20 17 10 / 0.16); transition: transform 250ms var(--ease); }
.card-buy a:hover { transform: translateY(-1px); }
.card-buy svg { width: 15px; height: 15px; }
.pill.store { height: 44px; background: #fff; }
.stores { margin-top: 26px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- contact ---------- */
.contact {
  background: var(--night); color: #fff;
  padding: clamp(64px, 10vw, 120px) max(var(--gutter), env(safe-area-inset-right, 0px)) 40px max(var(--gutter), env(safe-area-inset-left, 0px));
}
.contact-inner { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.contact .kicker { color: var(--sun); }
.contact h2 { margin-top: 14px; font-size: clamp(40px, 5.2vw, 76px); font-weight: 800; letter-spacing: -0.055em; line-height: 0.92; text-wrap: balance; }
.contact-head p { margin-top: 16px; max-width: 42ch; font-size: 17px; line-height: 1.5; color: rgb(255 255 255 / 0.72); }
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.contact-card {
  display: flex; align-items: center; gap: 14px; min-width: 0; padding: 18px; border-radius: 20px;
  background: rgb(255 255 255 / 0.06); border: 1px solid rgb(255 255 255 / 0.1); color: #fff; text-decoration: none;
  transition: transform 300ms var(--ease), background 300ms, border-color 300ms;
}
a.contact-card:hover { transform: translateY(-3px); background: rgb(255 255 255 / 0.1); border-color: rgb(255 255 255 / 0.22); }
.contact-card > svg { flex: none; width: 44px; height: 44px; padding: 10px; border-radius: 14px; background: rgb(255 255 255 / 0.1); }
.contact-card span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.contact-card b { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.contact-card small { font-size: 13px; color: rgb(255 255 255 / 0.66); overflow-wrap: anywhere; }
.contact-card.wa { grid-column: 1 / -1; background: #1faa59; border-color: #1faa59; }
.contact-card.wa:hover { background: #22bb62; border-color: #22bb62; }
.contact-card.wa > svg { background: rgb(255 255 255 / 0.18); }
.contact-card.wa small { color: rgb(255 255 255 / 0.85); }
.contact-card.wa::after { content: "→"; margin-left: auto; font-size: 22px; font-weight: 700; }
.contact-card.ig > svg { background: linear-gradient(45deg, #f9a825, #e1306c 55%, #833ab4); }
.contact-card.tt > svg { background: #000; box-shadow: -2px -2px 0 #25f4ee inset, 2px 2px 0 #fe2c55 inset; }
.contact-card.mail > svg { background: var(--sun); color: var(--night); }
.contact-card.mail { grid-column: 1 / -1; order: 3; }
.selectable { user-select: all; -webkit-user-select: all; }
.copy { margin-left: auto; flex: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 0; cursor: pointer; font: 700 13px/1 'Manrope', system-ui, sans-serif; background: #fff; color: var(--night); }
.contact-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 28px; margin-top: 8px; border-top: 1px solid rgb(255 255 255 / 0.12); }
.contact-foot img { height: 30px; width: auto; filter: brightness(0) invert(1); }
.contact-foot small { font-size: 12px; color: rgb(255 255 255 / 0.5); }

/* ---------- narrow screens (proper phone composition comes after desktop approval) ---------- */
@media (max-width: 860px) {
  .top .logo { height: 30px; }
  .pill.hide-sm { display: none; }
  .intro::before { background: linear-gradient(0deg, rgb(255 250 240 / 0.9) 0%, rgb(255 250 240 / 0.55) 45%, transparent 70%); }
  .intro { justify-content: flex-end; padding-bottom: 60px; }
  .intro h1 { font-size: clamp(48px, 14vw, 80px); }
  .ticker { height: 66px; }
  .ticker li { font-size: 15px; }
  .layer, .cam video { object-position: 52% center; }
  .detail .word { top: 13%; font-size: 21vw; }
  .detail .product { height: calc(var(--p-height, 76%) * 0.42); top: 34%; right: 4%; }
  .detail .info {
    left: 0; right: 0; top: auto; bottom: 0; width: auto;
    padding: 28px max(16px, env(safe-area-inset-right, 0px)) calc(70px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    background: linear-gradient(0deg, rgb(255 255 255 / 0.92) 55%, transparent);
  }
  .lead { font-size: 14px; }
  .facts, .note { display: none; }
  .btn { height: 42px; padding: 0 16px; font-size: 14px; }
  .rail { left: max(16px, env(safe-area-inset-left, 0px)); gap: 12px; }
  .outro-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card img { height: 70px; }
  .contact-inner, .contact-grid { grid-template-columns: 1fr; }
  .top nav { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0s !important; transition-duration: 1ms !important; transition-delay: 0s !important; }
}
