/* =================================================================
   C♭ Scripts — Design System
   Modern dark SaaS aesthetic · blue accent · subtle glow
   ================================================================= */

/* ---------- Design tokens ---------- */
:root {
  --bg:           #0E0E12;
  --bg-2:         #121218;
  --surface:      #14141B;
  --surface-2:    #1C1C25;
  --surface-hover:#22222D;
  --border:       #2A2A36;
  --border-hover: #50587A;
  --accent:       #608AFF;
  --accent-2:     #7CA0FF;
  --accent-dim:   #344278;
  --accent-glow:  rgba(96,138,255,0.35);
  --text:         #ECECF6;
  --muted:        #9696A7;
  --good:         #5BD6A0;
  --bad:          #FF6B7A;
  --warn:         #FFC861;
  --radius:       12px;
  --radius-sm:    8px;
  --radius-lg:    18px;
  --maxw:         1160px;
  --shadow:       0 10px 40px rgba(0,0,0,0.45);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --t: 0.18s ease;
}

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

* { margin: 0; }

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

body {
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

svg { fill: currentColor; }

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t);
}
a:hover { color: var(--accent-2); }

ul,
ol { list-style: none; padding: 0; }

table {
  border-collapse: collapse;
  width: 100%;
}

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

::selection {
  background: var(--accent-dim);
  color: var(--text);
}

/* Scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* =================================================================
   Base typography
   ================================================================= */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

p { color: var(--text); }

small { font-size: 0.85rem; }

strong, b { font-weight: 700; }

code, pre, .mono {
  font-family: var(--mono);
  font-feature-settings: "liga" 0;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

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

.section {
  padding-block: clamp(3.5rem, 8vw, 6rem);
}

.section-sm {
  padding-block: clamp(2rem, 5vw, 3.25rem);
}

.narrow {
  max-width: 720px;
  margin-inline: auto;
}

.center-text {
  text-align: center;
}
.center-text .hero-sub,
.center-text p { margin-inline: auto; }

.grid {
  display: grid;
  gap: 1.25rem;
}
.grid-2 { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Section heading block */
.section-head {
  max-width: 640px;
  margin-bottom: 2.5rem;
}
.section-head.center-text { margin-inline: auto; }
.section-head h2 { margin-bottom: 0.75rem; }
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* =================================================================
   Site header
   ================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18, 18, 24, 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: background var(--t), border-color var(--t), box-shadow var(--t);
}
.site-header.scrolled {
  background: rgba(14, 14, 18, 0.88);
  border-bottom-color: var(--border);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 66px;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  font-size: 1.2rem;
}
.brand:hover { color: var(--text); }
.brand-mark {
  display: inline-flex;
  align-items: baseline;
  font-weight: 800;
}
.brand-flat {
  color: var(--accent);
  margin-left: 1px;
  text-shadow: 0 0 14px var(--accent-glow);
}
.brand-name {
  font-weight: 700;
  color: var(--text);
}

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--t), background var(--t);
}
.nav-link:hover {
  color: var(--text);
  background: var(--surface-2);
}
.nav-link.active {
  color: var(--text);
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
}
.nav-auth[data-loading="true"] {
  opacity: 0.55;
  pointer-events: none;
}

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: border-color var(--t), background var(--t);
}
.nav-toggle:hover { border-color: var(--border-hover); }
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--t), opacity var(--t);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =================================================================
   Buttons
   ================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: transform var(--t), background var(--t), border-color var(--t),
              box-shadow var(--t), color var(--t), opacity var(--t);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 1.1em; height: 1.1em; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 120%);
  color: #fff;
  border-color: var(--accent-2);
  box-shadow: 0 4px 18px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 120%);
  box-shadow: 0 8px 28px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover {
  border-color: var(--border-hover);
  background: var(--surface);
  color: var(--text);
}

