/* Engineer's Notebook — neutral zinc + citruszest mint green */
/* Near-black on near-white for terminal-grade precision */
/* Accent is citruszest-ghostty.nvim green — mint that echoes the cursor color */
/* Type: Geist everywhere, Geist Mono for labels, code, and data */
:root {
  /* Colors */
  --primary: #067046;         /* Darkened citruszest green — AA on paper */
  --primary-hover: #04502F;   /* Deeper mint — hover */
  --primary-light: #1affa3;   /* Citruszest green_bright — dark-mode accent */
  --secondary: #0A0A0A;       /* Near-black — headings */
  --light-bg: #FAFAFA;        /* Neutral paper ground */
  --card-bg: #F4F4F5;         /* Zinc-100 — card lift */
  --dark-bg: #0A0A0A;         /* Near-black — header/footer */
  --text: #0A0A0A;            /* Near-black — body */
  --text-secondary: #52525B;  /* Zinc-600 — secondary */
  --text-tertiary: #71717A;   /* Zinc-500 — meta */
  --text-light: #FAFAFA;      /* Paper — text on dark */
  --border: #D4D4D8;          /* Zinc-300 — 1px dividers */
  --shadow: transparent;
  --code-bg: #F4F4F5;         /* Zinc-100 — inline code */
  --btn-primary-text: #FAFAFA; /* Primary button label — white on dark-green */

  /* Layout widths — two sizes, centered everywhere */
  --width-prose: 42rem;       /* Long-form reading: post, contact */
  --width-index: 56rem;       /* Everything else: hero, about, blog, uses, projects, recent */

  /* Type Scale — bigger display range (1.333 ratio at the top) */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1.0625rem; /* 17px — bumped body */
  --text-lg: 1.25rem;     /* 20px */
  --text-xl: 1.5rem;      /* 24px */
  --text-2xl: 2rem;       /* 32px */
  --text-3xl: 2.75rem;    /* 44px */
  --text-4xl: 4rem;       /* 64px */
  --text-display: 6rem;   /* 96px — hero display */

  /* Line Heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Spacing (8px baseline grid) */
  --space-1: 0.5rem;   /* 8px */
  --space-2: 1rem;     /* 16px */
  --space-3: 1.5rem;   /* 24px */
  --space-4: 2rem;     /* 32px */
  --space-5: 2.5rem;   /* 40px */
  --space-6: 3rem;     /* 48px */
  --space-8: 4rem;     /* 64px */
  --space-10: 5rem;    /* 80px */
  --space-12: 6rem;    /* 96px */

  /* Container Widths (Tailwind-inspired) */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;

  /* Breakpoints for reference (not used in CSS, but matches Tailwind) */
  /* sm: 640px, md: 768px, lg: 1024px, xl: 1280px, 2xl: 1536px */
}

/* Global styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  color: var(--text);
  background-color: var(--light-bg);
  /* Geist — Vercel's engineer-grade sans, precise at all sizes */
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  font-size: var(--text-base);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "ss01" 1;
  letter-spacing: -0.003em;
}

/* Headings — same Geist, tight tracking, heavier weight for hierarchy */
h1, h2, h3, h4, h5, h6,
.section-title,
.card-title,
.hero-title,
.featured-card-title {
  font-family: "Geist", sans-serif;
  font-weight: 600;
  letter-spacing: -0.025em;
}

/* Mono for code, labels, metadata — anything that wants to read as data */
code, pre, kbd, samp, tt,
.mono,
.badge,
.section-eyebrow,
time[datetime] {
  font-family: "Geist Mono", "SF Mono", Menlo, Consolas, "Courier New", monospace;
}

/* Typography — Geist display with tight tracking and clear hierarchy */
h1 {
  font-size: var(--text-4xl);
  line-height: 1.02;
  font-weight: 400;
  color: var(--secondary);
  margin-bottom: var(--space-4);
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--text-3xl);
  line-height: 1.08;
  font-weight: 400;
  color: var(--secondary);
  margin-bottom: var(--space-3);
  letter-spacing: -0.025em;
}

h3 {
  font-size: var(--text-2xl);
  line-height: 1.15;
  font-weight: 400;
  color: var(--secondary);
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

h4 {
  font-size: var(--text-xl);
  line-height: 1.25;
  font-weight: 400;
  color: var(--secondary);
  margin-bottom: var(--space-2);
  letter-spacing: -0.015em;
}

/* Imagery — editorial, warm, minimal */
figure {
  margin: var(--space-4) 0;
}

figure img,
.project-image,
.post-image {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border);
}

