/* ==========================================================================
   DocuDense — Consolidated Stylesheet
   Clean modern SaaS + professional/trustworthy
   Sections: Tokens · Base · Layout · Nav · Buttons · Hero · Trust ·
             Products · Focus · Tools · About · Contact · Footer · Responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand */
  --brand-600: #5b4cf0;
  --brand-500: #7668ff;
  --brand-700: #4938cf;
  --accent-600: #1479e8;
  --accent-500: #35a2ff;

  /* Neutrals (light) */
  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-muted: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --text-invert: #ffffff;

  /* Status */
  --green-100: #dcfce7;
  --green-700: #15803d;
  --amber-100: #fef3c7;
  --amber-700: #b45309;
  --blue-100: #dbeafe;
  --blue-700: #1d4ed8;

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 40px -12px rgba(15, 23, 42, 0.22);
  --gradient: linear-gradient(135deg, #6047ed 0%, #167fe7 100%);
  --gradient-soft: linear-gradient(135deg, #f0efff 0%, #eef8ff 100%);

  /* Radii & spacing */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --container: 1180px;
  --gutter: clamp(1.1rem, 4vw, 2rem);

  /* Type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Dark theme — applied when data-theme="dark" is set on <html>,
   and by default when the OS prefers dark (unless overridden to light). */
:root[data-theme="dark"] {
  --bg: #0b1120;
  --bg-subtle: #0f172a;
  --bg-muted: #111c33;
  --surface: #131d33;
  --border: #22304d;
  --border-strong: #2f4066;
  --text: #f1f5f9;
  --text-muted: #cbd5e1;
  --text-subtle: #94a3b8;
  --gradient-soft: linear-gradient(135deg, #141d38 0%, #0f1b30 100%);
  --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --green-100: #052e1a; --green-700: #4ade80;
  --amber-100: #3a2708; --amber-700: #fbbf24;
  --blue-100: #0b2447; --blue-700: #60a5fa;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120;
    --bg-subtle: #0f172a;
    --bg-muted: #111c33;
    --surface: #131d33;
    --border: #22304d;
    --border-strong: #2f4066;
    --text: #f1f5f9;
    --text-muted: #cbd5e1;
    --text-subtle: #94a3b8;
    --gradient-soft: linear-gradient(135deg, #141d38 0%, #0f1b30 100%);
    --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, 0.6);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --green-100: #052e1a; --green-700: #4ade80;
    --amber-100: #3a2708; --amber-700: #fbbf24;
    --blue-100: #0b2447; --blue-700: #60a5fa;
  }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 { line-height: 1.08; letter-spacing: -0.035em; font-weight: 750; }
h1 { font-size: clamp(3rem, 6vw, 5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.2rem; }

:focus-visible { outline: 3px solid var(--accent-500); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--brand-600); color: #fff; padding: 0.7rem 1.2rem;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------------------
   Layout helpers
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section--alt { background: var(--bg-subtle); }

.section__head { max-width: 640px; margin: 0 auto clamp(2rem, 4vw, 3.2rem); text-align: center; }
.section__eyebrow {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--brand-600); margin-bottom: 0.75rem;
}
.section__title { margin-bottom: 0.9rem; }
.section__subtitle { color: var(--text-muted); font-size: 1.08rem; }

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

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.35rem; border-radius: var(--radius-pill);
  font-weight: 600; font-size: 0.98rem; border: 1.5px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--gradient); color: #fff; box-shadow: var(--shadow-md); }
.btn--primary:hover { box-shadow: var(--shadow-lg); }
.btn--secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--bg-muted); }
.btn--ghost { background: var(--bg-muted); color: var(--text); }
.btn--ghost:hover { background: var(--border); }
.btn--large { padding: 0.95rem 1.7rem; font-size: 1.05rem; }
.btn--block { width: 100%; }
.btn__icon { font-size: 1.05em; line-height: 1; }

