/* ============================================
   VisageVibe — Design System
   Modern SaaS · Light-first · Rounded & Clean
   ============================================ */

/* ---------- Tokens ---------- */
:root {
  /* Light theme (default) */
  --bg: #F4F5F7;
  --bg-alt: #ECEEF1;
  --bg-card: #FFFFFF;
  --fg: #0F1626;
  --fg-muted: #65707D;
  --fg-subtle: #9BA3AE;
  --border: #E4E7EB;
  --border-strong: #0F1626;
  --accent: #FCD34D;
  --accent-soft: #FEF3C7;
  --shadow-xs: 0 1px 2px rgba(15, 22, 38, 0.04);
  --shadow-sm: 0 2px 8px rgba(15, 22, 38, 0.05);
  --shadow: 0 8px 24px rgba(15, 22, 38, 0.07);
  --shadow-lg: 0 24px 56px rgba(15, 22, 38, 0.10);
  --shadow-nav: 0 4px 24px rgba(15, 22, 38, 0.06);

  /* Typography */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Scale (fluid) */
  --step--2: clamp(0.72rem, 0.69rem + 0.13vw, 0.80rem);
  --step--1: clamp(0.86rem, 0.82rem + 0.18vw, 0.94rem);
  --step-0: clamp(1.00rem, 0.96rem + 0.22vw, 1.10rem);
  --step-1: clamp(1.17rem, 1.10rem + 0.34vw, 1.30rem);
  --step-2: clamp(1.37rem, 1.26rem + 0.52vw, 1.55rem);
  --step-3: clamp(1.60rem, 1.44rem + 0.79vw, 1.85rem);
  --step-4: clamp(1.87rem, 1.63rem + 1.19vw, 2.20rem);
  --step-5: clamp(2.19rem, 1.83rem + 1.80vw, 2.65rem);
  --step-6: clamp(2.56rem, 2.02rem + 2.71vw, 3.20rem);
  --step-7: clamp(3.00rem, 2.19rem + 4.05vw, 3.85rem);
  --step-8: clamp(3.50rem, 2.30rem + 6.00vw, 4.65rem);

  /* Layout */
  --container: 1280px;
  --container-wide: 1440px;
  --container-narrow: 780px;

  /* Radius */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="dark"] {
  --bg: #0B0D12;
  --bg-alt: #15181F;
  --bg-card: #1A1D25;
  --fg: #F3F5F9;
  --fg-muted: #9BA3AE;
  --fg-subtle: #65707D;
  --border: #262A33;
  --border-strong: #F3F5F9;
  --accent: #FCD34D;
  --accent-soft: #3B2F0A;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.6);
  --shadow-nav: 0 4px 24px rgba(0, 0, 0, 0.35);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

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

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

button {
  font: inherit;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

input,
select,
textarea {
  font: inherit;
}

ul,
ol {
  list-style: none;
}

/* ---------- Base ---------- */
html {
  background: var(--bg);
  color: var(--fg);
}

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  background: var(--bg);
  color: var(--fg);
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--fg);
}

h1 {
  font-size: var(--step-7);
  letter-spacing: -0.035em;
}

h2 {
  font-size: var(--step-5);
  letter-spacing: -0.03em;
}

h3 {
  font-size: var(--step-3);
  letter-spacing: -0.02em;
}

h4 {
  font-size: var(--step-2);
  letter-spacing: -0.015em;
  font-weight: 700;
}

p {
  max-width: 65ch;
}

