/* ==========================================================================
   FreeAIToolsNow — main stylesheet
   --------------------------------------------------------------------------
   1. Tokens          6. Section scaffolding   11. Why section
   2. Base            7. Tool cards + filters  12. CTA panel
   3. Utilities       8. Showcase (parallax)   13. Footer
   4. Buttons/badges  9. Categories            14. Content pages & forms
   5. Header / nav   10. Hero                  15. Motion & reduced motion
   ========================================================================== */

/* Fonts (self-hosted, Latin subset, variable weight) */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --bg: #05060d;
  --bg-elev: #0a0c1a;
  --bg-soft: #0e1126;
  --ink: 255, 255, 255; /* neutral overlay channel: white on dark, navy on light */
  --surface: rgba(var(--ink), 0.035);
  --surface-2: rgba(var(--ink), 0.06);
  --surface-3: rgba(var(--ink), 0.09);
  --border: rgba(var(--ink), 0.08);
  --border-2: rgba(var(--ink), 0.14);

  --text: #eef0fb;
  --text-2: #b6bbd8;
  --muted: #8b91b4;

  --blue: #4f8cff;
  --violet: #8b5cf6;
  --magenta: #d16bff;
  --cyan: #22d3ee;
  --pink: #ec4899;
  --lilac: #c4b5fd;
  --success: #34d399;
  --danger: #fb7185;

  --grad: linear-gradient(120deg, #4f8cff 0%, #8b5cf6 52%, #d16bff 100%);
  --grad-text: linear-gradient(100deg, #8fb4ff 0%, #a78bfa 45%, #e879f9 100%);
  --grad-soft: linear-gradient(120deg, rgba(79, 140, 255, 0.18), rgba(139, 92, 246, 0.2));

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow: 0 24px 70px -24px rgba(0, 0, 0, 0.75);
  --glow: 0 10px 40px -10px rgba(110, 90, 255, 0.55);

  /* Themed component colours */
  --on-soft: #fff;              /* text on tinted/soft-gradient fills */
  --mix-base: #fff;             /* lightens accent-coloured text */
  --success-text: #a7f3d0;
  --danger-text: #fecdd3;
  --link: #a5b4fc;
  --why-icon: #c7d2fe;
  --placeholder: #6f7598;
  --field-bg: rgba(255, 255, 255, 0.04);
  --field-bg-focus: rgba(255, 255, 255, 0.06);
  --option-bg: #0e1126;
  --glass-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02));
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.015));
  --chip-glass-bg: rgba(10, 12, 26, 0.6);
  --header-bg: rgba(6, 7, 16, 0.72);
  --menu-bg: rgba(6, 7, 16, 0.96);
  --panel-bg: rgba(8, 10, 24, 0.75);
  --ws-output-bg: rgba(5, 6, 13, 0.35);
  --toast-bg: rgba(10, 20, 20, 0.92);
  --toast-text: #d1fae5;
  --code-k: #c4b5fd;
  --code-f: #7dd3fc;
  --code-s: #86efac;
  --stage-shadow: 0 60px 120px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.06), 0 -20px 120px -40px rgba(124, 92, 255, 0.55);
  --showcase-bg: linear-gradient(180deg, var(--bg) 0%, #070a1d 30%, #0a0a22 70%, var(--bg) 100%);
  --cta-bg:
    radial-gradient(70% 90% at 50% 0%, rgba(124, 92, 255, 0.35), transparent 70%),
    radial-gradient(50% 60% at 100% 100%, rgba(79, 140, 255, 0.22), transparent 70%),
    linear-gradient(180deg, #0f1030, #090a1c);

  --font-display: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Consolas, monospace;

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --nav-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: dark;
}

/* Light theme — set by the header switch (html[data-theme="light"]) */
:root[data-theme="light"] {
  --bg: #f5f6fb;
  --bg-elev: #ffffff;
  --bg-soft: #eceef7;
  --ink: 20, 24, 60;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-2: rgba(var(--ink), 0.05);
  --surface-3: rgba(var(--ink), 0.08);
  --border: rgba(var(--ink), 0.1);
  --border-2: rgba(var(--ink), 0.16);

  --text: #0d1026;
  --text-2: #414766;
  --muted: #5f6588;
  --lilac: #6d28d9;
  --success: #059669;
  --danger: #e11d48;

  --grad-text: linear-gradient(100deg, #2563eb 0%, #7c3aed 50%, #c026d3 100%);
  --grad-soft: linear-gradient(120deg, rgba(79, 140, 255, 0.14), rgba(139, 92, 246, 0.16));
  --shadow: 0 24px 60px -28px rgba(30, 30, 80, 0.3);

  --on-soft: #1e1b4b;
  --mix-base: #0d1026;
  --success-text: #047857;
  --danger-text: #be123c;
  --link: #4f46e5;
  --why-icon: #4f46e5;
  --placeholder: #8a8fab;
  --field-bg: #ffffff;
  --field-bg-focus: #ffffff;
  --option-bg: #ffffff;
  --glass-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.65));
  --card-bg: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.8));
  --chip-glass-bg: rgba(255, 255, 255, 0.75);
  --header-bg: rgba(245, 246, 251, 0.8);
  --menu-bg: rgba(245, 246, 251, 0.97);
  --panel-bg: rgba(255, 255, 255, 0.88);
  --ws-output-bg: rgba(var(--ink), 0.025);
  --toast-bg: #ecfdf5;
  --toast-text: #065f46;
  --code-k: #7c3aed;
  --code-f: #0369a1;
  --code-s: #15803d;
  --stage-shadow: 0 50px 100px -40px rgba(40, 40, 110, 0.35), 0 0 0 1px rgba(20, 24, 60, 0.08), 0 -20px 120px -40px rgba(124, 92, 255, 0.35);
  --showcase-bg: linear-gradient(180deg, var(--bg) 0%, #eeecff 30%, #e9edff 70%, var(--bg) 100%);
  --cta-bg:
    radial-gradient(70% 90% at 50% 0%, rgba(124, 92, 255, 0.22), transparent 70%),
    radial-gradient(50% 60% at 100% 100%, rgba(79, 140, 255, 0.18), transparent 70%),
    linear-gradient(180deg, #f1efff, #ffffff);

  color-scheme: light;
}

/* Smooth colour cross-fade while switching themes (skipped for reduced motion). */
.theme-anim *, .theme-anim *::before, .theme-anim *::after {
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease), fill 0.35s, stroke 0.35s !important;
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

[hidden] { display: none !important; }

img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1em; text-wrap: pretty; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }

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