.btn-danger {
  background: linear-gradient(135deg, var(--bad) 0%, #c8424f 120%);
  color: #fff;
  border-color: #ff8a96;
  box-shadow: 0 4px 18px rgba(255, 107, 122, 0.3);
}
.btn-danger:hover {
  box-shadow: 0 8px 26px rgba(255, 107, 122, 0.4);
  color: #fff;
}

.btn-lg {
  padding: 0.9rem 1.6rem;
  font-size: 1.05rem;
  border-radius: var(--radius);
}
.btn-sm {
  padding: 0.42rem 0.8rem;
  font-size: 0.85rem;
}
.btn-block {
  display: flex;
  width: 100%;
}

.btn:disabled,
.btn.loading {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  pointer-events: none;
}
.btn.loading {
  position: relative;
  color: transparent !important;
}
.btn.loading::after {
  content: "";
  position: absolute;
  width: 1.05em;
  height: 1.05em;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

/* =================================================================
   Hero
   ================================================================= */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(4rem, 11vw, 8rem);
  text-align: center;
}
.hero-bg {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 720px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 55% at 50% 12%, var(--accent-glow) 0%, rgba(96, 138, 255, 0.12) 38%, transparent 70%),
    radial-gradient(40% 40% at 80% 0%, rgba(124, 160, 255, 0.18) 0%, transparent 60%);
  filter: blur(8px);
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, transparent 60%, var(--bg) 100%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(96,138,255,0.04) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(96,138,255,0.04) 39px 40px);
  mask-image: radial-gradient(60% 60% at 50% 20%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(60% 60% at 50% 20%, #000 0%, transparent 75%);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  margin-bottom: 1.5rem;
  border-radius: 99px;
  border: 1px solid var(--accent-dim);
  background: rgba(96, 138, 255, 0.08);
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 1.25rem;
}
.hero-title .accent,
.hero-title span.accent {
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent);
}

.hero-sub {
  max-width: 640px;
  margin: 0 auto 2rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.hero-meta {
  color: var(--muted);
  font-size: 0.9rem;
}
.hero-meta .accent { color: var(--accent-2); }

/* =================================================================
   Cards
   ================================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t), background var(--t);
}

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

/* Feature card */
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}
.feature:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 1.1rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(96, 138, 255, 0.18), rgba(96, 138, 255, 0.05));
  border: 1px solid var(--accent-dim);
  color: var(--accent-2);
}
.feature-icon svg { width: 24px; height: 24px; }
.feature h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}
.feature p {
  color: var(--muted);
  font-size: 0.95rem;
}

/* =================================================================
   Script cards
   ================================================================= */
.script-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}
.script-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.script-thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 8;
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--accent-2);
  background:
    radial-gradient(120% 120% at 20% 10%, rgba(96, 138, 255, 0.28), transparent 55%),
    linear-gradient(135deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--border);
  text-shadow: 0 0 24px var(--accent-glow);
  letter-spacing: -0.02em;
}

.script-card > .script-body,
.script-card > h3,
.script-card > p {
  padding-inline: 1.3rem;
}
.script-body {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.3rem;
  flex: 1;
}
.script-card h3 { font-size: 1.15rem; }
.script-card p {
  color: var(--muted);
  font-size: 0.93rem;
  flex: 1;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent-2);
  background: rgba(96, 138, 255, 0.1);
  border: 1px solid var(--accent-dim);
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.4rem;
  color: var(--muted);
  font-size: 0.82rem;
}

/* =================================================================
   Pricing
   ================================================================= */
.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}
.price-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
}
.price-card.featured {
  border-color: var(--accent);
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(96, 138, 255, 0.14), transparent 60%),
    var(--surface);
  box-shadow: 0 12px 48px var(--accent-glow);
}
.price-card h3 {
  font-size: 1.05rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-popular {
  position: absolute;
  top: -0.85rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.3rem 0.9rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  box-shadow: 0 4px 16px var(--accent-glow);
  white-space: nowrap;
}

.price-amount {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}
.price-period {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 0.25rem;
}

.price-features {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 0.5rem 0 1rem;
}
.price-features li {
  position: relative;
  padding-left: 1.85rem;
  color: var(--text);
  font-size: 0.95rem;
}
.price-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background:
    var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 0.78rem no-repeat;
  box-shadow: 0 0 10px var(--accent-glow);
}
.price-features li.muted-feature {
  color: var(--muted);
}
.price-features li.muted-feature::before {
  background: var(--surface-2);
  box-shadow: none;
}
.price-card .btn { margin-top: auto; }

/* =================================================================
   Stats band
   ================================================================= */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.25rem;
  padding: 2rem;
  background:
    radial-gradient(80% 140% at 50% 0%, rgba(96, 138, 255, 0.08), transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.stat {
  text-align: center;
}
.stat-num {
  display: block;
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent);
}
.stat-label {
  display: block;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

/* =================================================================
   Badges / pills
   ================================================================= */
.badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.7rem;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
}
.badge-accent {
  color: var(--accent-2);
  background: rgba(96, 138, 255, 0.1);
  border-color: var(--accent-dim);
}
.badge-good {
  color: var(--good);
  background: rgba(91, 214, 160, 0.1);
  border-color: rgba(91, 214, 160, 0.35);
}
.pill {
  color: var(--text);
}