/* ---------- Pill badge (eyebrow replacement) ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.95rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  box-shadow: var(--shadow-xs);
}

.pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.pill.pill-dark {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.pill.pill-accent {
  background: var(--accent);
  color: var(--fg);
  border-color: var(--accent);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 3vw, 2rem);
}

.container-wide {
  max-width: var(--container-wide);
}

.container-narrow {
  max-width: var(--container-narrow);
}

section {
  padding: clamp(3rem, 7vw, 6rem) 0;
}

section.tight {
  padding: clamp(2rem, 4vw, 3.5rem) 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-size: var(--step--1);
  font-weight: 500;
  border-radius: var(--radius-full);
  transition: all 0.2s var(--ease);
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  letter-spacing: -0.005em;
}

.btn-primary {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.btn-primary:hover {
  background: #222B3E;
  border-color: #222B3E;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .btn-primary:hover {
  background: #E8EBF0;
  border-color: #E8EBF0;
}

.btn-ghost {
  background: var(--bg-card);
  color: var(--fg);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--fg);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-sm {
  padding: 0.55rem 1rem;
  font-size: var(--step--2);
}

.btn-arrow::after {
  content: "→";
  font-weight: 400;
  transition: transform 0.25s var(--ease);
}

.btn-arrow:hover::after {
  transform: translateX(3px);
}

/* ---------- Navigation (floating pill) ---------- */
.nav-wrap {
  position: sticky;
  top: 1rem;
  z-index: 100;
  padding: 0 clamp(1rem, 3vw, 2rem);
  margin-top: 1rem;
}

.nav {
  position: sticky;
  top: 1rem;
  z-index: 100;
  max-width: calc(var(--container) - 2rem);
  margin: 1rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-nav);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  transform: translate3d(0, 0, 0);
  /* Force hardware acceleration to fix Chrome lag */
  transition: max-width 0.4s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.nav-wrap .nav {
  margin: 0 auto;
  /* reset margin when inside nav-wrap */
}

.nav-wrap.is-scrolled .nav,
.nav.is-scrolled {
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 4px 24px rgba(15, 22, 38, 0.08);
}

[data-theme="dark"] .nav-wrap.is-scrolled .nav,
[data-theme="dark"] .nav.is-scrolled {
  background: rgba(26, 29, 37, 0.65);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.7rem 0.6rem 1.4rem;
  position: relative;
  transition: padding 0.3s var(--ease);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--step-0);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-transform: uppercase;
  flex-shrink: 0;
}

.logo .logo-img {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
}

.nav-links a {
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  max-width: 200px; /* Base max-width for animation */
  opacity: 1;
  flex-shrink: 0;
  margin-right: clamp(1rem, 2vw, 1.6rem);
  transition: color 0.2s var(--ease), max-width 0.3s var(--ease), padding 0.3s var(--ease), margin-right 0.3s var(--ease), opacity 0.2s var(--ease);
  padding: 0.4rem 0.2rem;
}

.nav-links a:last-child {
  margin-right: 0;
}

.nav-links a:hover {
  color: var(--fg);
}

.nav-links a.active {
  color: var(--fg);
  font-weight: 600;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: inline-grid;
  place-items: center;
  transition: all 0.2s var(--ease);
  color: var(--fg-muted);
  background: var(--bg-card);
}

.theme-toggle:hover {
  border-color: var(--fg);
  color: var(--fg);
}

.theme-toggle svg {
  width: 15px;
  height: 15px;
}

.theme-toggle .sun {
  display: none;
}

.theme-toggle .moon {
  display: block;
}

[data-theme="dark"] .theme-toggle .sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .moon {
  display: none;
}

.nav-cta {
  display: none;
}

@media (min-width: 720px) {
  .nav-cta {
    display: inline-flex;
  }
}

.nav-burger {
  width: 36px;
  height: 36px;
  display: none;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
}

.nav-burger span {
  display: block;
  width: 14px;
  height: 1.5px;
  background: var(--fg);
  position: relative;
  transition: background 0.2s var(--ease);
}

.nav-burger span::before,
.nav-burger span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 14px;
  height: 1.5px;
  background: var(--fg);
  transition: transform 0.2s var(--ease), top 0.2s var(--ease);
}

.nav-burger span::before {
  top: -5px;
}

.nav-burger span::after {
  top: 5px;
}

/* Burger animation to X */
.nav-open .nav-burger span {
  background: transparent;
}

