/* Product pages and the motion hooks.
   Everything animates from a visible resting state: with scripts off, or with
   reduced motion on, the page is simply still. GSAP only ever moves transform
   and opacity, never layout. */

/* ---------- hero with a device ---------- */
.p-hero {
  position: relative; overflow: hidden;
  padding: clamp(3rem, 7vw, 6rem) 0 0;
}
.p-hero .glow {
  position: absolute; inset: -20% -10% auto; height: 70%; pointer-events: none; z-index: 0;
  background:
    radial-gradient(60% 55% at 70% 30%, color-mix(in srgb, var(--accent-solid) 26%, transparent), transparent 70%),
    radial-gradient(45% 45% at 20% 60%, color-mix(in srgb, var(--blue-9) 20%, transparent), transparent 70%);
  filter: blur(30px);
}
@media (prefers-reduced-motion: no-preference) {
  /* Automatic motion stops within five seconds and holds its final position. */
  .p-hero .glow { animation: drift 4.5s ease-in-out 1 forwards; }
  @keyframes drift { from { transform: translate3d(-2%, 0, 0) scale(1); } to { transform: translate3d(2%, 3%, 0) scale(1.06); } }
}
.p-hero .wrap { position: relative; z-index: 1; display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) { .p-hero .wrap { grid-template-columns: 1.05fr 0.95fr; gap: 3rem; } }
.p-hero h1 { font-size: var(--step-5); max-width: 14ch; }
/* the product name is the h1; the descriptive sentence sits under it as a subhead */
.p-hero .p-sub { font-size: var(--step-3); font-weight: 600; line-height: 1.2; letter-spacing: -0.015em;
  color: var(--text); max-width: 26ch; margin-top: 0.8rem; text-wrap: balance; }
.p-hero .lead { font-size: var(--step-1); color: var(--text-soft); max-width: 46ch; margin-top: 1.2rem; }
.p-hero .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.p-hero .icon { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 1.2rem; box-shadow: 0 6px 24px rgb(0 0 0 / 0.35); }

/* phone render: the image already contains the device, so just a soft floor */
.device-phone { position: relative; margin: 0 auto; width: min(100%, 380px); }
.device-phone img { width: 100%; height: auto; display: block; border-radius: 28px 28px 0 0; }
.device-phone::after {
  content: ""; position: absolute; inset: auto 8% -10px; height: 40px; border-radius: 50%;
  background: rgb(0 0 0 / 0.45); filter: blur(22px); z-index: -1;
}
/* browser frame for the Civesto panel */
.device-browser {
  border-radius: 12px; overflow: hidden; border: 1px solid var(--line-strong);
  background: var(--bg-raised); box-shadow: 0 30px 60px rgb(0 0 0 / 0.45);
}
.device-browser .bar { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.device-browser .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--neutral-7); }
.device-browser img { display: block; width: 100%; height: auto; }
/* panel and citizen app shown together: the phone overlaps the browser's lower right corner */
.device-pair { position: relative; }
.device-pair.has-phone { padding: 0 6% 9% 0; }
.hero-phone {
  position: absolute; right: 0; bottom: 0; width: 27%; height: auto; display: block;
  border-radius: clamp(10px, 1.6vw, 20px); border: 1px solid var(--line-strong);
  box-shadow: 0 24px 50px rgb(0 0 0 / 0.55);
}

/* ---------- citizen app: text, three screens, short facts ---------- */
.app-intro { padding-bottom: 0; }
.app-head { max-width: 62ch; margin-bottom: 2rem; }
.app-head h2 { margin-top: 0.9rem; }
.app-lead { margin-top: 1rem; color: var(--text-soft); font-size: var(--step-1); }
.app-defs { margin-top: 1.5rem; }

