/* ==========================================================================
   Invoicely — Premium SaaS Invoice Generator
   Design System & Component Library
   ========================================================================== */

/* ----------------------------------------------------------------
   1. Root tokens & theme
   ---------------------------------------------------------------- */
:root {
  /* Brand palette */
  --brand-50:  #eef2ff;
  --brand-100: #e0e7ff;
  --brand-200: #c7d2fe;
  --brand-300: #a5b4fc;
  --brand-400: #818cf8;
  --brand-500: #6366f1;
  --brand-600: #4f46e5;
  --brand-700: #4338ca;
  --brand-800: #3730a3;

  --accent-400: #22d3ee;
  --accent-500: #06b6d4;
  --pink-500:   #ec4899;
  --violet-500: #8b5cf6;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --grad-cool:    linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
  --grad-warm:    linear-gradient(135deg, #ec4899 0%, #f97316 100%);
  --grad-text:    linear-gradient(120deg, #818cf8 0%, #c084fc 40%, #f472b6 70%, #22d3ee 100%);

  /* Light theme surfaces */
  --bg:           #f7f8fc;
  --bg-soft:      #eef0f9;
  --surface:      #ffffff;
  --surface-2:    #f4f5fb;
  --glass-bg:     rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.12);

  --text:         #0f1222;
  --text-soft:    #51536b;
  --text-muted:   #8a8da6;
  --border:       rgba(15, 18, 34, 0.08);
  --border-strong:rgba(15, 18, 34, 0.14);

  --ring: rgba(99, 102, 241, 0.35);
  --shadow-sm: 0 1px 2px rgba(15,18,34,.06);
  --shadow-md: 0 8px 24px rgba(15,18,34,.08);
  --shadow-lg: 0 20px 50px rgba(15,18,34,.12);
  --shadow-xl: 0 30px 80px rgba(79,70,229,.18);

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

  --nav-h: 76px;
  --maxw: 1200px;

  --ease: cubic-bezier(.22,1,.36,1);
  --ease-bounce: cubic-bezier(.34,1.56,.64,1);

  --font: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="dark"] {
  --bg:           #07070f;
  --bg-soft:      #0d0e1a;
  --surface:      #11131f;
  --surface-2:    #161826;
  --glass-bg:     rgba(20, 22, 38, 0.55);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);

  --text:         #f3f4fb;
  --text-soft:    #b9bcd6;
  --text-muted:   #7a7d99;
  --border:       rgba(255, 255, 255, 0.08);
  --border-strong:rgba(255, 255, 255, 0.16);

  --ring: rgba(129, 140, 248, 0.5);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,.4);
  --shadow-lg: 0 20px 50px rgba(0,0,0,.5);
  --shadow-xl: 0 30px 80px rgba(0,0,0,.6);
}

/* ----------------------------------------------------------------
   2. Reset & base
   ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 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;
  overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul { list-style: none; }
img { user-select: none; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--brand-500); color: #fff; }

h1,h2,h3,h4,h5 { font-family: var(--font-display); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }

/* ----------------------------------------------------------------
   3. Decorative background
   ---------------------------------------------------------------- */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .55;
  animation: floatBlob 18s ease-in-out infinite;
}
.blob.b1 { width: 520px; height: 520px; background: radial-gradient(circle, #6366f1, transparent 70%); top: -160px; left: -120px; }
.blob.b2 { width: 480px; height: 480px; background: radial-gradient(circle, #ec4899, transparent 70%); top: 30%; right: -140px; animation-delay: -6s; }
.blob.b3 { width: 460px; height: 460px; background: radial-gradient(circle, #22d3ee, transparent 70%); bottom: -180px; left: 30%; animation-delay: -12s; }
[data-theme="dark"] .blob { opacity: .35; }

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  opacity: .6;
}

@keyframes floatBlob {
  0%,100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(40px,-30px) scale(1.08); }
  66% { transform: translate(-30px,40px) scale(.95); }
}

/* Floating shapes (hero) */
.float-shape {
  position: absolute;
  border-radius: 22px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  animation: floatY 6s ease-in-out infinite;
}
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }

/* ----------------------------------------------------------------
   4. Layout helpers
   ---------------------------------------------------------------- */
.container { width: min(100% - 40px, var(--maxw)); margin-inline: auto; }
.section { padding: clamp(64px, 9vw, 130px) 0; position: relative; }
.center { text-align: center; }
.flex { display: flex; }
.grid { display: grid; }
.nowrap { white-space: nowrap; }
.muted { color: var(--text-muted); }
.soft  { color: var(--text-soft); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  font-size: 13px; font-weight: 600;
  color: var(--brand-600);
  letter-spacing: .02em;
}
[data-theme="dark"] .eyebrow { color: var(--brand-300); }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-500); box-shadow: 0 0 0 4px var(--ring); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 var(--ring);} 50% { box-shadow: 0 0 0 8px transparent;} }

.section-title { font-size: clamp(28px, 4.2vw, 48px); margin: 18px 0 14px; }
.section-sub { color: var(--text-soft); font-size: clamp(15px,1.5vw,18px); max-width: 620px; margin-inline: auto; }

.gradient-text {
  background: var(--grad-text);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }

/* ----------------------------------------------------------------
   5. Buttons
   ---------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 700; font-size: 15px;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
  white-space: nowrap;
  user-select: none;
  isolation: isolate;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 10px 30px rgba(99,102,241,.4);
}
.btn-primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg,#8b5cf6,#ec4899);
  opacity: 0; transition: opacity .3s; z-index: -1;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(139,92,246,.55); }
.btn-primary:hover::after { opacity: 1; }
.btn-primary:active { transform: translateY(0) scale(.98); }

.btn-ghost {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-color: var(--glass-border);
  color: var(--text);
}
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--brand-400); color: var(--brand-600); box-shadow: var(--shadow-md); }

.btn-soft {
  background: var(--brand-50);
  color: var(--brand-700);
}
[data-theme="dark"] .btn-soft { background: rgba(99,102,241,.15); color: var(--brand-300); }
.btn-soft:hover { background: var(--brand-100); transform: translateY(-2px); }

.btn-lg { padding: 16px 30px; font-size: 16px; }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none !important; }

/* Ripple */
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.5); animation: ripple .6s var(--ease); pointer-events: none; z-index: 0; }
.btn-ghost .ripple, .btn-soft .ripple { background: var(--brand-500); opacity:.25; }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* magnetic helper class */
.magnetic { transition: transform .2s var(--ease); }