/* 3. Utilities ------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 100;
  padding: 0.75rem 1.1rem;
  border-radius: 12px;
  background: #fff;
  color: #05060d;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

.gradient-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

.icon { width: 1.25em; height: 1.25em; flex: none; }

/* 4. Buttons & badges ------------------------------------------------------ */
.btn {
  --btn-h: 48px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--btn-h);
  padding: 0 1.35rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 600 0.95rem/1 var(--font-body);
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s, border-color 0.25s, color 0.25s;
}
.btn .arrow { display: inline-block; transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  color: #fff;
  background: var(--grad);
  background-size: 140% 100%;
  background-position: 0% 50%;
  box-shadow: 0 10px 30px -10px rgba(124, 92, 255, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background-position 0.5s var(--ease);
}
.btn-primary:hover {
  transform: translateY(-2px);
  background-position: 100% 50%;
  box-shadow: 0 16px 40px -10px rgba(124, 92, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-ghost {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-2);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: var(--surface-3); border-color: rgba(var(--ink), 0.24); transform: translateY(-2px); }

.btn-sm { --btn-h: 40px; padding: 0 1rem; font-size: 0.9rem; }
.btn-lg { --btn-h: 56px; padding: 0 1.7rem; font-size: 1rem; }
.btn-block { width: 100%; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
}
.link-btn:hover { color: var(--text); background: var(--surface-2); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge-free {
  color: var(--success-text);
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.28);
}
.badge-new {
  color: #fff;
  background: var(--grad);
  border-color: transparent;
}

/* 5. Header / navigation --------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color 0.35s var(--ease), border-color 0.35s, backdrop-filter 0.35s;
}
.site-header.is-scrolled,
.site-header.is-open {
  background: var(--header-bg);
  border-bottom-color: var(--border);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  backdrop-filter: saturate(160%) blur(18px);
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font: 700 1.15rem/1 var(--font-display);
  letter-spacing: -0.03em;
  text-decoration: none;
}
.logo img { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 6px 20px -6px rgba(124, 92, 255, 0.8); }
.logo-accent { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-menu { display: flex; align-items: center; gap: 1.25rem; }

.nav-links {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-links a {
  display: block;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 0.93rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}
.nav-links a:hover,
.nav-links a[aria-current] { color: var(--text); background: var(--surface-2); }

/* Theme switch (Light / Dark) */
.theme-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: var(--surface-2);
}
.theme-switch::before {
  content: "";
  position: absolute;
  top: 3px; bottom: 3px; left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: var(--grad);
  box-shadow: 0 4px 14px -4px rgba(124, 92, 255, 0.7);
  transform: translateX(100%);
  transition: transform 0.35s var(--ease);
}
:root[data-theme="light"] .theme-switch::before { transform: translateX(0); }
.theme-btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 36px; height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.25s;
}
.theme-btn .icon { width: 17px; height: 17px; }
.theme-btn:hover { color: var(--text); }
.theme-btn[aria-pressed="true"] { color: #fff; }
.theme-btn:focus-visible { outline-offset: 1px; }
.theme-label {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  position: relative;
  width: 44px; height: 44px;
  margin-left: auto;
  border: 1px solid var(--border-2);
  border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
}
.nav-toggle span {
  position: absolute;
  left: 12px; right: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.3s var(--ease), top 0.3s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 25px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 20.5px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { top: 20.5px; transform: rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-menu {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem var(--gutter) 1.5rem;
    background: var(--menu-bg);
    border-bottom: 1px solid var(--border);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s linear 0.25s;
  }
  .site-header.is-open .nav-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  }
  .nav-links { flex-direction: column; }
  .nav-links a { padding: 0.85rem 1rem; font-size: 1.05rem; border-radius: 12px; }
  .nav-cta { width: 100%; }
  .theme-switch { display: grid; width: 100%; }
  .theme-btn { width: auto; height: 44px; font-size: 0.95rem; font-weight: 600; }
  .theme-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}

/* 6. Section scaffolding --------------------------------------------------- */
main { display: block; }

.section {
  position: relative;
  padding: clamp(80px, 11vw, 140px) 0;
}

.section-head {
  max-width: 720px;
  margin: 0 auto clamp(40px, 6vw, 64px);
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--lilac);
  font: 600 0.78rem/1 var(--font-body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 18px; height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.section-title {
  margin: 0.9rem 0 1rem;
  font-size: clamp(2rem, 4.8vw, 3.5rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.section-lead {
  margin: 0 auto;
  max-width: 600px;
  color: var(--text-2);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
}

/* 7. Tool cards + filters -------------------------------------------------- */
.tools-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(45% 22% at 50% 26%, rgba(79, 140, 255, 0.1), transparent 70%),
    radial-gradient(40% 40% at 90% 60%, rgba(139, 92, 246, 0.08), transparent 70%);
  pointer-events: none;
}

.tools-toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.search {
  position: relative;
  width: min(440px, 100%);
}
.search .icon {
  position: absolute;
  left: 16px; top: 50%;
  translate: 0 -50%;
  color: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 50px;
  padding: 0 1rem 0 2.9rem;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: rgba(139, 92, 246, 0.6); background: var(--surface-2); box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15); }

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  max-width: 100%;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}
.chip:hover { color: var(--text); border-color: var(--border-2); }
.chip[aria-pressed="true"] {
  color: var(--on-soft);
  background: var(--grad-soft);
  border-color: rgba(139, 92, 246, 0.55);
}
.chip-count { color: var(--muted); font-size: 0.78rem; }
.chip[aria-pressed="true"] .chip-count { color: var(--lilac); }

@media (max-width: 640px) {
  .filter-chips {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    width: calc(100% + var(--gutter) * 2);
    margin-inline: calc(var(--gutter) * -1);
    padding: 2px var(--gutter) 8px;
    scrollbar-width: none;
  }
  .filter-chips::-webkit-scrollbar { display: none; }
}

.results-status { margin: 0; color: var(--muted); font-size: 0.85rem; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: clamp(18px, 2.4vw, 28px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.tools-grid > li { display: flex; }

.tool-card {
  --a1: #4f8cff;
  --a2: #8b5cf6;
  --rx: 0deg;
  --ry: 0deg;
  --lift: 0px;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: clamp(22px, 2.4vw, 30px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(var(--lift));
  transition: transform 0.6s var(--ease), box-shadow 0.4s var(--ease), border-color 0.3s;
}
.tool-card.is-tilting { transition: transform 0.12s linear, box-shadow 0.4s var(--ease), border-color 0.3s; }

/* Cursor-following glow */
.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--a1) 22%, transparent), transparent 62%);
  opacity: 0;
  transition: opacity 0.4s;
}
/* Gradient hairline border */
.tool-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(140deg, var(--a1), transparent 38%, transparent 62%, var(--a2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.35;
  transition: opacity 0.3s;
}
.tool-card:hover,
.tool-card:focus-within {
  --lift: -6px;
  box-shadow: 0 34px 70px -34px color-mix(in srgb, var(--a2) 70%, transparent);
}
.tool-card:hover::before,
.tool-card:focus-within::before,
.tool-card:hover::after,
.tool-card:focus-within::after { opacity: 1; }

.tool-card-art {
  position: absolute;
  top: -48px; right: -56px;
  width: 210px; height: 210px;
  z-index: -1;
  color: var(--a1);
  opacity: 0.05;
  pointer-events: none;
  transition: transform 0.8s var(--ease), opacity 0.4s;
}
.tool-card-art svg { width: 100%; height: 100%; }
.tool-card:hover .tool-card-art { transform: rotate(-8deg) scale(1.08); opacity: 0.1; }

.tool-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.tool-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px; height: 58px;
  flex: none;
  border-radius: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.45), transparent 45%),
    linear-gradient(135deg, var(--a1), var(--a2));
  box-shadow: 0 12px 30px -10px color-mix(in srgb, var(--a2) 80%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: translateZ(30px);
}
.tool-icon::after {
  content: "";
  position: absolute;
  inset: -6px;
  z-index: -1;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--a1), var(--a2));
  filter: blur(14px);
  opacity: 0.35;
}
.tool-icon svg { width: 28px; height: 28px; }
.tool-icon img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }

.tool-card-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.4rem; }
.tool-card .badge-category {
  color: color-mix(in srgb, var(--a1) 65%, var(--mix-base));
  background: color-mix(in srgb, var(--a1) 12%, transparent);
  border-color: color-mix(in srgb, var(--a1) 35%, transparent);
}

.tool-card-title {
  margin-bottom: 0.6rem;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.tool-card-desc { flex: 1; margin-bottom: 1.25rem; color: var(--text-2); font-size: 0.97rem; }

.tool-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}
.tool-card-tags li {
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
}

.tool-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.tool-card-meta { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted); font-size: 0.8rem; }
.tool-card-meta .icon { width: 14px; height: 14px; }

.tool-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}
/* Makes the whole card clickable while keeping a single, accessible link. */
.tool-card-cta::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius-lg); }
.tool-card-cta .arrow { transition: transform 0.25s var(--ease); }
.tool-card:hover .tool-card-cta {
  color: #fff;
  background: linear-gradient(135deg, var(--a1), var(--a2));
  border-color: transparent;
}
.tool-card:hover .tool-card-cta .arrow { transform: translateX(3px); }
.tool-card-cta:focus-visible { outline: none; }
.tool-card-cta:focus-visible::after { outline: 2px solid var(--lilac); outline-offset: 3px; }

