/* Code Velocity - Design System v4.0 */
/* Machined Minimalism | Engineering HUD */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* Evolution Palette */
  --bg-body: #0B0C10;
  --bg-card: #13151A;
  --border-subtle: #2A2F3A;
  --text-primary: #F5F5F7;
  --text-secondary: #D1D1D1;
  --accent-glow: #0055FF;
  --accent-hover: #3377FF;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout */
  --max-width: 1200px;
  --content-width: 720px;
  --section-padding: 6rem;
  --border-radius: 16px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-body);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Subtle Grid Background */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.15;
  pointer-events: none;
  z-index: -1;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

main {
  flex: 1;
}

/* Typography */
h1, h2, h3, h4 {
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-top: 0;
  margin-bottom: 0.75rem;
  text-wrap: balance;
}

p, .lead, .card-copy {
  text-wrap: pretty;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 1.25rem;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
}

h4 {
  font-size: 1.1rem;
  margin-top: 1rem;
  margin-bottom: 0.3rem;
}

p {
  margin-top: 0;
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

a {
  color: var(--accent-glow);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
  text-shadow: 0 0 20px rgba(64, 96, 255, 0.5);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(11, 12, 16, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 0;
  z-index: 100;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
}

.logo svg {
  height: 40px;
  width: auto;
}

.logo:hover {
  opacity: 0.9;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

.nav-menu a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--text-primary);
  text-shadow: none;
}

/* Hero */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8rem 2rem 6rem;
  text-align: center;
}

.hero h1 {
  margin-bottom: 1.5rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .lead {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

/* CTA Button with Glow */
.cta-button {
  display: inline-block;
  background: var(--accent-glow);
  color: #fff;
  padding: 1rem 2.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  transition: all 0.3s ease;
  box-shadow:
    0 0 20px rgba(64, 96, 255, 0.4),
    0 0 40px rgba(64, 96, 255, 0.2);
  border: 1px solid rgba(64, 96, 255, 0.5);
}

.cta-button:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow:
    0 0 30px rgba(64, 96, 255, 0.6),
    0 0 60px rgba(64, 96, 255, 0.3);
  text-shadow: none;
}

/* Segments Section */
.segments-section {
  padding: var(--section-padding) 2rem;
}

.segments-section h2 {
  text-align: center;
  margin-bottom: 3rem;
}

/* Bento Grid - Fixed Layout */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.card {
  background-color: #13151A;
  border: 1px solid #2A2F3A;
  border-radius: 16px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  border-color: #4060FF;
  transform: translateY(-4px);
}

.card-icon {
  margin-bottom: 0.5rem;
}

.card-icon svg {
  width: 48px;
  height: 48px;
}

.card-target {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-glow);
}

.card-copy {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  flex: 1;
  margin-bottom: 0;
}

.card-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  background: rgba(64, 96, 255, 0.1);
  border-radius: 6px;
}

/* Engine Section */
.engine-section {
  padding: var(--section-padding) 2rem;
  border-top: 1px solid var(--border-subtle);
}

.engine-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.engine-container.text-only {
  display: block;
  max-width: var(--content-width);
  text-align: center;
}

.engine-content h2 {
  margin-bottom: 1.5rem;
}

