/* =============================================================
   Kinetiq Nexus — Blog stylesheet
   Brand canon: navy ground #111827, orange accent #f97316
   Typography: Inter (body), Roboto Mono (technical)
   Aesthetic: Liquid Glass / Modern Industrial
   ============================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root {
  --navy: #111827;
  --navy-deep: #0b1220;
  --navy-mid: #1f2937;
  --orange: #f97316;
  --orange-dim: rgba(249, 115, 22, 0.85);
  --orange-faint: rgba(249, 115, 22, 0.12);
  --ink: #f3f4f6;
  --ink-mute: #9ca3af;
  --ink-dim: #6b7280;
  --glass: rgba(255, 255, 255, 0.04);
  --glass-strong: rgba(255, 255, 255, 0.07);
  --glass-line: rgba(255, 255, 255, 0.08);
  --grid: rgba(255, 255, 255, 0.025);
  --radius: 14px;
  --radius-sm: 8px;
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Roboto Mono', ui-monospace, 'SF Mono', Consolas, monospace;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--navy);
  background-image:
    radial-gradient(circle at 15% 8%, rgba(249, 115, 22, 0.08) 0%, transparent 35%),
    radial-gradient(circle at 85% 75%, rgba(59, 130, 246, 0.05) 0%, transparent 45%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

main, header, footer { position: relative; z-index: 1; }

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(2.25rem, 4.5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h4 { font-size: 1.05rem; font-weight: 500; }

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--orange); text-decoration: none; transition: color 180ms ease; }
a:hover { color: var(--ink); }

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--glass-strong);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--glass-line);
  color: #fde68a;
}

pre {
  font-family: var(--font-mono);
  background: var(--glass-strong);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 1.5rem 0;
}
pre code { background: transparent; border: none; padding: 0; color: #e5e7eb; }

blockquote {
  border-left: 3px solid var(--orange);
  padding: 0.5rem 0 0.5rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--ink-mute);
}

ul, ol { margin: 1em 0 1em 1.5em; }
li { margin-bottom: 0.4em; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 1.5rem; }

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(17, 24, 39, 0.72);
  border-bottom: 1px solid var(--glass-line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 1140px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand-mark { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-subdomain {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-mute);
  margin-left: 0.5rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--glass-line);
}
.nav-links { display: flex; gap: 1.75rem; list-style: none; margin: 0; align-items: center; }
.nav-links a { color: var(--ink-mute); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  background: var(--orange);
  color: var(--navy);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.nav-cta:hover { background: var(--orange-dim); color: var(--navy); }
.nav-toggle { display: none; background: none; border: 1px solid var(--glass-line); border-radius: var(--radius-sm); width: 38px; height: 38px; align-items: center; justify-content: center; cursor: pointer; }
.nav-toggle span { display: block; width: 16px; height: 1.5px; background: var(--ink); position: relative; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; width: 16px; height: 1.5px; background: var(--ink); }
.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }

.hero { padding: 5rem 0 3rem; position: relative; }
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--orange);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}
.hero-eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--orange); }
.hero h1 { max-width: 28ch; margin-bottom: 1.25rem; }
.hero-lede { font-size: 1.15rem; color: var(--ink-mute); max-width: 58ch; line-height: 1.55; }

.card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 220ms ease, transform 220ms ease, background 220ms ease;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-line), transparent);
}
.card:hover { border-color: rgba(249, 115, 22, 0.35); transform: translateY(-2px); background: var(--glass-strong); }

.section { padding: 3rem 0; }
.section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--glass-line);
  padding-bottom: 0.75rem;
}
.section-label h2 {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.section-label .count { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-dim); }

.posts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }

.post-card { display: flex; flex-direction: column; cursor: pointer; text-decoration: none; color: inherit; }
.post-card:hover { color: inherit; }
.post-card .post-meta {
  display: flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--ink-dim); letter-spacing: 0.04em;
  margin-bottom: 0.875rem; text-transform: uppercase;
}
.post-card .post-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--orange); }
.post-card h3 { margin-bottom: 0.75rem; font-size: 1.35rem; letter-spacing: -0.015em; line-height: 1.25; }
.post-card .post-excerpt { color: var(--ink-mute); font-size: 0.95rem; line-height: 1.55; margin-bottom: 1.25rem; flex-grow: 1; }
.post-card .post-readmore {
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--orange);
  letter-spacing: 0.04em; display: inline-flex; align-items: center; gap: 0.5rem;
}
.post-card .post-readmore::after { content: "→"; transition: transform 200ms ease; }
.post-card:hover .post-readmore::after { transform: translateX(4px); }

.post-featured {
  grid-column: 1 / -1;
  padding: 2.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}
.post-featured h3 { font-size: 2rem; line-height: 1.15; }
.post-featured .featured-visual {
  height: 100%;
  min-height: 220px;
  border-radius: var(--radius-sm);
  background:
    radial-gradient(circle at 30% 30%, rgba(249, 115, 22, 0.25) 0%, transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(59, 130, 246, 0.15) 0%, transparent 60%),
    linear-gradient(135deg, rgba(17, 24, 39, 0.6), rgba(17, 24, 39, 0.9));
  border: 1px solid var(--glass-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--orange);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}
.post-featured .featured-visual::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(249, 115, 22, 0.25);
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.post-page { padding: 4rem 0 6rem; }
.post-header { margin-bottom: 3rem; padding-bottom: 2.5rem; border-bottom: 1px solid var(--glass-line); }
.post-header .post-meta {
  display: flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--orange); letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 1.25rem;
}
.post-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
  max-width: 22ch;
}
.post-header .post-deck { font-size: 1.15rem; color: var(--ink-mute); max-width: 58ch; line-height: 1.55; }
.post-byline {
  display: flex; gap: 1.25rem; align-items: center;
  margin-top: 2rem; padding-top: 1.5rem;
  border-top: 1px solid var(--glass-line);
  font-family: var(--font-mono); font-size: 0.82rem;
  color: var(--ink-mute); letter-spacing: 0.04em;
}
.post-byline strong { color: var(--ink); font-weight: 600; }

.post-content { font-size: 1.05rem; line-height: 1.75; }
.post-content h2 { margin-top: 3rem; margin-bottom: 1rem; font-size: 1.55rem; letter-spacing: -0.02em; }
.post-content h3 { margin-top: 2rem; margin-bottom: 0.75rem; font-size: 1.2rem; }
.post-content p { margin-bottom: 1.25em; }
.post-content ul, .post-content ol { margin: 1.25em 0 1.25em 1.5em; }
.post-content li { margin-bottom: 0.5em; }
.post-content .callout {
  background: var(--orange-faint);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  font-size: 0.98rem;
}
.post-content .callout strong { color: var(--orange); }
.post-content .factbox {
  background: var(--glass-strong);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--ink-mute);
  line-height: 1.65;
}
.post-content .factbox strong { color: var(--ink); }

table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--glass-line); }
th { color: var(--ink-mute); font-weight: 500; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; background: var(--glass); }

.cta-section { padding: 4rem 0; text-align: center; }
.cta-card {
  padding: 3rem 2rem;
  text-align: center;
  background: linear-gradient(135deg, var(--glass), var(--glass-strong));
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.cta-card h2 { font-size: 1.85rem; margin-bottom: 0.75rem; }
.cta-card p { color: var(--ink-mute); max-width: 50ch; margin: 0 auto 1.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 200ms ease;
  border: none;
}
.btn-primary { background: var(--orange); color: var(--navy); }
.btn-primary:hover { background: var(--orange-dim); color: var(--navy); transform: translateY(-1px); }
.btn-ghost { background: var(--glass); border: 1px solid var(--glass-line); color: var(--ink); backdrop-filter: blur(10px); }
.btn-ghost:hover { background: var(--glass-strong); border-color: var(--orange); color: var(--ink); }

.footer { border-top: 1px solid var(--glass-line); padding: 3rem 0 2rem; margin-top: 4rem; color: var(--ink-mute); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2.5rem; }
.footer h4 { font-size: 0.8rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 1rem; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 0.5rem; }
.footer a { color: var(--ink-mute); font-size: 0.92rem; }
.footer a:hover { color: var(--ink); }
.footer-tagline { font-size: 0.92rem; line-height: 1.55; max-width: 32ch; margin-top: 0.75rem; }
.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--glass-line);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--orange-faint);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--orange);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--navy-deep);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--glass-line);
  }
  .nav-links.open li { padding: 0.75rem 0; border-bottom: 1px solid var(--glass-line); }
  .nav-links.open li:last-child { border-bottom: none; }
  .nav-toggle { display: inline-flex; }
  .hero { padding: 3rem 0 2rem; }
  .post-featured { grid-template-columns: 1fr; padding: 1.75rem; }
  .post-featured .featured-visual { min-height: 160px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 0.75rem; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .brand-subdomain { display: none; }
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