/* --------------------------------------------------------------------------
   Header / nav
   -------------------------------------------------------------------------- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.header.is-scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }

.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.85rem; position: relative; }
.nav__collapse { display: flex; align-items: center; gap: 1rem; }
.nav__brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.2rem; }
.nav__logo-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--gradient);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.1rem;
  box-shadow: var(--shadow-sm);
}
.nav__menu { display: flex; align-items: center; gap: 0.35rem; }
.nav__link {
  padding: 0.5rem 0.85rem; border-radius: var(--radius-sm); font-weight: 500;
  color: var(--text-muted); transition: color 0.15s ease, background 0.15s ease;
}
.nav__link[aria-current="page"],
.nav__link:hover { color: var(--text); background: var(--bg-muted); }
.nav__actions { display: flex; align-items: center; gap: 0.6rem; }

.theme-toggle {
  width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); display: grid; place-items: center; font-size: 1.1rem;
}
.theme-toggle:hover { background: var(--bg-muted); }

.nav__toggle {
  display: none; width: 42px; height: 42px; border: 1px solid var(--border);
  background: var(--surface); border-radius: var(--radius-sm); position: relative;
}
.nav__toggle span {
  position: absolute; left: 10px; right: 10px; height: 2px; background: var(--text);
  border-radius: 2px; transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav__toggle span:nth-child(1) { top: 14px; }
.nav__toggle span:nth-child(2) { top: 20px; }
.nav__toggle span:nth-child(3) { top: 26px; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(3.5rem, 8vw, 6rem); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 55% at 80% -10%, color-mix(in srgb, var(--brand-500) 22%, transparent), transparent 70%),
    radial-gradient(50% 50% at 0% 10%, color-mix(in srgb, var(--accent-500) 16%, transparent), transparent 70%);
}
.hero__grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center;
}
.hero__badge {
  display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.9rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill);
  font-size: 0.85rem; color: var(--text-muted); box-shadow: var(--shadow-sm); margin-bottom: 1.4rem;
}
.hero__badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
.hero__title { margin-bottom: 1.1rem; }
.hero__description { font-size: 1.18rem; color: var(--text-muted); max-width: 34ch; margin-bottom: 1.8rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 2.4rem; }
.hero__stats { display: flex; gap: clamp(1.2rem, 4vw, 2.6rem); flex-wrap: wrap; }
.stat__number { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; }
.stat__label { font-size: 0.85rem; color: var(--text-subtle); }

/* Hero visual — stylized document mockup */
.hero__visual { position: relative; }
.hero__card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 1.4rem; transform: rotate(-1.5deg);
}
.hero__card-bar { display: flex; gap: 0.4rem; margin-bottom: 1rem; }
.hero__card-bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--border-strong); }
.doc-row { height: 12px; border-radius: 6px; background: var(--bg-muted); margin-bottom: 0.7rem; }
.doc-row.w-90 { width: 90%; } .doc-row.w-70 { width: 70%; } .doc-row.w-50 { width: 50%; }
.doc-row.accent { background: var(--gradient); width: 40%; height: 16px; }
.hero__chip {
  position: absolute; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 0.7rem 1rem;
  display: flex; align-items: center; gap: 0.6rem; font-weight: 600; font-size: 0.9rem;
}
.hero__chip .emoji { font-size: 1.3rem; }
.hero__chip--tl { top: -18px; left: -14px; }
.hero__chip--br { bottom: -20px; right: -10px; }

/* --------------------------------------------------------------------------
   Trust strip
   -------------------------------------------------------------------------- */
.trust { border-block: 1px solid var(--border); background: var(--bg-subtle); }
.trust__inner { padding-block: 1.6rem; text-align: center; }
.trust__label { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-subtle); margin-bottom: 1rem; }
.trust__row { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(1.2rem, 5vw, 3rem); align-items: center; }
.trust__item { font-weight: 700; color: var(--text-muted); opacity: 0.75; font-size: 1.05rem; }

/* --------------------------------------------------------------------------
   Cards grid (products / features)
   -------------------------------------------------------------------------- */
.grid { display: grid; gap: 1.4rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow-sm); transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  height: 100%;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.card__icon {
  width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center;
  font-size: 1.5rem; background: var(--gradient-soft); margin-bottom: 1.1rem;
}
.card__title { margin-bottom: 0.5rem; }
.card__text { color: var(--text-muted); font-size: 0.97rem; }
.card__list { margin-top: 1rem; display: grid; gap: 0.4rem; }
.card__list li { font-size: 0.9rem; color: var(--text-muted); padding-left: 1.4rem; position: relative; }
.card__list li::before { content: "✓"; position: absolute; left: 0; color: var(--brand-600); font-weight: 800; }

