/* Cometize: hero comets, How it works cards and the Why Cometize bento.
   Card = copy on top, a small "screen" (.stage) underneath with a looping demo (shared/demos.js).
   Each demo's markup is its finished frame, so with no JS or reduced motion it reads as a still. */

/* ---------- Hero sky: faint grid + comets on a canvas ---------- */
.hero-sky { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hero-sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero[data-hero-bg="grid"] .hero-sky::before {
  content: ""; position: absolute; inset: 0; --cell: 64px;
  background-image: linear-gradient(to right, rgba(244, 242, 238, .085) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(244, 242, 238, .085) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  background-position: var(--ox, 0px) 0;
}
.hero[data-hero-bg="grid"] .hero-sky {
  -webkit-mask-image: radial-gradient(ellipse 62% 48% at 50% 34%, #000 35%, transparent 78%);
          mask-image: radial-gradient(ellipse 62% 48% at 50% 34%, #000 35%, transparent 78%);
}
@media (max-width: 760px) { .hero[data-hero-bg="grid"] .hero-sky::before { --cell: 48px; } }

/* ---------- Cards ---------- */
.hiw, .bento { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; }
.hiw { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bento { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bento .wide { grid-column: span 2; }

.xcard { position: relative; display: flex; flex-direction: column; gap: 22px; padding: 26px 24px 24px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.xcard-copy { display: grid; gap: 10px; align-content: start; }
.xcard h3 { font-size: clamp(22px, 2vw, 26px); }
.xcard-copy > p:last-child { color: var(--muted); }
.xstep { display: flex; align-items: baseline; gap: 10px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.xstep .n { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 34px; line-height: 1; letter-spacing: 0; color: var(--accent); }

/* Small arrows in the gaps between the three steps */
@media (min-width: 1001px) {
  .hiw .xcard + .xcard::before { content: ""; position: absolute; z-index: 2; left: -24px; top: 50%; width: 28px; height: 28px; margin-top: -14px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--bg); }
  .hiw .xcard + .xcard::after { content: ""; position: absolute; z-index: 3; left: -14px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border: solid var(--accent); border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
}

.stage { position: relative; margin-top: auto; height: 252px; padding: 16px; border-radius: 14px; background: #0B0D11; border: 1px solid var(--line); overflow: hidden; }
.demo { position: relative; height: 100%; display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 1.3; }

@media (max-width: 1000px) {
  .hiw { grid-template-columns: 1fr; max-width: 580px; margin-inline: auto; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento .wide { grid-column: 1 / -1; }
}
@media (max-width: 640px) { .bento { grid-template-columns: 1fr; } .xcard { padding: 22px 18px 18px; } }

/* Scroll reveal */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); transition-delay: calc(var(--d, 0) * 90ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Shared demo bits ---------- */
.demo .tick { width: 14px; height: 14px; flex: none; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.demo .row { display: grid; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; background: rgba(244, 242, 238, .035); }
.demo .muted, .demo .k { color: var(--muted); }
.demo .head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.demo .head b { color: var(--fg); }
.demo [class*="-head"] { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.demo [class*="-head"] b { color: var(--fg); font-weight: 600; }
.demo .num, .demo .nv { font-variant-numeric: tabular-nums; }
.demo li, .demo figure, .demo .dk-script, .demo .dm-toast, .demo .dn-you, .demo .cr-count, .demo .rn-badge { transition: opacity 380ms var(--ease-out), transform 380ms var(--ease-out), background-color 380ms var(--ease-out), border-color 380ms var(--ease-out), color 380ms var(--ease-out); }
.demo ul { margin: 0; padding: 0; list-style: none; }

/* 01 Brand call */
.d-call .dc-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.live { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--fg); font-weight: 600; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(255, 106, 26, .8); animation: pulse 1.6s ease-in-out infinite; }
.dc-time { font-variant-numeric: tabular-nums; }
.dc-wave { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 4px; }
.dc-wave i { flex: none; width: 3px; height: calc(var(--h) * 100%); border-radius: 2px; background: rgba(255, 106, 26, .55); transform-origin: 50% 50%; animation: wave 1.2s ease-in-out infinite alternate; }
.dc-wave i:nth-child(3n) { animation-delay: -.4s; } .dc-wave i:nth-child(3n+1) { animation-delay: -.8s; } .dc-wave i:nth-child(4n) { animation-duration: .9s; }
.d-call.is-quiet .dc-wave i { animation-play-state: paused; opacity: .4; }
.dc-notes { display: grid; gap: 6px; }
.dc-notes li { display: grid; grid-template-columns: 78px 1fr 14px; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; background: rgba(244, 242, 238, .035); }
.dc-notes .k { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.dc-notes .v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-notes li:not(.on) { opacity: 0; transform: translateY(6px); }
.dc-notes li:not(.done) .tick { opacity: 0; transform: scale(.5); }
.dc-notes .tick { transition: opacity 250ms, transform 300ms var(--ease-out); }

/* 02 Lock your look and script */
.dk-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dk-tiles figure { position: relative; margin: 0; aspect-ratio: 4 / 5; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); background: #15181E; }
.dk-tiles img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dk-tiles figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 5px; font-size: 10px; font-weight: 600; color: #F4F2EE; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); }
.dk-tiles .lock { position: absolute; top: 5px; right: 5px; width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: rgba(7, 8, 11, .7); fill: none; stroke: var(--accent); stroke-width: 1.6; opacity: 0; transform: scale(.4); transition: opacity 250ms, transform 350ms cubic-bezier(.3, 1.6, .5, 1); }
.dk-tiles figure:not(.on) { opacity: 0; transform: scale(.88); }
.dk-tiles figure.locked { border-color: rgba(255, 106, 26, .55); }
.dk-tiles figure.locked .lock { opacity: 1; transform: none; }
.dk-script { position: relative; margin-top: auto; display: grid; gap: 4px; padding: 10px 12px; border-radius: 9px; background: rgba(244, 242, 238, .035); border: 1px solid var(--line); }
.dk-script:not(.on) { opacity: 0; transform: translateY(8px); }
.dk-scene { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.dk-line { min-height: 1.3em; padding-right: 70px; }
.dk-stamp { position: absolute; right: 10px; top: 50%; margin-top: -12px; padding: 3px 8px; border: 1.5px solid var(--accent); border-radius: 5px; color: var(--accent); font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; transform: rotate(-8deg); }
.dk-stamp:not(.on) { opacity: 0; transform: rotate(-8deg) scale(1.8); }
.dk-stamp.on { transition: opacity 160ms, transform 280ms cubic-bezier(.3, 1.4, .5, 1); }

/* 03 Produce and deliver */
.dm-pct { font-variant-numeric: tabular-nums; color: var(--fg); }
.dm-bar { height: 6px; border-radius: 99px; background: rgba(244, 242, 238, .07); overflow: hidden; }
.dm-bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); border-radius: 99px; background: linear-gradient(90deg, rgba(255, 106, 26, .35), #FF6A1A); transition: width 520ms var(--ease-out); }
.dm-stages { display: grid; gap: 5px; margin-top: 2px; }
.dm-stages li { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-radius: 8px; color: var(--muted); background: rgba(244, 242, 238, .025); }
.dm-stages li.active { color: var(--fg); background: rgba(255, 106, 26, .08); }
.dm-stages li.done { color: var(--fg); }
.dm-stages li:not(.done) .tick { opacity: 0; transform: scale(.5); }
.dm-stages .tick { transition: opacity 250ms, transform 300ms var(--ease-out); }
.dm-toast { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 11px; background: #1A1D24; border: 1px solid var(--line-strong); box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .7); }
.dm-toast img { width: 72px; height: 40px; border-radius: 6px; object-fit: cover; flex: none; }
.dm-msg { display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.dm-msg b { color: var(--fg); font-size: 13px; }
.dm-toast:not(.on) { opacity: 0; transform: translateY(110%); }

/* Bento 1: First ad in 5 to 7 days */
.d-days { flex-direction: row; align-items: stretch; gap: 26px; }
.dy-left { flex: none; display: flex; flex-direction: column; justify-content: center; min-width: 118px; }
.dy-num { margin: 0; font-family: var(--font-serif); font-size: 104px; line-height: .85; color: var(--fg); }
.dy-cap { margin: 8px 0 0; max-width: 13ch; color: var(--muted); font-size: 13px; }
.dy-right { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 0 22px 0 8px; }
.dy-track { position: relative; height: 112px; }
.dy-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; border-radius: 99px; background: rgba(244, 242, 238, .12); }
.dy-fill { position: absolute; left: 0; top: 50%; height: 2px; margin-top: -1px; width: calc(var(--p, 0) * 100%); border-radius: 99px; background: linear-gradient(90deg, rgba(255, 106, 26, .2), #FF6A1A); }
.dy-comet { position: absolute; top: 50%; left: calc(var(--p, 0) * 100%); width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #FFB27A; box-shadow: 0 0 12px 3px rgba(255, 106, 26, .85); z-index: 2; }
.dy-mark { position: absolute; top: 50%; left: calc(var(--x) * 100%); z-index: 1; }
.dy-mark i { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(244, 242, 238, .28); background: #0B0D11; transition: border-color 300ms, background-color 300ms, box-shadow 300ms, transform 300ms; }
.dy-mark em { position: absolute; left: 0; transform: translateX(-50%); font-style: normal; font-size: 12px; white-space: nowrap; color: var(--muted); transition: color 300ms; }
.dy-mark:nth-of-type(odd) em { bottom: 14px; }
.dy-mark:nth-of-type(even) em { top: 14px; }
.dy-mark:first-of-type em { transform: none; left: -6px; }
.dy-mark.on i { border-color: var(--accent); background: var(--accent); }
.dy-mark.on em { color: var(--fg); }
.dy-mark.hl.on i { transform: scale(1.35); box-shadow: 0 0 0 5px rgba(255, 106, 26, .18); }
.dy-mark.hl.on em { color: var(--accent); font-weight: 700; }
.dy-days { position: relative; height: 16px; }
.dy-day { position: absolute; left: calc(var(--x) * 100%); transform: translateX(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; opacity: .7; }

/* Bento 2: Done for you */
.dn-list { display: grid; gap: 5px; }
.dn-list li { display: grid; grid-template-columns: 1fr auto 14px; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; background: rgba(244, 242, 238, .035); }
.dn-list .who { font-size: 11px; color: var(--muted); }
.dn-list li:not(.on) { opacity: .4; }
.dn-list li:not(.on) .tick { opacity: 0; transform: scale(.5); }
.dn-list .tick, .dn-you .tick { transition: opacity 250ms, transform 300ms var(--ease-out); }
.dn-you { margin: auto 0 0; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; border: 1px dashed rgba(255, 106, 26, .55); }
.dn-you span { color: var(--muted); font-size: 12px; }
.dn-you b { margin-left: auto; font-weight: 600; }
.dn-you:not(.on) { opacity: 0; transform: translateY(8px); }

/* Bento 3: No crew, no filming days */
.cr-head { margin: 0; font-size: 11px !important; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.cr-list { display: grid; gap: 6px; }
.cr-list li { position: relative; display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 8px; background: rgba(244, 242, 238, .035); }
.cr-list li::after { content: ""; position: absolute; left: 8px; right: 8px; top: 50%; height: 1.5px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 420ms var(--ease-out); }
.cr-list li.struck { color: var(--muted); }
.cr-list li.struck::after { transform: scaleX(1); }
.cr-list li:not(.on) { opacity: 0; }
.cr-list .x { color: var(--muted); }
.cr-count { margin: auto 0 0; font-family: var(--font-serif); font-size: 30px; line-height: 1; color: var(--fg); }
.cr-count .nv { color: var(--accent); font-size: 44px; margin-right: 4px; }
.cr-count:not(.on) { opacity: 0; transform: translateY(8px); }

/* Bento 4: Always on brand */
.br-frames { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.br-frames figure { position: relative; margin: 0; aspect-ratio: 9 / 13; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); background: #15181E; }
.br-frames img { width: 100%; height: 100%; object-fit: cover; display: block; }
.br-frames figure:nth-child(1) img { object-position: 38% 50%; }
.br-frames figure:nth-child(2) img { object-position: 58% 50%; }
.br-frames figure:nth-child(3) img { object-position: 30% 50%; }
.br-frames span { position: absolute; left: 6px; bottom: 5px; font-size: 10px; font-weight: 600; color: #F4F2EE; text-shadow: 0 1px 4px rgba(0, 0, 0, .8); }
.br-frames figure:not(.on) { opacity: 0; transform: translateY(10px); }
.br-chips { margin-top: auto !important; display: flex; flex-wrap: wrap; gap: 6px; }
.br-chips li { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px 5px 8px; border-radius: 99px; border: 1px solid rgba(255, 106, 26, .45); background: rgba(255, 106, 26, .08); font-size: 12px; }
.br-chips li:not(.on) { opacity: 0; transform: scale(.85); }

/* Bento 5: Yours to run anywhere */
.rn-chips { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; }
.rn-chips li { padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.rn-chips li.on { border-color: rgba(255, 106, 26, .55); background: rgba(255, 106, 26, .08); color: var(--fg); }
.rn-badge { margin: auto 0 0; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 106, 26, .12); font-size: 13px; font-weight: 600; }
.rn-badge:not(.on) { opacity: 0; transform: translateY(8px); }

@media (max-width: 640px) {
  .d-days { flex-direction: column; gap: 6px; }
  .dy-left { flex-direction: row; align-items: baseline; gap: 10px; min-width: 0; }
  .dy-num { font-size: 56px; }
  .dy-cap { margin: 0; max-width: none; }
  .dy-right { padding: 0 18px 0 6px; }
  .dy-mark em { font-size: 10.5px; }
  .bento .wide .stage { height: 270px; }
}

@keyframes pulse { 50% { opacity: .35; } }
@keyframes wave { from { transform: scaleY(.35); } to { transform: scaleY(1); } }

@media (prefers-reduced-motion: reduce) {
  .live i, .dc-wave i { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
