/* ==========================================================================
   Design Tokens & Variables
   ========================================================================== */

/* Dark Mode (Default) */
:root {
  --bg: #000000;
  --header-bg: rgba(0, 0, 0, 0.75);
  --surface: #0a0a0c;
  --surface-raised: #121215;
  --border: #1d1d20;
  --border-hover: #323238;
  --text-primary: #f5f5f7;
  --text-secondary: #86868b;
  --text-tertiary: #525257;
  --accent: #2997ff;
  --accent-glow: rgba(41, 151, 255, 0.15);
  --timeline-line: #222226;
  --timeline-dot: #2997ff;
  --mono-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

/* Light Mode (Clean Ceramic) */
[data-theme="light"] {
  --bg: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.82);
  --surface: #fbfbfd;
  --surface-raised: #f5f5f7;
  --border: #e5e5ea;
  --border-hover: #d1d1d6;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --accent: #0071e3;
  --accent-glow: rgba(0, 113, 227, 0.12);
  --timeline-line: #e5e5ea;
  --timeline-dot: #0071e3;
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--sans-font);
  letter-spacing: -0.015em;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: background-color 0.25s ease, color 0.25s ease;
}

::selection {
  background: var(--accent-glow);
  color: var(--text-primary);
}

.container {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.nav-inner {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.brand {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

nav {
  display: flex;
  gap: 20px;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.15s ease;
}

nav a:hover {
  color: var(--text-primary);
}

/* Theme Toggle Button */
.theme-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.theme-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--surface-raised);
}

.theme-btn svg {
  width: 14px;
  height: 14px;
}

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

[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* ==========================================================================
   Hero Section (Authentic Engineering Identity)
   ========================================================================== */

main {
  padding-top: 72px;
}

.hero {
  margin-bottom: 72px;
}

.hero-name {
  font-size: clamp(34px, 4.5vw, 46px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.hero-title {
  font-family: var(--mono-font);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: -0.01em;
  margin-bottom: 22px;
}

.lead {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 680px;
  line-height: 1.65;
  margin-bottom: 24px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.meta-item {
  color: var(--text-secondary);
}

.meta-separator {
  color: var(--border-hover);
}

.meta-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

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

/* ==========================================================================
   Section Labels & Layout
   ========================================================================== */

section {
  margin-bottom: 80px;
}

.mb-24 {
  margin-bottom: 24px;
}

.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  font-weight: 600;
  margin-bottom: 20px;
}

/* ==========================================================================
   Cards & Architecture Panels
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  transition: border-color 0.2s ease, background 0.25s ease;
}

.card:hover {
  border-color: var(--border-hover);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.role-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.company-name {
  font-size: 13px;
  color: var(--accent);
  margin-top: 2px;
}

.timestamp {
  font-family: var(--mono-font);
  font-size: 12px;
  color: var(--text-tertiary);
}

.source-link {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.source-link:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Subsystem Hierarchy inside Cards */
.subsystem-block {
  margin: 20px 0 0 0;
}

.subsystem-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* ==========================================================================
   Career Progression Timeline
   ========================================================================== */

.timeline-progression {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  padding-left: 18px;
  margin-bottom: 24px;
  border-left: 1px solid var(--timeline-line);
}

.progression-node {
  position: relative;
}

.progression-node::before {
  content: '';
  position: absolute;
  left: -22.5px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--timeline-dot);
  border: 2px solid var(--surface);
}

.node-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
}

.node-time {
  font-size: 11px;
  font-family: var(--mono-font);
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ==========================================================================
   Spec Matrices & Tags
   ========================================================================== */

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.spec-item {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.spec-label {
  font-size: 10px;
  font-family: var(--mono-font);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.spec-value {
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.45;
}

.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 20px;
}

.stack-tag {
  font-family: var(--mono-font);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* ==========================================================================
   Manifesto / Philosophy Card
   ========================================================================== */

.manifesto-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 10px;
  padding: 24px 28px;
}

.manifesto-card blockquote {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 400;
  line-height: 1.65;
}

/* ==========================================================================
   Contact / Endpoints Block
   ========================================================================== */

.contact-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.contact-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.link-row a {
  font-size: 13px;
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: all 0.15s ease;
}

.link-row a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 640px) {
  main { 
    padding-top: 48px; 
  }
  
  .card { 
    padding: 20px; 
  }
  
  .card-header { 
    flex-direction: column; 
    gap: 6px; 
  }
  
  .source-link { 
    align-self: flex-start; 
  }
  
  .nav-right { 
    gap: 14px; 
  }
  
  nav { 
    gap: 12px; 
  }
}