/* ==========================================================================
   OptiMax — landing page styles
   Dark premium theme · glassmorphism · gradient accents · offline (no CDN)
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --bg: #06070e;
  --bg-soft: #0a0c18;
  --bg-alt: #080a14;

  --text: #eef0fa;
  --text-dim: #b9bed3;
  --text-mute: #8d94ab;

  --brand: #7c6cff;
  --brand-soft: #9a8dff;
  --brand-2: #4ad6f0;
  --brand-3: #35e0b0;
  --warn: #f3b13c;
  --danger: #ff7a86;

  --grad: linear-gradient(120deg, #7c6cff 0%, #4ad6f0 100%);
  --grad-soft: linear-gradient(120deg, rgba(124, 108, 255, .18), rgba(74, 214, 240, .14));

  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .07);
  --stroke: rgba(255, 255, 255, .09);
  --stroke-strong: rgba(255, 255, 255, .18);

  --shadow: 0 24px 60px -28px rgba(0, 0, 0, .85);
  --shadow-glow: 0 18px 60px -22px rgba(124, 108, 255, .55);

  --r-sm: 12px;
  --r: 18px;
  --r-lg: 26px;

  --container: 1200px;
  --header-h: 74px;

  --ease: cubic-bezier(.22, .61, .36, 1);

  --font: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system,
    "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Consolas", "SFMono-Regular", ui-monospace, monospace;
}

/* ---------- 2. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: .005em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 12% -8%, rgba(124, 108, 255, .20), transparent 62%),
    radial-gradient(760px 520px at 92% 4%, rgba(74, 214, 240, .14), transparent 60%),
    radial-gradient(900px 700px at 50% 108%, rgba(53, 224, 176, .10), transparent 62%),
    linear-gradient(180deg, #06070e 0%, #080a14 45%, #06070e 100%);
}

img { max-width: 100%; display: block; }
svg { display: block; }

a { color: var(--text); text-decoration: none; }
a:not(.btn):hover { color: var(--brand-soft); }

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: -.025em;
  font-weight: 750;
  text-wrap: balance;
}
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: rgba(124, 108, 255, .4); }

:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 3px;
  border-radius: 6px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon.accent { color: var(--brand-soft); }
.brand-mark svg, .studio-mark svg { fill: currentColor; stroke: none; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  padding: .7rem 1.1rem;
  background: var(--brand);
  color: #fff;
  border-radius: 0 0 12px 12px;
  font-weight: 600;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 0; color: #fff; }

.container {
  width: min(var(--container), 100% - 2.5rem);
  margin-inline: auto;
}
.container-narrow { width: min(820px, 100% - 2.5rem); }

/* ---------- 3. Type helpers ---------- */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.kicker {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand-soft);
  margin-bottom: .9rem;
}
.kicker-accent { color: var(--brand-2); }

.section-head { max-width: 720px; margin-bottom: clamp(2rem, 4vw, 3.4rem); }
.section-head h2 { font-size: clamp(1.85rem, 3.6vw, 2.9rem); }
.section-sub { color: var(--text-dim); font-size: clamp(1rem, 1.15vw, 1.1rem); margin-top: 1rem; }

.note { color: var(--text-mute); font-size: .9rem; margin-top: 1.1rem; }

/* ---------- 4. Buttons ---------- */
.btn {
  --btn-bg: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .8rem 1.35rem;
  border: 1px solid var(--stroke-strong);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--text);
  font: inherit;
  font-weight: 650;
  font-size: .95rem;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease),
              background-color .22s var(--ease), border-color .22s var(--ease);
}
.btn:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .3); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--grad);
  border-color: transparent;
  color: #0a0a18;
  font-weight: 750;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { box-shadow: 0 22px 55px -18px rgba(124, 108, 255, .75); }
.btn-primary .icon { stroke-width: 2; }

.btn-ghost { background: rgba(255, 255, 255, .04); backdrop-filter: blur(10px); }
.btn-sm { padding: .6rem 1rem; font-size: .875rem; }
.btn-lg { padding: .95rem 1.7rem; font-size: 1rem; }