.engine-content p {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.engine-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Twin-Piston Engine */
.twin-engine {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  height: 120px;
}

.cylinder {
  width: 40px;
  height: 100px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: 4px 4px 0 0;
  position: relative;
  overflow: hidden;
}

.piston {
  position: absolute;
  bottom: 10px;
  left: 4px;
  right: 4px;
  height: 30px;
  background: linear-gradient(180deg, #555 0%, #333 100%);
  border-radius: 2px;
}

.cylinder:nth-child(1) .piston {
  animation: stroke 1.5s ease-in-out infinite;
}

.cylinder:nth-child(2) .piston {
  animation: stroke 1.5s ease-in-out infinite 0.75s;
}

.spark {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: var(--accent-glow);
  border-radius: 50%;
  opacity: 0;
  filter: blur(4px);
}

.cylinder:nth-child(1) .spark {
  animation: spark 1.5s ease-in-out infinite;
}

.cylinder:nth-child(2) .spark {
  animation: spark 1.5s ease-in-out infinite 0.75s;
}

@keyframes stroke {
  0%, 100% { bottom: 10px; }
  50% { bottom: 55px; }
}

@keyframes spark {
  0%, 48% { opacity: 0; }
  50% { opacity: 1; box-shadow: 0 0 20px var(--accent-glow); }
  52%, 100% { opacity: 0; }
}

/* Proof Section - Visual Heatmap */
.proof-section {
  padding: var(--section-padding) 2rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.metric-hero {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 700;
  color: var(--accent-glow);
  text-shadow: 0 0 60px rgba(64, 96, 255, 0.5);
  margin-bottom: 0.5rem;
}

.metric-sub {
  display: block;
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-shadow: none;
  margin-top: 0.5rem;
}

.heatmap-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.heatmap-row {
  display: flex;
  align-items: center;
  gap: 20px;
}

.heatmap-row .label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  width: 100px;
  text-align: right;
}

.squares-track {
  display: flex;
  gap: 4px;
}

.sq {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: #333;
}

.sq.active-blue {
  background: #4060FF;
  box-shadow: 0 0 8px rgba(64, 96, 255, 0.6);
}

.sq.fading {
  opacity: 0.2;
}

/* CTA Section */
.cta-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--section-padding) 2rem;
  text-align: center;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 2rem;
  margin-top: 2rem;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Page content */
.page,
.list-page {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 4rem 2rem;
}

.page-header {
  margin-bottom: 3rem;
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

.page-content p {
  color: var(--text-secondary);
}

.page-content a {
  color: var(--accent-glow);
}

.page-content strong {
  color: var(--text-primary);
}

/* Blog */
.blog-list {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 4rem 2rem;
}

.blog-list .page-header {
  margin-bottom: 3rem;
}

.blog-item-link {
  display: block;
  text-decoration: none;
  margin-bottom: 1rem;
}

.blog-item {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
  cursor: pointer;
}

.blog-item-link:hover .blog-item {
  border-color: var(--accent-glow);
  box-shadow: 0 0 30px rgba(64, 96, 255, 0.1);
  transform: translateY(-4px);
}

.blog-item h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.blog-item-link:hover h2 {
  color: var(--accent-glow);
}

.blog-meta {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.blog-item p {
  color: var(--text-secondary);
  margin-bottom: 0;
}

.blog-post {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 4rem 2rem;
}

.blog-post-header {
  margin-bottom: 3rem;
}

.blog-post-header h1 {
  margin-bottom: 1rem;
}

.blog-post-meta {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.blog-post-content {
  font-size: 1.125rem;
  line-height: 1.8;
}

.blog-post-content p {
  color: var(--text-secondary);
}

.blog-post-content h2 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.blog-post-content h3 {
  font-size: 1.25rem;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
}

.blog-post-content h4 {
  font-size: 1.1rem;
  margin-top: 1rem;
  margin-bottom: 0.3rem;
}

.blog-post-content p {
  margin-bottom: 1.5rem;
}

.blog-post-content hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 3rem 0;
}

.blog-post-content em {
  font-style: italic;
  color: var(--text-primary);
}

.blog-post-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.blog-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1.5rem 0 1rem;
  border: 1px solid var(--border-subtle);
}

.blog-post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
}

.blog-post-content th,
.blog-post-content td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.blog-post-content th {
  color: var(--text-primary);
  font-weight: 600;
  background: var(--bg-card);
}

.blog-post-content td {
  color: var(--text-secondary);
}

.blog-post-content ul,
.blog-post-content ol {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

.blog-post-content li {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

/* Code Blocks - Engineering Style */
.blog-post-content pre,
.blog-post-content code {
  font-family: var(--font-mono);
}

.blog-post-content pre {
  background: rgba(0, 0, 0, 0.4);
  border-left: 3px solid var(--accent-glow);
  padding: 1.5rem;
  border-radius: 0 8px 8px 0;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.blog-post-content code {
  font-size: 0.9em;
  color: #D1D1D1;
}

.blog-post-content p code {
  background: rgba(0, 85, 255, 0.1);
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

/* HUD Header */
.blog-hud {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}

.blog-hud span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-hud .status {
  color: #00FF88;
}

.blog-hud .accent {
  color: var(--accent-glow);
}

/* Breadcrumb */
.blog-breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  opacity: 0.7;
}

.blog-breadcrumb::before {
  content: "~/";
  color: var(--accent-glow);
}

.blog-post-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.blog-post-footer a {
  color: var(--text-secondary);
  font-weight: 500;
}

.blog-post-footer a:hover {
  color: var(--accent-glow);
}

/* Contact */
.contact-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
}

.contact-card {
  background: #13151A;
  border: 1px solid #2A2F3A;
  border-radius: 24px;
  padding: 60px;
  text-align: center;
  max-width: 600px;
  margin: 100px auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.contact-card h1 {
  margin-bottom: 2rem;
}

.contact-copy p {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.contact-cta {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.contact-cta h3 {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.ghost-button {
  display: inline-block;
  padding: 1rem 2rem;
  border: 1px solid var(--accent-glow);
  border-radius: 10px;
  color: var(--accent-glow);
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
}

.ghost-button:hover {
  background: var(--accent-glow);
  color: #fff;
  box-shadow: 0 0 20px rgba(64, 96, 255, 0.4);
  text-shadow: none;
}

.email-link {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.email-link:hover {
  color: var(--accent-glow);
}

/* Responsive */
@media (max-width: 1024px) {
  .engine-container {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .engine-visual {
    order: -1;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 4rem;
  }

  .hero {
    padding: 5rem 1.5rem 4rem;
  }

  .nav-menu {
    gap: 1.5rem;
  }

  .nav-menu a {
    font-size: 0.875rem;
  }

  .bento-grid {
    grid-template-columns: 1fr;
  }

  .metric-hero {
    font-size: 3rem;
  }

  .heatmap-row .label {
    width: 80px;
    font-size: 0.65rem;
  }

  .sq {
    width: 8px;
    height: 8px;
  }
}