/* ----------------------------------------------------------------
   6. Navbar
   ---------------------------------------------------------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: height .35s var(--ease), background .35s, box-shadow .35s, border-color .35s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  height: 64px;
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}
.nav-inner { width: min(100% - 40px, var(--maxw)); margin-inline: auto; display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -0.03em; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--grad-primary);
  display: grid; place-items: center;
  color: #fff; font-weight: 800;
  box-shadow: 0 6px 18px rgba(99,102,241,.5);
  position: relative; overflow: hidden;
}
.logo-mark::before { content:""; position:absolute; inset:0; background: linear-gradient(120deg,transparent 40%,rgba(255,255,255,.5),transparent 60%); transform: translateX(-100%); }
.logo:hover .logo-mark::before { animation: sweep .8s var(--ease); }
@keyframes sweep { to { transform: translateX(100%); } }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav-links a {
  position: relative;
  padding: 9px 14px; border-radius: 10px;
  font-size: 14.5px; font-weight: 600; color: var(--text-soft);
  transition: color .2s, background .2s;
}
.nav-links a::after {
  content:""; position:absolute; left:14px; right:14px; bottom:5px; height:2px;
  background: var(--grad-primary); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--text); }

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  transition: transform .25s var(--ease), border-color .25s;
}
.theme-toggle:hover { transform: rotate(20deg) scale(1.05); border-color: var(--brand-400); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

.hamburger {
  display: none; width: 42px; height: 42px; border-radius: 12px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  align-items: center; justify-content: center;
}
.hamburger span { display:block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; position: relative; transition: .3s; }
.hamburger span::before, .hamburger span::after { content:""; position:absolute; left:0; width:20px; height:2px; background: var(--text); border-radius:2px; transition:.3s; }
.hamburger span::before { top:-6px; } .hamburger span::after { top:6px; }
body.menu-open .hamburger span { background: transparent; }
body.menu-open .hamburger span::before { top:0; transform: rotate(45deg); }
body.menu-open .hamburger span::after { top:0; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 auto 0;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 18px;
  transform: translateY(-120%);
  transition: transform .4s var(--ease);
  z-index: 99;
  max-height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}
body.menu-open .mobile-menu { transform: translateY(0); }
.mobile-menu a { display:block; padding: 14px 16px; border-radius: 12px; font-weight: 600; color: var(--text-soft); border:1px solid transparent; }
.mobile-menu a:hover { background: var(--surface-2); color: var(--text); }
.mobile-menu .btn { margin-top: 12px; }

/* ----------------------------------------------------------------
   7. Glass card
   ---------------------------------------------------------------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s;
  overflow: hidden;
}
.card::before {
  content:""; position:absolute; inset:0; border-radius: inherit; padding:1px;
  background: var(--grad-primary);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .4s var(--ease);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); }
.card:hover::before { opacity: 1; }
.card .card-glow {
  position: absolute; width: 200px; height: 200px; border-radius: 50%;
  background: var(--grad-cool); filter: blur(60px); opacity: 0;
  top: -60px; right: -60px; transition: opacity .5s; pointer-events:none;
}
.card:hover .card-glow { opacity: .25; }

.icon-box {
  width: 54px; height: 54px; border-radius: 15px;
  display: grid; place-items: center; color: #fff;
  background: var(--grad-primary);
  box-shadow: 0 10px 24px rgba(99,102,241,.4);
  margin-bottom: 18px;
  transition: transform .4s var(--ease-bounce);
}
.card:hover .icon-box { transform: scale(1.1) rotate(-6deg); }
.icon-box svg { width: 26px; height: 26px; }
.icon-box.cool { background: var(--grad-cool); box-shadow: 0 10px 24px rgba(6,182,212,.4); }
.icon-box.warm { background: var(--grad-warm); box-shadow: 0 10px 24px rgba(236,72,153,.4); }

/* ----------------------------------------------------------------
   8. Hero
   ---------------------------------------------------------------- */
.hero { padding-top: calc(var(--nav-h) + 60px); padding-bottom: 60px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 50px; align-items: center; }
.hero h1 { font-size: clamp(36px, 6vw, 68px); line-height: 1.04; margin: 22px 0; }
.hero p.lead { font-size: clamp(16px, 1.8vw, 20px); color: var(--text-soft); max-width: 540px; margin-bottom: 30px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 34px; }
.hero-mini { display:flex; gap: 28px; flex-wrap: wrap; }
.hero-mini .num { font-size: 28px; font-weight: 800; letter-spacing:-.02em; }
.hero-mini .lbl { font-size: 13px; color: var(--text-muted); }