/* --------------------------------------------------------------------------
   Focus / split feature
   -------------------------------------------------------------------------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.split__title { margin-bottom: 1rem; }
.split__text { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 1.4rem; }
.checklist { display: grid; gap: 0.9rem; }
.checklist li { display: flex; gap: 0.75rem; align-items: flex-start; }
.checklist .check {
  flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--gradient);
  color: #fff; display: grid; place-items: center; font-size: 0.8rem; font-weight: 800; margin-top: 2px;
}
.checklist strong { display: block; }
.checklist span { color: var(--text-muted); font-size: 0.95rem; }

.panel {
  background: var(--gradient-soft); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 3vw, 2.2rem); box-shadow: var(--shadow-md);
}
.panel__row { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 0.9rem; box-shadow: var(--shadow-sm); }
.panel__row:last-child { margin-bottom: 0; }
.panel__row .emoji { font-size: 1.5rem; }
.panel__row strong { display: block; font-size: 0.98rem; }
.panel__row span { font-size: 0.85rem; color: var(--text-subtle); }
.panel__row .arrow { margin-left: auto; color: var(--brand-600); font-weight: 800; }

/* --------------------------------------------------------------------------
   Tools
   -------------------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 0.55rem; justify-content: center; margin-bottom: 2rem; }
.filters__group { display: flex; flex-wrap: wrap; gap: 0.55rem; justify-content: center; }
.chip {
  padding: 0.5rem 1rem; border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted); font-weight: 600; font-size: 0.9rem;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--brand-500); color: var(--text); }
.chip.is-active { background: var(--gradient); color: #fff; border-color: transparent; box-shadow: var(--shadow-sm); }
.filters__divider { width: 100%; height: 0; }

.tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }

.tool-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.tool-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.tool-card__icon { width: 50px; height: 50px; border-radius: 13px; background: var(--gradient-soft); display: grid; place-items: center; font-size: 1.5rem; }
.tool-card__title { margin-bottom: 0.5rem; }
.tool-card__desc { color: var(--text-muted); font-size: 0.95rem; flex: 1; }
.tool-card__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.1rem; }
.tag {
  font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.6rem; border-radius: var(--radius-pill);
  background: var(--bg-muted); color: var(--text-muted);
}
.tool-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px solid var(--border); }
.tool-card__cat { font-size: 0.8rem; color: var(--text-subtle); font-weight: 600; }
.tool-link { font-weight: 700; color: var(--brand-600); font-size: 0.92rem; display: inline-flex; align-items: center; gap: 0.35rem; }
.tool-link:hover { gap: 0.6rem; }
.tool-link[aria-disabled="true"] { color: var(--text-subtle); pointer-events: none; }

.badge { font-size: 0.7rem; font-weight: 700; padding: 0.25rem 0.6rem; border-radius: var(--radius-pill); text-transform: uppercase; letter-spacing: 0.04em; }
.badge--live { background: var(--green-100); color: var(--green-700); }
.badge--beta { background: var(--blue-100); color: var(--blue-700); }
.badge--soon { background: var(--amber-100); color: var(--amber-700); }

.tools-empty { text-align: center; color: var(--text-subtle); padding: 3rem 1rem; grid-column: 1 / -1; }

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */
.about__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; margin-top: 2.5rem; }
.about__stat { text-align: center; padding: 1.4rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.about__stat .num { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; }
.about__stat .lbl { font-size: 0.85rem; color: var(--text-subtle); }

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */
.contact { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
.contact__intro h2 { margin-bottom: 0.9rem; }
.contact__intro p { color: var(--text-muted); margin-bottom: 1.5rem; }
.contact__detail { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.9rem; color: var(--text-muted); }
.contact__detail .emoji { font-size: 1.2rem; }

.form {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 3vw, 2rem); box-shadow: var(--shadow-md);
}
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; }
.field input, .field textarea, .field select {
  width: 100%; padding: 0.75rem 0.9rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-family: inherit; font-size: 0.97rem; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 22%, transparent);
}
.field textarea { resize: vertical; min-height: 120px; }
.form__note { font-size: 0.82rem; color: var(--text-subtle); margin-top: 0.8rem; text-align: center; }
.form__success {
  display: none; background: var(--green-100); color: var(--green-700); border-radius: var(--radius-sm);
  padding: 0.9rem 1rem; font-weight: 600; margin-bottom: 1rem;
}
.form__success.is-visible { display: block; }