figcaption {
  font-family: "Geist", sans-serif;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  margin-top: 0.5rem;
  letter-spacing: -0.005em;
}

p {
  margin-bottom: var(--space-3);
}

/* Horizontal rules */
hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: var(--space-6) 0;
}

/* Layout Utilities - Responsive Containers */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

/* Increase padding on larger screens */
@media (min-width: 1280px) {
  .container {
    padding: 0 var(--space-6);
  }
}

@media (min-width: 1536px) {
  .container {
    padding: 0 var(--space-8);
  }
}

/* Responsive max-widths (like Tailwind) */
@media (min-width: 640px) {
  .container {
    max-width: 640px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

@media (min-width: 1536px) {
  .container {
    max-width: 1536px;
  }
}

/* Grid System - Responsive */
.grid {
  display: grid;
  gap: var(--space-4);
}

/* Grid 2 - Responsive: 1 col mobile, 2 col tablet+ */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Grid 3 - Responsive: 1 col mobile, 2 col tablet, 3 col desktop */
.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Increase gap on larger screens */
@media (min-width: 1280px) {
  .grid,
  .grid-2,
  .grid-3 {
    gap: var(--space-6);
  }
}

/* Spacing Utilities */
.section {
  padding: var(--space-8) 0;
}

.section-sm {
  padding: var(--space-6) 0;
}

/* Component Library */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  font-family: "Geist", sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: -0.005em;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--btn-primary-text);
  border-color: var(--primary);
  font-weight: 600;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text);
  border-color: var(--text);
}

.btn-secondary:hover {
  background-color: var(--text);
  color: var(--light-bg);
  text-decoration: none;
}

.btn-ghost {
  background-color: transparent;
  color: var(--text);
  border: none;
  box-shadow: inset 0 0 0 1px var(--text-secondary);
}

.btn-ghost:hover {
  box-shadow: inset 0 0 0 1px var(--primary);
}

.btn-ghost:hover {
  background-color: transparent;
  color: var(--primary);
  border-color: var(--primary);
  text-decoration: none;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
}

/* Cards */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--space-5);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.card-title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--secondary);
  margin-bottom: var(--space-2);
}

.card-body {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-3);
}

