/* Product pages (/products/, /madrichon/, /albummaker/, /clock/, /clinic/): shared layout + motion.
   Each page sets its accent on <body class="prod" style="--accent:..;--accent-soft:..">. */

body.prod { --accent-2: color-mix(in srgb, var(--accent) 55%, #6c5ce7); }
body.prod main { overflow-x: clip; } /* side-slide reveals and device shadows never widen the page */

/* ---------- hero ---------- */
.prod-hero { position: relative; padding: 64px 0 80px; background: var(--accent-soft); border-bottom: 1px solid var(--line); overflow: hidden; isolation: isolate; }
.prod-hero .blob { position: absolute; z-index: -1; border-radius: 50%; filter: blur(60px); opacity: .55; animation: blob 18s ease-in-out infinite alternate; }
.prod-hero .blob.b1 { width: 520px; height: 520px; background: color-mix(in srgb, var(--accent) 45%, white); inset-inline-end: -120px; top: -160px; }
.prod-hero .blob.b2 { width: 420px; height: 420px; background: #dfe4ff; inset-inline-start: -140px; bottom: -200px; animation-delay: -6s; }
.prod-hero .blob.b3 { width: 260px; height: 260px; background: color-mix(in srgb, var(--accent-2) 40%, white); inset-inline-start: 40%; top: 10%; animation-delay: -11s; opacity: .35; }
@keyframes blob { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(40px, 30px) scale(1.12); } 100% { transform: translate(-30px, 10px) scale(.95); } }
.prod-hero h1 { font-size: clamp(2.6rem, 6vw, 4.3rem); line-height: 1.05; margin-bottom: 10px; }
.prod-hero h1 .tag { display: block; font-size: clamp(1.2rem, 2.6vw, 1.75rem); color: var(--accent); margin-top: 12px; font-weight: 700; }
.prod-hero .lead { max-width: 640px; }

/* entrance: children of [data-enter] rise in one after another */
[data-enter] > * { opacity: 0; transform: translateY(22px); animation: rise .8s cubic-bezier(.2, .8, .2, 1) forwards; }
[data-enter] > *:nth-child(1) { animation-delay: .05s; } [data-enter] > *:nth-child(2) { animation-delay: .15s; }
[data-enter] > *:nth-child(3) { animation-delay: .25s; } [data-enter] > *:nth-child(4) { animation-delay: .35s; }
[data-enter] > *:nth-child(5) { animation-delay: .45s; } [data-enter] > *:nth-child(6) { animation-delay: .55s; }
[data-enter] > *:nth-child(7) { animation-delay: .65s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* gradient word */
.shine { background: linear-gradient(100deg, var(--ink) 0%, var(--accent) 40%, var(--accent-2) 60%, var(--ink) 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 7s ease-in-out infinite; }
@keyframes shine { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }

/* ---------- devices ---------- */
.phones { position: relative; height: 560px; max-width: 460px; width: 100%; justify-self: center; perspective: 1200px; }
.phone { position: absolute; width: 250px; border-radius: 38px; padding: 9px; background: #1c2b3f; box-shadow: 0 30px 70px rgba(28,43,63,.28); transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.phone img, .phone video { display: block; width: 100%; height: auto; border-radius: 30px; aspect-ratio: 390 / 844; object-fit: cover; object-position: top; background: #fff; }
.phones .p1 { inset-inline-end: 0; top: 0; z-index: 2; animation: bob 7s ease-in-out infinite; }
.phones .p2 { inset-inline-start: 0; top: 70px; transform: rotate(-5deg); }
.phones .float { z-index: 3; }
.phones .f1 { top: 34%; inset-inline-end: auto; inset-inline-start: 34%; }
.phones .f2 { top: auto; bottom: 6%; inset-inline-start: auto; inset-inline-end: 4%; }
@keyframes bob { 50% { translate: 0 -12px; } }
/* parallax: products.js sets --px/--py from the pointer */
.phones[data-parallax] .p1 { transform: translate(calc(var(--px, 0) * 14px), calc(var(--py, 0) * 10px)); }
.phones[data-parallax] .p2 { transform: rotate(-5deg) translate(calc(var(--px, 0) * -10px), calc(var(--py, 0) * -8px)); }

.laptop { position: relative; width: 100%; max-width: 640px; justify-self: center; }
.laptop .screen { border-radius: 16px 16px 6px 6px; padding: 10px; background: #1c2b3f; box-shadow: 0 30px 70px rgba(28,43,63,.28); }
.laptop .screen > video, .laptop .screen > img { display: block; width: 100%; border-radius: 8px; aspect-ratio: 16 / 9; object-fit: cover; background: #111; }
.laptop .base { height: 14px; margin: 0 -4%; background: linear-gradient(#cfd6df, #9aa5b3); border-radius: 0 0 18px 18px; }
.laptop .bar { display: flex; gap: 6px; padding: 0 2px 8px; }
.laptop .bar i { width: 9px; height: 9px; border-radius: 50%; background: #ffffff40; }

/* ---------- features ---------- */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.feature + .feature { margin-top: 104px; }
.feature.flip > .shots { order: -1; }
.feature .shots { display: flex; gap: 18px; justify-content: center; align-items: flex-start; }
.feature .shots .phone { position: relative; width: 230px; }
.feature .shots .phone:nth-child(2) { margin-top: 48px; }
.who { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--accent); background: var(--surface); border: 1px solid var(--line); padding: 6px 14px; border-radius: 99px; font-size: .9rem; margin-bottom: 14px; }

/* slide-in from the side when revealed (uses the site's .reveal/.in) */
.reveal.from-side { transform: translateX(-40px); }
.feature.flip .reveal.from-side { transform: translateX(40px); }
.reveal.from-side.in { transform: none; }
.reveal.pop { transform: scale(.92); }
.reveal.pop.in { transform: none; }
/* staggered children */
[data-stagger] > .reveal:nth-child(2) { transition-delay: .08s; } [data-stagger] > .reveal:nth-child(3) { transition-delay: .16s; }
[data-stagger] > .reveal:nth-child(4) { transition-delay: .24s; } [data-stagger] > .reveal:nth-child(5) { transition-delay: .32s; }
[data-stagger] > .reveal:nth-child(6) { transition-delay: .40s; }

/* checklist items tick in one by one once their list is visible */
.checklist.ticks li { opacity: 0; transform: translateX(-12px); transition: opacity .5s, transform .5s; }
.checklist.ticks.in li { opacity: 1; transform: none; }
.checklist.ticks.in li:nth-child(2) { transition-delay: .12s; } .checklist.ticks.in li:nth-child(3) { transition-delay: .24s; }
.checklist.ticks.in li:nth-child(4) { transition-delay: .36s; } .checklist.ticks.in li:nth-child(5) { transition-delay: .48s; }

/* modules */
.mods .card { display: flex; flex-direction: column; }
.mods .badge { align-self: flex-start; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; margin-bottom: 14px; background: var(--accent-soft); color: var(--accent); }
.mods .badge.add { background: #efeafd; color: #6c5ce7; }

/* numbers strip */
.proof { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--ink); color: #fff; border-radius: 24px; overflow: hidden; position: relative; }
.proof::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.08) 50%, transparent 70%); background-size: 250% 100%; animation: sweep 6s linear infinite; pointer-events: none; }
@keyframes sweep { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.proof > div { padding: 26px 24px; border-inline-start: 1px solid rgba(255,255,255,.1); position: relative; }
.proof > div:first-child { border-inline-start: 0; }
.proof strong { display: block; font-family: "Heebo"; font-size: 1.35rem; margin-bottom: 4px; }
.proof span { color: rgba(255,255,255,.7); font-size: .92rem; }

/* feature ticker */
.ticker { overflow: hidden; border-block: 1px solid var(--line); background: var(--surface); padding: 16px 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.ticker-track { display: flex; gap: 14px; width: max-content; animation: tick 40s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker span { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 8px 16px; border-radius: 99px; background: var(--accent-soft); color: var(--ink); font-weight: 600; font-size: .95rem; }
.ticker span .ms { color: var(--accent); font-size: 1.1rem; }
@keyframes tick { to { transform: translateX(50%); } }

/* card hover glow following the pointer (products.js sets --mx/--my) */
.glow { position: relative; }
.glow::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); }
.glow:hover::before { opacity: 1; }

/* ---------- products hub ---------- */
.prod-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.prod-card { --c: var(--accent); display: grid; grid-template-rows: auto 1fr; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; overflow: hidden; transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; transform-style: preserve-3d; }
.prod-card:hover { box-shadow: 0 30px 60px rgba(28,43,63,.14); }
.prod-card .art { position: relative; height: 270px; background: color-mix(in srgb, var(--c) 14%, white); overflow: hidden; }
.prod-card .art::after { content: ""; position: absolute; inset: auto -20% -60% -20%; height: 80%; background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 35%, transparent), transparent); }
.prod-card .art img, .prod-card .art video { position: absolute; z-index: 1; transition: transform .6s cubic-bezier(.2,.8,.2,1); box-shadow: 0 18px 40px rgba(28,43,63,.25); }
.prod-card .art .ph { width: 150px; border-radius: 22px; border: 6px solid #1c2b3f; bottom: -70px; }
.prod-card .art .ph.a { inset-inline-end: 22%; transform: rotate(4deg); }
.prod-card .art .ph.b { inset-inline-end: 47%; bottom: -100px; transform: rotate(-6deg); }
.prod-card:hover .art .ph.a { transform: rotate(0) translateY(-18px); }
.prod-card:hover .art .ph.b { transform: rotate(-2deg) translateY(-12px); }
.prod-card .art .wide { width: 82%; inset-inline-start: 9%; bottom: -24px; border-radius: 12px; border: 6px solid #1c2b3f; aspect-ratio: 16/9; object-fit: cover; }
.prod-card:hover .art .wide { transform: translateY(-14px) scale(1.02); }
.prod-card .body { padding: 26px 28px 30px; display: flex; flex-direction: column; }
.prod-card .kind { font-size: .85rem; font-weight: 600; color: var(--c); margin-bottom: 6px; }
.prod-card h3 { font-size: 1.6rem; margin-bottom: 8px; }
.prod-card p { color: var(--muted); margin: 0 0 14px; }
.prod-card .more { margin-top: auto; font-weight: 700; color: var(--c); display: inline-flex; align-items: center; gap: 6px; }
.prod-card .more .ms { transition: transform .3s; }
.prod-card:hover .more .ms { transform: translateX(-6px); }
.prod-card .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.prod-card .chips span { font-size: .8rem; padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--c) 12%, white); color: var(--ink); }

@media (max-width: 900px) {
  .prod-hero { padding: 40px 0 52px; }
  .phones { height: 470px; max-width: 360px; margin-top: 16px; }
  .phone { width: 200px; border-radius: 32px; padding: 7px; }
  .phone img, .phone video { border-radius: 26px; }
  .phones .p2 { top: 56px; }
  .feature, .feature.flip { grid-template-columns: 1fr; gap: 32px; }
  .feature.flip > .shots { order: 0; }
  .feature .shots .phone { width: 46%; max-width: 210px; }
  .feature .shots .phone:nth-child(2) { margin-top: 32px; }
  .proof { grid-template-columns: 1fr 1fr; }
  .proof > div:nth-child(3) { border-inline-start: 0; }
  .proof > div:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.1); }
  .prod-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) { .phones { height: 420px; } .phone { width: 178px; } .prod-card .art { height: 230px; } }

@media (prefers-reduced-motion: reduce) {
  [data-enter] > * { opacity: 1; transform: none; animation: none; }
  .prod-hero .blob, .phones .p1, .shine, .proof::before, .ticker-track { animation: none; }
  .reveal.from-side, .reveal.pop, .checklist.ticks li { transform: none; opacity: 1; }
}