/* --------------------------------------------------------------------------
   CTA banner
   -------------------------------------------------------------------------- */
.cta-banner { background: var(--gradient); border-radius: var(--radius-lg); padding: clamp(2rem, 5vw, 3.4rem); text-align: center; color: #fff; box-shadow: var(--shadow-lg); }
.cta-banner h2 { color: #fff; margin-bottom: 0.8rem; }
.cta-banner p { color: rgba(255,255,255,0.9); max-width: 52ch; margin: 0 auto 1.8rem; font-size: 1.08rem; }
.cta-banner .btn--primary { background: #fff; color: var(--brand-700); }
.cta-banner .btn--secondary { color: #fff; border-color: rgba(255,255,255,0.6); }
.cta-banner .btn--secondary:hover { background: rgba(255,255,255,0.12); }
.cta-banner__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer { background: var(--bg-subtle); border-top: 1px solid var(--border); padding-block: 3rem 2rem; }
.footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; margin-bottom: 2.5rem; }
.footer__brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.15rem; margin-bottom: 0.9rem; }
.footer__tagline { color: var(--text-muted); font-size: 0.95rem; max-width: 32ch; }
.footer__col h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-subtle); margin-bottom: 0.9rem; }
.footer__col a { display: block; color: var(--text-muted); padding: 0.3rem 0; font-size: 0.95rem; }
.footer__col a:hover { color: var(--text); }
.footer__bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.6rem; border-top: 1px solid var(--border); color: var(--text-subtle); font-size: 0.88rem; }
.footer__social { display: flex; gap: 0.6rem; }
.footer__social a { width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border); display: grid; place-items: center; background: var(--surface); }
.footer__social a:hover { background: var(--bg-muted); }

/* --------------------------------------------------------------------------
   Portfolio homepage
   -------------------------------------------------------------------------- */
