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

:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --text: #1d1d1f;
  --text-muted: #6e6e73;
  --accent: #0071e3;
  --border: #d2d2d7;
  --max-w: 860px;
  --pad-section: 80px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  color-scheme: light;
}

html {
  scroll-behavior: smooth;
}

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

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

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

a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 640px) {
  :root {
    --pad-section: 48px;
  }
}

/* Navigation */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 15, 30, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.nav-name {
  font-weight: 600;
  font-size: 17px;
  color: #f0f9ff;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-name:hover {
  text-decoration: none;
  color: #38bdf8;
}

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

.nav-links a {
  font-size: 13px;
  color: rgba(240, 249, 255, 0.6);
  transition: color 0.15s;
}

.nav-links a:hover {
  color: #f0f9ff;
  text-decoration: none;
}

.nav-links .nav-cta {
  font-size: 13px;
  font-weight: 500;
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 6px 14px;
  border-radius: 980px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-lang {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.lang-active {
  font-weight: 600;
  color: #f0f9ff;
}

.lang-sep {
  color: rgba(255, 255, 255, 0.2);
}

.nav-links .nav-cta:hover {
  background: #38bdf8;
  color: #07101f;
}

.nav-lang a {
  color: rgba(240, 249, 255, 0.4);
  text-decoration: none;
}

.nav-lang a:hover {
  color: #f0f9ff;
}

@media (max-width: 640px) {
  .nav-links li:not(:last-child) {
    display: none;
  }
}

/* Hero */
.hero {
  padding: 100px 0 80px;
  background: linear-gradient(160deg, #07101f 0%, #0d1b2a 50%, #0a1628 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(56, 189, 248, 0.07) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 80%, rgba(99, 102, 241, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.hero-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.hero-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  flex-shrink: 0;
  border: 2px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.08), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.hero-title {
  text-align: center;
}

.hero-eyebrow {
  font-size: 14px;
  color: #38bdf8;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-name {
  font-size: clamp(52px, 8vw, 80px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: #f0f9ff;
  margin-bottom: 24px;
}

.hero-bio {
  font-size: 21px;
  color: rgba(240, 249, 255, 0.65);
  max-width: 560px;
  line-height: 1.5;
  margin: 0 auto 32px;
  text-align: center;
}

.hero-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 15px;
  flex-wrap: wrap;
}

.hero-sep {
  color: rgba(240, 249, 255, 0.2);
}

.hero-location {
  font-size: 15px;
  color: rgba(240, 249, 255, 0.45);
}

.hero-links a {
  color: #38bdf8;
}

@media (max-width: 640px) {
  .hero {
    padding: 64px 0 48px;
  }

  .hero-identity {
    align-items: center;
  }
}

/* Shared section styles */
.section {
  padding: var(--pad-section) 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 48px;
  text-align: center;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.timeline-item {
  position: relative;
  border-left: 2px solid var(--border);
  padding-left: 24px;
  transition: border-color 0.2s;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}

.timeline-item:hover {
  border-color: var(--accent);
}

.timeline-item:hover::before {
  background: var(--accent);
}

.timeline-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.timeline-company {
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
}

.timeline-period {
  font-size: 14px;
  color: var(--text-muted);
}

.timeline-role {
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 10px;
}

.timeline-bullets {
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
}

.timeline-bullets li + li {
  margin-top: 4px;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 36px;
}

.skill-group {
  padding-left: 12px;
  border-left: 2px solid transparent;
  transition: border-color 0.2s;
}

.skill-group:hover {
  border-color: var(--accent);
}

.skill-group-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 12px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid rgba(0, 113, 227, 0.2);
  padding: 4px 12px;
  border-radius: 980px;
}

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

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

.card-link {
  font-size: 14px;
  font-weight: 500;
  margin-top: 4px;
}

.card-verify {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  align-self: flex-start;
  transition: color 0.15s;
}

.card-verify:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
}

/* Story section */
.story-body {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.story-body p {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Cert thumbnail + lightbox */
.cert-thumb {
  display: block;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  width: 64px;
  height: 64px;
  min-width: 64px;
  max-width: 64px;
  border-radius: 8px;
  overflow: hidden;
  align-self: flex-start;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.cert-thumb:hover {
  transform: scale(1.08);
}

.cert-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 8px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.lightbox-close:hover {
  opacity: 1;
}

/* Accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Story history dropdown */
.story-history {
  margin-top: 24px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.story-history-toggle {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.story-history-toggle::-webkit-details-marker {
  display: none;
}

.story-history-toggle::before {
  content: '+ ';
}

details[open] .story-history-toggle::before {
  content: '- ';
}

.history-list {
  list-style: none;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.history-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
}

.history-company {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.history-period {
  font-size: 13px;
  color: var(--text-muted);
}

.history-role {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* In-progress cert card */
.card.in-progress {
  border-color: rgba(0, 113, 227, 0.35);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.08);
}

.in-progress-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(0, 113, 227, 0.1);
  border: 1px solid rgba(0, 113, 227, 0.25);
  padding: 3px 9px;
  border-radius: 980px;
}

.cert-thumb-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid rgba(0, 113, 227, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  align-self: flex-start;
}

.progress-bar-wrap {
  background: rgba(0, 113, 227, 0.08);
  border-radius: 980px;
  height: 5px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 15%;
  background: linear-gradient(90deg, #0071e3, #38bdf8);
  border-radius: 980px;
  animation: pulse-progress 2s ease-in-out infinite alternate;
}

@keyframes pulse-progress {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

.progress-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Homelab & Training cards */
.card-icon-pi {
  background: linear-gradient(135deg, #0d1b2a, #1e3a5f);
}

.card-icon-thm {
  background: linear-gradient(135deg, #1a0a0a, #2d1515);
  overflow: hidden;
}

.card-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.progress-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.stat-row {
  display: flex;
  gap: 24px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.card-bullets {
  padding-left: 18px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

.card-bullets li + li {
  margin-top: 2px;
}