/* ---------- story: pinned visual, scrolling steps ---------- */
.story { padding: clamp(3rem, 8vw, 7rem) 0; }
.story .wrap { display: grid; gap: 2.5rem; }
.story-visual { position: relative; }
@media (min-width: 900px) {
  .story .wrap { grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; }
  .story-visual { position: sticky; top: 96px; }
}
.story-visual .frame { position: relative; }
.story-visual .frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
/* A static first image survives missing scripts and reduced-motion changes. */
.story-visual .frame img:first-child { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .story-visual .frame.enhanced img { opacity: 0; transition: opacity 0.5s ease; }
  .story-visual .frame.enhanced img.is-active { opacity: 1; }
}
.story-visual .frame.phone { aspect-ratio: 9 / 16; max-width: 360px; margin-inline: auto; border-radius: 28px; overflow: hidden; }
.story-visual .frame.browser { aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-strong); }
.story-steps { display: grid; gap: clamp(2.5rem, 8vh, 6rem); }
.step { padding-left: 1.4rem; border-left: 2px solid var(--line); }
.step.is-active { border-color: var(--accent-solid); }
.step .n { font-family: var(--font-mono); font-size: var(--step--1); color: var(--accent); }
.step h2, .step h3 { font-size: var(--step-2); margin-top: 0.5rem; }
.step p { color: var(--text-soft); margin-top: 0.7rem; }
.step img { display: none; }
@media (max-width: 899px) {
  .story-visual { display: none; }
  .step img { display: block; width: 100%; height: auto; border-radius: 16px; margin-top: 1.2rem; border: 1px solid var(--line); }
}

/* ---------- feature grid ---------- */
.features { display: grid; gap: 1.25rem; }
@media (min-width: 620px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { padding: 1.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); }
.feature .k { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); letter-spacing: 0.06em; }
.feature h2, .feature h3 { margin-top: 0.6rem; font-size: var(--step-1); }
.feature p { margin-top: 0.5rem; color: var(--text-soft); }

/* ---------- questions and answers: always visible, no script needed ---------- */
.faq h2 { font-size: var(--step-2); }
.faq-list { margin-top: 1.4rem; border-top: 1px solid var(--line); }
.faq-item { display: grid; gap: 0.5rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line); }
.faq-item h3 { font-size: var(--step-1); }
.faq-item p { color: var(--text-soft); }
@media (min-width: 900px) { .faq-item { grid-template-columns: 1fr 1.4fr; gap: 3rem; } }

/* ---------- gallery of store cards ---------- */
.gallery { overflow-x: auto; scroll-snap-type: x mandatory; display: flex; gap: 1rem;
  padding: 0.5rem var(--gutter) 1.5rem; margin-inline: calc(var(--gutter) * -1); scrollbar-width: thin; }
.gallery img { flex: 0 0 auto; width: min(72vw, 300px); height: auto; border-radius: 18px; scroll-snap-align: start;
  border: 1px solid var(--line); }

/* ---------- big number / statement band ---------- */
.statement { padding: clamp(3rem, 8vw, 6rem) 0; }
.statement blockquote { margin: 0; font-size: var(--step-3); line-height: 1.25; max-width: 24ch; letter-spacing: -0.015em; }
.statement cite { display: block; margin-top: 1.2rem; font-style: normal; color: var(--text-soft); font-size: var(--step--1); }

/* ---------- home showcase ---------- */
.showcase { display: grid; gap: 1.25rem; }
@media (min-width: 900px) { .showcase { grid-template-columns: repeat(2, 1fr); } }
.showcase a { text-decoration: none; }
.show-card {
  position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--bg-raised); min-height: 420px; display: grid; grid-template-rows: auto 1fr;
}
.show-card .text { padding: 1.6rem 1.6rem 0; }
.show-card .text h2, .show-card .text h3 { font-size: var(--step-2); }
.show-card .text p { margin-top: 0.5rem; color: var(--text-soft); }
.show-card .pic { position: relative; margin: 1.6rem 1.6rem 0; overflow: hidden; border-radius: 14px 14px 0 0; }
.show-card .pic img { display: block; width: 100%; height: auto; transition: transform 0.6s cubic-bezier(.2,.7,.2,1); }
.show-card:hover .pic img { transform: translateY(-6px); }
.show-card .pic.phone { width: min(70%, 300px); margin-inline: auto; }
@media (prefers-reduced-motion: reduce) { .show-card .pic img { transition: none; } .show-card:hover .pic img { transform: none; } }

/* header state once the page has scrolled */
.site-head.scrolled { box-shadow: 0 10px 30px rgb(0 0 0 / 0.25); }