.hero--portfolio {
  min-height: calc(100vh - 68px);
  display: grid;
  align-items: center;
  padding-block: clamp(4.5rem, 9vw, 8rem);
}
.hero--portfolio::before {
  background:
    radial-gradient(45% 55% at 82% 28%, color-mix(in srgb, #7c5cff 22%, transparent), transparent 72%),
    radial-gradient(42% 48% at 10% 4%, color-mix(in srgb, #2b9fff 15%, transparent), transparent 76%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg-subtle) 62%, transparent), transparent 72%);
}
.hero--portfolio .hero__grid { grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr); }
.hero--portfolio .hero__title { max-width: 12ch; margin-bottom: 1.35rem; }
.hero--portfolio .hero__description { max-width: 46ch; font-size: clamp(1.08rem, 1.7vw, 1.26rem); line-height: 1.7; }
.hero__proof { display: flex; flex-wrap: wrap; gap: 0.65rem 1.25rem; color: var(--text-subtle); font-size: 0.86rem; font-weight: 600; }
.hero__proof span { display: inline-flex; align-items: center; gap: 0.45rem; }
.hero__proof i { width: 5px; height: 5px; border-radius: 50%; background: var(--brand-500); }

.product-stack { position: relative; display: grid; gap: 1rem; padding: 2rem 0 2rem 2rem; }
.product-stack::before {
  content: ""; position: absolute; inset: 0 7% 0 0; border-radius: 40px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--brand-500) 15%, transparent), color-mix(in srgb, var(--accent-500) 7%, transparent));
  border: 1px solid color-mix(in srgb, var(--brand-500) 17%, var(--border));
  transform: rotate(2deg);
}
.product-stack__card {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem;
  min-height: 112px; padding: 1.15rem 1.25rem; border: 1px solid var(--border); border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: 0 16px 40px -24px rgba(15,23,42,.45);
  backdrop-filter: blur(14px); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.product-stack__card:nth-child(2) { transform: translateX(1.3rem); }
.product-stack__card:hover { transform: translateX(-.4rem); box-shadow: 0 24px 55px -24px rgba(15,23,42,.5); border-color: var(--border-strong); }
.product-stack__card:nth-child(2):hover { transform: translateX(.9rem); }
.product-stack__icon {
  width: 58px; height: 58px; display: grid; place-items: center; border-radius: 16px;
  font-weight: 800; font-size: .78rem; letter-spacing: -.02em; color: #fff;
}
.product-stack__card--pdf .product-stack__icon { background: linear-gradient(145deg,#3867ff,#6847e8); }
.product-stack__card--power .product-stack__icon { background: linear-gradient(145deg,#6d3de8,#ae50dc); font-size: 1rem; font-style: italic; }
.product-stack__card--auto .product-stack__icon { background: linear-gradient(145deg,#e86f2d,#e8a62d); font-size: .68rem; }
.product-stack__copy { display: grid; gap: .28rem; }
.product-stack__copy strong { font-size: 1.08rem; letter-spacing: -.02em; }
.product-stack__copy small { color: var(--text-subtle); font-size: .88rem; line-height: 1.45; }
.product-stack__arrow { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-muted); color: var(--text-muted); }

.section__head--wide { max-width: 760px; }
.portfolio { position: relative; }
.portfolio-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.portfolio-card {
  --card-accent: var(--brand-500); position: relative; display: flex; flex-direction: column; min-height: 430px;
  overflow: hidden; padding: clamp(1.5rem, 2.6vw, 2.15rem); border: 1px solid var(--border); border-radius: 24px;
  background: var(--surface); box-shadow: 0 18px 48px -38px rgba(15,23,42,.55);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.portfolio-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--card-accent); }
.portfolio-card::after { content: ""; position: absolute; width: 180px; height: 180px; right: -80px; top: -95px; border-radius: 50%; background: color-mix(in srgb, var(--card-accent) 12%, transparent); }
.portfolio-card:hover { transform: translateY(-7px); border-color: color-mix(in srgb, var(--card-accent) 42%, var(--border)); box-shadow: 0 30px 60px -34px rgba(15,23,42,.5); }
.portfolio-card--pdf { --card-accent: #5267ef; }
.portfolio-card--power { --card-accent: #9a4be0; }
.portfolio-card--auto { --card-accent: #e58b2b; }
.portfolio-card__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3.4rem; }
.portfolio-card__mark { font-size: .78rem; font-weight: 800; letter-spacing: .12em; color: var(--text-subtle); }
.portfolio-card__kicker { color: var(--card-accent); font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; margin-bottom: .65rem; }
.portfolio-card h3 { font-size: clamp(1.65rem, 2.4vw, 2rem); margin-bottom: .9rem; }
.portfolio-card > p:not(.portfolio-card__kicker) { color: var(--text-muted); line-height: 1.7; }
.portfolio-card__tags { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1.4rem 0; }
.portfolio-card__tags span { padding: .35rem .65rem; border-radius: var(--radius-pill); background: var(--bg-muted); color: var(--text-muted); font-size: .75rem; font-weight: 700; }
.portfolio-card__link { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 1.15rem; border-top: 1px solid var(--border); color: var(--text); font-weight: 750; }
.portfolio-card__link span { color: var(--card-accent); font-size: 1.15rem; transition: transform .18s ease; }
.portfolio-card__link:hover span { transform: translate(3px,-3px); }

.manifesto { color: #fff; background: #0d1326; }
.manifesto .section__eyebrow { color: #9fb0ff; }
.manifesto__grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(3rem, 7vw, 7rem); align-items: start; }
.manifesto__intro { position: sticky; top: 110px; }
.manifesto__intro h2 { color: #fff; font-size: clamp(2.4rem, 4.5vw, 4rem); margin-bottom: 1.2rem; }
.manifesto__intro p { color: #aeb8cf; max-width: 38ch; font-size: 1.06rem; }
.manifesto__principles { border-top: 1px solid rgba(255,255,255,.15); }
.principle { display: grid; grid-template-columns: 42px 1fr; gap: 1rem; padding: 1.75rem 0; border-bottom: 1px solid rgba(255,255,255,.15); }
.principle > span { color: #7f91b7; font-size: .76rem; font-weight: 800; letter-spacing: .1em; padding-top: .22rem; }
.principle h3 { color: #fff; margin-bottom: .55rem; font-size: 1.2rem; }
.principle p { color: #aeb8cf; line-height: 1.65; }

.contact-card {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: clamp(2rem, 5vw, 4.5rem); border-radius: 30px; color: #fff;
  background: linear-gradient(135deg,#5943df 0%,#176fca 100%); box-shadow: 0 28px 70px -36px rgba(40,54,180,.8);
}
.contact-card .section__eyebrow { color: rgba(255,255,255,.72); }
.contact-card h2 { color: #fff; max-width: 18ch; font-size: clamp(2rem, 4vw, 3.25rem); margin-bottom: .8rem; }
.contact-card p { color: rgba(255,255,255,.82); font-size: 1.04rem; }
.btn--light { background: #fff; color: #3425a5; box-shadow: var(--shadow-md); }
.btn--light:hover { box-shadow: var(--shadow-lg); }

.footer--compact { padding-top: 3.5rem; }
.footer__grid--compact { grid-template-columns: 1.5fr .75fr .75fr; }

.directory-page main { min-height: 68vh; }
.directory-hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(38% 45% at 82% 8%, color-mix(in srgb, var(--brand-500) 14%, transparent), transparent 75%),
    linear-gradient(180deg, var(--bg-subtle), var(--bg));
}
.directory-hero .section__head { max-width: 760px; margin-bottom: 2.4rem; }
.directory-hero .section__title { font-size: clamp(2.8rem, 6vw, 4.8rem); }
.directory-page .filters { margin-bottom: 1rem; }
.directory-page .filters:empty { display: none; }
.directory-page .tools-grid { margin-top: 2.2rem; }
.directory-page .tool-card { min-height: 340px; border-radius: 22px; padding: 1.8rem; }
.directory-page .tool-card__icon { width: 58px; height: 58px; border-radius: 16px; }
.directory-page .tool-card__title { font-size: 1.45rem; }
.directory-page .tool-card__desc { line-height: 1.7; }

/* API catalog empty state */
.api-empty {
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1.25rem, 4vw, 3rem);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); text-align: center;
}
.api-empty__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px; margin-bottom: 1.5rem;
  border-radius: 20px; background: var(--gradient-soft); color: var(--brand-500);
  font-family: monospace; font-size: 1.75rem; font-weight: 700;
}
.api-empty h2 { font-size: clamp(1.5rem, 4vw, 2rem); margin-bottom: .75rem; }
.api-empty p { max-width: 48ch; margin: 0 auto 1.75rem; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Reveal on scroll
   -------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .grid--3, .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { max-width: 460px; margin-inline: auto; order: -1; }
  .hero--portfolio { min-height: auto; }
  .hero--portfolio .hero__grid { grid-template-columns: 1fr; }
  .hero--portfolio .hero__title { max-width: 14ch; }
  .product-stack { width: min(100%, 620px); padding-left: 0; margin-inline: auto; }
  .product-stack::before { inset-inline: 5%; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .portfolio-card { min-height: 360px; }
  .manifesto__grid { grid-template-columns: 1fr; }
  .manifesto__intro { position: static; }
  .split, .contact { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .about__stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .nav__toggle { display: block; order: 3; }
  .theme-toggle { order: 2; }
  .nav__collapse {
    display: none; position: absolute; left: var(--gutter); right: var(--gutter); top: calc(100% + 10px);
    flex-direction: column; align-items: stretch; gap: 0.9rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1rem; box-shadow: var(--shadow-lg);
  }
  .nav.is-open .nav__collapse { display: flex; }
  .nav__menu { flex-direction: column; align-items: stretch; gap: 0.1rem; }
  .nav__link { padding: 0.7rem 0.85rem; }
  .nav__actions { flex-direction: column; align-items: stretch; gap: 0.6rem; border-top: 1px solid var(--border); padding-top: 0.9rem; }
  .nav__actions .btn { width: 100%; }
}

@media (max-width: 560px) {
  .grid--3, .grid--2, .tools-grid, .footer__grid, .about__stats, .form__row { grid-template-columns: 1fr; }
  .hero__actions .btn, .cta-banner__actions .btn { width: 100%; }
  .hero--portfolio { padding-block: 3.6rem 4.5rem; }
  .hero--portfolio .hero__title { font-size: clamp(2.75rem, 13vw, 4rem); }
  .product-stack { padding-block: 1.2rem; }
  .product-stack__card { min-height: 96px; padding: 1rem; }
  .product-stack__card:nth-child(2), .product-stack__card:nth-child(2):hover { transform: none; }
  .product-stack__icon { width: 48px; height: 48px; border-radius: 13px; }
  .product-stack__copy small { font-size: .8rem; }
  .portfolio-card { min-height: 390px; }
  .contact-card { align-items: flex-start; flex-direction: column; }
  .contact-card .btn { width: 100%; }
}
