/* Knarf Consults — design tokens */
:root {
  --bg: #0F1419;
  --surface: #1A1F26;
  --surface-2: #232932;
  --border: #2A2F36;
  --text: #E6EDF3;
  --muted: #8B949E;
  --accent: #14F1D9;
  --accent-2: #0CC9B6;
  --accent-glow: rgba(20, 241, 217, 0.18);
  --danger: #F87171;
  --success: #34D399;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.45);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.55);
  --maxw: 1180px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.22,.61,.36,1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--accent); color: #000; padding: 8px 14px; border-radius: 6px; font-weight: 700; z-index: 999; }
.skip-link:focus { left: 8px; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* Header / Nav */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 20, 25, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-text { font-size: 18px; letter-spacing: -0.01em; }
.brand-text strong { color: var(--accent); font-weight: 800; }
.primary-nav { display: flex; align-items: center; gap: 8px; }
.primary-nav a { color: var(--muted); padding: 8px 14px; border-radius: 8px; font-weight: 500; font-size: 15px; transition: color .15s var(--ease), background .15s var(--ease); }
.primary-nav a:hover { color: var(--text); background: var(--surface); }
.primary-nav a.is-active { color: var(--text); }
.primary-nav a.is-active::after { content: ''; display: block; height: 2px; background: var(--accent); border-radius: 2px; margin-top: 4px; }
.nav-cta { background: var(--accent); color: #001210 !important; font-weight: 600; }
.nav-cta:hover { background: var(--accent-2); }
.nav-cta.is-active::after { display: none; }
.nav-toggle { display: none; background: none; border: 0; width: 40px; height: 40px; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 100%; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; transition: transform .2s var(--ease), opacity .2s var(--ease); }
.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: 8px; padding: 12px 22px; border-radius: 10px; font-weight: 600; font-size: 15px; border: 1px solid transparent; cursor: pointer; transition: transform .12s var(--ease), background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease); text-decoration: none; }
.btn-primary { background: var(--accent); color: #001210; }
.btn-primary:hover { background: var(--accent-2); color: #001210; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface); color: var(--text); border-color: var(--accent); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* Typography helpers */
h1,h2,h3,h4 { color: var(--text); letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
p { margin: 0 0 1em; color: var(--text); }
.muted { color: var(--muted); }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .14em; padding: 4px 10px; background: var(--accent-glow); border-radius: 999px; margin-bottom: 16px; }

/* Sections */
section { padding: 80px 0; }
@media (max-width: 720px) { section { padding: 56px 0; } }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 100px 0 80px;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, var(--accent-glow), transparent 60%),
    linear-gradient(180deg, #0B0F13 0%, var(--bg) 100%);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 60px; align-items: center; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 560px; }
.hero-cta { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 32px; margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.hero-stat strong { display: block; font-size: 1.6rem; color: var(--accent); font-weight: 800; }
.hero-stat span { color: var(--muted); font-size: 14px; }
.hero-visual {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.hero-visual::before { content: ''; position: absolute; inset: -1px; border-radius: 18px; padding: 1px; background: linear-gradient(135deg, var(--accent), transparent 60%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.code-stack { font-family: var(--font-mono); font-size: 13.5px; color: var(--muted); }
.code-stack .row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.code-stack .row:last-child { border: 0; }
.code-stack .row .ok { color: var(--success); }
.code-stack .row .tag { color: var(--accent); }
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } .hero-stats { gap: 18px; } }

/* Services */
.section-head { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.svc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
  position: relative;
}
.svc-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow-md); }
.svc-icon { width: 44px; height: 44px; display: grid; place-items: center; background: var(--accent-glow); color: var(--accent); border-radius: 10px; margin-bottom: 16px; }
.svc-card h3 { margin-bottom: 8px; }
.svc-card p { color: var(--muted); margin: 0; font-size: 14.5px; }
.svc-card ul { margin: 14px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.svc-card ul li { padding: 4px 0 4px 22px; position: relative; }
.svc-card ul li::before { content: ''; position: absolute; left: 0; top: 12px; width: 12px; height: 2px; background: var(--accent); border-radius: 2px; }

/* Why-us */
.why {
  background: linear-gradient(180deg, var(--bg) 0%, #0B0F13 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.why-card { padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.why-card .num { font-family: var(--font-mono); color: var(--accent); font-size: 13px; }
.why-card h3 { margin-top: 8px; font-size: 1.05rem; }

/* CTA banner */
.cta-banner {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-banner::before { content: ''; position: absolute; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, var(--accent-glow), transparent 60%); top: -180px; right: -120px; }
.cta-banner h2 { position: relative; }
.cta-banner p { position: relative; color: var(--muted); }
.cta-banner .btn { position: relative; }

/* Blog */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform .2s var(--ease), border-color .2s var(--ease); display: flex; flex-direction: column; }
.post-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.post-cover { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--surface-2), var(--surface)); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.post-meta { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.post-card h3 { margin: 8px 0 10px; font-size: 1.1rem; }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--accent); }
.post-card p { color: var(--muted); font-size: 14.5px; flex: 1; }
.post-card .read-more { color: var(--accent); font-weight: 600; font-size: 14px; margin-top: 8px; }

/* Single post */
.post-hero { padding: 80px 0 40px; text-align: center; }
.post-hero .meta { color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 18px; }
.post-hero h1 { max-width: 820px; margin: 0 auto 24px; }
.post-cover-large { max-width: 900px; margin: 0 auto 40px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.post-content { max-width: 720px; margin: 0 auto; padding: 0 24px 80px; font-size: 1.05rem; line-height: 1.75; }
.post-content h2 { margin-top: 2em; }
.post-content h3 { margin-top: 1.8em; }
.post-content img { border-radius: var(--radius-sm); margin: 24px 0; }
.post-content pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; overflow-x: auto; font-family: var(--font-mono); font-size: 14px; }
.post-content code { background: var(--surface); padding: 2px 6px; border-radius: 4px; font-family: var(--font-mono); font-size: 14px; }
.post-content blockquote { border-left: 3px solid var(--accent); padding: 4px 18px; margin: 24px 0; color: var(--muted); font-style: italic; }

/* Forms */
.form { display: grid; gap: 18px; max-width: 640px; }
.form-row { display: grid; gap: 8px; }
.form-row label { font-size: 14px; color: var(--text); font-weight: 500; }
.form-row input, .form-row textarea, .form-row select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font: inherit;
  width: 100%;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { outline: none; border-color: var(--accent); background: var(--surface-2); }
.form-row textarea { resize: vertical; min-height: 140px; }
.form-row .hint { color: var(--muted); font-size: 13px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; gap: 18px; }
.form-row.cols-2 > div { display: grid; gap: 8px; }
@media (max-width: 600px) { .form-row.cols-2 { grid-template-columns: 1fr; } }
.form-status { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; }
.form-status.success { background: rgba(52, 211, 153, .12); color: var(--success); border: 1px solid rgba(52,211,153,.3); }
.form-status.error { background: rgba(248, 113, 113, .12); color: var(--danger); border: 1px solid rgba(248,113,113,.3); }

/* Contact split */
.contact-split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: start; }
.contact-info { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.contact-info h3 { margin-bottom: 18px; }
.contact-info p { color: var(--muted); margin-bottom: 18px; }
.contact-info ul { list-style: none; padding: 0; margin: 0; }
.contact-info li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); align-items: center; }
.contact-info li:last-child { border: 0; }
.contact-info li strong { display: block; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.contact-info li a { color: var(--text); font-weight: 500; }
.contact-info li a:hover { color: var(--accent); }
@media (max-width: 880px) { .contact-split { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { background: #0B0F13; border-top: 1px solid var(--border); padding: 60px 0 24px; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid var(--border); }
.footer-grid h4 { color: var(--text); font-size: 14px; letter-spacing: .08em; margin-bottom: 14px; }
.footer-tag { color: var(--muted); margin-top: 14px; font-size: 14px; }
.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list li { padding: 4px 0; }
.footer-list a { color: var(--muted); font-size: 14px; }
.footer-list a:hover { color: var(--accent); }
.newsletter-form { display: flex; gap: 8px; margin-top: 8px; }
.newsletter-form input { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text); font: inherit; }
.newsletter-form input:focus { outline: none; border-color: var(--accent); }
.newsletter-form button { padding: 10px 16px; }
.newsletter-msg { font-size: 13px; margin-top: 6px; min-height: 16px; }
.newsletter-msg.success { color: var(--success); }
.newsletter-msg.error { color: var(--danger); }
.footer-base { display: flex; justify-content: space-between; padding-top: 24px; color: var(--muted); font-size: 13px; flex-wrap: wrap; gap: 8px; }
.footer-base a { color: var(--muted); }
.footer-base a:hover { color: var(--accent); }
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* Mobile nav */
@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .primary-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    max-height: 0; overflow: hidden;
    transition: max-height .25s var(--ease), padding .25s var(--ease);
  }
  .primary-nav.is-open { max-height: 80vh; padding: 16px 24px; }
  .primary-nav a { padding: 12px 14px; border-radius: 8px; }
  .nav-cta { text-align: center; margin-top: 8px; }
}

/* Admin */
.admin-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; background: var(--bg); }
.admin-topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; }
.admin-topbar .brand-text { font-size: 16px; }
.admin-topbar nav { display: flex; gap: 6px; }
.admin-topbar nav a { color: var(--muted); padding: 6px 12px; border-radius: 6px; font-size: 14px; }
.admin-topbar nav a:hover, .admin-topbar nav a.is-active { color: var(--text); background: var(--surface-2); }
.admin-main { padding: 32px 24px; max-width: 1100px; margin: 0 auto; width: 100%; }
.admin-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse 60% 60% at 50% 30%, var(--accent-glow), transparent 60%) var(--bg); }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.login-card .brand { margin-bottom: 24px; justify-content: center; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.table td a { color: var(--text); font-weight: 500; }
.table td a:hover { color: var(--accent); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.draft { background: rgba(139, 148, 158, .15); color: var(--muted); }
.badge.published { background: rgba(52, 211, 153, .15); color: var(--success); }
.btn-row { display: flex; gap: 8px; align-items: center; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(248,113,113,.3); }
.btn-danger:hover { background: rgba(248,113,113,.1); border-color: var(--danger); }

/* Service icons */
.icon { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
