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

:root {
  /* Light theme (default) — Cobalt & Red */
  --bg:          #ffffff;
  --bg-card:     #ffffff;
  --bg-hero:     #f5f5f7;
  --text:        #0a0a0a;
  --text-muted:  #555555;
  --text-subtle: #777777;
  --accent:      #0047AB;
  --accent-hover:#003580;
  --accent-soft: rgba(0, 71, 171, 0.08);
  --accent-cta:      #DC0000;
  --accent-cta-hover: #B00000;
  --accent-cta-soft:  rgba(220, 0, 0, 0.08);
  --border:      #e0e0e0;
  --border-hover:#cccccc;
  --shadow:      0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-hover:0 8px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
  --radius:      12px;
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  --toggle-bg:   #e0e0e0;
  --toggle-icon: "🌙";
  --logo-brain:  #DC0000;
  --logo-arc:    #0047AB;
  --logo-core:   #0047AB;
}

[data-theme="dark"] {
  --bg:          #0a0a0a;
  --bg-card:     #111111;
  --bg-hero:     #0a0a0a;
  --text:        #ffffff;
  --text-muted:  #aaaaaa;
  --text-subtle: #777777;
  --accent:      #5B9BD5;
  --accent-hover:#7CB5E8;
  --accent-soft: rgba(91, 155, 213, 0.12);
  --accent-cta:      #DC0000;
  --accent-cta-hover: #FF2222;
  --accent-cta-soft:  rgba(220, 0, 0, 0.10);
  --border:      #222222;
  --border-hover:#333333;
  --shadow:      0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-hover:0 8px 25px rgba(0,0,0,0.4), 0 4px 10px rgba(0,0,0,0.3);
  --toggle-bg:   #222222;
  --toggle-icon: "☀️";
  --logo-brain:  #DC0000;
  --logo-arc:    #5B9BD5;
  --logo-core:   #5B9BD5;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

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

/* ── Theme Toggle ────────────────────────────────────────── */
.theme-toggle {
  position: fixed;
  top: 0.7rem;
  right: 1.25rem;
  z-index: 100;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}
.theme-toggle:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: scale(1.05);
}

/* ── Site Nav ────────────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease;
}

:root .site-nav {
  background: rgba(255, 255, 255, 0.85);
}
[data-theme="dark"] .site-nav {
  background: rgba(10, 10, 10, 0.85);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text);
}
.nav-logo:hover {
  color: var(--text);
}

.nav-logo svg {
  height: 36px;
  width: 36px;
  flex-shrink: 0;
}

.nav-brand {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.nav-brand .nav-accent {
  color: var(--accent);
}

/* ── Hero Logo ──────────────────────────────────────────── */
.hero-logo {
  margin-bottom: 2rem;
}
.hero-logo svg {
  height: 120px;
  width: 120px;
  filter: drop-shadow(0 0 20px rgba(0, 71, 171, 0.3));
  animation: logo-pulse 4s ease-in-out infinite;
}

@keyframes logo-pulse {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(0, 71, 171, 0.3)); }
  50%      { filter: drop-shadow(0 0 30px rgba(0, 71, 171, 0.5)); }
}

/* ── Layout ──────────────────────────────────────────────── */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 5rem 0;
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--bg-hero);
  padding: 6rem 0 4rem;
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}

.hero-content {
  max-width: 720px;
  padding: 0 1.5rem;
}

.hero-brand {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.hero-brand .accent {
  color: var(--accent);
}

.hero-tagline {
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  color: var(--text);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.hero-link--primary {
  background: var(--accent-cta);
  color: #fff;
}
.hero-link--primary:hover {
  background: var(--accent-cta-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 0, 0, 0.3);
}

.hero-link--secondary {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-card);
}
.hero-link--secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

/* ── Section Headers ─────────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

/* ── Project Cards ───────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-cta));
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.project-card:hover::before {
  opacity: 1;
}

.project-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}

.project-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
}

.project-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.project-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-grow: 1;
  line-height: 1.65;
}

.project-quote {
  font-size: 0.88rem;
  color: var(--text-subtle);
  font-style: italic;
  border-left: 2px solid var(--accent);
  padding-left: 0.75rem;
  margin-bottom: 1rem;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.project-meta a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-weight: 500;
}
.project-meta a:hover {
  color: var(--accent);
}

.project-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-subtle);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ── Philosophy ──────────────────────────────────────────── */
.philosophy {
  background: var(--bg-hero);
  position: relative;
}

.philosophy::before,
.philosophy::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 80px;
  pointer-events: none;
}
.philosophy::before {
  top: 0;
  background: linear-gradient(to bottom, var(--bg), transparent);
}
.philosophy::after {
  bottom: 0;
  background: linear-gradient(to top, var(--bg), transparent);
}

.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  max-width: 800px;
  margin: 0 auto;
}

.philosophy-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: all 0.2s ease;
}

.philosophy-item:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.philosophy-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 0.1rem;
}

.philosophy-text {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
}

.philosophy-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 0.25rem;
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}
.footer-link:hover {
  color: var(--accent);
}

.footer-note {
  font-size: 0.85rem;
  color: var(--text-subtle);
  margin-bottom: 0.35rem;
}

.footer-privacy {
  font-size: 0.78rem;
  color: var(--text-subtle);
  opacity: 0.7;
  font-family: var(--font-mono);
}

/* ── Scroll Animations ───────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Stagger children */
.stagger > .fade-in:nth-child(1) { transition-delay: 0.0s; }
.stagger > .fade-in:nth-child(2) { transition-delay: 0.1s; }
.stagger > .fade-in:nth-child(3) { transition-delay: 0.2s; }
.stagger > .fade-in:nth-child(4) { transition-delay: 0.3s; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  section {
    padding: 3.5rem 0;
  }

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

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

  .hero {
    min-height: 80vh;
    padding-top: 5rem;
  }

  .hero-logo svg {
    height: 90px;
    width: 90px;
  }

  .project-card {
    padding: 1.5rem;
  }

  .nav-brand {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .hero-links {
    flex-direction: column;
    align-items: center;
  }

  .hero-link {
    width: 100%;
    max-width: 260px;
    justify-content: center;
  }

  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
  .theme-toggle, .site-nav { display: none; }
  .hero { min-height: auto; padding-top: 2rem; }
  body { background: #fff; color: #000; }
}