/* ---------- 5. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  border-bottom: 1px solid transparent;
  /* backdrop-filter is intentionally NOT transitioned: the blur is rasterised
     instantly, which is both cheaper and immune to transition hiccups. */
  transition: background-color .25s var(--ease), border-color .25s var(--ease);
}
.site-header.is-stuck {
  background: rgba(6, 7, 14, .72);
  backdrop-filter: blur(18px) saturate(150%);
  border-bottom-color: var(--stroke);
}

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand { display: inline-flex; align-items: center; gap: .7rem; }
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--grad);
  color: #0b0b18;
  box-shadow: 0 10px 25px -12px rgba(124, 108, 255, .9);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-size: 1.12rem; font-weight: 780; letter-spacing: -.02em; }
.brand-text small { font-size: .62rem; letter-spacing: .22em; color: var(--text-mute); font-weight: 600; }

.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: .35rem; }
.main-nav a {
  display: block;
  padding: .5rem .8rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 550;
  color: var(--text-dim);
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.main-nav a:hover { color: var(--text); background: var(--surface); }

.header-actions { display: flex; align-items: center; gap: .6rem; margin-left: auto; }

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
}
.lang-btn {
  border: 0;
  background: transparent;
  color: var(--text-mute);
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: .3rem .6rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.lang-btn:hover { color: var(--text); }
.lang-btn.is-active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--stroke); }

.menu-toggle {
  display: none;
  width: 42px; height: 42px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  place-items: center;
}
.menu-toggle .icon { width: 20px; height: 20px; }
.menu-toggle .icon-close { display: none; }
.site-header.nav-open .menu-toggle .icon-close { display: block; }
.site-header.nav-open .menu-toggle .icon-menu { display: none; }

/* ---------- 6. Hero ---------- */
.hero {
  position: relative;
  padding: clamp(3rem, 7vw, 6rem) 0 clamp(3.5rem, 8vw, 7rem);
  overflow: hidden;
}

.aurora { position: absolute; inset: -20% -10% auto; height: 130%; pointer-events: none; z-index: -1; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .55;
  animation: drift 22s ease-in-out infinite;
}
.blob-1 { width: 46vw; height: 46vw; max-width: 620px; max-height: 620px; background: rgba(124, 108, 255, .55); top: -6%; left: -8%; }
.blob-2 { width: 38vw; height: 38vw; max-width: 520px; max-height: 520px; background: rgba(74, 214, 240, .38); top: 6%; right: -6%; animation-delay: -7s; }
.blob-3 { width: 34vw; height: 34vw; max-width: 460px; max-height: 460px; background: rgba(53, 224, 176, .28); bottom: -14%; left: 34%; animation-delay: -13s; }

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33% { transform: translate3d(3%, -4%, 0) scale(1.08); }
  66% { transform: translate3d(-3%, 3%, 0) scale(.95); }
}

.grid-overlay {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .4rem .9rem .4rem .6rem;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  color: var(--text-dim);
  font-size: .82rem;
  font-weight: 550;
  margin-bottom: 1.4rem;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-3);
  box-shadow: 0 0 0 4px rgba(53, 224, 176, .18);
}

.hero h1 { font-size: clamp(2.9rem, 7vw, 5.2rem); font-weight: 800; letter-spacing: -.04em; }
.hero h1 .grad-text { display: block; line-height: .98; }
.h1-sub {
  display: block;
  margin-top: .7rem;
  font-size: clamp(1.15rem, 2.1vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.28;
  color: var(--text-dim);
}

.lede { margin-top: 1.3rem; max-width: 56ch; color: var(--text-dim); font-size: clamp(1rem, 1.2vw, 1.12rem); }

.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.9rem; }

.badge-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 2.1rem; }
.badge {
  display: inline-flex;
  align-items: baseline;
  gap: .42rem;
  padding: .5rem .95rem;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  font-size: .85rem;
  color: var(--text-dim);
}
.badge b { font-size: 1rem; font-weight: 780; color: var(--text); }
.badge-free { border-color: rgba(53, 224, 176, .35); background: rgba(53, 224, 176, .08); }
.badge-free b { color: var(--brand-3); }

/* Hero visual */
.hero-visual { position: relative; }

.app-frame {
  border: 1px solid var(--stroke-strong);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: rgba(255, 255, 255, .05);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, .03) inset;
  backdrop-filter: blur(14px);
  transform: perspective(1400px) rotateY(-7deg) rotateX(2deg);
  transition: transform .6s var(--ease);
}
.hero-visual:hover .app-frame { transform: perspective(1400px) rotateY(-2deg) rotateX(1deg) translateY(-4px); }
.app-frame img { width: 100%; height: auto; }