/* =================================================================
   Forms / auth
   ================================================================= */
.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 66px);
  padding: clamp(2rem, 6vw, 4rem) 24px;
  position: relative;
  isolation: isolate;
}
.auth-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(50% 50% at 50% 30%, var(--accent-glow), transparent 70%);
  opacity: 0.5;
  filter: blur(20px);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  box-shadow: var(--shadow);
}
.auth-card h1 {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}
.auth-card > p {
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.input::placeholder { color: var(--muted); opacity: 0.7; }
.input:hover { border-color: var(--border-hover); }
.input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(96, 138, 255, 0.18);
}
.input:disabled { opacity: 0.6; cursor: not-allowed; }

.form-help {
  font-size: 0.8rem;
  color: var(--muted);
}
.form-error {
  font-size: 0.85rem;
  color: var(--bad);
  font-weight: 500;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.checkbox-row input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
  cursor: pointer;
}
.checkbox-row label { font-weight: 500; }

.auth-alt {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}
.auth-alt a { font-weight: 600; }

/* =================================================================
   Alerts
   ================================================================= */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
}
.alert:empty { display: none; }
.alert-error {
  color: var(--bad);
  background: rgba(255, 107, 122, 0.08);
  border-color: rgba(255, 107, 122, 0.4);
}
.alert-success {
  color: var(--good);
  background: rgba(91, 214, 160, 0.08);
  border-color: rgba(91, 214, 160, 0.4);
}
.alert-info {
  color: var(--accent-2);
  background: rgba(96, 138, 255, 0.08);
  border-color: var(--accent-dim);
}

/* =================================================================
   Code / docs
   ================================================================= */
.code-block {
  position: relative;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}
.code-block code {
  font-family: inherit;
  background: none;
  padding: 0;
  color: inherit;
}

.copy-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t), color var(--t), border-color var(--t), background var(--t);
}
.code-block:hover .copy-btn,
.copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--surface-2);
}
.copy-btn.copied {
  color: var(--good);
  border-color: rgba(91, 214, 160, 0.4);
  opacity: 1;
}

/* Inline code */
:not(pre) > code:not(.brand-mark) {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.12em 0.4em;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent-2);
}

.kbd {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

/* Docs layout */
.doc-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.5rem;
  align-items: start;
}
.doc-toc {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.doc-toc h4 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.doc-toc a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--t), background var(--t);
}
.doc-toc a:hover,
.doc-toc a.active {
  color: var(--text);
  background: var(--surface-2);
}

.doc-section {
  margin-bottom: 3rem;
  scroll-margin-top: 90px;
}
.doc-section h2 {
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.doc-section h3 { margin: 1.75rem 0 0.6rem; }
.doc-section p { color: var(--muted); margin-bottom: 1rem; }
.doc-section .code-block { margin: 1rem 0; }
.doc-section ul { margin: 0 0 1rem; }
.doc-section ul li {
  position: relative;
  padding-left: 1.3rem;
  margin-bottom: 0.4rem;
  color: var(--muted);
}
.doc-section ul li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.7em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.callout {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  margin: 1.25rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--accent-dim);
  border-left: 3px solid var(--accent);
  background: rgba(96, 138, 255, 0.06);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.6;
}
.callout strong { color: var(--accent-2); }

/* =================================================================
   Tables / files
   ================================================================= */
.table {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.table th,
.table td {
  text-align: left;
  padding: 0.8rem 1.1rem;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--border);
}
.table th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr {
  transition: background var(--t);
}
.table tbody tr:hover { background: var(--surface-hover); }

.file-row td:last-child { text-align: right; }
.file-name {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 500;
}
.file-name svg { width: 1.05rem; height: 1.05rem; color: var(--accent-2); flex: none; }
.file-name a { color: var(--text); font-weight: 500; }
.file-name a:hover { color: var(--accent-2); }
.file-size {
  color: var(--muted);
  font-size: 0.85rem;
  font-family: var(--mono);
  white-space: nowrap;
}

/* Breadcrumbs */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.crumbs a {
  color: var(--muted);
  font-weight: 500;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  transition: color var(--t), background var(--t);
}
.crumbs a:hover { color: var(--text); background: var(--surface-2); }
.crumbs span.sep {
  color: var(--border-hover);
  user-select: none;
}
.crumbs .current { color: var(--text); font-weight: 600; }

/* =================================================================
   Account menu / avatar
   ================================================================= */