.hero-visual { position: relative; }
.invoice-mock {
  position: relative; z-index: 2;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-xl);
  transform: rotate(-1.5deg);
  transition: transform .5s var(--ease);
}
.invoice-mock:hover { transform: rotate(0deg); }
.invoice-mock .top { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom: 22px; }
.invoice-mock .brand-block { display:flex; gap:12px; align-items:center; }
.invoice-mock .brand-block .sq { width:42px;height:42px;border-radius:11px;background:var(--grad-primary); }
.invoice-mock .ttl { font-weight:800; font-size:15px; }
.invoice-mock .sub { font-size:11px; color: var(--text-muted); }
.invoice-mock .big { font-size: 30px; font-weight: 800; letter-spacing:-.02em; }
.bar { height: 8px; border-radius: 6px; background: var(--surface-2); margin: 8px 0; overflow: hidden; }
.bar > i { display:block; height:100%; border-radius:6px; background: var(--grad-primary); transform-origin:left; animation: growBar 1.4s var(--ease) forwards; }
@keyframes growBar { from { transform: scaleX(0); } }
.stat-chip {
  position: absolute; z-index: 3;
  padding: 14px 18px; border-radius: 16px;
  background: var(--glass-bg); backdrop-filter: blur(16px); border:1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  display:flex; align-items:center; gap:12px;
  animation: floatY 5s ease-in-out infinite;
}
.stat-chip .ic { width: 38px;height:38px;border-radius:10px;display:grid;place-items:center;color:#fff; }
.stat-chip .v { font-weight:800; font-size:16px; }
.stat-chip .l { font-size:11px; color: var(--text-muted); }
.stat-chip.s1 { top: -22px; right: -10px; }
.stat-chip.s2 { bottom: 30px; left: -30px; animation-delay:-2.5s; }
.stat-chip.s3 { bottom: -22px; right: 40px; animation-delay:-1.2s; }

/* ----------------------------------------------------------------
   9. Marquee
   ---------------------------------------------------------------- */
.marquee { position: relative; overflow: hidden; mask-image: linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent); -webkit-mask-image: linear-gradient(90deg,transparent,#000 12%,#000 88%,transparent); }
.marquee-track { display:flex; gap: 60px; width: max-content; animation: scrollX 28s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track .logo-item { display:flex; align-items:center; gap:10px; font-weight:700; font-size:20px; color: var(--text-muted); opacity:.8; white-space: nowrap; transition: opacity .2s, color .2s; }
.marquee-track .logo-item:hover { opacity:1; color: var(--text); }
.marquee-track .logo-item svg { width: 26px; height: 26px; }
@keyframes scrollX { to { transform: translateX(-50%); } }

/* ----------------------------------------------------------------
   10. Feature grid
   ---------------------------------------------------------------- */
.feat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.feat-grid .card h3 { font-size: 18px; margin-bottom: 8px; }
.feat-grid .card p { color: var(--text-soft); font-size: 14.5px; }

/* ----------------------------------------------------------------
   11. Steps
   ---------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 26px; counter-reset: step; }
.step { position: relative; padding: 32px 26px; }
.step .num { font-family: var(--font-mono); font-size: 14px; font-weight:700; color: var(--brand-500); margin-bottom: 14px; display:inline-block; padding:5px 12px; border-radius:999px; background: var(--brand-50); }
[data-theme="dark"] .step .num { background: rgba(99,102,241,.15); }
.step h3 { font-size: 20px; margin-bottom: 8px; }
.step p { color: var(--text-soft); font-size: 15px; }
.step::after { content:""; position:absolute; top: 50%; right: -26px; width: 26px; height: 2px; background: var(--grad-primary); opacity:.5; }
.steps .step:last-child::after { display:none; }

/* ----------------------------------------------------------------
   12. Templates showcase
   ---------------------------------------------------------------- */
.tpl-grid { display:grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.tpl-card { position: relative; border-radius: var(--radius-lg); overflow: hidden; border:1px solid var(--border); background: var(--surface); transition: transform .4s var(--ease), box-shadow .4s; cursor: pointer; }
.tpl-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-xl); }
.tpl-card .preview { aspect-ratio: 4/3; background: var(--surface-2); padding: 22px; position: relative; overflow:hidden; }
.tpl-card .preview .head { display:flex; justify-content:space-between; margin-bottom: 18px; }
.tpl-card .preview .sq { width: 36px; height: 36px; border-radius: 9px; }
.tpl-card .preview .ln { height: 7px; border-radius:5px; background: var(--border-strong); margin-bottom: 8px; }
.tpl-card .preview .ln.short { width: 50%; }
.tpl-card .preview .ln.med { width: 75%; }
.tpl-card .info { padding: 18px 22px; display:flex; justify-content:space-between; align-items:center; }
.tpl-card .info h4 { font-size: 16px; }
.tpl-card .info span { font-size: 13px; color: var(--brand-500); font-weight:600; }
.tpl-card .badge { position:absolute; top:14px; left:14px; padding:5px 11px; border-radius:999px; font-size:11px; font-weight:700; color:#fff; background: var(--grad-warm); z-index:2; }

/* ----------------------------------------------------------------
   13. Testimonials
   ---------------------------------------------------------------- */
.tst-grid { display:grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
.tst { padding: 28px; }
.tst .stars { color: #fbbf24; margin-bottom: 14px; display:flex; gap:2px; }
.tst p { color: var(--text); font-size: 15.5px; line-height: 1.7; margin-bottom: 20px; }
.tst .who { display:flex; align-items:center; gap: 12px; }
.tst .avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--grad-primary); color:#fff; display:grid; place-items:center; font-weight:800; }
.tst .who .name { font-weight:700; font-size: 14.5px; }
.tst .who .role { font-size: 12.5px; color: var(--text-muted); }

/* ----------------------------------------------------------------
   14. Pricing
   ---------------------------------------------------------------- */
.price-grid { display:grid; grid-template-columns: repeat(3,1fr); gap: 24px; align-items: stretch; }
.plan { display:flex; flex-direction:column; padding: 34px 30px; position:relative; }
.plan.featured { background: linear-gradient(180deg, rgba(99,102,241,.12), transparent); border:1px solid var(--brand-300); box-shadow: var(--shadow-xl); }
[data-theme="dark"] .plan.featured { border-color: var(--brand-500); }
.plan .tag { position:absolute; top:-13px; left:50%; transform:translateX(-50%); background: var(--grad-primary); color:#fff; font-size:12px; font-weight:700; padding:6px 16px; border-radius:999px; box-shadow: var(--shadow-md); }
.plan h3 { font-size: 20px; margin-bottom: 6px; }
.plan .price { font-size: 44px; font-weight:800; letter-spacing:-.03em; margin: 14px 0 4px; }
.plan .price span { font-size:15px; font-weight:600; color: var(--text-muted); }
.plan .desc { color: var(--text-soft); font-size: 14.5px; margin-bottom: 22px; }
.plan ul { display:flex; flex-direction:column; gap:12px; margin: 8px 0 26px; flex:1; }
.plan li { display:flex; align-items:flex-start; gap:10px; font-size: 14.5px; color: var(--text-soft); }
.plan li svg { width: 18px; height: 18px; color: var(--brand-500); flex-shrink:0; margin-top:2px; }

/* ----------------------------------------------------------------
   15. FAQ accordion
   ---------------------------------------------------------------- */
.faq-wrap { max-width: 820px; margin-inline:auto; display:flex; flex-direction:column; gap: 14px; }
.faq-item { border:1px solid var(--border); border-radius: 16px; background: var(--surface); overflow:hidden; transition: border-color .3s, box-shadow .3s; }
.faq-item.open { border-color: var(--brand-300); box-shadow: var(--shadow-md); }
.faq-q { width:100%; display:flex; align-items:center; justify-content:space-between; gap:18px; padding: 20px 24px; font-weight:700; font-size: 16.5px; text-align:left; }
.faq-q .chev { width: 24px; height: 24px; flex-shrink:0; transition: transform .35s var(--ease); color: var(--brand-500); }
.faq-item.open .chev { transform: rotate(180deg); }
.faq-a { max-height:0; overflow:hidden; transition: max-height .4s var(--ease); }
.faq-a .inner { padding: 0 24px 22px; color: var(--text-soft); font-size: 15px; line-height:1.7; }

/* ----------------------------------------------------------------
   16. Newsletter
   ---------------------------------------------------------------- */
.newsletter { padding: 48px; text-align:center; position:relative; overflow:hidden; }
.newsletter h2 { font-size: clamp(26px,3vw,36px); margin-bottom: 10px; }
.newsletter p { color: var(--text-soft); margin-bottom: 26px; }
.news-form { display:flex; gap:10px; max-width: 480px; margin-inline:auto; }

/* ----------------------------------------------------------------
   17. Footer
   ---------------------------------------------------------------- */
.footer { border-top: 1px solid var(--border); padding: 70px 0 30px; background: var(--bg-soft); position:relative; }
.footer-grid { display:grid; grid-template-columns: 1.6fr repeat(4,1fr); gap: 40px; margin-bottom: 50px; }
.footer .brand p { color: var(--text-soft); font-size:14.5px; margin: 16px 0; max-width: 300px; }
.footer h5 { font-size: 13px; text-transform:uppercase; letter-spacing:.08em; color: var(--text-muted); margin-bottom: 16px; }
.footer ul { display:flex; flex-direction:column; gap:10px; }
.footer ul a { color: var(--text-soft); font-size:14.5px; transition: color .2s, padding-left .2s; }
.footer ul a:hover { color: var(--brand-500); padding-left: 4px; }
.socials { display:flex; gap:10px; margin-top: 18px; }
.socials a { width: 38px; height:38px; border-radius:11px; display:grid; place-items:center; background: var(--surface); border:1px solid var(--border); color: var(--text-soft); transition: all .25s var(--ease); }
.socials a:hover { background: var(--grad-primary); color:#fff; transform: translateY(-3px); border-color:transparent; }
.socials svg { width: 18px; height: 18px; }
.footer-bottom { border-top:1px solid var(--border); padding-top:24px; display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; color: var(--text-muted); font-size: 13.5px; }

/* ----------------------------------------------------------------
   18. Forms (floating labels)
   ---------------------------------------------------------------- */
.field { position: relative; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 18px 16px 8px;
  border: 1.5px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  font-size: 15px;
  transition: border-color .25s, box-shadow .25s;
}
.field textarea { padding-top: 24px; resize: vertical; min-height: 90px; }
.field label {
  position: absolute; left: 16px; top: 16px;
  color: var(--text-muted); font-size: 15px;
  pointer-events: none; transition: all .2s var(--ease);
  background: transparent; padding: 0 4px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand-500);
  box-shadow: 0 0 0 4px var(--ring);
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field input.filled + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label,
.field select:focus + label,
.field select.filled + label {
  top: 6px; font-size: 11px; font-weight: 600; color: var(--brand-500);
}
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: #ef4444; }
.field .err { display:none; color:#ef4444; font-size:12.5px; margin-top:6px; padding-left:4px; }
.field.invalid .err { display:block; }
.field.valid input { border-color: #10b981; }

/* checkbox / radio */
.check { display:flex; align-items:flex-start; gap:10px; cursor:pointer; font-size:14px; color: var(--text-soft); }
.check input { width:18px; height:18px; accent-color: var(--brand-500); margin-top:2px; }

/* ----------------------------------------------------------------
   19. Buttons generic & back-to-top
   ---------------------------------------------------------------- */
.back-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 90;
  width: 50px; height: 50px; border-radius: 14px;
  background: var(--grad-primary); color:#fff;
  display:grid; place-items:center;
  box-shadow: 0 12px 30px rgba(99,102,241,.5);
  opacity: 0; transform: translateY(20px) scale(.8); pointer-events:none;
  transition: all .35s var(--ease-bounce);
}
.back-top.show { opacity:1; transform: translateY(0) scale(1); pointer-events:auto; }
.back-top:hover { transform: translateY(-4px) scale(1.05); }

/* ----------------------------------------------------------------
   20. Toasts
   ---------------------------------------------------------------- */
.toast-wrap { position: fixed; top: calc(var(--nav-h) + 16px); right: 24px; z-index: 200; display:flex; flex-direction:column; gap:10px; }
.toast {
  display:flex; align-items:center; gap:12px;
  padding: 14px 18px; border-radius: 14px;
  background: var(--glass-bg); backdrop-filter: blur(16px);
  border:1px solid var(--glass-border); box-shadow: var(--shadow-lg);
  min-width: 280px; max-width: 360px;
  transform: translateX(120%); transition: transform .4s var(--ease-bounce);
  font-size: 14.5px; font-weight: 500;
}
.toast.show { transform: translateX(0); }
.toast .ic { width: 30px; height:30px; border-radius:9px; display:grid; place-items:center; color:#fff; flex-shrink:0; }
.toast.success .ic { background: #10b981; }
.toast.error .ic { background: #ef4444; }
.toast.info .ic { background: var(--brand-500); }
.toast svg { width: 18px; height:18px; }

/* ----------------------------------------------------------------
   21. Page header (interior pages)
   ---------------------------------------------------------------- */
.page-head { padding-top: calc(var(--nav-h) + 70px); padding-bottom: 40px; text-align:center; }
.page-head h1 { font-size: clamp(34px,5vw,56px); margin: 18px 0 14px; }
.page-head p { color: var(--text-soft); font-size: clamp(15px,1.6vw,18px); max-width: 640px; margin-inline:auto; }
.breadcrumb { display:flex; justify-content:center; gap:8px; font-size:13.5px; color: var(--text-muted); margin-top:18px; }
.breadcrumb a:hover { color: var(--brand-500); }

/* ----------------------------------------------------------------
   22. Prose (legal / about)
   ---------------------------------------------------------------- */
.prose { max-width: 820px; margin-inline:auto; }
.prose h2 { font-size: 24px; margin: 36px 0 12px; }
.prose h3 { font-size: 18px; margin: 24px 0 8px; }
.prose p, .prose li { color: var(--text-soft); font-size: 15.5px; line-height: 1.8; margin-bottom: 12px; }
.prose ul { list-style: disc; padding-left: 22px; margin-bottom: 14px; }
.prose a { color: var(--brand-500); text-decoration: underline; text-underline-offset: 3px; }
.prose .callout { padding: 20px 24px; border-radius: 16px; background: var(--brand-50); border-left:4px solid var(--brand-500); margin: 24px 0; }
[data-theme="dark"] .prose .callout { background: rgba(99,102,241,.1); }
.prose .last-updated { color: var(--text-muted); font-size: 14px; margin-bottom: 30px; }

/* table */
.table-wrap { overflow-x:auto; border-radius: var(--radius); border:1px solid var(--border); }
table.data { width:100%; border-collapse: collapse; background: var(--surface); }
table.data th, table.data td { padding: 14px 18px; text-align:left; border-bottom:1px solid var(--border); font-size:14.5px; }
table.data th { background: var(--surface-2); font-weight:700; font-size:13px; text-transform:uppercase; letter-spacing:.05em; color: var(--text-muted); }
table.data tr:last-child td { border-bottom:none; }
table.data tr:hover td { background: var(--surface-2); }

/* ----------------------------------------------------------------
   23. Invoice Generator tool
   ---------------------------------------------------------------- */
.tool-layout { display:grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items:start; }
.tool-panel { padding: 28px; position: sticky; top: calc(var(--nav-h) + 16px); }
.tool-section { margin-bottom: 26px; }
.tool-section h3 { font-size: 17px; margin-bottom: 4px; display:flex; align-items:center; gap:10px; }
.tool-section h3 .ic { width: 30px; height:30px; border-radius:9px; background: var(--grad-primary); color:#fff; display:grid; place-items:center; }
.tool-section h3 .ic svg { width:16px;height:16px; }
.tool-section .hint { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.form-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1/-1; }

.logo-uploader { display:flex; align-items:center; gap: 16px; }
.logo-preview { width: 78px; height: 78px; border-radius: 16px; border: 2px dashed var(--border-strong); display:grid; place-items:center; color: var(--text-muted); overflow:hidden; background: var(--surface-2); cursor:pointer; transition: border-color .25s, color .25s; flex-shrink:0; }
.logo-preview:hover { border-color: var(--brand-500); color: var(--brand-500); }
.logo-preview img { width:100%; height:100%; object-fit: contain; }
.logo-preview svg { width: 26px; height:26px; }

.items-table { border:1px solid var(--border); border-radius: 14px; overflow:hidden; }
.items-table .row { display:grid; grid-template-columns: 1.7fr .6fr 1fr 1fr 40px; gap: 10px; padding: 12px; align-items:center; border-bottom:1px solid var(--border); }
.items-table .row:last-child { border-bottom:none; }
.items-table .head-row { background: var(--surface-2); font-size: 12px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color: var(--text-muted); }
.items-table .row input { padding: 10px 12px; border:1px solid var(--border-strong); border-radius: 10px; background: var(--surface); font-size: 14px; width:100%; }
.items-table .row input:focus { outline:none; border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--ring); }
.items-table .amt { font-weight:700; text-align:right; font-size: 14px; }
.del-item { width: 34px; height:34px; border-radius: 10px; display:grid; place-items:center; color:#ef4444; background: rgba(239,68,68,.08); transition: all .2s; }
.del-item:hover { background: rgba(239,68,68,.18); transform: scale(1.08); }
.add-item { margin-top: 12px; }

.calc-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.calc-total { margin-top: 20px; padding-top: 18px; border-top: 2px dashed var(--border-strong); display:flex; justify-content:space-between; align-items:center; }
.calc-total .lbl { font-size: 15px; color: var(--text-soft); font-weight:600; }
.calc-total .val { font-size: 32px; font-weight:800; letter-spacing:-.02em; background: var(--grad-text); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }

.tool-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top: 26px; }
.tool-actions .btn { flex:1; min-width: 130px; }

/* Invoice preview (the actual doc) */
.inv-doc {
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 38px;
  box-shadow: var(--shadow-lg);
  min-height: 600px;
}
.inv-doc .doc-head { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom: 34px; padding-bottom: 24px; border-bottom: 2px solid var(--border); }
.inv-doc .doc-head .brand { display:flex; gap: 14px; align-items:center; }
.inv-doc .doc-head .brand img, .inv-doc .doc-head .brand .ph { width: 56px; height:56px; border-radius: 14px; object-fit: contain; background: var(--grad-primary); display:grid; place-items:center; color:#fff; font-weight:800; font-size: 22px; }
.inv-doc .ttl { font-weight:800; font-size: 17px; } .inv-doc .sub { font-size: 12.5px; color: var(--text-muted); }
.inv-doc .inv-title { font-size: 30px; font-weight: 800; letter-spacing:-.02em; }
.inv-doc .inv-meta { text-align:right; font-size: 13px; color: var(--text-soft); }
.inv-doc .inv-meta .num { font-family: var(--font-mono); font-weight: 700; color: var(--brand-500); }
.inv-doc .parties { display:grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 28px; }
.inv-doc .parties h6 { font-size: 11px; text-transform:uppercase; letter-spacing:.08em; color: var(--text-muted); margin-bottom: 8px; font-weight:700; }
.inv-doc .parties .nm { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.inv-doc .parties p { font-size: 13px; color: var(--text-soft); line-height:1.6; }
.inv-doc table.items { width:100%; border-collapse: collapse; margin-bottom: 24px; }
.inv-doc table.items th { font-size: 11px; text-transform:uppercase; letter-spacing:.06em; color: var(--text-muted); text-align:left; padding: 12px 14px; background: var(--surface-2); }
.inv-doc table.items th.r, .inv-doc table.items td.r { text-align: right; }
.inv-doc table.items td { padding: 14px; border-bottom:1px solid var(--border); font-size: 14px; }
.inv-doc .totals { margin-left:auto; width: 280px; display:flex; flex-direction:column; gap: 8px; }
.inv-doc .totals .row { display:flex; justify-content:space-between; font-size: 14px; padding: 6px 0; color: var(--text-soft); }
.inv-doc .totals .row.grand { font-size: 19px; font-weight: 800; color: var(--text); padding-top: 14px; margin-top:6px; border-top: 2px solid var(--border); }
.inv-doc .notes { margin-top: 30px; padding: 16px 18px; background: var(--surface-2); border-radius: 12px; font-size: 13px; color: var(--text-soft); }
.inv-doc .notes h6 { font-size: 11px; text-transform:uppercase; letter-spacing:.08em; color: var(--text-muted); margin-bottom: 6px; }
.inv-doc .footer-note { margin-top: 30px; text-align:center; font-size: 12px; color: var(--text-muted); }

.empty-mini { text-align:center; padding: 30px; color: var(--text-muted); font-size: 14px; }

/* ----------------------------------------------------------------
   24. Dashboard mockup
   ---------------------------------------------------------------- */
.dash-layout { display:grid; grid-template-columns: 240px 1fr; gap: 24px; align-items:start; }
.dash-side { padding: 22px; position: sticky; top: calc(var(--nav-h) + 16px); }
.dash-side .nav-item { display:flex; align-items:center; gap:12px; padding: 11px 14px; border-radius: 11px; font-size: 14.5px; font-weight: 600; color: var(--text-soft); transition: all .2s; margin-bottom: 4px; }
.dash-side .nav-item svg { width: 19px; height: 19px; }
.dash-side .nav-item:hover { background: var(--surface-2); color: var(--text); }
.dash-side .nav-item.active { background: var(--grad-primary); color:#fff; box-shadow: 0 8px 20px rgba(99,102,241,.35); }
.dash-side .label { font-size: 11px; text-transform:uppercase; letter-spacing:.08em; color: var(--text-muted); margin: 18px 0 8px; padding-left: 14px; }

.dash-main { display:flex; flex-direction:column; gap: 22px; }
.stat-grid { display:grid; grid-template-columns: repeat(4,1fr); gap: 18px; }
.stat-card { padding: 22px; }
.stat-card .top { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom: 14px; }
.stat-card .ic { width: 42px; height:42px; border-radius: 12px; display:grid; place-items:center; color:#fff; }
.stat-card .val { font-size: 28px; font-weight:800; letter-spacing:-.02em; }
.stat-card .lbl { font-size: 13px; color: var(--text-muted); }
.stat-card .trend { font-size: 12px; font-weight: 700; display:inline-flex; align-items:center; gap:3px; padding: 3px 8px; border-radius:999px; margin-top:8px; }
.stat-card .trend.up { color:#10b981; background: rgba(16,185,129,.1); }
.stat-card .trend.down { color:#ef4444; background: rgba(239,68,68,.1); }

.chart-card { padding: 26px; }
.chart-card .head { display:flex; justify-content:space-between; align-items:center; margin-bottom: 22px; }
.chart-bars { display:flex; align-items:flex-end; gap: 12px; height: 220px; padding-top: 10px; }
.chart-bars .bar-col { flex:1; display:flex; flex-direction:column; align-items:center; gap: 8px; height:100%; justify-content:flex-end; }
.chart-bars .bar-col .b { width:100%; max-width: 38px; border-radius: 8px 8px 0 0; background: var(--grad-primary); transform-origin: bottom; animation: barUp 1s var(--ease) backwards; position:relative; }
.chart-bars .bar-col .b::after { content:""; position:absolute; inset:0; background: linear-gradient(180deg, rgba(255,255,255,.25), transparent); border-radius: inherit; }
.chart-bars .bar-col .lbl { font-size: 11.5px; color: var(--text-muted); font-weight:600; }
@keyframes barUp { from { transform: scaleY(0); } }

.dash-row { display:grid; grid-template-columns: 1.6fr 1fr; gap: 22px; }

/* ----------------------------------------------------------------
   25. Reveal animations (custom AOS-like)
   ---------------------------------------------------------------- */
[data-reveal] { opacity:0; transform: translateY(30px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
[data-reveal="left"] { transform: translateX(-40px); }
[data-reveal="right"] { transform: translateX(40px); }
[data-reveal="scale"] { transform: scale(.92); }
[data-reveal].in { opacity:1; transform: none; }
[data-reveal-delay="1"] { transition-delay:.1s; }
[data-reveal-delay="2"] { transition-delay:.2s; }
[data-reveal-delay="3"] { transition-delay:.3s; }
[data-reveal-delay="4"] { transition-delay:.4s; }
[data-reveal-delay="5"] { transition-delay:.5s; }

/* loader */
.loader { position: fixed; inset:0; z-index: 9999; background: var(--bg); display:grid; place-items:center; transition: opacity .5s, visibility .5s; }
.loader.hide { opacity:0; visibility:hidden; }
.loader .ring { width: 60px; height:60px; border-radius:50%; border:4px solid var(--border-strong); border-top-color: var(--brand-500); animation: spin 1s linear infinite; }
.loader .logo-mark { animation: pulse 1.5s infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* page transition */
.page-enter { animation: pageIn .6s var(--ease); }
@keyframes pageIn { from { opacity:0; transform: translateY(12px); } }

/* custom cursor */
.cursor-dot, .cursor-ring { position: fixed; top:0; left:0; pointer-events:none; z-index:9998; border-radius:50%; transform: translate(-50%,-50%); mix-blend-mode: difference; }
.cursor-dot { width: 8px; height:8px; background:#fff; transition: transform .1s; }
.cursor-ring { width: 36px; height:36px; border:2px solid #fff; transition: transform .2s var(--ease), width .2s, height .2s; }
.cursor-ring.grow { width: 60px; height:60px; background: rgba(255,255,255,.1); }
@media (hover:none) { .cursor-dot, .cursor-ring { display:none; } }

/* ----------------------------------------------------------------
   26. Responsive
   ---------------------------------------------------------------- */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 60px; }
  .hero-visual { max-width: 520px; margin-inline:auto; }
  .feat-grid { grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1/-1; }
}
@media (max-width: 900px) {
  .nav-links { display:none; }
  .hamburger { display:flex; }
  .nav-actions .btn-login { display:none; }
  .tool-layout { grid-template-columns: 1fr; }
  .tool-panel { position: static; }
  .dash-layout { grid-template-columns: 1fr; }
  .dash-side { position: static; }
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .dash-row { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .step::after { display:none; }
  .tpl-grid, .tst-grid, .price-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .container { width: calc(100% - 28px); }
  .section { padding: 60px 0; }
  .hero { padding-top: calc(var(--nav-h) + 30px); }
  .feat-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .items-table .row { grid-template-columns: 1fr; gap: 6px; }
  .items-table .head-row { display:none; }
  .items-table .row input::placeholder { font-size: 13px; }
  .inv-doc { padding: 24px; }
  .inv-doc .parties { grid-template-columns: 1fr; }
  .inv-doc .doc-head { flex-direction: column; gap: 16px; }
  .inv-doc .totals { width: 100%; }
  .stat-chip.s1, .stat-chip.s2, .stat-chip.s3 { display:none; }
  .nav-actions .theme-toggle { display:grid; }
  .newsletter { padding: 32px 22px; }
  .news-form { flex-direction: column; }
  .tool-actions .btn { flex: 1 1 100%; }
}

/* ==========================================================================
   27. RESUME BUILDER
   ========================================================================== */
.rb-layout { display:grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
.rb-editor { position: sticky; top: calc(var(--nav-h) + 16px); max-height: calc(100vh - var(--nav-h) - 32px); overflow-y: auto; padding: 26px; }
.rb-editor::-webkit-scrollbar { width: 8px; }
.rb-editor::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }

/* Sidebar tabs */
.rb-tabs { display:flex; gap: 4px; padding: 5px; background: var(--surface-2); border-radius: 12px; margin-bottom: 22px; }
.rb-tab { flex:1; padding: 9px 8px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-muted); transition: all .2s; white-space: nowrap; }
.rb-tab.active { background: var(--surface); color: var(--brand-600); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .rb-tab.active { color: var(--brand-300); }
.rb-tab:hover:not(.active) { color: var(--text); }

.rb-pane { display: none; animation: rbFade .35s var(--ease); }
.rb-pane.active { display: block; }
@keyframes rbFade { from { opacity:0; transform: translateY(8px); } }

.rb-section { margin-bottom: 22px; }
.rb-section h4 { font-size: 14px; margin-bottom: 12px; display:flex; align-items:center; gap: 8px; letter-spacing:-.01em; }
.rb-section h4 .ic { width: 26px; height:26px; border-radius:8px; background: var(--grad-primary); color:#fff; display:grid; place-items:center; }
.rb-section h4 .ic svg { width:14px; height:14px; }

/* repeatable group (experience, education, skills) */
.rb-group { border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-bottom: 12px; background: var(--surface-2); position: relative; }
.rb-group .grp-head { display:flex; justify-content:space-between; align-items:center; margin-bottom: 10px; }
.rb-group .grp-head .ttl { font-size: 13px; font-weight: 700; color: var(--brand-600); }
[data-theme="dark"] .rb-group .grp-head .ttl { color: var(--brand-300); }
.rb-group .grp-del { width: 26px; height:26px; border-radius:7px; display:grid; place-items:center; color:#ef4444; background: rgba(239,68,68,.08); transition: all .2s; }
.rb-group .grp-del:hover { background: rgba(239,68,68,.18); transform: scale(1.08); }
.rb-group .grp-del svg { width:14px; height:14px; }
.rb-add { width:100%; padding: 11px; border:1.5px dashed var(--border-strong); border-radius:12px; color: var(--brand-600); font-weight:600; font-size:13.5px; display:flex; align-items:center; justify-content:center; gap:8px; transition: all .2s; }
[data-theme="dark"] .rb-add { color: var(--brand-300); }
.rb-add:hover { border-color: var(--brand-500); background: var(--brand-50); }
[data-theme="dark"] .rb-add:hover { background: rgba(99,102,241,.1); }

/* Photo uploader */
.rb-photo-row { display:flex; gap: 16px; align-items:center; margin-bottom: 16px; }
.rb-photo { width: 88px; height: 88px; border-radius: 14px; border: 2px dashed var(--border-strong); display:grid; place-items:center; color: var(--text-muted); overflow:hidden; cursor:pointer; flex-shrink:0; background: var(--surface); transition: border-color .25s, color .25s; }
.rb-photo:hover { border-color: var(--brand-500); color: var(--brand-500); }
.rb-photo img { width:100%; height:100%; object-fit: cover; }
.rb-photo svg { width: 28px; height:28px; }

/* Color theme picker */
.color-grid { display:grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.color-swatch { aspect-ratio: 1; border-radius: 10px; cursor:pointer; position:relative; border: 2px solid transparent; transition: transform .2s var(--ease-bounce); }
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.active { border-color: var(--text); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--brand-500); }
.color-swatch.active::after { content:"✓"; position:absolute; inset:0; display:grid; place-items:center; color:#fff; font-weight:800; font-size:14px; text-shadow: 0 1px 2px rgba(0,0,0,.4); }

/* Font picker */
.font-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.font-opt { padding: 12px; border:1.5px solid var(--border-strong); border-radius: 11px; cursor:pointer; transition: all .2s; text-align:center; }
.font-opt:hover { border-color: var(--brand-400); }
.font-opt.active { border-color: var(--brand-500); background: var(--brand-50); }
[data-theme="dark"] .font-opt.active { background: rgba(99,102,241,.12); }
.font-opt .sample { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.font-opt .nm { font-size: 11px; color: var(--text-muted); }

/* Template picker */
.tpl-mini-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tpl-mini { aspect-ratio: .72; border-radius: 10px; border: 2px solid var(--border); cursor:pointer; padding: 10px; background: var(--surface); position:relative; transition: all .2s; overflow:hidden; }
.tpl-mini:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.tpl-mini.active { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--ring); }
.tpl-mini .nm { position:absolute; bottom: 6px; left: 6px; right:6px; font-size: 9px; font-weight:700; text-align:center; color: var(--text); background: var(--glass-bg); backdrop-filter: blur(8px); padding: 3px; border-radius: 5px; }
.tpl-mini .mock { width:100%; height:100%; }

/* Resume preview canvas */
.rb-preview-wrap { position: sticky; top: calc(var(--nav-h) + 16px); }
.rb-preview-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom: 14px; flex-wrap:wrap; }
.rb-zoom { display:flex; align-items:center; gap: 6px; }
.rb-zoom button { width: 34px; height:34px; border-radius: 9px; background: var(--glass-bg); border:1px solid var(--glass-border); display:grid; place-items:center; backdrop-filter: blur(10px); transition: all .2s; }
.rb-zoom button:hover { border-color: var(--brand-400); color: var(--brand-500); }
.rb-zoom .val { font-size: 13px; font-weight: 600; min-width: 44px; text-align:center; color: var(--text-soft); }

.rb-paper {
  background: #fff;
  color: #1a1a1a;
  width: 210mm;            /* A4 width */
  min-height: 297mm;       /* A4 height */
  margin: 0 auto;
  box-shadow: var(--shadow-xl);
  transform-origin: top center;
  transition: transform .25s var(--ease);
  overflow: hidden;
  border-radius: 2px;
}
.rb-paper.dark { background: #1a1a2e; color: #e4e4e7; }
.rb-paper.cream { background: #faf7f0; }

/* Resume fonts */
.rb-paper[data-font="inter"]    { font-family: 'Inter', system-ui, sans-serif; }
.rb-paper[data-font="jakarta"]  { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }
.rb-paper[data-font="serif"]    { font-family: Georgia, 'Times New Roman', serif; }
.rb-paper[data-font="mono"]     { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* Generic resume typography */
.rb-paper { line-height: 1.5; font-size: 13.5px; }
.rb-paper h1 { font-size: 30px; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; margin: 0; }
.rb-paper h2 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; margin: 0 0 10px; }
.rb-paper h3 { font-size: 14px; font-weight: 700; margin: 0; }
.rb-paper p { margin: 0; }
.rb-paper a { color: inherit; text-decoration: none; }

/* Color theming via CSS var on the paper */
.rb-paper { --rb-accent: #6366f1; --rb-accent-2: #8b5cf6; }
.rb-paper .accent { color: var(--rb-accent); }
.rb-paper .accent-bg { background: var(--rb-accent); color: #fff; }

/* ---- Template: Modern (sidebar) ---- */
.tpl-modern { display:grid; grid-template-columns: 34% 66%; min-height: 297mm; }
.tpl-modern .side { background: var(--rb-accent); color: #fff; padding: 32px 24px; }
.tpl-modern .side .photo { width: 120px; height:120px; border-radius: 50%; object-fit: cover; margin: 0 auto 18px; display:block; border: 4px solid rgba(255,255,255,.25); background: rgba(255,255,255,.15); }
.tpl-modern .side .photo-ph { width: 120px; height:120px; border-radius: 50%; margin: 0 auto 18px; display:grid; place-items:center; font-size: 44px; font-weight:800; background: rgba(255,255,255,.15); border: 4px solid rgba(255,255,255,.25); }
.tpl-modern .side h2 { color: rgba(255,255,255,.7); }
.tpl-modern .side .contact-item { display:flex; align-items:center; gap:8px; font-size: 11.5px; margin-bottom: 7px; word-break: break-word; }
.tpl-modern .side .contact-item svg { width: 13px; height:13px; flex-shrink:0; opacity:.85; }
.tpl-modern .side .skill-bar { margin-bottom: 9px; }
.tpl-modern .side .skill-bar .nm { font-size: 11.5px; margin-bottom: 4px; display:flex; justify-content:space-between; }
.tpl-modern .side .skill-bar .track { height: 5px; background: rgba(255,255,255,.2); border-radius: 5px; overflow:hidden; }
.tpl-modern .side .skill-bar .track i { display:block; height:100%; background: #fff; border-radius:5px; }
.tpl-modern .side .lang { font-size: 11.5px; margin-bottom: 6px; display:flex; justify-content:space-between; }
.tpl-modern .side .sec { margin-bottom: 22px; }
.tpl-modern .main { padding: 34px 30px; }
.tpl-modern .main .name { font-size: 32px; font-weight: 800; letter-spacing:-.02em; line-height:1; margin-bottom: 4px; color: #1a1a1a; }
.tpl-modern .main .role { font-size: 14px; color: var(--rb-accent); font-weight: 600; margin-bottom: 22px; }
.tpl-modern .main h2 { color: var(--rb-accent); padding-bottom: 6px; border-bottom: 2px solid #eee; margin-bottom: 12px; }
.tpl-modern .exp-item { margin-bottom: 16px; }
.tpl-modern .exp-item .top { display:flex; justify-content:space-between; gap:10px; margin-bottom: 3px; }
.tpl-modern .exp-item .pos { font-weight: 700; font-size: 13.5px; color:#1a1a1a; }
.tpl-modern .exp-item .co { font-size: 12.5px; color: var(--rb-accent); font-weight: 600; }
.tpl-modern .exp-item .date { font-size: 11px; color: #888; white-space: nowrap; }
.tpl-modern .exp-item ul { margin: 5px 0 0 16px; padding:0; }
.tpl-modern .exp-item li { font-size: 12px; color: #444; margin-bottom: 3px; }
.tpl-modern .summary { font-size: 12.5px; color: #444; line-height: 1.6; }

/* dark paper variant adjustments */
.rb-paper.dark .tpl-modern .main .name { color:#fff; }
.rb-paper.dark .tpl-modern .main .exp-item .pos { color:#fff; }
.rb-paper.dark .tpl-modern .main .exp-item li,
.rb-paper.dark .tpl-modern .main .summary { color:#b9bcd6; }
.rb-paper.dark .tpl-modern .main h2 { border-color: rgba(255,255,255,.1); }

/* ---- Template: Classic (single column) ---- */
.tpl-classic { padding: 40px 46px; }
.tpl-classic .head { text-align:center; padding-bottom: 18px; border-bottom: 3px solid var(--rb-accent); margin-bottom: 22px; }
.tpl-classic .head .photo { width: 100px; height:100px; border-radius: 50%; object-fit:cover; margin: 0 auto 12px; border: 3px solid var(--rb-accent); }
.tpl-classic .head .photo-ph { width: 100px; height:100px; border-radius:50%; margin:0 auto 12px; display:grid; place-items:center; font-size:36px; font-weight:800; color:var(--rb-accent); background: rgba(0,0,0,.05); border:3px solid var(--rb-accent); }
.tpl-classic .head .name { font-size: 28px; font-weight: 800; letter-spacing:.01em; }
.tpl-classic .head .role { font-size: 14px; color: var(--rb-accent); font-weight: 600; margin-top: 2px; }
.tpl-classic .head .contact { display:flex; flex-wrap:wrap; justify-content:center; gap: 6px 16px; margin-top: 10px; font-size: 11.5px; color:#555; }
.tpl-classic .head .contact span { display:flex; align-items:center; gap:5px; }
.tpl-classic h2 { color: var(--rb-accent); border-left: 4px solid var(--rb-accent); padding-left: 10px; margin: 20px 0 12px; }
.tpl-classic .exp-item { margin-bottom: 14px; }
.tpl-classic .exp-item .top { display:flex; justify-content:space-between; }
.tpl-classic .exp-item .pos { font-weight: 700; }
.tpl-classic .exp-item .co { color: var(--rb-accent); font-weight: 600; }
.tpl-classic .exp-item .date { font-size: 11px; color:#888; }
.tpl-classic .exp-item ul { margin: 4px 0 0 18px; color:#444; }
.rb-paper.dark .tpl-classic .head .contact,
.rb-paper.dark .tpl-classic .exp-item ul { color:#b9bcd6; }

/* ---- Template: Minimal ---- */
.tpl-minimal { padding: 48px 50px; }
.tpl-minimal .head { display:flex; align-items:center; gap: 22px; padding-bottom: 24px; margin-bottom: 24px; }
.tpl-minimal .head .photo { width: 92px; height:92px; border-radius: 50%; object-fit: cover; }
.tpl-minimal .head .photo-ph { width: 92px; height:92px; border-radius:50%; display:grid; place-items:center; font-size:32px; font-weight:800; background: var(--rb-accent); color:#fff; }
.tpl-minimal .head .name { font-size: 30px; font-weight: 800; }
.tpl-minimal .head .role { font-size: 14px; color: #777; font-weight: 500; }
.tpl-minimal .head .contact { display:flex; flex-wrap:wrap; gap: 4px 14px; margin-top: 8px; font-size: 11.5px; color:#666; }
.tpl-minimal h2 { font-size: 13px; letter-spacing: .15em; text-transform: uppercase; margin: 24px 0 12px; padding-bottom: 6px; border-bottom: 1px solid #e0e0e0; }
.tpl-minimal .two-col { display:grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.tpl-minimal .exp-item { margin-bottom: 14px; }
.tpl-minimal .exp-item .pos { font-weight: 700; font-size: 13.5px; }
.tpl-minimal .exp-item .co { color: var(--rb-accent); font-size: 12.5px; }
.tpl-minimal .exp-item .date { font-size: 11px; color:#999; }
.tpl-minimal .exp-item ul { margin: 4px 0 0 18px; color:#555; font-size: 12px; }
.rb-paper.dark .tpl-minimal .exp-item ul,
.rb-paper.dark .tpl-minimal .head .contact,
.rb-paper.dark .tpl-minimal .head .role { color:#b9bcd6; }

/* ---- Template: Creative (header banner) ---- */
.tpl-creative { }
.tpl-creative .banner { background: linear-gradient(135deg, var(--rb-accent), var(--rb-accent-2)); color:#fff; padding: 36px 40px; display:flex; align-items:center; gap: 24px; }
.tpl-creative .banner .photo { width: 110px; height:110px; border-radius: 20px; object-fit: cover; border: 4px solid rgba(255,255,255,.3); }
.tpl-creative .banner .photo-ph { width: 110px; height:110px; border-radius: 20px; display:grid; place-items:center; font-size:40px; font-weight:800; background: rgba(255,255,255,.2); border:4px solid rgba(255,255,255,.3); }
.tpl-creative .banner .name { font-size: 30px; font-weight: 800; }
.tpl-creative .banner .role { font-size: 15px; opacity: .92; }
.tpl-creative .banner .contact { display:flex; flex-wrap:wrap; gap: 4px 16px; margin-top: 8px; font-size: 11.5px; opacity:.95; }
.tpl-creative .body { padding: 30px 40px; }
.tpl-creative h2 { color: var(--rb-accent); margin: 20px 0 12px; display:flex; align-items:center; gap:8px; }
.tpl-creative h2::before { content:""; width: 22px; height: 3px; background: var(--rb-accent); border-radius: 3px; }
.tpl-creative .exp-item { margin-bottom: 14px; }
.tpl-creative .exp-item .top { display:flex; justify-content:space-between; }
.tpl-creative .exp-item .pos { font-weight: 700; }
.tpl-creative .exp-item .co { color: var(--rb-accent); font-weight:600; }
.tpl-creative .exp-item ul { margin: 4px 0 0 18px; color:#444; }

/* ---- Template: Executive (two-col, dark sidebar) ---- */
.tpl-exec { display:grid; grid-template-columns: 38% 62%; min-height: 297mm; }
.tpl-exec .side { background: #1a1a2e; color:#fff; padding: 34px 26px; }
.tpl-exec .side .photo { width: 130px; height:130px; border-radius: 50%; object-fit: cover; margin: 0 auto 20px; display:block; border: 4px solid var(--rb-accent); }
.tpl-exec .side .photo-ph { width: 130px; height:130px; border-radius:50%; margin:0 auto 20px; display:grid; place-items:center; font-size:48px; font-weight:800; background: var(--rb-accent); border:4px solid rgba(255,255,255,.15); }
.tpl-exec .side h2 { color: var(--rb-accent); border-bottom: 2px solid rgba(255,255,255,.15); padding-bottom: 6px; margin-bottom: 12px; }
.tpl-exec .side .contact-item { font-size: 11.5px; margin-bottom: 7px; color: #c8c8d8; }
.tpl-exec .side .skill { font-size: 11.5px; margin-bottom: 6px; color:#c8c8d8; }
.tpl-exec .main { padding: 36px 32px; }
.tpl-exec .main .name { font-size: 30px; font-weight: 800; }
.tpl-exec .main .role { font-size: 14px; color: var(--rb-accent); font-weight: 600; margin-bottom: 22px; }
.tpl-exec .main h2 { color: var(--rb-accent); padding-bottom:6px; border-bottom: 2px solid #eee; margin-bottom: 12px; }
.tpl-exec .exp-item { margin-bottom: 14px; }
.tpl-exec .exp-item .top { display:flex; justify-content:space-between; }
.tpl-exec .exp-item .pos { font-weight: 700; }
.tpl-exec .exp-item .co { color: var(--rb-accent); font-weight:600; }
.tpl-exec .exp-item ul { margin: 4px 0 0 18px; color:#444; }

/* mini preview skeletons */
.tpl-mini .mock-modern { display:grid; grid-template-columns: 30% 70%; height:100%; }
.tpl-mini .mock-modern .l { background: var(--rb-accent); border-radius: 4px 0 0 4px; }
.tpl-mini .mock-modern .r { padding: 6px; display:flex; flex-direction:column; gap: 3px; }
.tpl-mini .mock-modern .r .ln { height: 3px; background: #ddd; border-radius: 2px; }
.tpl-mini .mock-modern .r .ln.s { width: 60%; }
.tpl-mini .mock-modern .r .ln.h { height: 6px; background: #bbb; width: 70%; margin-bottom: 4px; }
.tpl-mini .mock-classic { padding: 8px; height:100%; display:flex; flex-direction:column; gap:4px; }
.tpl-mini .mock-classic .ln { height: 3px; background:#ddd; border-radius:2px; }
.tpl-mini .mock-classic .ln.h { height:6px; background: var(--rb-accent); width:40%; margin: 4px auto; }
.tpl-mini .mock-classic .ln.s { width:60%; align-self:center; }
.tpl-mini .mock-minimal { padding:8px; height:100%; display:flex; flex-direction:column; gap:3px; }
.tpl-mini .mock-minimal .ln { height:3px; background:#e5e5e5; border-radius:2px; }
.tpl-mini .mock-minimal .ln.h { height:7px; background:#333; width:50%; }
.tpl-mini .mock-creative { height:100%; }
.tpl-mini .mock-creative .b { height:35%; background: linear-gradient(135deg, var(--rb-accent), var(--rb-accent-2)); }
.tpl-mini .mock-creative .c { padding:6px; display:flex; flex-direction:column; gap:3px; }
.tpl-mini .mock-creative .c .ln { height:3px; background:#ddd; border-radius:2px; }
.tpl-mini .mock-creative .c .ln.s { width:60%; }
.tpl-mini .mock-exec { display:grid; grid-template-columns:38% 62%; height:100%; }
.tpl-mini .mock-exec .l { background:#1a1a2e; }
.tpl-mini .mock-exec .r { padding:6px; display:flex; flex-direction:column; gap:3px; }
.tpl-mini .mock-exec .r .ln { height:3px; background:#ddd; border-radius:2px; }
.tpl-mini .mock-exec .r .ln.h { height:6px; background: var(--rb-accent); width:60%; }

/* ---- Image cropper modal ---- */
.crop-modal { position: fixed; inset:0; z-index: 500; background: rgba(0,0,0,.75); backdrop-filter: blur(8px); display:none; align-items:center; justify-content:center; padding: 20px; }
.crop-modal.open { display:flex; animation: rbFade .3s var(--ease); }
.crop-box { background: var(--surface); border-radius: var(--radius-lg); padding: 24px; max-width: 540px; width:100%; box-shadow: var(--shadow-xl); }
.crop-box h3 { font-size: 19px; margin-bottom: 4px; }
.crop-box .hint { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
.crop-stage { position: relative; width: 100%; aspect-ratio: 1; background: #0a0a0a; border-radius: 14px; overflow: hidden; touch-action: none; user-select: none; margin-bottom: 18px; }
.crop-stage img { position: absolute; top:0; left:0; max-width: none; transform-origin: 0 0; pointer-events:none; }
.crop-overlay { position: absolute; inset:0; pointer-events:none; box-shadow: 0 0 0 9999px rgba(0,0,0,.55); }
.crop-frame { position:absolute; border: 1.5px solid rgba(255,255,255,.8); border-radius: 50%; pointer-events:auto; cursor: move; box-sizing: border-box; }
.crop-frame::before, .crop-frame::after { content:""; position:absolute; background: rgba(255,255,255,.6); }
.crop-frame::before { left:50%; top:0; bottom:0; width:1px; transform: translateX(-50%); }
.crop-frame::after { top:50%; left:0; right:0; height:1px; transform: translateY(-50%); }
.crop-controls { display:flex; align-items:center; gap:14px; margin-bottom: 18px; }
.crop-controls input[type=range] { flex:1; accent-color: var(--brand-500); }
.crop-controls button { width: 36px; height:36px; border-radius:9px; background: var(--surface-2); border:1px solid var(--border); display:grid; place-items:center; }
.crop-controls button:hover { color: var(--brand-500); border-color: var(--brand-400); }
.crop-actions { display:flex; gap: 10px; }
.crop-actions .btn { flex:1; }
.crop-rotate { position:absolute; bottom: 14px; left:50%; transform: translateX(-50%); display:flex; gap:8px; z-index:5; }
.crop-rotate button { width: 38px; height:38px; border-radius:10px; background: var(--glass-bg); backdrop-filter: blur(10px); border:1px solid var(--glass-border); display:grid; place-items:center; color:#fff; }
.crop-rotate button:hover { background: var(--brand-500); }

/* rb preview responsive */
.rb-canvas { overflow: auto; padding-bottom: 40px; display:flex; justify-content:center; }
.rb-canvas::-webkit-scrollbar { height: 10px; width:10px; }
.rb-canvas::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }

.rb-empty-actions { display:flex; gap:10px; flex-wrap:wrap; }

/* responsive */
@media (max-width: 1100px) {
  .rb-layout { grid-template-columns: 1fr; }
  .rb-editor { position: static; max-height: none; }
  .rb-preview-wrap { position: static; }
}
@media (max-width: 640px) {
  .rb-paper { width: 100%; }
  .tpl-modern, .tpl-exec { grid-template-columns: 1fr; }
  .tpl-modern .side, .tpl-exec .side { padding: 24px; }
  .rb-section .form-grid { grid-template-columns: 1fr; }
  .color-grid { grid-template-columns: repeat(6, 1fr); }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity:1; transform:none; }
}