.nav-open .nav-burger span::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-open .nav-burger span::after {
  top: 0;
  transform: rotate(-45deg);
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .nav-burger {
    display: inline-grid;
  }

  .nav-wrap.nav-open .nav,
  .nav.nav-open {
    border-radius: var(--radius-lg);
  }

  .nav-wrap.nav-open .nav-links,
  .nav.nav-open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0 1.4rem 1.2rem;
    gap: 0.8rem;
    width: 100%;
    order: 3;
    /* Push links below logo and buttons */
  }

  .nav-wrap.nav-open .nav-inner,
  .nav.nav-open .nav-inner {
    flex-wrap: wrap;
  }
}

/* ---------- Desktop Dropdown (Sticky Nav Compact Mode) ---------- */
.desktop-dropdown {
  display: none !important; /* Hidden by default and always on mobile */
}

@media (min-width: 901px) {
  /* When scrolled on desktop, compact the header and narrow its width */
  .nav-wrap.is-scrolled .nav {
    max-width: 740px;
  }

  .nav-wrap.is-scrolled .nav-inner {
    padding: 0.4rem 0.5rem 0.4rem 1.2rem;
  }

  /* Hide all main links except "Styles" (2nd) and "How it works" (3rd) */
  .nav-wrap.is-scrolled .nav-links a:not(:nth-child(2)):not(:nth-child(3)) {
    max-width: 0;
    padding-left: 0;
    padding-right: 0;
    margin-right: 0;
    opacity: 0;
    pointer-events: none;
    border: none;
  }

  /* Hide the theme toggle in the main bar when scrolled */
  .nav-wrap.is-scrolled .nav-right .theme-toggle:not(.dropdown-theme) {
    display: none;
  }

  /* Show the burger menu when scrolled */
  .nav-wrap.is-scrolled .nav-burger {
    display: inline-grid;
  }

  /* Show the dropdown when burger is clicked */
  .nav-wrap.is-scrolled.nav-open .desktop-dropdown {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0.5rem;
    width: 240px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 101;
    transform-origin: top right;
    animation: dropIn 0.2s var(--ease) forwards;
  }

  @keyframes dropIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
  }

  .desktop-dropdown .dropdown-links {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }

  .desktop-dropdown .dropdown-links a {
    font-size: var(--step--1);
    font-weight: 500;
    color: var(--fg-muted);
    transition: all 0.2s var(--ease);
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius);
  }

  .desktop-dropdown .dropdown-links a:hover {
    color: var(--fg);
    background: rgba(120, 120, 120, 0.08);
  }

  .desktop-dropdown .dropdown-links a.active {
    color: var(--fg);
    font-weight: 600;
    background: rgba(120, 120, 120, 0.08);
  }

  .desktop-dropdown .dropdown-footer {
    display: flex;
    justify-content: flex-end;
  }
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(2rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 5rem);
}

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

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.05fr 1fr;
    min-height: 70vh;
  }
}

.hero-text {
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-title {
  font-size: clamp(2.4rem, 1.2rem + 5vw, 4.4rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
  color: var(--fg);
}

.hero-sub {
  font-size: var(--step-1);
  color: var(--fg-muted);
  max-width: 56ch;
  line-height: 1.5;
  font-weight: 400;
}

.hero-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.2rem;
}

.hero-list li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: var(--step-0);
  color: var(--fg);
  font-weight: 500;
}

.hero-list li::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  flex-shrink: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%230F1626' stroke-width='1.8'><path d='M2 6l3 3 5-6'/></svg>");
  background-size: 12px 12px;
  background-repeat: no-repeat;
  background-position: center;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.4rem, 2vw, 0.8rem);
  margin-top: 1rem;
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(0.6rem, 2vw, 1rem) clamp(0.6rem, 2vw, 1.2rem);
  box-shadow: var(--shadow-xs);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

.stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
  border-color: var(--accent);
}

.stat-num {
  font-size: clamp(1rem, 0.6rem + 1vw, 1rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--fg);
}