.app-frame-bar {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .6rem .9rem;
  background: rgba(255, 255, 255, .05);
  border-bottom: 1px solid var(--stroke);
}
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.app-frame-title {
  margin-left: .6rem;
  font-size: .72rem;
  color: var(--text-mute);
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hero chip strip under the app screenshot */
.hero-chips { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; }
.hero-chip {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .62rem .85rem;
  border-radius: var(--r);
  background: linear-gradient(150deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .03));
  border: 1px solid var(--stroke);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  animation: fade-up .6s var(--ease);
}
.hero-chip:nth-child(2) { animation-delay: .08s; }
.hero-chip:nth-child(3) { animation-delay: .16s; }
.hero-chip strong { display: block; font-size: .85rem; font-weight: 700; color: var(--text); }
.hero-chip small { color: var(--text-mute); font-size: .73rem; }

/* ---------- 7. Glass surfaces & sections ---------- */
.glass {
  background: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .025));
  border: 1px solid var(--stroke);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.section { position: relative; padding: clamp(4rem, 8.5vw, 7.5rem) 0; }
.section-alt { background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .022) 12%, rgba(255, 255, 255, .022) 88%, transparent); }

.card {
  border-radius: var(--r-lg);
  padding: clamp(1.4rem, 2.2vw, 1.9rem);
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--stroke-strong); box-shadow: var(--shadow); }

.card-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--grad-soft);
  border: 1px solid var(--stroke);
  color: var(--brand-soft);
  margin-bottom: 1.05rem;
}
.card-icon .icon { width: 22px; height: 22px; }
.card h3 { font-size: 1.16rem; margin-bottom: .55rem; }
.card p { color: var(--text-dim); font-size: .95rem; }

/* ---------- 8. Bento (features) ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.bento .span-2 { grid-column: span 2; }

.accent-card {
  background:
    radial-gradient(600px 200px at 8% 0%, rgba(124, 108, 255, .16), transparent 60%),
    linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .025));
}

.tick-list { margin-top: 1.1rem; display: grid; gap: .5rem; }
.tick-list li { display: flex; gap: .55rem; align-items: flex-start; font-size: .9rem; color: var(--text-dim); }
.tick-list .icon { color: var(--brand-3); flex: none; margin-top: .25rem; }
.tick-inline { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* ---------- 9. Profiles ---------- */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.profile-card { display: flex; flex-direction: column; gap: .4rem; }
.profile-icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--grad);
  color: #0b0b18;
  margin-bottom: .7rem;
  box-shadow: 0 12px 26px -14px rgba(124, 108, 255, .95);
}
.profile-icon .icon { width: 23px; height: 23px; stroke-width: 1.9; }
.profile-card h3 { font-size: 1.1rem; }
.profile-card p { font-size: .9rem; }
.profile-count { margin-top: auto; padding-top: .8rem; color: var(--text-mute); font-size: .82rem; }
.profile-count b { color: var(--brand-2); font-size: 1.05rem; }

/* ---------- 10. Tabs / categories ---------- */
.tabs-wrap { display: grid; gap: 1.2rem; }

.tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .6rem 1rem;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-dim);
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease),
              background-color .2s var(--ease), transform .2s var(--ease);
}
.tab:hover { color: var(--text); transform: translateY(-2px); }
.tab .icon { width: 17px; height: 17px; }
.tab-count {
  font-style: normal;
  font-size: .74rem;
  font-weight: 700;
  padding: .1rem .42rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: var(--text-mute);
}
.tab.is-active {
  color: #0a0a18;
  background: var(--grad);
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}
.tab.is-active .tab-count { background: rgba(0, 0, 0, .18); color: #0a0a18; }

.panels {
  border-radius: var(--r-lg);
  border: 1px solid var(--stroke);
  background: linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  backdrop-filter: blur(16px);
  padding: clamp(1.3rem, 2.4vw, 2rem);
}
.panel { animation: fade-up .4s var(--ease); }
.panel[hidden] { display: none; }
.panel-note {
  color: var(--text-dim);
  font-size: .95rem;
  max-width: 80ch;
  padding-bottom: 1.2rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px dashed var(--stroke);
}

.task-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: .7rem 1.4rem; }
.task-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem .95rem;
  border: 1px solid var(--stroke);
  border-radius: var(--r);
  background: rgba(255, 255, 255, .022);
  transition: border-color .25s var(--ease), background-color .25s var(--ease);
}
.task-list li:hover { border-color: var(--stroke-strong); background: rgba(255, 255, 255, .045); }
.task-list h4 { font-size: .96rem; font-weight: 650; letter-spacing: -.01em; }
.task-list p { font-size: .85rem; color: var(--text-mute); margin-top: .25rem; }