.account-menu {
  position: relative;
}
.account-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.6rem 0.35rem 0.4rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: border-color var(--t), background var(--t);
}
.account-btn:hover { border-color: var(--border-hover); background: var(--surface-hover); }
.account-btn svg {
  width: 1rem;
  height: 1rem;
  color: var(--muted);
  transition: transform var(--t);
}
.account-menu.open .account-btn svg { transform: rotate(180deg); }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  box-shadow: 0 0 14px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  user-select: none;
}
.avatar.avatar-lg { width: 56px; height: 56px; font-size: 1.4rem; }

.account-dropdown {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--t), transform var(--t), visibility var(--t);
  z-index: 120;
}
.account-menu.open .account-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.account-dropdown .dropdown-head {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}
.account-dropdown .dropdown-head .name { display: block; font-weight: 700; color: var(--text); }
.account-dropdown .dropdown-head .sub { display: block; font-size: 0.78rem; color: var(--muted); }
.account-dropdown a,
.account-dropdown button {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  background: none;
  border: none;
  transition: color var(--t), background var(--t);
}
.account-dropdown a:hover,
.account-dropdown button:hover {
  background: var(--surface-2);
  color: var(--text);
}
.account-dropdown .danger { color: var(--bad); }
.account-dropdown .danger:hover { background: rgba(255, 107, 122, 0.1); color: var(--bad); }
.account-dropdown svg { width: 1rem; height: 1rem; color: var(--muted); }

/* =================================================================
   Dashboard helpers
   ================================================================= */
.dash-welcome {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}
.dash-welcome h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
.dash-welcome p { color: var(--muted); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}
.panel-head h2 { font-size: 1.15rem; }

.info-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.info-list .info-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.info-list .info-item:last-child { border-bottom: none; padding-bottom: 0; }
.info-list .info-item .k { color: var(--muted); }
.info-list .info-item .v { color: var(--text); font-weight: 600; }

.upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.upload-row input[type="file"] {
  flex: 1;
  min-width: 200px;
  font-size: 0.88rem;
  color: var(--muted);
}
.upload-row input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color var(--t), background var(--t);
}
.upload-row input[type="file"]::file-selector-button:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}
#upload-status { font-size: 0.85rem; color: var(--muted); }

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}
.empty-state svg { width: 40px; height: 40px; margin: 0 auto 0.75rem; color: var(--border-hover); }

/* =================================================================
   Page header (interior pages)
   ================================================================= */
.page-header {
  position: relative;
  isolation: isolate;
  padding-block: clamp(3rem, 7vw, 5rem) clamp(1.5rem, 3vw, 2.5rem);
  text-align: center;
  overflow: hidden;
}
.page-header::before {
  content: "";
  position: absolute;
  inset: -40% 0 auto 0;
  height: 420px;
  z-index: -1;
  background: radial-gradient(50% 60% at 50% 0%, var(--accent-glow), transparent 65%);
  opacity: 0.45;
  filter: blur(10px);
}
.page-header h1 { margin-bottom: 0.75rem; }
.page-header p {
  max-width: 600px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.1rem;
}

/* CTA band */
.cta-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  text-align: center;
  padding: clamp(2.5rem, 6vw, 4rem);
  border-radius: var(--radius-lg);
  border: 1px solid var(--accent-dim);
  background:
    radial-gradient(80% 140% at 50% 0%, rgba(96, 138, 255, 0.18), transparent 60%),
    var(--surface);
  box-shadow: 0 12px 48px var(--accent-glow);
}
.cta-band h2 { margin-bottom: 0.75rem; }
.cta-band p { color: var(--muted); max-width: 520px; margin: 0 auto 1.75rem; font-size: 1.05rem; }

/* How it works steps */
.steps {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  counter-reset: step;
}
.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem 1.5rem;
}
.step::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 0.9rem;
  border-radius: 50%;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  box-shadow: 0 0 18px var(--accent-glow);
}
.step h3 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.step p { color: var(--muted); font-size: 0.95rem; }

/* FAQ */
.faq-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.faq-item:last-child { border-bottom: none; }
.faq-item h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.faq-item p { color: var(--muted); font-size: 0.95rem; }

/* About values */
.value-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: transform var(--t), border-color var(--t);
}
.value-card:hover { transform: translateY(-3px); border-color: var(--border-hover); }
.value-card h3 { margin-bottom: 0.5rem; }
.value-card p { color: var(--muted); font-size: 0.95rem; }

.lead {
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.6;
  color: var(--text);
}