@media (max-width: 480px) {
  .stat-num {
    font-size: clamp(0.8rem, 0.5rem + 1vw, 0.85rem);
  }
}

.stat-label {
  font-size: clamp(0.6rem, 0.5rem + 1vw, 0.8rem);
  color: var(--fg-muted);
  margin-top: 0.3rem;
  letter-spacing: 0.02em;
}

/* ---------- Hero vertical scroll ---------- */
.hero-scroll-wrap {
  position: relative;
  height: min(75vh, 680px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, transparent, #000 2%, #000 98%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 2%, #000 98%, transparent);
}

@media (max-width: 900px) {
  .hero-scroll-wrap {
    height: 400px;
    gap: 0.5rem;
  }
}

.hero-col {
  position: relative;
  overflow-y: auto;
  scrollbar-width: none;
}

.hero-col::-webkit-scrollbar {
  display: none;
}

.hero-track {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.hero-col:nth-child(2) .hero-track {}

.hero-item {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  position: relative;
  display: block;
  border: 1px solid var(--border);
}

.hero-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.hero-item:hover img {
  transform: scale(1.04);
}

.hero-item .tag {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  padding: 0.35rem 0.75rem;
  background: rgba(15, 22, 38, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: var(--radius-full);
  z-index: 2;
}

.hero-item .bottom-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.8rem 0.9rem 0.9rem;
  background: linear-gradient(to top, rgba(15, 22, 38, 0.85), transparent);
  color: #fff;
  z-index: 2;
}

.hero-item .bottom-title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}



@media (prefers-reduced-motion: reduce) {
  .hero-track {
    animation: none !important;
    transform: none !important;
  }
}

/* Removed 1-column override for mobile */

/* ---------- Section heads ---------- */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-head .headings {
  max-width: 720px;
}

.section-head h2 {
  margin-top: 1rem;
}

.section-head .lead {
  color: var(--fg-muted);
  margin-top: 0.9rem;
  font-size: var(--step-1);
  max-width: 55ch;
}

/* ---------- Category grid ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.cat-card {
  position: relative;
  aspect-ratio: 2/1;
  /* Horizontal by default for mobile */
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  display: block;
}

.cat-grid-featured .cat-card:first-child,
.cat-grid-featured .cat-card:nth-child(5) {
  aspect-ratio: 1/1;
  /* Keep featured cards vertical on mobile */
}

.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.cat-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.cat-card:hover img {
  transform: scale(1.04);
}

.cat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 22, 38, 0.75) 0%, rgba(15, 22, 38, 0.15) 45%, transparent 70%);
}

.cat-card .cat-meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1.2rem 1.3rem 1.3rem;
  color: #fff;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.2rem 1rem;
}

.cat-card .cat-tag {
  grid-column: 1 / -1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.cat-card .cat-name {
  font-size: var(--step-3);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.cat-card .cat-arrow {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.85;
  transition: transform 0.3s var(--ease);
}

.cat-card:hover .cat-arrow {
  transform: translateX(4px);
}

/* featured: first card big */
@media (min-width: 900px) {
  .cat-grid-featured {
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: minmax(auto, 1fr);
  }

  .cat-grid-featured .cat-card:nth-child(1) {
    grid-column: span 3;
    grid-row: span 2;
    aspect-ratio: auto;
  }

  .cat-grid-featured .cat-card:nth-child(n+2) {
    grid-column: span 3;
    aspect-ratio: 2/1;
  }

  .cat-grid-featured .cat-card:nth-child(5) {
    grid-row: span 2;
    aspect-ratio: auto;
  }
}

/* ---------- How It Works ---------- */
.how-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 800px) {
  .how-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow-xs);
  position: relative;
}

.step .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--fg);
  font-weight: 700;
  font-size: var(--step-0);
  margin-bottom: 1rem;
}