.tools-empty {
  grid-column: 1 / -1;
  padding: clamp(40px, 6vw, 64px) 24px;
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--text-2);
}
.tools-empty .emoji { display: block; margin-bottom: 0.75rem; font-size: 2.25rem; }
.tools-empty h3 { margin-bottom: 0.5rem; font-size: 1.3rem; color: var(--text); }
.tools-empty p { margin-bottom: 1.25rem; }

.tools-more {
  display: flex;
  justify-content: center;
  margin-top: clamp(32px, 4vw, 48px);
}

/* 8. Showcase (full-width parallax) ---------------------------------------- */
.showcase {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(96px, 12vw, 160px) 0 clamp(80px, 10vw, 140px);
  background: var(--showcase-bg);
}

.showcase-bg {
  position: absolute;
  inset: -20% 0;
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}
.sc-layer { position: absolute; inset: 0; }
.sc-glow {
  background:
    radial-gradient(35% 30% at 50% 55%, rgba(124, 92, 255, 0.28), transparent 70%),
    radial-gradient(30% 25% at 20% 30%, rgba(79, 140, 255, 0.16), transparent 70%),
    radial-gradient(25% 25% at 85% 70%, rgba(209, 107, 255, 0.14), transparent 70%);
}
.sc-stars {
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(var(--ink), 0.7), transparent),
    radial-gradient(1px 1px at 30% 70%, rgba(var(--ink), 0.5), transparent),
    radial-gradient(1.5px 1.5px at 55% 15%, rgba(196, 181, 253, 0.8), transparent),
    radial-gradient(1px 1px at 75% 45%, rgba(var(--ink), 0.6), transparent),
    radial-gradient(1px 1px at 90% 85%, rgba(var(--ink), 0.5), transparent),
    radial-gradient(1.5px 1.5px at 45% 90%, rgba(143, 180, 255, 0.7), transparent),
    radial-gradient(1px 1px at 65% 60%, rgba(var(--ink), 0.4), transparent);
  background-size: 480px 480px;
  opacity: 0.8;
}
.sc-grid {
  position: absolute;
  left: -20%; right: -20%; bottom: 12%;
  height: 55%;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.22) 1px, transparent 1px);
  background-size: 70px 70px;
  opacity: 0.7;
  transform: perspective(600px) rotateX(62deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 30%, transparent 100%);
}

.sc-stage {
  position: relative;
  height: clamp(440px, 52vw, 580px);
  margin-top: clamp(24px, 4vw, 40px);
}

