@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* ─── Design Tokens ──────────────────────────────────────────────────── */
:root {
  --bg:             #f3f2ef;
  --bg-soft:        #edecea;
  --surface:        #ffffff;
  --surface-soft:   #fafaf8;
  --text:           #0c1525;
  --text-soft:      #46576c;
  --text-muted:     #8899aa;
  --line:           #dde3ec;
  --primary:        #1a5fd8;
  --primary-dark:   #1348b0;
  --primary-light:  #dbeafe;
  --amber:          #d97706;
  --amber-bg:       #fef3c7;
  --amber-border:   #fde68a;
  --green:          #059669;
  --green-bg:       #d1fae5;
  --shadow:         0 4px 18px rgba(12, 21, 37, 0.07);
  --shadow-lg:      0 14px 44px rgba(12, 21, 37, 0.12);
  --shadow-xl:      0 24px 64px rgba(12, 21, 37, 0.17);
  --radius:         18px;
  --font-display:   'IBM Plex Sans', system-ui, sans-serif;
  --font-body:      'IBM Plex Sans', system-ui, sans-serif;
}

/* ─── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); }
a:hover { text-decoration: none; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); }

/* ─── Scroll Reveal ──────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.52s ease, transform 0.52s ease;
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }
.reveal-d4 { transition-delay: 0.32s; }

/* keep fade-in as alias for backwards compat on pages not yet updated */
.fade-in { opacity: 0; transform: translateY(22px); transition: opacity 0.55s ease, transform 0.55s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.fade-in:nth-child(2) { transition-delay: 0.08s; }
.fade-in:nth-child(3) { transition-delay: 0.16s; }
.fade-in:nth-child(4) { transition-delay: 0.24s; }

/* ─── Hero ───────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(140deg, #060e1d 0%, #0b1730 50%, #112244 100%);
  color: white;
  padding: 72px 20px 60px;
}

/* dot grid */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.055) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* ambient glow */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 70% at 88% 14%, rgba(37,99,235,0.22) 0%, transparent 60%),
    radial-gradient(ellipse 35% 50% at 10% 86%, rgba(14,165,233,0.09) 0%, transparent 55%);
  pointer-events: none;
}

.hero-inner,
.site-footer-inner,
.site-nav-inner { position: relative; z-index: 1; }

.hero-inner {
  max-width: 1140px;
  margin: 0 auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 36px;
  align-items: stretch;
}

/* ─── Availability Badge ─────────────────────────────────────────────── */
.availability-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 5px 14px 5px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #a7f3d0;
  margin-bottom: 18px;
  width: fit-content;
}
.availability-badge::before {
  content: '';
  display: block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52,211,153,0.28);
  animation: pulse-dot 2.2s ease infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%,100% { box-shadow: 0 0 0 3px rgba(52,211,153,0.28); }
  50%      { box-shadow: 0 0 0 7px rgba(52,211,153,0.08); }
}

/* ─── Hero copy ──────────────────────────────────────────────────────── */
.hero-copy h1 {
  margin: 0 0 12px;
  font-size: clamp(2.6rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.tagline {
  font-size: 1.05rem;
  margin: 0 0 18px;
  color: #94b4e8;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.intro {
  max-width: 640px;
  margin-bottom: 28px;
  color: #c8d8f0;
  font-size: 1rem;
  line-height: 1.76;
}

.hero-actions,
.resume-actions,
.link-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ─── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.93rem;
  font-family: var(--font-body);
  border: 2px solid transparent;
  transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
  cursor: pointer;
}
.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(26,95,216,0.35);
  color: white;
}

/* dark-context ghost */
.btn-secondary {
  background: transparent;
  border-color: rgba(255,255,255,0.26);
  color: white;
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.10);
  color: white;
}

/* light-context outline */
.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: white;
}