.step h3 {
  font-size: var(--step-2);
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.step p {
  color: var(--fg-muted);
  font-size: var(--step-0);
}

/* ---------- Product cards (grid of products) ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.product-card {
  display: block;
  position: relative;
  background: var(--bg-card);
  overflow: hidden;
  border-radius: var(--radius-lg);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.product-card .product-img {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--bg-alt);
  position: relative;
}

.product-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}

.product-card:hover img {
  transform: scale(1.04);
}

.product-card .product-tag {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  padding: 0.3rem 0.7rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--fg);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2;
}

.product-card .product-body {
  padding: 0.9rem 1rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.product-card .product-title {
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1.25;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.product-card .product-cta {
  font-size: var(--step--1);
  color: var(--fg-muted);
  flex-shrink: 0;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s var(--ease);
}

.product-card:hover .product-cta {
  color: var(--fg);
  gap: 0.5rem;
}

/* ---------- Testimonials ---------- */
.quote-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 800px) {
  .quote-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.quote {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quote-stars {
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: 0.1em;
}

.quote-text {
  font-size: var(--step-0);
  line-height: 1.5;
  color: var(--fg);
  font-weight: 400;
  max-width: none;
}

.quote-meta {
  font-size: var(--step--2);
  color: var(--fg-muted);
  letter-spacing: 0.01em;
  margin-top: auto;
}

.quote-meta strong {
  color: var(--fg);
  font-weight: 600;
  display: block;
  font-size: var(--step--1);
}

/* ---------- Info card (resources block) ---------- */
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow: var(--shadow-sm);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 800px) {
  .info-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.info-grid .info-block h3 {
  font-size: var(--step-3);
  margin: 1rem 0 0.8rem;
  font-weight: 700;
}

.info-grid .info-block p {
  color: var(--fg-muted);
}

/* ---------- CTA banner ---------- */
.cta-banner {
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--radius-xl);
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 3vw, 3rem);
  text-align: center;
  margin: clamp(2rem, 5vw, 4rem) 0;
}

.cta-banner h2 {
  color: var(--bg);
  max-width: 18ch;
  margin: 1rem auto;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.7);
  max-width: 48ch;
  margin: 0 auto 1.8rem;
  font-size: var(--step-1);
}

.cta-banner .btn-primary {
  background: var(--bg);
  color: var(--fg);
  border-color: var(--bg);
}

.cta-banner .btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--fg);
}

