:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-alt: #f0f2f7;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e4e7ee;
  --primary: #0a0a0a;
  --primary-contrast: #ffffff;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 1px rgba(15,23,42,.03);
  --shadow: 0 8px 24px rgba(15, 23, 42, .06), 0 2px 6px rgba(15, 23, 42, .04);
  --max: 1160px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 720px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; color: var(--text); margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 2.5vw, 2.25rem); letter-spacing: -0.015em; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--text); }
.lead { font-size: 1.15rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; color: var(--text); display: flex; align-items: center; gap: .6rem; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, #0f172a, #334155);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: .75rem;
}
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a { padding: 8px 14px; color: var(--text); font-weight: 500; border-radius: 8px; font-size: .95rem; }
.nav-links a:hover { background: var(--surface-alt); color: var(--text); }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.4rem; cursor: pointer; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: 11px 20px; border-radius: 10px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: all .15s ease;
  text-decoration: none; line-height: 1;
}
.btn-primary { background: var(--primary); color: var(--primary-contrast); }
.btn-primary:hover { background: #1f2937; color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--text); color: var(--text); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .85rem; }

/* ---------- HERO ---------- */
.hero {
  padding: 96px 0 72px;
  background:
    radial-gradient(1000px 400px at 90% -10%, rgba(37,99,235,.12), transparent 70%),
    radial-gradient(900px 500px at -10% 20%, rgba(16,185,129,.08), transparent 70%),
    var(--bg);
}
.hero h1 { margin-bottom: .4em; }
.hero-sub { font-size: 1.2rem; color: var(--muted); max-width: 620px; margin: 0 0 2rem; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.kicker {
  display: inline-block; padding: 5px 12px; font-size: .78rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--muted); margin-bottom: 1.25rem;
}

/* ---------- SECTIONS ---------- */
.section { padding: 72px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.section-head .lead { margin-top: .6rem; }

/* ---------- GRIDS / CARDS ---------- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-links.open { display: flex; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; background: #fff; border-bottom: 1px solid var(--border); padding: 12px; }
  .nav-toggle { display: inline-flex; }
  .hero { padding: 64px 0 48px; }
  .section { padding: 56px 0; }
}

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d6dae3; }
.card h3 { margin-top: 12px; }
.card-icon {
  width: 44px; height: 44px; border-radius: 10px; background: var(--surface-alt);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem;
}

/* ---------- BLOG ---------- */
.post-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.post-card .cover { aspect-ratio: 16/9; background: var(--surface-alt); overflow: hidden; }
.post-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.post-card .body { padding: 24px; }
.post-card h3 { margin: 6px 0 8px; }
.post-card .meta { color: var(--muted); font-size: .85rem; }

.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose p, .prose ul, .prose ol { font-size: 1.05rem; }
.prose img { border-radius: var(--radius-sm); margin: 1.5em 0; }

/* ---------- FORMS ---------- */
.form { display: grid; gap: 14px; max-width: 560px; }
.input, input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], input[type=datetime-local], input[type=tel], select, textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-family: inherit; font-size: .95rem;
  background: #fff; color: var(--text); transition: border-color .12s, box-shadow .12s;
}
.input:focus, input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
textarea { min-height: 110px; resize: vertical; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field .help, .helptext, .form small { display: block; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.errorlist { list-style: none; padding: 0; margin: 6px 0 0; color: var(--danger); font-size: .85rem; }

/* ---------- MESSAGES ---------- */
.messages { margin: 18px 0; display: grid; gap: 8px; }
.msg { padding: 10px 14px; border-radius: var(--radius-sm); font-size: .92rem; border: 1px solid; }
.msg.success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.msg.error, .msg.warning { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.msg.info, .msg.debug { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* ---------- FOOTER ---------- */
.footer { background: #0a0a0a; color: #d4d4d8; margin-top: 80px; padding: 56px 0 28px; }
.footer a { color: #d4d4d8; }
.footer a:hover { color: #fff; }
.footer h4 { color: #fff; font-size: .95rem; margin-bottom: 14px; }
.footer .grid { gap: 40px; }
.footer .bottom { border-top: 1px solid #262626; margin-top: 40px; padding-top: 20px; font-size: .85rem; color: #a1a1aa; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* ---------- PORTAL / CMS LAYOUT ---------- */
.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  background: #0a0a0a; color: #e5e7eb; padding: 24px 16px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { color: #fff; margin-bottom: 28px; padding: 0 8px; }
.sidebar .brand-mark { background: linear-gradient(135deg, #fff, #cbd5e1); color: #0a0a0a; }
.sidebar-section { color: #6b7280; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 14px 10px 6px; }
.sidebar a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: #d4d4d8; font-size: .92rem; font-weight: 500;
}
.sidebar a:hover { background: #171717; color: #fff; }
.sidebar a.active { background: #262626; color: #fff; }
.sidebar .logout { margin-top: auto; }

.app-main { padding: 28px 40px 80px; min-width: 0; }
.app-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; flex-wrap: wrap; gap: 12px; }
.app-header h1 { font-size: 1.75rem; margin: 0; }
.app-header .sub { color: var(--muted); margin-top: 2px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .sidebar-section { display: none; }
  .app-main { padding: 20px; }
}

/* ---------- STATS ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat .label { color: var(--muted); font-size: .82rem; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 1.75rem; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }

/* ---------- TABLE ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.panel-head h2 { font-size: 1.05rem; margin: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 14px 22px; font-size: .92rem; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-alt); }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fafbfc; }
.empty { padding: 40px 22px; text-align: center; color: var(--muted); }

.actions { display: flex; gap: 8px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-muted { background: var(--surface-alt); color: var(--muted); }

/* reveal toggle for credentials */
.reveal { cursor: pointer; user-select: none; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.reveal[data-hidden="true"] { letter-spacing: .15em; }

/* ============================================================
   LANDING v2 — refined minimal design (inspired by Linear/Vercel/Stripe)
   ============================================================ */

:root {
  --ink: #0a0a0a;
  --ink-2: #1a1a1a;
  --line: #eaecef;
  --line-2: #f1f2f4;
  --soft: #fafafa;
}

/* Announcement bar */
.annc {
  background: #0a0a0a; color: #fff; text-align: center;
  padding: 10px 16px; font-size: .85rem; letter-spacing: .01em;
}
.annc a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.annc .pill {
  display: inline-block; padding: 2px 8px; margin-right: 8px;
  background: #fff; color: #0a0a0a; border-radius: 999px; font-weight: 700; font-size: .7rem;
}

/* Navigation refinement */
.nav.nav-v2 { background: rgba(255,255,255,.72); backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid rgba(10,10,10,.06); }
.nav-v2 .nav-links a { font-size: .9rem; color: #444; }
.nav-v2 .nav-links a:hover { color: #0a0a0a; background: transparent; }

/* Hero v2 — oversized type with subtle grid */
.hero-v2 {
  position: relative; overflow: hidden;
  padding: 120px 0 96px;
  background: #fff;
}
.hero-v2::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(10,10,10,.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(10,10,10,.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 40%, #000 40%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 40%, #000 40%, transparent 75%);
  pointer-events: none;
}
.hero-v2 .container { position: relative; text-align: center; }
.hero-v2 .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; background: #fff;
  border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.04);
  font-size: .82rem; font-weight: 500; color: #444; margin-bottom: 28px;
}
.hero-v2 .eyebrow .dot { width: 6px; height: 6px; border-radius: 999px; background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
.hero-v2 h1 {
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  letter-spacing: -0.035em; font-weight: 700; line-height: 1.02;
  max-width: 18ch; margin: 0 auto .35em;
  background: linear-gradient(180deg, #0a0a0a 0%, #343434 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-v2 .sub {
  font-size: clamp(1.05rem, 1.35vw, 1.25rem); color: #525252;
  max-width: 620px; margin: 0 auto 36px; line-height: 1.55;
}
.hero-v2 .ctas { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.hero-v2 .ctas .btn { padding: 13px 22px; border-radius: 10px; }
.hero-v2 .ctas .btn-primary { background: #0a0a0a; }
.hero-v2 .ctas .btn-ghost {
  background: transparent; color: #0a0a0a; border: 1px solid var(--line);
}
.hero-v2 .ctas .btn-ghost:hover { border-color: #0a0a0a; background: #fff; }

/* Trust bar */
.trust {
  padding: 36px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: #fff;
}
.trust .label { text-align: center; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: #888; margin-bottom: 22px; }
.trust .logos { display: flex; align-items: center; justify-content: center; gap: 48px; flex-wrap: wrap; }
.trust .logo { font-weight: 700; letter-spacing: -.02em; color: #a3a3a3; font-size: 1.1rem; }

/* Section container */
.sec { padding: 104px 0; background: #fff; }
.sec.alt { background: var(--soft); }
.sec .sec-head { max-width: 680px; margin: 0 auto 56px; text-align: center; }
.sec .sec-head .tag {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: #f1f2f4; color: #0a0a0a; font-size: .75rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; margin-bottom: 16px;
}
.sec h2.title {
  font-size: clamp(1.9rem, 3.2vw, 2.8rem);
  letter-spacing: -0.025em; font-weight: 700; line-height: 1.1; margin: 0 0 .4em;
  color: #0a0a0a;
}
.sec .sub { font-size: 1.1rem; color: #525252; }

/* Feature grid v2 */
.features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
}
.feature {
  background: #fff; padding: 32px; display: flex; flex-direction: column; gap: 14px;
  transition: background .2s ease;
}
.feature:hover { background: #fafafa; }
.feature .icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: #0a0a0a; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.feature .icon svg { width: 20px; height: 20px; }
.feature h3 { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; margin: 0; color: #0a0a0a; }
.feature p { margin: 0; color: #525252; font-size: .95rem; line-height: 1.55; }
@media (max-width: 900px) { .features { grid-template-columns: 1fr; } }

/* Product preview mockup */
.preview-wrap {
  margin-top: 56px; padding: 24px; border-radius: 20px;
  background: linear-gradient(180deg, #f7f7f7, #ebebeb);
  border: 1px solid var(--line);
}
.preview {
  border-radius: 12px; overflow: hidden;
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 30px 60px -20px rgba(10,10,10,.18), 0 10px 20px -10px rgba(10,10,10,.1);
}
.preview .chrome {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); background: #fafafa;
}
.preview .chrome .dot { width: 11px; height: 11px; border-radius: 999px; background: #e5e5e5; }
.preview .chrome .bar {
  flex: 1; height: 22px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  text-align: center; font-size: .75rem; color: #888; line-height: 22px;
}
.preview .app-ui { display: grid; grid-template-columns: 220px 1fr; min-height: 420px; }
.preview .app-ui aside { background: #0a0a0a; color: #fafafa; padding: 20px; }
.preview .app-ui aside .brand-m { font-weight: 700; margin-bottom: 24px; }
.preview .app-ui aside .nav-item {
  padding: 8px 10px; border-radius: 6px; font-size: .86rem; color: #d4d4d4; margin-bottom: 2px;
}
.preview .app-ui aside .nav-item.active { background: #1f1f1f; color: #fff; }
.preview .app-ui .pane { padding: 28px; }
.preview .stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.preview .stat { padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.preview .stat .k { font-size: .72rem; text-transform: uppercase; color: #888; letter-spacing: .08em; }
.preview .stat .v { font-size: 1.4rem; font-weight: 700; color: #0a0a0a; margin-top: 4px; }
.preview .row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line-2); font-size: .9rem; }
.preview .row:last-child { border: 0; }
.preview .bdg { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .7rem; font-weight: 600; }
.preview .bdg.ok { background: #ecfdf5; color: #047857; }
.preview .bdg.warn { background: #fef3c7; color: #92400e; }
@media (max-width: 780px) { .preview .app-ui { grid-template-columns: 1fr; } .preview .app-ui aside { display: none; } }

/* Two-column "how" */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.how .step { padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.how .step .n {
  width: 32px; height: 32px; border-radius: 8px; background: #0a0a0a; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 14px;
}
.how .step h3 { margin: 0 0 8px; font-size: 1.1rem; }
.how .step p { margin: 0; color: #525252; font-size: .95rem; }
@media (max-width: 820px) { .how { grid-template-columns: 1fr; } }

/* Testimonial */
.quote {
  max-width: 760px; margin: 0 auto; text-align: center;
  padding: 48px; border: 1px solid var(--line); border-radius: 18px; background: #fff;
}
.quote p { font-size: 1.35rem; line-height: 1.5; letter-spacing: -0.01em; color: #0a0a0a; margin: 0 0 20px; }
.quote .who { color: #525252; font-size: .95rem; }

/* CTA v2 */
.cta-v2 {
  margin: 0 24px 80px;
  max-width: 1160px; margin-left: auto; margin-right: auto;
  padding: 72px 32px; border-radius: 20px;
  background: #0a0a0a; color: #fff; text-align: center;
  position: relative; overflow: hidden;
}
.cta-v2::before {
  content: ""; position: absolute; inset: 0; opacity: .35;
  background: radial-gradient(600px 260px at 20% 0%, rgba(37,99,235,.5), transparent 60%),
              radial-gradient(600px 260px at 80% 100%, rgba(16,185,129,.35), transparent 60%);
}
.cta-v2 h2 { position: relative; color: #fff; font-size: clamp(1.75rem, 3vw, 2.5rem); margin: 0 0 .4em; letter-spacing: -0.02em; }
.cta-v2 p { position: relative; color: #cfcfcf; max-width: 560px; margin: 0 auto 28px; }
.cta-v2 .btn { position: relative; background: #fff; color: #0a0a0a; padding: 13px 24px; }
.cta-v2 .btn:hover { background: #e5e5e5; color: #0a0a0a; }

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--line); padding: 20px 4px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.02rem; list-style: none; position: relative; padding-right: 30px; color: #0a0a0a; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: -2px; font-size: 1.4rem; color: #888; transition: transform .2s ease;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 12px 0 0; color: #525252; font-size: .98rem; line-height: 1.6; }