.risk {
  flex: none;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding: .22rem .6rem;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}
.risk.safe { color: var(--brand-3); border-color: rgba(53, 224, 176, .4); background: rgba(53, 224, 176, .1); }
.risk.medium { color: var(--warn); border-color: rgba(243, 177, 60, .38); background: rgba(243, 177, 60, .1); }
.risk.advanced { color: var(--danger); border-color: rgba(255, 122, 134, .38); background: rgba(255, 122, 134, .1); }

/* ---------- 11. Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.shot { margin: 0; }
.shot-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--stroke);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
  cursor: zoom-in;
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.shot-btn:hover { transform: translateY(-4px); border-color: var(--stroke-strong); box-shadow: var(--shadow); }
.shot-btn img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.shot-zoom {
  position: absolute;
  right: .7rem; bottom: .7rem;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(6, 7, 14, .7);
  border: 1px solid var(--stroke);
  color: var(--text);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.shot-btn:hover .shot-zoom, .shot-btn:focus-visible .shot-zoom { opacity: 1; transform: none; }
.shot figcaption { display: flex; flex-direction: column; padding: .8rem .2rem 0; }
.shot figcaption b { font-size: .95rem; }
.shot figcaption span { color: var(--text-mute); font-size: .84rem; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 2rem; }
.lightbox[hidden] { display: none; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(4, 5, 10, .86); backdrop-filter: blur(8px); }
.lightbox-body {
  position: relative;
  max-width: min(1180px, 100%);
  max-height: 100%;
  z-index: 1;
  animation: zoom-in .28s var(--ease);
}
.lightbox-body img {
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--r);
  border: 1px solid var(--stroke-strong);
  box-shadow: var(--shadow);
}
.lightbox-caption { text-align: center; color: var(--text-dim); font-size: .9rem; margin-top: .8rem; }
.lightbox-close {
  position: absolute;
  top: -.4rem; right: -.4rem;
  transform: translate(50%, -50%);
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--stroke-strong);
  background: rgba(6, 7, 14, .9);
  color: var(--text);
  cursor: pointer;
}
.lightbox-close:hover { background: var(--brand); color: #0a0a18; }

@keyframes zoom-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- 12. Themes ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.theme-card { padding: 0; overflow: hidden; }
.theme-preview { border-bottom: 1px solid var(--stroke); background: rgba(0, 0, 0, .25); }
.theme-preview img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.theme-meta { display: flex; gap: .9rem; padding: 1.1rem 1.3rem 1.4rem; }
.theme-ico {
  flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--stroke);
}
.theme-ico.light { background: #f2f4fb; color: #3a3f56; }
.theme-ico.gray { background: #b9bfd0; color: #2a2e42; }
.theme-ico.black { background: #0b0e1c; color: #9a8dff; }
.theme-meta h3 { font-size: 1.05rem; }
.theme-meta p { font-size: .88rem; color: var(--text-mute); }

.lang-strip {
  margin-top: 1rem;
  border-radius: var(--r-lg);
  padding: clamp(1.3rem, 2.4vw, 2rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 1.4rem;
  align-items: center;
}
.lang-strip h3 { font-size: 1.2rem; }
.lang-strip p { color: var(--text-dim); font-size: .93rem; margin-top: .4rem; }
.lang-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.lang-chips li {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .72rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .03);
  font-size: .82rem;
  color: var(--text-dim);
}
.lang-chips .icon { width: 14px; height: 14px; color: var(--brand-2); }

/* ---------- 13. Free panel ---------- */
.free-panel { position: relative; border-radius: 32px; overflow: hidden; padding: 1px; }
.free-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, rgba(124, 108, 255, .85), rgba(74, 214, 240, .55), rgba(53, 224, 176, .6));
  opacity: .85;
}
.free-glow {
  position: absolute;
  inset: -40% 30% 40% -10%;
  background: radial-gradient(circle at 30% 40%, rgba(124, 108, 255, .45), transparent 60%);
  filter: blur(60px);
}
.free-inner {
  position: relative;
  border-radius: 31px;
  background: linear-gradient(165deg, rgba(9, 10, 20, .96), rgba(8, 10, 19, .99));
  padding: clamp(2rem, 4vw, 3.4rem);
  text-align: center;
}
.free-inner h2 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
.free-lede { max-width: 62ch; margin: 1rem auto 0; color: var(--text-dim); }