/* 404 */
.notfound {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - 66px - 240px);
  padding: clamp(3rem, 8vw, 6rem) 24px;
}
.notfound .glyph {
  font-size: clamp(5rem, 16vw, 9rem);
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 40px var(--accent-glow);
  margin-bottom: 1rem;
}
.notfound h1 { margin-bottom: 0.75rem; }
.notfound p { color: var(--muted); max-width: 460px; margin: 0 auto 1.75rem; font-size: 1.05rem; }

/* =================================================================
   Footer
   ================================================================= */
.site-footer {
  margin-top: auto;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 2fr;
  gap: 2.5rem;
  padding-block: 3rem;
}
.footer-brand .brand { font-size: 1.25rem; }
.footer-tagline {
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 260px;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.footer-col h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.footer-col a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  width: fit-content;
}
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-block: 1.25rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* =================================================================
   Utilities
   ================================================================= */
.muted { color: var(--muted) !important; }
.accent { color: var(--accent) !important; }
.mono { font-family: var(--mono) !important; }
.hidden { display: none !important; }

.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-3 { margin-top: 1.5rem !important; }
.mt-4 { margin-top: 2rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }
.mb-4 { margin-bottom: 2rem !important; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.wrap { flex-wrap: wrap; }

/* Spinner */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
.spinner-lg { width: 2.25rem; height: 2.25rem; border-width: 3px; }

.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* body must be column flex for sticky footer */
body {
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

/* =================================================================
   Responsive
   ================================================================= */
@media (max-width: 980px) {
  .doc-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .doc-toc {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .doc-toc h4 { width: 100%; }
}

@media (max-width: 820px) {
  /* Hamburger appears */
  .nav-toggle { display: flex; }

  .site-nav {
    position: fixed;
    top: 66px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 1rem 24px 1.5rem;
    background: rgba(14, 14, 18, 0.97);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--t), transform var(--t), visibility var(--t);
    max-height: calc(100vh - 66px);
    overflow-y: auto;
  }
  .site-nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .nav-link {
    padding: 0.75rem 0.85rem;
    font-size: 1rem;
  }
  .nav-auth {
    margin-left: 0;
    margin-top: 0.5rem;
    padding-left: 0;
    padding-top: 0.85rem;
    border-left: none;
    border-top: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
  }
  .nav-auth .btn { width: 100%; }

  .account-menu { width: 100%; }
  .account-btn { width: 100%; justify-content: flex-start; }
  .account-dropdown {
    position: static;
    width: 100%;
    margin-top: 0.5rem;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
  }
}

@media (max-width: 760px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  .container { padding-inline: 18px; }

  /* grids collapse to single column on mobile */
  .grid-2,
  .grid-3,
  .grid-4,
  .grid,
  .steps,
  .stats {
    grid-template-columns: 1fr;
  }

  .footer-cols { grid-template-columns: 1fr 1fr; }

  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }

  .table th,
  .table td { padding: 0.65rem 0.7rem; font-size: 0.85rem; }
}

@media (max-width: 420px) {
  .footer-cols { grid-template-columns: 1fr; }
}

/* =================================================================
   Reduced motion
   ================================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover,
  .card-hover:hover,
  .feature:hover,
  .script-card:hover,
  .price-card:hover,
  .value-card:hover { transform: none; }
}

/* =================================================================
   Dashboard file browser — top-ups for elements built in dashboard.js
   (breadcrumb buttons, directory buttons, nav account name).
   These mirror the look of their <a>/sibling counterparts above.
   ================================================================= */
/* Clickable breadcrumb segments are <button>s (in-page actions, not links). */
.crumbs button.crumb {
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  color: var(--muted);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: color var(--t), background var(--t);
}
.crumbs button.crumb:hover { color: var(--text); background: var(--surface-2); }
.crumbs .crumb-sep {
  color: var(--muted);
  opacity: 0.6;
  user-select: none;
}
.crumbs .crumb-current { color: var(--text); font-weight: 600; padding: 0.2rem 0.5rem; }

/* Directory rows use a <button> styled to read like the file links. */
.file-name .dir-link {
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 600;
  padding: 0;
  text-align: left;
  transition: color var(--t);
}
.file-name .dir-link:hover { color: var(--accent-2); }

/* Action cell (delete button) — keep buttons from stretching the row. */
.file-actions { display: flex; justify-content: flex-end; gap: 0.4rem; }

/* Username label in the logged-in nav account button. */
.account-name {
  font-weight: 600;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Small layout utilities (used by the product / par2 pages — keeps markup
   CSP-clean with no inline style attributes). */
.stack-narrow { max-width: 560px; }
.actions-center { justify-content: center; }
.mt-md { margin-top: 1.5rem; }
.mt-lg { margin-top: 2rem; }