.sc-core {
  position: absolute;
  left: 50%; top: 50%;
  width: clamp(260px, 34vw, 400px);
  aspect-ratio: 1;
  translate: -50% -50%;
}
.sc-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(196, 181, 253, 0.18);
}
.sc-ring:nth-child(2) { inset: 14%; border-style: dashed; border-color: rgba(143, 180, 255, 0.25); animation: spin 60s linear infinite; }
.sc-ring:nth-child(3) { inset: 28%; border-color: rgba(209, 107, 255, 0.25); animation: spin 40s linear infinite reverse; }
.sc-ring .sat {
  position: absolute;
  top: -5px; left: 50%;
  width: 10px; height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
}
.sc-ring:nth-child(3) .sat { background: var(--magenta); box-shadow: 0 0 14px var(--magenta); }
.sc-orb {
  position: absolute;
  inset: 38%;
  display: grid;
  place-items: center;
  border-radius: 28%;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.55), transparent 40%),
    var(--grad);
  box-shadow: 0 0 60px rgba(124, 92, 255, 0.7), 0 0 140px rgba(79, 140, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  animation: pulse 6s ease-in-out infinite;
}
.sc-orb svg { width: 46%; height: 46%; color: #fff; }

.sc-card {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: clamp(170px, 19vw, 230px);
  padding: 14px;
  border-radius: 18px;
  font-size: 0.8rem;
  color: var(--text-2);
  box-shadow: var(--shadow);
}
.sc-card-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.7rem; color: var(--text); font-weight: 600; font-size: 0.82rem; }
.sc-card-emoji {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 9px;
  background: var(--surface-3);
  font-size: 0.95rem;
}
.sc-lines span { display: block; height: 7px; margin-bottom: 7px; border-radius: 4px; background: rgba(var(--ink), 0.1); }
.sc-lines span:nth-child(1) { width: 92%; }
.sc-lines span:nth-child(2) { width: 78%; }
.sc-lines span:nth-child(3) { width: 58%; margin-bottom: 0; }
.sc-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.12);
  color: var(--success-text);
  font-size: 0.72rem;
  font-weight: 600;
}
.sc-checks { margin: 0; padding: 0; list-style: none; }
.sc-checks li { display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.4rem; }
.sc-checks li::before {
  content: "";
  width: 14px; height: 14px;
  flex: none;
  border-radius: 4px;
  background: var(--grad);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.sc-checks li span { display: block; height: 6px; flex: 1; border-radius: 3px; background: rgba(var(--ink), 0.1); }
.sc-thumb {
  height: 78px;
  margin-bottom: 0.6rem;
  border-radius: 12px;
  background:
    radial-gradient(circle at 70% 30%, #fcd34d 0 10%, transparent 11%),
    radial-gradient(120% 80% at 50% 110%, #1e1b4b 40%, transparent 41%),
    radial-gradient(90% 70% at 20% 120%, #312e81 45%, transparent 46%),
    linear-gradient(180deg, #f472b6 0%, #fb923c 45%, #fde68a 100%);
}
.sc-mono { font-family: var(--font-mono); font-size: 0.72rem; line-height: 1.7; color: var(--text-2); }
.sc-mono .k { color: var(--code-k); }
.sc-mono .f { color: var(--code-f); }
.sc-mono .s { color: var(--code-s); }
.sc-bars { display: flex; align-items: flex-end; gap: 6px; height: 64px; }
.sc-bars span { flex: 1; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--violet), rgba(79, 140, 255, 0.35)); }
.sc-wave { display: flex; align-items: center; gap: 3px; height: 44px; }
.sc-wave span {
  flex: 1;
  height: var(--h, 40%);
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  animation: wave 1.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.12s);
}

.sc-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: clamp(28px, 4vw, 44px);
}
.sc-chips a {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: var(--chip-glass-bg);
  color: var(--text-2);
  font-size: 0.9rem;
  text-decoration: none;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.sc-chips a:hover { color: var(--on-soft); border-color: rgba(139, 92, 246, 0.6); background: rgba(139, 92, 246, 0.15); }

@media (max-width: 760px) {
  .sc-card {
    left: min(var(--x), calc(100% - 150px));
    top: min(var(--y), calc(100% - 170px));
    width: 150px;
    padding: 11px;
    font-size: 0.72rem;
  }
  .sc-card--hide-sm { display: none; }
}

/* 9. Categories ------------------------------------------------------------ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(12px, 1.8vw, 20px);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 960px) { .categories-grid { grid-template-columns: repeat(2, 1fr); } }

.category-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
  padding: clamp(16px, 2vw, 22px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.3s, background-color 0.3s;
}
.category-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(240px circle at var(--mx, 0%) var(--my, 0%), rgba(139, 92, 246, 0.18), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s;
}
.category-card:hover,
.category-card:focus-visible { transform: translateY(-4px); border-color: rgba(139, 92, 246, 0.45); background: var(--surface-2); }
.category-card:hover::before { opacity: 1; }
.category-emoji {
  position: relative;
  display: grid;
  place-items: center;
  width: 50px; height: 50px;
  flex: none;
  border-radius: 14px;
  border: 1px solid var(--border-2);
  background: linear-gradient(145deg, rgba(var(--ink), 0.1), rgba(var(--ink), 0.02));
  font-size: 1.45rem;
}
.category-body { position: relative; min-width: 0; }
.category-name { display: block; font: 600 1.02rem/1.25 var(--font-display); letter-spacing: -0.02em; }
.category-count { display: block; margin-top: 0.2rem; color: var(--muted); font-size: 0.8rem; }
.category-count.is-live { color: var(--success-text); }
.category-arrow {
  position: relative;
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.3s var(--ease), color 0.3s;
}
.category-card:hover .category-arrow { transform: translateX(4px); color: var(--text); }

@media (max-width: 480px) {
  .category-card { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .category-arrow { display: none; }
}

/* 10. Hero ----------------------------------------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: calc(var(--nav-h) + clamp(56px, 9vw, 110px)) 0 clamp(72px, 9vw, 120px);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 75%, transparent);
  mask-image: linear-gradient(180deg, #000 75%, transparent);
}
.hero-grid {
  position: absolute;
  inset: -10% -10% 0;
  background-image:
    linear-gradient(rgba(var(--ink), 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--ink), 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 65% 50% at 50% 28%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse 65% 50% at 50% 28%, #000 25%, transparent 75%);
}
.hero-particles { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.75; }

.orb { position: absolute; border-radius: 50%; }
.orb-1 { width: 720px; height: 720px; left: -260px; top: -220px; background: radial-gradient(circle, rgba(79, 140, 255, 0.35), transparent 62%); }
.orb-2 { width: 680px; height: 680px; right: -240px; top: 60px; background: radial-gradient(circle, rgba(139, 92, 246, 0.32), transparent 62%); }
.orb-3 { width: 560px; height: 560px; left: 50%; bottom: -260px; margin-left: -280px; background: radial-gradient(circle, rgba(209, 107, 255, 0.22), transparent 62%); }

.shape { position: absolute; }
.shape > * { animation: float 9s ease-in-out infinite; }
.shape-ring { left: 8%; top: 30%; }
.shape-ring > span {
  display: block;
  width: 110px; height: 110px;
  border-radius: 50%;
  padding: 10px;
  background: linear-gradient(140deg, rgba(79, 140, 255, 0.9), rgba(209, 107, 255, 0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.55;
}
.shape-cube { right: 9%; top: 26%; }
.shape-cube > span {
  display: block;
  width: 78px; height: 78px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.55), rgba(79, 140, 255, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 20px 50px -10px rgba(139, 92, 246, 0.6);
  transform: rotate(18deg);
  animation-duration: 11s;
  animation-delay: -3s;
}
.shape-sphere { left: 15%; top: 40%; }
.shape-sphere > span {
  display: block;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff 0%, #a5b4fc 18%, #6366f1 55%, #312e81 100%);
  box-shadow: 0 10px 40px rgba(99, 102, 241, 0.7);
  animation-duration: 7s;
  animation-delay: -2s;
}
.shape-spark { right: 22%; top: 12%; }
.shape-spark > span { display: block; width: 34px; height: 34px; color: var(--lilac); animation-duration: 8s; }
.shape-spark svg { width: 100%; height: 100%; filter: drop-shadow(0 0 10px rgba(196, 181, 253, 0.8)); }

.hero-inner { max-width: 940px; margin-inline: auto; text-align: center; }

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.9rem 0.35rem 0.4rem;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.85rem;
  text-decoration: none;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: border-color 0.2s, color 0.2s;
}
.hero-pill:hover { color: var(--text); border-color: rgba(139, 92, 246, 0.5); }
.hero-pill .pill-tag { padding: 0.2rem 0.6rem; border-radius: 999px; background: var(--grad); color: #fff; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; }

.hero-title {
  margin: 1.5rem 0 1.4rem;
  font-size: clamp(2.65rem, 7.4vw, 6rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
}
.hero-title .line { display: block; }

.hero-sub {
  max-width: 660px;
  margin: 0 auto 2.25rem;
  color: var(--text-2);
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  line-height: 1.6;
}

.hero-ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; }

.trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 0.75rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.9rem;
}
.trust li { display: inline-flex; align-items: center; gap: 0.75rem; }
.trust li + li::before { content: "•"; color: rgba(196, 181, 253, 0.6); }

/* Product preview */
.hero-stage {
  position: relative;
  max-width: 1080px;
  margin: clamp(56px, 8vw, 96px) auto 0;
  perspective: 1800px;
}
.stage-window {
  --tilt: 16deg;
  --scale: 0.94;
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--stage-shadow);
  transform: rotateX(var(--tilt)) scale(var(--scale));
  transform-origin: 50% 0%;
  will-change: transform;
}
.stage-window::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 30%);
  pointer-events: none;
}
.stage-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(var(--ink), 0.03);
}
.stage-dots { display: flex; gap: 7px; }
.stage-dots span { width: 11px; height: 11px; border-radius: 50%; background: rgba(var(--ink), 0.14); }
.stage-url {
  flex: 1;
  max-width: 420px;
  margin-inline: auto;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(var(--ink), 0.05);
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stage-body { display: grid; grid-template-columns: 220px 1fr; min-height: 380px; background: var(--panel-bg); }
.stage-side { padding: 18px 14px; border-right: 1px solid var(--border); }
.stage-side-label { margin: 0 0 10px 8px; color: var(--muted); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.stage-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  padding: 9px 10px;
  border-radius: 12px;
  color: var(--text-2);
  font-size: 0.82rem;
}
.stage-nav-item.is-active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.stage-nav-item .mini-icon {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  flex: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--a1, #4f8cff), var(--a2, #8b5cf6));
  color: #fff;
}
.stage-nav-item .mini-icon svg { width: 14px; height: 14px; }
.stage-main { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 22px; }
.stage-pane { padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: rgba(var(--ink), 0.025); }
.stage-pane-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; color: var(--text); font-size: 0.82rem; font-weight: 600; }
.stage-pane-title small { color: var(--muted); font-weight: 500; }
.skeleton span { display: block; height: 8px; margin-bottom: 11px; border-radius: 4px; background: linear-gradient(90deg, rgba(var(--ink), 0.07), rgba(var(--ink), 0.14), rgba(var(--ink), 0.07)); background-size: 200% 100%; animation: shimmer 2.8s linear infinite; }
.skeleton span:nth-child(3n) { width: 82%; }
.skeleton span:nth-child(4n) { width: 64%; }
.stage-summary { margin: 0; padding: 0; list-style: none; }
.stage-summary li { display: flex; gap: 10px; margin-bottom: 12px; color: var(--text-2); font-size: 0.8rem; line-height: 1.45; }
.stage-summary li::before { content: ""; width: 7px; height: 7px; margin-top: 6px; flex: none; border-radius: 50%; background: var(--grad); box-shadow: 0 0 10px rgba(139, 92, 246, 0.8); }
.stage-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}
.stage-btn svg { width: 13px; height: 13px; }