/* ─── Hero Panel ─────────────────────────────────────────────────────── */
.hero-panel {
  background: rgba(255,255,255,0.075);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 22px;
  padding: 26px;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.hero-panel h2 {
  margin: 0 0 10px;
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  border: none; padding: 0;
  letter-spacing: -0.01em;
}

.hero-panel p { color: #c0d4ee; font-size: 0.97rem; margin: 0 0 18px; }

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
}

.metric {
  background: rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 14px 10px;
  border: 1px solid rgba(255,255,255,0.10);
  text-align: center;
}
.metric strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.03em;
}
.metric span {
  display: block;
  color: #93b4dd;
  font-size: 0.78rem;
  line-height: 1.35;
  margin-top: 3px;
}

/* ─── Sticky Nav ─────────────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(243,242,239,0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(180,190,210,0.28);
  transition: box-shadow 0.2s;
}
.site-nav.scrolled { box-shadow: 0 2px 18px rgba(12,21,37,0.09); }

.site-nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 20px;
}

.site-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.03em;
}

nav { display: flex; gap: 4px; flex-wrap: wrap; }

nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}
nav a:hover,
nav a.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* ─── Sections ───────────────────────────────────────────────────────── */
section {
  max-width: 1140px;
  margin: 0 auto;
  padding: 56px 20px 12px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 700;
  font-family: var(--font-display);
  margin-bottom: 8px;
}

h2 {
  font-family: var(--font-display);
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.section-subtitle, .meta, .lead { color: var(--text-soft); margin: 0; }

/* ─── Grids ──────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 24px; }
.list-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; }

/* ─── Cards ──────────────────────────────────────────────────────────── */
.card, .feature-card, .list-card, .surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card { padding: 24px; margin-bottom: 18px; }

.feature-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s, box-shadow 0.22s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.feature-card-body { padding: 22px; }

.feature-card h3, .card h3 {
  font-family: var(--font-display);
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.feature-card h3 a { color: var(--text); text-decoration: none; }
.feature-card h3 a:hover { color: var(--primary); }

.feature-card p, .card p, .list-card p,
.project-page p, .resume-page p,
.project-page li, .resume-page li { color: var(--text-soft); }

.list-card {
  padding: 22px;
  border-radius: 18px;
}
.list-card h3 {
  font-family: var(--font-display);
  margin-top: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.list-card ul, .project-page ul, .resume-page ul { padding-left: 20px; }

/* ─── Thumb / image ──────────────────────────────────────────────────── */
.thumb-wrap {
  position: relative;
  overflow: hidden;
  background: #0d1629;
  aspect-ratio: 16/9;
}
.thumb-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.feature-card:hover .thumb-wrap img { transform: scale(1.04); }

.thumb-badge {
  position: absolute;
  top: 14px; left: 14px;
  background: rgba(10,18,40,0.78);
  color: white;
  border: 1px solid rgba(255,255,255,0.16);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  backdrop-filter: blur(4px);
}

/* ─── Pills ──────────────────────────────────────────────────────────── */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--primary-light);
  border: 1px solid #bfdbfe;
}

/* ─── Tech Stack ─────────────────────────────────────────────────────── */
.tech-stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.tech-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text-soft);
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.tech-item:hover {
  border-color: #bfdbfe;
  color: var(--primary);
  box-shadow: 0 4px 16px rgba(26,95,216,0.09);
}
.tech-icon { font-size: 1.1rem; flex-shrink: 0; width: 20px; text-align: center; }

/* legacy tech-stack from v0.1 */
.tech-item-category {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 4px;
}
.tech-item-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.tech-category-label {
  font-size: 0.77rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 24px 0 10px;
}

/* ─── Certifications ─────────────────────────────────────────────────── */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.cert-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cert-card:hover {
  border-color: var(--amber-border);
  box-shadow: 0 4px 20px rgba(217,119,6,0.09);
}

.cert-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.cert-body { flex: 1; min-width: 0; }

.cert-card-title, .cert-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 3px;
  display: block;
}
.cert-card-issuer {
  font-size: 0.78rem;
  color: var(--text-soft);
  display: block;
  margin-bottom: 3px;
}
.cert-card-date, .cert-year {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
}