.cta-banner .pill {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ---------- Page header ---------- */
.page-header {
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(1.5rem, 3vw, 3rem);
}

.page-header h1 {
  font-size: clamp(2.2rem, 1rem + 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  max-width: 18ch;
  margin-top: 1rem;
}

.page-header .lead {
  color: var(--fg-muted);
  font-size: var(--step-1);
  max-width: 58ch;
  margin-top: 1rem;
}

.breadcrumb {
  font-size: var(--step--2);
  letter-spacing: 0.02em;
  color: var(--fg-muted);
  margin-bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.breadcrumb a:hover {
  color: var(--fg);
}

.breadcrumb span.sep {
  opacity: 0.4;
}

/* ---------- FAQ ---------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 820px;
  margin: 0 auto;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: box-shadow 0.3s var(--ease);
}

.faq-item[open] {
  box-shadow: var(--shadow-sm);
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.2rem 1.5rem;
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.015em;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--fg-muted);
  flex-shrink: 0;
  line-height: 1;
  transition: transform 0.3s var(--ease);
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item .answer {
  padding: 0 1.5rem 1.5rem;
  color: var(--fg-muted);
  font-size: var(--step-0);
  max-width: 65ch;
  line-height: 1.65;
}

.faq-item .answer a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Gallery ---------- */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.8rem;
}

.gallery-filters button {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--fg-muted);
  background: var(--bg-card);
  transition: all 0.2s var(--ease);
  cursor: pointer;
}

.gallery-filters button:hover {
  border-color: var(--fg);
  color: var(--fg);
}

.gallery-filters button.active {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.gallery-grid {
  columns: 1;
  column-gap: 0.8rem;
}

@media (min-width: 600px) {
  .gallery-grid {
    columns: 2;
  }
}

@media (min-width: 900px) {
  .gallery-grid {
    columns: 3;
  }
}

@media (min-width: 1200px) {
  .gallery-grid {
    columns: 4;
  }
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 0.8rem;
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.gallery-item img {
  width: 100%;
  height: auto;
  transition: transform 0.7s var(--ease);
}

.gallery-item:hover img {
  transform: scale(1.03);
}

.gallery-item .gal-tag {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  padding: 0.3rem 0.75rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--fg);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gallery-item .gal-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.9rem 1rem;
  background: linear-gradient(to top, rgba(15, 22, 38, 0.85), transparent);
  color: #fff;
  font-size: var(--step--1);
  font-weight: 500;
  transform: translateY(10px);
  opacity: 0;
  transition: all 0.3s var(--ease);
}

.gallery-item:hover .gal-overlay {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Blog ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 800px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.post-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.post-card .post-img {
  aspect-ratio: 16/10;
  overflow: hidden;
}

.post-card .post-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}

.post-card:hover .post-img img {
  transform: scale(1.04);
}

.post-card .post-body {
  padding: 1rem 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-card .post-meta {
  font-size: var(--step--2);
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.post-card h3 {
  font-size: var(--step-2);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.post-card p {
  color: var(--fg-muted);
  font-size: var(--step--1);
  max-width: none;
  line-height: 1.5;
}

.prose {
  max-width: 680px;
  margin: 0 auto;
  font-size: var(--step-1);
  line-height: 1.7;
  color: var(--fg);
}

.prose h2 {
  font-size: var(--step-4);
  margin: 2.2em 0 0.8em;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.prose h3 {
  font-size: var(--step-2);
  margin: 1.8em 0 0.6em;
  font-weight: 700;
}

.prose p {
  margin-bottom: 1.1em;
  color: var(--fg);
  max-width: none;
}

.prose ul,
.prose ol {
  margin: 1em 0;
  padding-left: 0;
}

.prose ul li,
.prose ol li {
  position: relative;
  padding-left: 1.5em;
  margin-bottom: 0.5em;
}

.prose ul li::before {
  content: "";
  position: absolute;
  left: 0.3em;
  top: 0.75em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg);
}

.prose ol {
  counter-reset: ol;
}

.prose ol li {
  counter-increment: ol;
}

.prose ol li::before {
  content: counter(ol) ".";
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--fg-muted);
}

.prose blockquote {
  margin: 2em 0;
  padding: 1.2rem 1.5rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  font-size: var(--step-1);
  font-weight: 500;
}

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: opacity 0.2s var(--ease);
}

.prose a:hover {
  opacity: 0.7;
}

.prose img {
  width: 100%;
  border-radius: var(--radius-lg);
  margin: 2em 0;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: clamp(2.5rem, 5vw, 4rem) 0 2rem;
  background: var(--bg);
  margin-top: clamp(2rem, 4vw, 4rem);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.footer-brand {
  max-width: 340px;
}

.footer-brand .logo {
  margin-bottom: 1rem;
}

.footer-brand p {
  color: var(--fg-muted);
  font-size: var(--step--1);
  line-height: 1.5;
}

.footer-brand .social {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

.footer-brand .social a {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  transition: all 0.2s var(--ease);
  background: var(--bg-card);
  color: var(--fg-muted);
}

.footer-brand .social a:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.footer-brand .social svg {
  width: 15px;
  height: 15px;
}

.footer-col h4 {
  font-size: var(--step--2);
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-col a {
  font-size: var(--step--1);
  color: var(--fg);
  font-weight: 500;
  transition: color 0.2s var(--ease);
}

.footer-col a:hover {
  color: var(--fg-muted);
}

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: var(--step--2);
  color: var(--fg-subtle);
}

/* ---------- Utilities ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.muted {
  color: var(--fg-muted);
}

.center {
  text-align: center;
}