.studio-badge {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin-top: 1.6rem;
  padding: .55rem 1.15rem .55rem .65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: linear-gradient(120deg, rgba(124, 108, 255, .25), rgba(74, 214, 240, .18));
  font-weight: 700;
  letter-spacing: .01em;
}
.studio-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--grad);
  color: #0a0a18;
}
.studio-mark svg { width: 17px; height: 17px; }

.free-list {
  margin-top: 2.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: .9rem;
  text-align: left;
}
.free-list li { display: flex; gap: .8rem; padding: 1.1rem; border-radius: var(--r); }
.free-list .icon { flex: none; width: 22px; height: 22px; color: var(--brand-2); margin-top: .15rem; }
.free-list b { display: block; font-size: .96rem; }
.free-list span { display: block; font-size: .86rem; color: var(--text-mute); margin-top: .2rem; }

/* ---------- 14. Download ---------- */
.download-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr);
  gap: clamp(1.6rem, 4vw, 3rem);
  align-items: start;
}
.steps { margin-top: 1.8rem; display: grid; gap: .8rem; counter-reset: step; }
.steps li {
  position: relative;
  padding: 1rem 1.1rem 1rem 3.4rem;
  border: 1px solid var(--stroke);
  border-radius: var(--r);
  background: rgba(255, 255, 255, .028);
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 1rem; top: 1rem;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--grad);
  color: #0a0a18;
  font-size: .82rem;
  font-weight: 750;
}
.steps b { display: block; font-size: .98rem; }
.steps span { display: block; font-size: .89rem; color: var(--text-mute); margin-top: .2rem; }

.download-side { display: grid; gap: 1rem; }
.req-card h3 { font-size: 1.05rem; margin-bottom: 1rem; }
.spec { margin: 0; display: grid; gap: .1rem; }
.spec > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem 0;
  border-bottom: 1px dashed var(--stroke);
  font-size: .9rem;
}
.spec > div:last-child { border-bottom: 0; }
.spec dt { color: var(--text-mute); }
.spec dd { margin: 0; text-align: right; font-weight: 600; }

.safe-card { display: flex; gap: .8rem; align-items: flex-start; }
.safe-card .icon { flex: none; width: 22px; height: 22px; margin-top: .2rem; }
.safe-card p { font-size: .9rem; color: var(--text-dim); }

/* ---------- 15. FAQ ---------- */
.faq { display: grid; gap: .7rem; }
.faq-item { border-radius: var(--r); overflow: hidden; }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  font-weight: 650;
  font-size: 1.02rem;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--brand-soft); }
.faq-item summary .icon {
  flex: none;
  width: 20px; height: 20px;
  color: var(--brand-2);
  transition: transform .3s var(--ease);
}
.faq-item[open] summary .icon { transform: rotate(45deg); }
.faq-body { padding: 0 1.25rem 1.25rem; }
.faq-body p { color: var(--text-dim); font-size: .95rem; }
.faq-item[open] { border-color: var(--stroke-strong); }

/* ---------- 16. Final CTA ---------- */
.final-cta { padding-bottom: clamp(4rem, 9vw, 8rem); }
.final-panel {
  position: relative;
  text-align: center;
  padding: clamp(2.4rem, 5vw, 4rem) clamp(1.4rem, 4vw, 3rem);
  border-radius: 32px;
  border: 1px solid var(--stroke);
  background:
    radial-gradient(700px 260px at 50% 0%, rgba(124, 108, 255, .28), transparent 65%),
    linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
  backdrop-filter: blur(16px);
  overflow: hidden;
}
.final-panel h2 { font-size: clamp(1.8rem, 4vw, 2.9rem); max-width: 22ch; margin-inline: auto; }
.final-panel p { color: var(--text-dim); margin: 1rem auto 1.8rem; max-width: 56ch; }