.float-chip {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.float-chip .fc-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--grad); color: #fff; }
.float-chip .fc-icon svg { width: 16px; height: 16px; }
.float-chip small { display: block; color: var(--muted); font-size: 0.7rem; font-weight: 400; }
.fc-1 { left: -7%; top: 64%; }
.fc-2 { right: -7%; bottom: 14%; }
.fc-3 { left: 30%; bottom: -5%; }
.fc-2 .fc-icon { background: linear-gradient(135deg, #ec4899, #f59e0b); }
.fc-3 .fc-icon { background: linear-gradient(135deg, #22d3ee, #4f8cff); }

@media (max-width: 900px) {
  .stage-body { grid-template-columns: 1fr; }
  .stage-side { display: none; }
  .fc-1 { left: 0; }
  .fc-2 { right: 0; }
}
@media (max-width: 640px) {
  .stage-main { grid-template-columns: 1fr; padding: 14px; }
  .stage-pane:first-child { display: none; }
  .stage-body { min-height: 0; }
  .float-chip { padding: 8px 11px; font-size: 0.72rem; }
  .float-chip .fc-icon { width: 26px; height: 26px; }
  .fc-1 { top: -6%; left: -2%; }
  .fc-2 { display: none; }
  .fc-3 { bottom: -8%; left: auto; right: -2%; }
  .shape-ring, .shape-cube, .shape-sphere { display: none; }
}

/* 11. Why section ---------------------------------------------------------- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 2vw, 22px);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 1024px) { .why-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .why-grid { grid-template-columns: 1fr; } }

.why-card {
  position: relative;
  height: 100%;
  padding: clamp(24px, 2.6vw, 32px);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.why-card::after {
  content: "";
  position: absolute;
  left: 20%; right: 20%; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 181, 253, 0.7), transparent);
}
.why-icon {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  margin-bottom: 1.4rem;
  border-radius: 16px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: linear-gradient(145deg, rgba(79, 140, 255, 0.2), rgba(139, 92, 246, 0.15));
  color: var(--why-icon);
}
.why-icon svg { width: 24px; height: 24px; }
.why-card h3 { margin-bottom: 0.6rem; font-size: 1.25rem; }
.why-card p { margin: 0; color: var(--text-2); font-size: 0.95rem; }
.why-num { position: absolute; top: 22px; right: 24px; color: rgba(var(--ink), 0.08); font: 700 2.4rem/1 var(--font-display); }

/* 12. CTA panel ------------------------------------------------------------ */
.cta-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(48px, 7vw, 88px) clamp(24px, 5vw, 72px);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: var(--cta-bg);
  text-align: center;
}
.cta-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(var(--ink), 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--ink), 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 40%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 70% at 50% 40%, #000, transparent 75%);
}
.cta-panel h2 { margin-bottom: 1rem; font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -0.04em; }
.cta-panel p { max-width: 520px; margin: 0 auto 2rem; color: var(--text-2); font-size: clamp(1rem, 1.4vw, 1.15rem); }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; }
.cta-float {
  position: absolute;
  z-index: -1;
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  border-radius: 20px;
  color: #fff;
  opacity: 0.85;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.6);
}
.cta-float svg { width: 28px; height: 28px; }
.cta-float--1 { left: 7%; top: 22%; background: linear-gradient(135deg, #4f8cff, #22d3ee); rotate: -12deg; }
.cta-float--2 { right: 8%; top: 18%; background: linear-gradient(135deg, #8b5cf6, #6366f1); rotate: 10deg; }
.cta-float--3 { right: 14%; bottom: 14%; width: 48px; height: 48px; border-radius: 15px; background: linear-gradient(135deg, #ec4899, #f59e0b); rotate: -6deg; }
@media (max-width: 760px) { .cta-float { display: none; } }

/* 13. Footer --------------------------------------------------------------- */
.site-footer {
  position: relative;
  padding: clamp(56px, 8vw, 88px) 0 32px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(79, 140, 255, 0.04));
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: clamp(28px, 4vw, 48px);
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

.footer-brand p { max-width: 340px; margin: 1rem 0 1.5rem; color: var(--text-2); font-size: 0.95rem; }
.footer-title { margin-bottom: 1rem; color: var(--text); font: 600 0.8rem/1 var(--font-body); letter-spacing: 0.12em; text-transform: uppercase; }
.footer-links { margin: 0; padding: 0; list-style: none; }
.footer-links li + li { margin-top: 0.7rem; }
.footer-links a { color: var(--text-2); font-size: 0.95rem; text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }

.socials { display: flex; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.socials a {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border: 1px solid var(--border-2);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-2);
  transition: color 0.2s, border-color 0.2s, background-color 0.2s, transform 0.25s var(--ease);
}
.socials a:hover { color: var(--on-soft); border-color: rgba(139, 92, 246, 0.55); background: rgba(139, 92, 246, 0.15); transform: translateY(-2px); }
.socials svg { width: 18px; height: 18px; }
.socials[hidden] { display: none; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(40px, 6vw, 64px);
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-bottom p { margin: 0; }

/* 14. Content pages & forms ------------------------------------------------ */
.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: calc(var(--nav-h) + clamp(48px, 7vw, 88px)) 0 clamp(40px, 6vw, 64px);
  text-align: center;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(45% 60% at 30% 0%, rgba(79, 140, 255, 0.22), transparent 70%),
    radial-gradient(40% 60% at 75% 10%, rgba(139, 92, 246, 0.22), transparent 70%);
}
.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(var(--ink), 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--ink), 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 20%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 70% at 50% 20%, #000 20%, transparent 75%);
}
.page-title { margin: 0.9rem 0 1rem; font-size: clamp(2.3rem, 5.5vw, 4rem); letter-spacing: -0.045em; }
.page-lead { max-width: 620px; margin: 0 auto; color: var(--text-2); font-size: clamp(1rem, 1.5vw, 1.2rem); }

.breadcrumb ol { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; margin: 0 0 1rem; padding: 0; list-style: none; color: var(--muted); font-size: 0.85rem; }
.breadcrumb li + li::before { content: "/"; margin-right: 0.4rem; opacity: 0.5; }
.breadcrumb a { color: var(--text-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb [aria-current] { color: var(--text); }

.prose { max-width: 760px; margin-inline: auto; color: var(--text-2); font-size: 1.02rem; line-height: 1.75; }
.prose h2 { margin: 2.4rem 0 0.9rem; color: var(--text); font-size: 1.6rem; }
.prose h3 { margin: 1.8rem 0 0.6rem; color: var(--text); font-size: 1.2rem; }
.prose a { color: var(--link); text-underline-offset: 3px; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }
.prose strong { color: var(--text); }
.prose .updated { color: var(--muted); font-size: 0.9rem; }

.card-panel {
  padding: clamp(24px, 4vw, 44px);
  border-radius: var(--radius-lg);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.25rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 0.45rem; min-width: 0; }
.field-label { color: var(--text); font-size: 0.88rem; font-weight: 600; }
.field-label .req { color: var(--lilac); }
.field-label .opt { color: var(--muted); font-weight: 400; }
.field-hint { color: var(--muted); font-size: 0.8rem; }
.field-error { color: var(--danger); font-size: 0.8rem; min-height: 0; }
.field-error:empty { display: none; }

.input, .select, .textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-2);
  border-radius: 12px;
  background: var(--field-bg);
  color: var(--text);
  font-size: 0.97rem;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--placeholder); }
.select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b91b4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  cursor: pointer;
}
.select option { background: var(--option-bg); color: var(--text); }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(var(--ink), 0.22); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.7);
  background-color: var(--field-bg-focus);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.16);
}
[aria-invalid="true"] { border-color: rgba(251, 113, 133, 0.7) !important; }

