/* ===========================================
   ZULFI PORTFOLIO — Stylesheet
   Design: ENERGY 2 / RHYTHM 3 / MOTION 1
   Aesthetic: Homelab / Systems / Authentic
   Fonts: Inter (body/headings) + JetBrains Mono (tech/code)
   Theme: Dark default + Light mode toggle (R-21, R-34)
   Accessibility: WCAG AA, :focus-visible, prefers-reduced-motion
   =========================================== */

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

/* --- DARK THEME (DEFAULT) --- */
:root {
  --bg-deep: #08080d;
  --bg-surface: #0f0f17;
  --bg-elevated: #161622;
  --bg-card: #13131c;
  --bg-terminal: #0b0b12;

  --cyan: #00e5ff;
  --cyan-dim: rgba(0, 229, 255, 0.12);
  --cyan-border: rgba(0, 229, 255, 0.3);
  --violet: #8b5cf6;
  --violet-dim: rgba(139, 92, 246, 0.12);
  --green: #10b981;
  --green-dim: rgba(16, 185, 129, 0.12);
  --orange: #f59e0b;
  --orange-dim: rgba(245, 158, 11, 0.12);

  --text-primary: #f1f1f7;
  --text-secondary: #9ea0b8;
  --text-muted: #646680;

  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --section-pad: 96px;
  --container-max: 1160px;
  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 6px;

  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.4);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- LIGHT THEME OVERRIDES (R-34: verified working, no broken styles) --- */
[data-theme="light"] {
  --bg-deep: #f5f6fa;
  --bg-surface: #eef0f6;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-terminal: #1a1c24;

  --cyan: #0284c7;
  --cyan-dim: rgba(2, 132, 199, 0.1);
  --cyan-border: rgba(2, 132, 199, 0.35);
  --violet: #6d28d9;
  --violet-dim: rgba(109, 40, 217, 0.1);
  --green: #059669;
  --green-dim: rgba(5, 150, 105, 0.1);
  --orange: #d97706;
  --orange-dim: rgba(217, 119, 6, 0.1);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --border: rgba(15, 23, 42, 0.1);
  --border-hover: rgba(15, 23, 42, 0.22);

  --shadow-subtle: 0 4px 18px rgba(15, 23, 42, 0.06);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--cyan) var(--bg-deep);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

/* Accessibility: focus indicator (R-32) */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* Cursor pointer affordances (R-39) */
a[href],
button,
summary,
select,
label[for],
input[type="checkbox"],
input[type="radio"],
[role="button"],
[role="tab"] {
  cursor: pointer;
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
}

/* Prefers reduced motion (R-39) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-canvas {
    display: none;
  }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--cyan); border-radius: 3px; }

/* Links */
a {
  color: var(--cyan);
  text-decoration: none;
  transition: color 0.15s var(--ease);
}
a:hover {
  color: #38bdf8;
}

img {
  max-width: 100%;
  display: block;
}

/* Layout utilities */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.section-block {
  padding: var(--section-pad) 0;
  position: relative;
}

.bg-surface {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Section headings & tags (R-06) */
.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.section-heading {
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 14px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.section-intro {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.75;
  margin-bottom: 40px;
}

.text-cyan {
  color: var(--cyan);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  border: none;
  text-decoration: none;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}

.btn-primary {
  background: var(--cyan);
  color: #040810;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 229, 255, 0.3);
  color: #040810;
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-hover);
}
.btn-outline:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-2px);
}
.btn-outline:active {
  transform: translateY(0);
}

/* Tech tag chips */
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tech-tag {
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}

[data-theme="light"] .tech-tag {
  background: rgba(15, 23, 42, 0.04);
}

.tech-tag:hover {
  border-color: var(--cyan-border);
  color: var(--cyan);
}

/* ===========================================
   NAVIGATION & THEME TOGGLE
   =========================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: background 0.25s var(--ease), padding 0.25s var(--ease), border-color 0.25s var(--ease);
}

.navbar.scrolled {
  background: rgba(8, 8, 13, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

[data-theme="light"] .navbar.scrolled {
  background: rgba(245, 246, 250, 0.9);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-primary);
  text-decoration: none;
}

.logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  position: relative;
  transition: color 0.15s var(--ease);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--cyan);
  transition: width 0.2s var(--ease);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}
.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme Toggle Button (R-34) */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: var(--text-primary);
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}

