:root {
  --bg: #030406;
  --surface: #090c12;
  --surface-alt: #0d121b;
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  --cyan: #38bdf8;
  --cyan-soft: rgba(56, 189, 248, 0.14);
  --cobalt: #0f4c81;
  --red: #f43f5e;
  --red-soft: rgba(244, 63, 94, 0.14);
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.14);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.14);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
  --radius: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  padding-top: 68px;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

section[id],
article[id],
div[id] {
  scroll-margin-top: 88px;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 40px 40px;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(900px 480px at 14% -5%, rgba(15, 76, 129, 0.24), transparent 65%),
    radial-gradient(720px 440px at 88% 12%, rgba(56, 189, 248, 0.08), transparent 65%);
}

.container {
  width: min(1160px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.mono {
  font-family: var(--font-mono);
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(3, 4, 6, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.96rem;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(15, 41, 66, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: var(--cyan);
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-btn.is-active {
  background: var(--cobalt);
  color: #ffffff;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
}

/* Sections */
.section {
  padding: 4.5rem 0;
}

.section-head {
  margin-bottom: 2.2rem;
  max-width: 720px;
}

.section-head.compact {
  margin-bottom: 1.5rem;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--cyan);
}

.section-title {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.section-desc {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.98rem;
}

/* Hero */
.hero {
  padding-top: 4rem;
  padding-bottom: 3.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.92fr);
  gap: 2.5rem;
  align-items: center;
}

.hero-content,
.hero-card,
.case-body,
.diagram-frame,
.metric-item,
.timeline-card,
.skill-card {
  min-width: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  background: rgba(15, 41, 66, 0.45);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #bae6fd;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  margin-bottom: 1.25rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
}

.hero-title {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.6vw, 3.35rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  margin: 0 0 1.15rem;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
}

.hero-lead {
  margin: 0 0 1.8rem;
  color: var(--text-muted);
  font-size: 1.02rem;
  max-width: 62ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.52rem 0.9rem;
  font-size: 0.84rem;
  border-radius: 8px;
}

.btn-primary {
  background: var(--cobalt);
  border-color: rgba(56, 189, 248, 0.45);
  color: #ffffff;
}

.btn-primary:hover {
  background: #145ea1;
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface-alt);
  border-color: var(--border-strong);
}

/* Hero Right Panel */
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.55);
}

.window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.05rem;
  background: #06080d;
  border-bottom: 1px solid var(--border);
}

.window-dots {
  display: flex;
  gap: 6px;
}