.check { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text-2); font-size: 0.9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--violet); }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.form-note { margin: 0; color: var(--muted); font-size: 0.82rem; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-success {
  padding: clamp(28px, 5vw, 48px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.07);
  text-align: center;
}
.form-success .emoji { display: block; margin-bottom: 0.75rem; font-size: 2.4rem; }
.form-success h2 { margin-bottom: 0.6rem; font-size: 1.6rem; }
.form-success p { color: var(--text-2); }

.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 2rem; }
@media (max-width: 760px) { .info-grid { grid-template-columns: 1fr; } }
.info-card { padding: 1.4rem; border-radius: var(--radius); }
.info-card h3 { margin-bottom: 0.4rem; font-size: 1.05rem; }
.info-card p { margin: 0; color: var(--text-2); font-size: 0.92rem; }

.not-found { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.not-found .code { font: 700 clamp(5rem, 18vw, 10rem)/1 var(--font-display); letter-spacing: -0.06em; }

/* 15. Motion --------------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; }
/* Above-the-fold content never waits for JavaScript: it is visible from the
   first paint and only slides in, so it can be the page's largest paint. */
.js .hero .reveal, .js .page-hero .reveal {
  opacity: 1;
  transform: none;
  transition: none;
  animation: rise-in 0.8s var(--ease) both;
  animation-delay: var(--d, 0s);
}
@keyframes rise-in { from { transform: translateY(18px); } to { transform: none; } }

/* Phones: skip the background blur on cards and panels (the page behind them
   is a plain gradient, so it looks the same and scrolls much smoother). */
@media (max-width: 760px) {
  .glass, .tool-card, .btn-ghost, .sc-chips a, .hero-pill {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

[data-speed] { will-change: translate; }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes wave { 0%, 100% { transform: scaleY(0.45); } 50% { transform: scaleY(1); } }
.shape-cube > span { animation-name: float-rot; }
@keyframes float-rot { 0%, 100% { transform: rotate(18deg) translateY(0); } 50% { transform: rotate(24deg) translateY(-14px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .stage-window { --tilt: 0deg; --scale: 1; }
  [data-speed] { translate: none !important; }
}