.theme-toggle:hover {
  border-color: var(--cyan);
  transform: translateY(-1px);
}

/* Light mode icon display toggle */
[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="light"] .theme-icon-light { display: inline-block; }
:root:not([data-theme="light"]) .theme-icon-dark { display: inline-block; }
:root:not([data-theme="light"]) .theme-icon-light { display: none; }

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
}

.mobile-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

/* ===========================================
   HERO SECTION & TERMINAL
   =========================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 100px;
  padding-bottom: 60px;
}

.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.hero-prompt-label {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-surface);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.prompt-user { color: var(--cyan); font-weight: 600; }
.prompt-host { color: var(--violet); font-weight: 600; }
.prompt-path { color: var(--green); font-weight: 600; }
.prompt-char { color: var(--text-primary); margin-right: 6px; }

.hero-name {
  font-size: clamp(2.8rem, 6.5vw, 4.2rem);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}

.hero-title {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 28px;
  max-width: 580px;
}

.hero-buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.hero-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.interest-tag {
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.interest-tag:hover {
  border-color: var(--cyan-border);
  color: var(--cyan);
}

/* Terminal Component (R-06, safe mock data) */
.hero-terminal {
  background: var(--bg-terminal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

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

.terminal-bar {
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.terminal-dot.red { background: #ef4444; }
.terminal-dot.yellow { background: #f59e0b; }
.terminal-dot.green { background: #10b981; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 6px;
}

.terminal-body {
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: #e2e8f0;
}

.terminal-line {
  margin-top: 10px;
}
.terminal-line:first-child {
  margin-top: 0;
}

.t-prompt {
  color: var(--green);
  font-weight: 700;
  margin-right: 6px;
}
.t-cmd {
  color: #f8fafc;
  font-weight: 600;
}
.t-output {
  color: #cbd5e1;
  margin-top: 4px;
  font-size: 0.78rem;
}
.t-dim { color: #94a3b8; }
.t-cyan { color: var(--cyan); font-weight: 600; }
.t-green { color: #34d399; font-weight: 600; }

.t-cursor {
  animation: blink 1s step-start infinite;
  color: var(--cyan);
  font-weight: 900;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ===========================================
   ABOUT SECTION
   =========================================== */
.about-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 52px;
  align-items: start;
}

.about-photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 16px;
}

.photo-placeholder svg {
  opacity: 0.35;
  color: var(--text-muted);
}

.photo-hint {
  font-size: 0.75rem;
}

.photo-hint code {
  color: var(--cyan);
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

.about-meta {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}
.meta-k {
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.meta-v {
  color: var(--text-primary);
  font-weight: 600;
}

.about-text p {
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.85;
  margin-bottom: 18px;
}

.about-text strong.text-cyan {
  color: var(--cyan);
  font-weight: 600;
}

.about-badges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 32px;
}

.badge-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.badge-item:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.badge-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.badge-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
}

.badge-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ===========================================
   HOMELAB & TOPOLOGY SECTION (R-05: distinct composition)
   =========================================== */
.topology-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-subtle);
  overflow-x: auto;
}

.topology-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.topology-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  display: inline-block;
}

.topology-svg {
  width: 100%;
  height: auto;
  min-width: 720px;
  display: block;
}

.topo-box {
  fill: var(--bg-elevated);
  stroke-width: 1.5;
  transition: fill 0.2s var(--ease);
}

.topo-box.active {
  stroke-width: 2;
  fill: rgba(0, 229, 255, 0.05);
}

.topo-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 12px;
  fill: var(--text-primary);
  text-anchor: middle;
}

.topo-sub {
  font-family: var(--font-sans);
  font-size: 10px;
  fill: var(--text-secondary);
  text-anchor: middle;
}

.topo-ip {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--cyan);
  text-anchor: middle;
}

.topo-badge {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  fill: var(--cyan);
  text-anchor: middle;
}

.topo-badge.violet {
  fill: var(--violet);
}

.topo-badge.green {
  fill: var(--green);
}

.topo-zone-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}

.topo-stack {
  fill: var(--bg-surface);
  stroke: var(--border);
  stroke-width: 1;
}

.topo-stack-text {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  fill: var(--text-secondary);
  text-anchor: middle;
}