.window-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot-red { background: var(--red); }
.dot-amber { background: #f59e0b; }
.dot-emerald { background: var(--emerald); }

.window-title {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
}

.metric-list {
  display: grid;
  gap: 0.85rem;
  padding: 1.1rem;
}

.metric-item {
  display: grid;
  gap: 0.25rem;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.metric-item:hover {
  transform: translateY(-2px);
}

.metric-item.tone-red:hover { border-color: rgba(244, 63, 94, 0.65); }
.metric-item.tone-emerald:hover { border-color: rgba(16, 185, 129, 0.65); }
.metric-item.tone-violet:hover { border-color: rgba(167, 139, 250, 0.65); }

.metric-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.tone-red .metric-tag { color: #fda4af; }
.tone-emerald .metric-tag { color: #6ee7b7; }
.tone-violet .metric-tag { color: #ddd6fe; }

.metric-value {
  font-size: 0.98rem;
  font-weight: 700;
}

.metric-sub {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.hero-card-foot {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.hero-card-foot-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  margin-right: auto;
}

.hero-card-link {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.hero-card-link:hover {
  border-color: rgba(56, 189, 248, 0.55);
  color: var(--cyan);
}

/* Case Studies */
.cases-stack {
  display: grid;
  gap: 2rem;
}

.cases-subhead {
  margin: 3.1rem 0 1.65rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.cases-subhead .eyebrow {
  margin-bottom: 0.35rem;
}

.cases-subhead-title {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: clamp(1.28rem, 2.3vw, 1.62rem);
  line-height: 1.25;
}

.cases-subhead-desc {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.94rem;
}

.case-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.65rem;
  position: relative;
  overflow: hidden;
}

.case-card::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
}

.case-card.accent-red::before { background: linear-gradient(90deg, var(--red), transparent 70%); }
.case-card.accent-emerald::before { background: linear-gradient(90deg, var(--emerald), transparent 70%); }
.case-card.accent-violet::before { background: linear-gradient(90deg, var(--violet), transparent 70%); }
.case-card.accent-cyan::before { background: linear-gradient(90deg, var(--cyan), transparent 70%); }
.case-card.accent-amber::before { background: linear-gradient(90deg, var(--amber), transparent 70%); }

.case-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.case-badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
}

.badge-red {
  background: var(--red-soft);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #fda4af;
}

.badge-emerald {
  background: var(--emerald-soft);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
}

.badge-violet {
  background: var(--violet-soft);
  border: 1px solid rgba(167, 139, 250, 0.45);
  color: #ddd6fe;
}

.badge-cyan {
  background: var(--cyan-soft);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}

.badge-amber {
  background: var(--amber-soft);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fcd34d;
}

.case-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.case-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
}

.case-title {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-size: 1.38rem;
  line-height: 1.25;
}

.case-summary {
  margin: 0 0 1.15rem;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.case-pillars {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}

.pillar {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.pillar h4 {
  margin: 0 0 0.28rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pillar p {
  margin: 0;
  font-size: 0.87rem;
  color: var(--text-muted);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-bottom: 1.2rem;
}

.tag-row span {
  padding: 0.24rem 0.58rem;
  border-radius: 6px;
  background: #06080d;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* Diagram Preview Frame */
.diagram-frame {
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
  background: #020203;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.diagram-frame:hover {
  border-color: rgba(56, 189, 248, 0.55);
  transform: translateY(-2px);
}

.diagram-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.52rem 0.85rem;
  background: #06080d;
  border-bottom: 1px solid var(--border);
}

.diagram-path {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
}

.diagram-zoom-chip {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.14rem 0.52rem;
  border-radius: 999px;
  background: rgba(15, 76, 129, 0.45);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #bae6fd;
}

.diagram-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1600 / 880;
  object-fit: contain;
}

/* Expandable Details Table */
.case-details {
  margin-top: 1.3rem;
  border-top: 1px solid var(--border);
  padding-top: 0.95rem;
}

.case-details summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--cyan);
  user-select: none;
}

.details-inner {
  margin-top: 0.95rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background: #06080d;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  background: var(--surface-alt);
}

tr:last-child td {
  border-bottom: 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #7dd3fc;
}

.details-note {
  margin: 0.8rem 0 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Skills */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  padding: 0.46rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.filter-btn.is-active {
  background: var(--cobalt);
  border-color: rgba(56, 189, 248, 0.5);
  color: #ffffff;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem;
}

.skill-card-wide {
  grid-column: 1 / -1;
}

.skill-card.is-hidden {
  display: none;
}

.skill-card h3 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.04rem;
}

.skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
}

.skill-chips span {
  padding: 0.34rem 0.68rem;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* Experience & Education */
.two-col-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  align-items: start;
}

.timeline {
  display: grid;
  gap: 1.1rem;
}

.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1.35rem;
}

.timeline-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.timeline-top h3 {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 700;
}

.time-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.18rem 0.58rem;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.pill-cyan {
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.38);
}

.pill-emerald {
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.38);
}

.timeline-org {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: var(--cyan);
}

.clean-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Contact */
.contact-card {
  background: linear-gradient(135deg, rgba(15, 41, 66, 0.42), var(--surface) 60%);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 20px;
  padding: 2.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.65rem 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 2, 3, 0.88);
  backdrop-filter: blur(6px);
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(1320px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #06080d;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 28px 68px rgba(0, 0, 0, 0.85);
}

.lightbox-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.lightbox-head h3 {
  margin: 0;
  font-size: 1rem;
  font-family: var(--font-display);
}

.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.lightbox-body {
  padding: 1rem;
  overflow: auto;
  background: #020203;
}

.lightbox-body img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Responsive */
@media (max-width: 960px) {
  .hero-grid,
  .case-grid,
  .two-col-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .container {
    width: min(1160px, calc(100% - 1.5rem));
  }

  .brand {
    gap: 0.45rem;
    font-size: 0.86rem;
    min-width: 0;
  }

  .brand-badge {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.85rem 1.25rem 1.15rem;
    background: rgba(9, 12, 18, 0.98);
    border-bottom: 1px solid var(--border);
    display: none;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding: 0.5rem 0.25rem;
  }

  .skills-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .status-pill {
    max-width: 100%;
    font-size: 0.72rem;
    padding: 0.36rem 0.7rem;
  }

  .section {
    padding: 3.1rem 0;
  }

  .case-card,
  .contact-card {
    padding: 1.15rem;
  }
}

