/* =========================================================
   Kleverr Studio — Design System
   Dark, modern, minimalist devstudio theme
   ========================================================= */

:root {
  /* Surfaces */
  --bg: #0a0a0f;
  --bg-soft: #0d0d14;
  --surface: #13131b;
  --surface-2: #191922;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Text */
  --text: #f5f5f7;
  --text-muted: #a1a1aa;
  --text-faint: #6b6b76;

  /* Accent gradient */
  --accent-1: #6366f1; /* indigo */
  --accent-2: #22d3ee; /* cyan */
  --accent-grad: linear-gradient(120deg, var(--accent-1), var(--accent-2));
  --accent-solid: #818cf8;

  /* Feedback */
  --success: #34d399;

  /* Type */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Spacing / radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --max-width: 1160px;

  --shadow-glow: 0 0 0 1px var(--border), 0 20px 60px -20px rgba(99, 102, 241, 0.35);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient background glow */
body::before {
  content: "";
  position: fixed;
  inset: -20% -20% auto -20%;
  height: 700px;
  background: radial-gradient(closest-side, rgba(99, 102, 241, 0.16), transparent 70%);
  z-index: -1;
  pointer-events: none;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; color: var(--text-muted); }

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--accent-solid);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-grad);
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent-grad);
  color: #0a0a0f;
  box-shadow: 0 12px 30px -10px rgba(99, 102, 241, 0.55);
}
.btn-primary:hover { box-shadow: 0 16px 36px -8px rgba(34, 211, 238, 0.55); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--accent-solid); background: rgba(99, 102, 241, 0.08); }

.btn-block { width: 100%; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
.brand svg { width: 30px; height: 30px; }
.brand-icon { width: 46px; height: 46px; display: block; flex-shrink: 0; }
.brand-name { display: flex; flex-direction: column; line-height: 1; }
.brand-name .sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-faint);
  letter-spacing: 0.14em;
  margin-top: 3px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links a {
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active { color: var(--text); background: var(--surface-2); }

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

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  width: 42px;
  height: 42px;
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

@media (max-width: 860px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    padding: 10px 24px 18px;
    gap: 2px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
  .nav-toggle { display: inline-flex; }
  .nav-actions .btn-ghost { display: none; }
}

/* ---------- Sections ---------- */
section { padding: 96px 0; }
section.tight { padding: 64px 0; }
.section-head {
  max-width: 640px;
  margin: 0 0 48px;
}
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.divider {
  height: 1px;
  background: var(--border);
  border: none;
  margin: 0;
}

/* ---------- Hero ---------- */
.hero {
  padding: 120px 0 100px;
  text-align: center;
}
.hero p.lead {
  max-width: 620px;
  margin: 0 auto 36px;
  font-size: 1.1rem;
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 56px;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 560px;
  margin: 0 auto;
}
.hero-stats div { text-align: center; }
.hero-stats strong {
  display: block;
  font-size: 1.7rem;
  font-family: var(--font-mono);
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-stats span { font-size: 0.85rem; color: var(--text-faint); }

/* ---------- Cards ---------- */
.grid {
  display: grid;
  gap: 24px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 30px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-glow);
}

.icon-badge {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.14);
  color: var(--accent-solid);
  margin-bottom: 18px;
  font-size: 1.3rem;
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  margin: 0 6px 6px 0;
}

/* ---------- Portfolio ---------- */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.project-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.project-thumb {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(34,211,238,0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  color: var(--text-faint);
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
}
.project-body { padding: 24px; }
.project-body h3 { margin-bottom: 8px; }

/* ---------- Process steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  counter-reset: step;
}
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.step {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  background: var(--surface);
}
.step .num {
  font-family: var(--font-mono);
  color: var(--accent-solid);
  font-size: 0.85rem;
  margin-bottom: 10px;
  display: block;
}

/* ---------- CTA band ---------- */
.cta-band {
  border-radius: var(--radius-lg);
  padding: 64px 40px;
  text-align: center;
  background: linear-gradient(135deg, rgba(99,102,241,0.16), rgba(34,211,238,0.08));
  border: 1px solid var(--border-strong);
}
.cta-band h2 { margin-bottom: 12px; }
.cta-band p { max-width: 480px; margin-left: auto; margin-right: auto; }

/* ---------- Forms ---------- */
.form-field { margin-bottom: 20px; text-align: left; }
.form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--accent-solid);
}
.form-field textarea { resize: vertical; min-height: 130px; }
.form-note { font-size: 0.82rem; color: var(--text-faint); margin-top: 14px; }
.form-success {
  display: none;
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: var(--success);
  font-size: 0.9rem;
}
.form-success.show { display: block; }
.form-error {
  display: none;
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  font-size: 0.9rem;
}
.form-error.show { display: block; }

/* ---------- Contact info list ---------- */
.contact-list { display: flex; flex-direction: column; gap: 18px; }
.contact-list .item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.contact-list .item .icon-badge { margin-bottom: 0; flex-shrink: 0; }
.contact-list .item strong { display: block; margin-bottom: 2px; }
.contact-list .item span { color: var(--text-muted); font-size: 0.92rem; }

/* ---------- Blog ---------- */
.post-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
  background: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.post-card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.post-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.post-body {
  max-width: 720px;
  margin: 0 auto;
}
.post-body h2 { margin-top: 1.6em; }
.post-body h3 { margin-top: 1.4em; }
.post-body p, .post-body li { color: var(--text-muted); }
.post-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.post-body code { font-family: var(--font-mono); color: var(--accent-solid); }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.back-link:hover { color: var(--text); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 32px;
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
.footer-grid h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.footer-grid ul li { margin-bottom: 10px; }
.footer-grid ul a { color: var(--text-muted); font-size: 0.92rem; }
.footer-grid ul a:hover { color: var(--text); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-faint);
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.badge-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.badge-dot .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}