.card-footer {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Badges — tiny mono uppercase labels, no fill */
.badge {
  display: inline-block;
  padding: 0.2rem 0;
  font-family: "Geist Mono", monospace;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: transparent;
  border: none;
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.badge-primary {
  color: var(--primary);
  background-color: transparent;
}

.badge-secondary {
  color: var(--text-secondary);
  background-color: transparent;
}

/* Render a · between adjacent badges */
.badge + .badge::before {
  content: "·";
  margin: 0 0.4rem;
  color: var(--text-tertiary);
}

/* Tag container for proper spacing when wrapping */
.tags {
  display: inline-flex;
  gap: 0.25rem 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.5rem;
}

.badge + .badge {
  margin-left: 0;
}

/* Section Headers — editorial, no framed rule */
.section-header {
  text-align: left;
  margin-bottom: var(--space-5);
  max-width: var(--width-index);
}

.section-title {
  font-family: "Geist", sans-serif;
  font-size: clamp(1.75rem, 3.5vw, 2.125rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--secondary);
  margin-bottom: var(--space-2);
}

.section-subtitle {
  font-family: "Geist", sans-serif;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  max-width: 600px;
  letter-spacing: -0.005em;
}

/* Header & Navigation — paper-tone with subtle divider */
body > header {
  background-color: var(--light-bg);
  color: var(--text);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 9999;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

main {
  position: relative;
  z-index: 1;
}

.nav-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.nav-brand {
  font-family: "Geist Mono", monospace;
  font-size: 1rem;
  font-weight: 600;
  color: var(--secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.nav-brand::before {
  content: "~/";
  color: var(--text-tertiary);
  font-weight: 400;
}

.nav-brand:hover {
  color: var(--primary);
}

nav ul {
  display: flex;
  list-style: none;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
}

nav a {
  font-family: "Geist", sans-serif;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-block;
  letter-spacing: -0.005em;
  border-bottom: none;
  padding-bottom: 0;
}

nav a:hover {
  color: var(--secondary);
  text-decoration: none;
  border-bottom: none;
}

nav a.active {
  color: var(--primary);
}

@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: var(--space-2);
  }

  nav ul {
    gap: var(--space-2);
    flex-wrap: wrap;
    justify-content: center;
  }

  nav a {
    font-size: var(--text-sm);
    white-space: nowrap;
  }

  html {
    scroll-padding-top: 100px;
  }
}

/* Section h2s — let the base heading rule carry the weight */
section h2 {
  color: var(--secondary);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

/* Footer — editorial colophon */
footer {
  background: var(--light-bg);
  color: var(--text-secondary);
  text-align: left;
  padding: var(--space-8) 0 var(--space-6);
  margin-top: var(--space-10);
  border-top: 1px solid var(--border);
  font-family: "Geist", sans-serif;
  font-size: 0.875rem;
}

.footer-inner {
  max-width: var(--width-index);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
}

footer p {
  margin: 0;
  color: var(--text-secondary);
}

.footer-credit {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

footer a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s ease, border-color 0.2s ease;
}

footer a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Dark Mode Toggle Button — minimal, editorial */
.dark-mode-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  font-size: 0.9375rem;
  line-height: 1;
  transition: border-color 0.2s ease, color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.dark-mode-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.dark-mode-toggle .icon-moon,
.dark-mode-toggle .icon-sun {
  display: block;
}

.dark-mode-toggle .icon-moon {
  display: none;
}

.dark-mode-toggle .icon-sun {
  color: #D97706; /* Warm amber — sun */
}

/* Dark mode — matches citruszest-ghostty.nvim ground (#121212) vibe */
[data-theme="dark"] {
  --primary: #1affa3;           /* Citruszest green_bright — vibrant on dark */
  --primary-hover: #00cc7a;     /* Citruszest green — hover */
  --primary-light: #00cc7a;
  --secondary: #FAFAFA;         /* Near-white — headings */
  --light-bg: #0A0A0A;          /* Near-black ground */
  --card-bg: #18181B;           /* Zinc-900 — card lift */
  --dark-bg: #050505;           /* Deepest — header/footer */
  --text: #FAFAFA;              /* Near-white body */
  --text-secondary: #A1A1AA;    /* Zinc-400 */
  --text-tertiary: #71717A;     /* Zinc-500 */
  --text-light: #FAFAFA;
  --border: #27272A;            /* Zinc-800 */
  --shadow: transparent;
  --code-bg: #18181B;
  --btn-primary-text: #0A0A0A;  /* Near-black on bright-mint button */
}

[data-theme="dark"] .dark-mode-toggle .icon-moon {
  display: block;
  color: #00cc7a; /* Citruszest mint — moon */
}

[data-theme="dark"] .dark-mode-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] header {
  background-color: var(--light-bg);
}

[data-theme="dark"] footer {
  background: var(--light-bg);
}

/* Enhanced Micro-interactions */

/* Link hover effects */
a {
  transition: color 0.2s ease, opacity 0.2s ease;
}

/* Card title link hover */
.card-title a {
  transition: color 0.2s ease;
}

.card-title a:hover {
  color: var(--primary) !important;
}

/* Badges — no hover lift; they're inline labels, not buttons */
.badge { transition: color 0.2s ease; }

/* Button press effect */
.btn:active {
  transform: translateY(0) scale(0.98);
}

/* Focus states for accessibility (keyboard only) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Remove outline on mouse click */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* Smooth image loading */
img {
  transition: opacity 0.3s ease;
}

/* Section fade-in on scroll (CSS only hint for JS) */
.section,
.section-sm {
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Profile photo hover — restrained, no drop shadow */
.profile-photo {
  transition: transform 0.4s ease;
}

/* Nav brand subtle animation */
.nav-brand {
  transition: color 0.3s ease, transform 0.2s ease;
}

.nav-brand:hover {
  transform: translateX(2px);
}

/* Footer link hover */
footer a {
  transition: opacity 0.2s ease, color 0.2s ease;
}

footer a:hover {
  opacity: 1;
  color: var(--primary-light);
}

@media (max-width: 768px) {
  .dark-mode-toggle {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
  }

  .nav-container {
    position: relative;
  }
}