/* ─── Contact Grid ───────────────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.contact-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.contact-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.contact-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 3px;
}
.contact-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.contact-value:hover { color: var(--primary); }

/* ─── Career Timeline ────────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 28px;
  margin-top: 8px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), #c7d9ff);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding: 0 0 32px 20px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -22px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-role {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  margin: 0 0 2px;
}
.timeline-company {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.95rem;
  margin: 0 0 4px;
}
.timeline-dates {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin: 0 0 10px;
  font-weight: 500;
}
.timeline-desc { color: var(--text-soft); font-size: 0.95rem; margin: 0; }

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.timeline-tag {
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--primary-light);
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--primary);
}

/* ─── Section divider ────────────────────────────────────────────────── */
.section-divider {
  border: none;
  border-top: 1px solid var(--line);
  max-width: 1140px;
  margin: 20px auto 0;
}

/* ─── Project / Resume pages ─────────────────────────────────────────── */
.project-page, .resume-page {
  max-width: 1140px;
  margin: 0 auto;
  padding: 40px 20px 24px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 22px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}
.back-link:hover { text-decoration: none; }

.page-header { margin-bottom: 28px; }
.page-header h1 {
  font-family: var(--font-display);
  margin: 4px 0 8px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.callout {
  background: linear-gradient(135deg, #e8f1ff 0%, #f0f7ff 100%);
  border: 1px solid #c7dcff;
  border-radius: 16px;
  padding: 16px 20px;
  margin: 0 0 24px;
  font-size: 0.95rem;
}

.diagram-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
  margin: 0 0 24px;
}
.diagram-card h3, .diagram-card h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.diagram-card h3 { margin-top: 0; font-size: 1.1rem; }
.diagram-card h4 { font-size: 0.95rem; margin: 20px 0 6px; }

.asset-image {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 10px 0 8px;
  box-shadow: var(--shadow);
  cursor: zoom-in;
  transition: transform 0.18s, box-shadow 0.18s;
  background: #fff;
}
.asset-image:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }

.zoom-hint {
  display: block;
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ─── ASCT arch flow ─────────────────────────────────────────────────── */
.arch-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 16px 0;
}
.arch-step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  box-shadow: var(--shadow);
}
.arch-arrow { padding: 0 8px; color: var(--text-muted); font-size: 1rem; }

/* ─── Education cards ────────────────────────────────────────────────── */
.edu-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }

.edu-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.edu-institution {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 3px;
}
.edu-degree { font-size: 0.88rem; color: var(--text-soft); margin-bottom: 3px; }
.edu-years  { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.edu-note   { font-size: 0.82rem; color: var(--green); font-weight: 600; margin-top: 5px; }

/* ─── Footer ─────────────────────────────────────────────────────────── */
.site-footer {
  margin-top: 60px;
  background: #060e1d;
  color: white;
}
.site-footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 28px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.site-footer p, .site-footer a {
  color: #7a92b2;
  margin: 0;
  font-size: 0.88rem;
}
.site-footer a:hover { color: #cbd5e1; }

/* ─── Lightbox ───────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(2,6,20,0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox-content {
  position: relative;
  max-width: min(96vw,1600px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.lightbox img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  background: white;
}
.lightbox-caption { color: #93b4e0; font-size: 0.92rem; text-align: center; }
.lightbox-close {
  position: absolute;
  top: -10px; right: -10px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  background: rgba(255,255,255,0.92);
  color: #0d1526;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 820px) {
  .hero-grid, .grid-2, .grid-3, .list-grid, .edu-grid {
    grid-template-columns: 1fr;
  }
  .hero { padding-top: 56px; }
  .hero-metrics { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .site-nav-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 540px) {
  .hero-metrics { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: 1fr; }
  .tech-stack-grid { grid-template-columns: repeat(2,1fr); }
}
