/* AIDEV-NOTE: Design system — dark navy theme, custom properties, typography, layout */

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
  --color-bg: #0a0e1a;
  --color-bg-elevated: #111827;
  --color-bg-card: #1a1f2e;
  --color-surface: #1e2433;
  --color-border: #2a3040;
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-text-dim: #64748b;
  --color-accent: #2dd4bf;
  --color-accent-hover: #5eead4;
  --color-accent-dim: rgba(45, 212, 191, 0.1);
  --color-white: #ffffff;

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);

  --header-height: 4rem;
  --container-max: 72rem;
  --container-narrow: 48rem;

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, video, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
}

ul, ol {
  list-style: none;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-white);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

@media (min-width: 768px) {
  h1 { font-size: var(--text-5xl); }
  h2 { font-size: var(--text-4xl); }
}

p + p {
  margin-top: var(--space-4);
}

/* ============================================
   Layout
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--narrow {
  max-width: var(--container-narrow);
}

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

.section--lg {
  padding: var(--space-24) 0;
}

.section__header {
  margin-bottom: var(--space-12);
}

.section__title {
  margin-bottom: var(--space-4);
}

.section__subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  max-width: 36rem;
}

/* ============================================
   Grid
   ============================================ */
.grid {
  display: grid;
  gap: var(--space-8);
}

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

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

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

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

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

/* ============================================
   Fade-in Animations
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Prose (blog post content styling)
   ============================================ */
.post-content h2,
.page-content h2 {
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
}

.post-content h3,
.page-content h3 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

.post-content p,
.page-content p {
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.post-content ul,
.post-content ol,
.page-content ul,
.page-content ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.page-content ul { list-style: disc; }
.page-content ol { list-style: decimal; }

.post-content li,
.page-content li {
  margin-bottom: var(--space-2);
}

.post-content blockquote,
.page-content blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-6);
  margin: var(--space-8) 0;
  color: var(--color-text-muted);
  font-style: italic;
}

.post-content code,
.page-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-bg-elevated);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}

.post-content a,
.page-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================
   Utility
   ============================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