/* ---------- 17. Footer ---------- */
.site-footer {
  border-top: 1px solid var(--stroke);
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .022));
  padding: clamp(2.6rem, 5vw, 3.6rem) 0 1.5rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--stroke);
}
.footer-brand p { color: var(--text-mute); font-size: .9rem; margin-top: 1rem; max-width: 42ch; }
.footer-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.footer-nav h4 {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--text-mute);
  margin-bottom: .85rem;
}
.footer-nav ul { display: grid; gap: .45rem; }
.footer-nav a { display: inline-flex; align-items: center; gap: .4rem; color: var(--text-dim); font-size: .92rem; }
.footer-nav a .icon { width: 14px; height: 14px; }
.footer-nav .lic { color: var(--text-mute); font-size: .92rem; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .6rem;
  padding-top: 1.4rem;
  color: var(--text-mute);
  font-size: .84rem;
}

/* ---------- 18. Reveal animations (hidden only when JS is available) ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); }
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

/* Anchor targets must clear the sticky header */
main > section[id], footer[id] { scroll-margin-top: calc(var(--header-h) + 14px); }

.main-nav a[aria-current="true"] { color: var(--text); background: var(--surface); }

@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes nav-in { from { transform: translateY(-8px); } to { transform: none; } }

/* 1px sentinel at the very top: drives the sticky-header state without
   depending on scroll events. */
.top-sentinel {
  position: absolute;
  top: 0; left: 0;
  width: 1px; height: 1px;
  pointer-events: none;
  visibility: hidden;
}

/* ---------- 19. Responsive ---------- */
@media (max-width: 1180px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lang-strip { grid-template-columns: 1fr; }
}

@media (max-width: 1020px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: 2; margin-top: 2.4rem; }
  .app-frame { transform: none; }

  .menu-toggle { display: grid; }
  .header-cta { display: none; }
  .main-nav {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    margin: 0;
    padding: .6rem;
    background: rgba(8, 10, 19, .96);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--stroke);
  }
  .main-nav ul { flex-direction: column; gap: .15rem; }
  .main-nav a { padding: .8rem .9rem; font-size: 1rem; border-radius: var(--r-sm); }
  /* display:none keeps the closed state bulletproof; the open state fades in with
     a keyframe animation that degrades gracefully to a plain visible panel
     (the explicit opacity/transform declarations apply whenever the animation
     does not run). */
  .site-header.nav-open .main-nav { display: grid; opacity: 1; transform: none; animation: nav-in .26s var(--ease); }
  .site-header { background: rgba(6, 7, 14, .9); backdrop-filter: blur(18px); border-bottom-color: var(--stroke); }

  .theme-grid { grid-template-columns: 1fr 1fr; }
  .download-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --header-h: 66px; }
  .container, .container-narrow { width: min(100% - 1.75rem, var(--container)); }
  .section { padding: clamp(3rem, 9vw, 4.5rem) 0; }
  .hero { padding-top: 2rem; }
  .bento { grid-template-columns: 1fr; }
  .bento .span-2 { grid-column: auto; }
  .profile-grid, .gallery, .theme-grid { grid-template-columns: 1fr; }
  .task-list { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: .4rem; scrollbar-width: thin; }
  .tab { flex: none; }
  .hero-cta .btn { width: 100%; }
  .badge-row { gap: .45rem; }
  .badge { padding: .42rem .75rem; font-size: .8rem; }
  .hero-chips { gap: .5rem; }
  .hero-chip { flex: 1 1 100%; }
  .hero-visual { display: grid; gap: .6rem; }
  .free-inner { padding: 1.6rem 1.15rem; }
  .lightbox { padding: 1rem; }
  .lightbox-close { transform: translate(-8%, 8%); }
  .footer-bottom { flex-direction: column; }
}

@media (max-width: 420px) {
  .brand-text small { display: none; }
  .lang-btn { padding: .28rem .5rem; }
}

/* ---------- 20. Reduced motion & contrast ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .app-frame { transform: none !important; }
}

@media (prefers-contrast: more) {
  :root {
    --text-dim: #dfe3f2;
    --text-mute: #c2c8dc;
    --stroke: rgba(255, 255, 255, .28);
  }
}