/* Layer Cards (RHYTHM 3: colored top borders per layer) */
.infra-layers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.infra-layer {
  padding: 28px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}

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

.infra-layer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.layer-cyan::before { background: var(--cyan); }
.layer-violet::before { background: var(--violet); }
.layer-green::before { background: var(--green); }

.layer-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}
.layer-cyan .layer-num { color: var(--cyan); }
.layer-violet .layer-num { color: var(--violet); }
.layer-green .layer-num { color: var(--green); }

.layer-title {
  font-size: 1.12rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.infra-layer p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 20px;
  flex-grow: 1;
}

.homelab-note {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
}

.note-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.homelab-note p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===========================================
   PROJECTS SECTION (R-05: varied composition)
   =========================================== */
.projects-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.project-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.project-item:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-subtle);
}

/* Differentiated card borders per project domain */
.project-homelab { border-top: 3px solid var(--cyan); }
.project-linux { border-top: 3px solid var(--violet); }
.project-security { border-top: 3px solid var(--orange); }

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.project-cat {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
}
.project-homelab .project-cat { color: var(--cyan); }
.project-linux .project-cat { color: var(--violet); }
.project-security .project-cat { color: var(--orange); }

.project-status {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}
[data-theme="light"] .project-status {
  background: rgba(15, 23, 42, 0.06);
}

.project-body {
  flex-grow: 1;
}

.project-body h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.project-body p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 18px;
}

.project-body .tech-tags {
  margin-bottom: 20px;
}

.project-footer {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: auto;
}

.project-link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.15s var(--ease);
}
.project-link:hover {
  gap: 8px;
}

/* ===========================================
   EXPERIENCE / TIMELINE SECTION
   =========================================== */
.timeline {
  position: relative;
  padding-left: 36px;
  max-width: 820px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border-hover);
  border-radius: 1px;
}

.timeline-entry {
  position: relative;
  padding-bottom: 36px;
}
.timeline-entry:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -32px;
  top: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  background: var(--bg-deep);
  transition: background-color 0.2s var(--ease);
}

/* Alternate marker colors for visual rhythm (RHYTHM 3) */
.timeline-entry:nth-child(even) .timeline-marker {
  border-color: var(--violet);
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-subtle);
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.timeline-card:hover {
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--cyan);
  font-weight: 600;
}

.timeline-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}
[data-theme="light"] .timeline-badge {
  background: rgba(15, 23, 42, 0.06);
}

.timeline-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.timeline-org {
  font-size: 0.88rem;
  color: var(--violet);
  font-weight: 600;
  margin-bottom: 10px;
}

.timeline-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ===========================================
   CONTACT SECTION
   =========================================== */
.contact-channels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  text-decoration: none;
  box-shadow: var(--shadow-subtle);
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}

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

.contact-card-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-card-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.contact-type {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.contact-val {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--cyan);
  word-break: break-all;
}

.contact-note {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 4px;
}

/* ===========================================
   FOOTER
   =========================================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  background: var(--bg-deep);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.footer-meta {
  display: flex;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.footer-status {
  color: var(--green);
  font-weight: 600;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer-copy strong {
  color: var(--text-primary);
}

/* ===========================================
   RESPONSIVE (antislop-layoutmobile)
   =========================================== */
@media (max-width: 1024px) {
  .hero .container {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .hero-terminal {
    max-width: 600px;
  }
  .about-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .about-photo-col {
    max-width: 240px;
  }
  .infra-layers {
    grid-template-columns: 1fr;
  }
  .projects-list {
    grid-template-columns: 1fr;
  }
  .contact-channels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --section-pad: 64px;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 260px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    gap: 22px;
    transition: right 0.3s var(--ease);
    z-index: 999;
  }

  .nav-links.open {
    right: 0;
  }

  .mobile-toggle {
    display: flex;
    z-index: 1001;
  }

  .mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .mobile-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero {
    padding-top: 80px;
    min-height: auto;
  }

  .hero-name {
    font-size: clamp(2.2rem, 8.5vw, 3.2rem);
  }

  .about-badges {
    grid-template-columns: 1fr;
  }

  .timeline {
    padding-left: 28px;
  }
  .timeline-marker {
    left: -24px;
  }
}

@media (max-width: 480px) {
  .hero-buttons {
    flex-direction: column;
  }
  .btn {
    width: 100%;
    justify-content: center;
  }
}
