/* Layout variants, chosen per app by scripts/pick_variant.py and set as data-* attributes on <body>.
   Colors never change here: they stay on the app's tokens in style.css. */

/* Shape */
body[data-shape="round"] { --radius: 22px; --btn-radius: 999px; }
body[data-shape="soft"] { --radius: 12px; --btn-radius: 10px; }
body[data-shape="sharp"] { --radius: 3px; --btn-radius: 2px; }
.store-badge, .lang-switch a { border-radius: var(--btn-radius, 12px); }
.hero-shot, .shots img { border-radius: calc(var(--radius) + 8px); }

/* Header */
body[data-header="primary"] .site-header { background: var(--primary-dark); box-shadow: none; }
body[data-header="primary"] .brand, body[data-header="primary"] .nav-links a, body[data-header="primary"] .menu-btn { color: #fff; }
body[data-header="border"] .site-header { background: var(--bg); box-shadow: none; border-bottom: 3px solid var(--primary); }
@media (min-width: 861px) {
  body[data-header="centered"] .nav { flex-direction: column; padding: 12px 0; gap: 8px; }
}

/* Hero */
@media (min-width: 861px) { body[data-hero="split-reverse"] .hero-grid > :first-child { order: 2; } }
body[data-hero="centered"] .hero-grid { grid-template-columns: 1fr; text-align: center; }
body[data-hero="centered"] .hero p { margin-inline: auto; }
body[data-hero="centered"] .store-badges { justify-content: center; }
body[data-hero="light"] .hero { background: var(--surface); color: var(--text); border-bottom: 1px solid var(--line); }
body[data-hero="light"] .hero h1 { color: var(--primary); }
body[data-hero="light"] .hero p { opacity: 1; color: var(--muted); }
body[data-hero="diagonal"] .hero { clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%); padding-bottom: 96px; }

/* Section titles */
body[data-title="left"] .section-title, body[data-title="left"] .section-sub { text-align: left; margin-inline: 0; }
body[data-title="bar"] .section-title { text-align: left; padding-left: 14px; border-left: 6px solid var(--accent); }
body[data-title="bar"] .section-sub { text-align: left; margin-inline: 0; }
body[data-title="underline"] .section-title::after { content: ""; display: block; width: 56px; height: 4px; margin: 10px auto 0; background: var(--accent); border-radius: 4px; }

/* Cards */
body[data-cards="outline"] .card { box-shadow: none; border: 2px solid var(--line); }
body[data-cards="tinted"] .card { box-shadow: none; background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
body[data-cards="tinted"] .card .icon { background: var(--surface); color: var(--primary); }
body[data-cards="row"] .grid { grid-template-columns: 1fr; }
body[data-cards="row"] .card { display: grid; grid-template-columns: 48px 1fr; column-gap: 16px; align-items: start; }
body[data-cards="row"] .card .icon { grid-row: span 2; margin: 0; }

/* Feature grid columns */
body[data-grid="three"] .grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { body[data-grid="three"] .grid { grid-template-columns: 1fr; } }

/* Screenshots */
body[data-shots="frame"] .shots img { border: 8px solid #111; }
body[data-shots="tilt"] .shots img:nth-child(odd) { transform: rotate(-2deg); }
body[data-shots="tilt"] .shots img:nth-child(even) { transform: rotate(2deg) translateY(8px); }

/* Footer */
body[data-footer="centered"] .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 32px 64px; text-align: left; justify-items: stretch; }
body[data-footer="centered"] .footer-brand, body[data-footer="centered"] .socials { justify-content: flex-start; }
@media (max-width: 860px) {
  body[data-footer="centered"] .footer-grid { grid-template-columns: 1fr; gap: 28px; text-align: center; justify-items: center; }
  body[data-footer="centered"] .footer-brand, body[data-footer="centered"] .socials { justify-content: center; }
}
body[data-footer="neutral"] .site-footer { background: #1d1d22; }
body[data-footer="light"] .site-footer { background: var(--surface); color: var(--text); border-top: 4px solid var(--primary); }
body[data-footer="light"] .site-footer a, body[data-footer="light"] .site-footer h4, body[data-footer="light"] .footer-brand { color: var(--text); }
body[data-footer="light"] .socials a { background: var(--primary); color: #fff; }

/* Scroll reveal: script.js adds .is-visible when an element enters the viewport.
   Hidden only when JS runs (html.js) and motion is allowed, so no-JS and reduced-motion users see everything.
   The start transform sits on :not(.is-visible), so the visible state never has to out-rank it. */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal { opacity: 0; transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0ms); }
  html.js .reveal.is-visible { opacity: 1; }
  html.js body[data-motion="rise"] .reveal:not(.is-visible) { transform: translateY(28px); }
  html.js body[data-motion="zoom"] .reveal:not(.is-visible) { transform: scale(.92); }
  html.js body[data-motion="slide"] .reveal:not(.is-visible) { transform: translateX(-32px); }
  html.js body[data-motion="slide"] .reveal:nth-child(even):not(.is-visible) { transform: translateX(32px); }
}
