/* ==========================================================================
   Dr. Tamas Fekete — Causal AI Portfolio
   Dark-first theme · Glassmorphism · Scroll reveal
   ========================================================================== */

/* ---------- Theme tokens ---------- */
:root {
  --bg: #0a0f1c;
  --bg-gradient: linear-gradient(165deg, #0a0f1c 0%, #0d1526 40%, #0a1220 100%);
  --surface: rgba(15, 23, 42, 0.55);
  --surface-elevated: rgba(22, 33, 55, 0.72);
  --surface-glass: rgba(15, 23, 42, 0.5);
  --border: rgba(148, 163, 184, 0.08);
  --border-hover: rgba(0, 212, 170, 0.22);
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --heading: #f1f5f9;
  --accent: #00d4aa;
  --accent-alt: #0ea5e9;
  --accent-dim: rgba(0, 212, 170, 0.08);
  --accent-glow: rgba(0, 212, 170, 0.12);
  --gradient: linear-gradient(135deg, #00d4aa 0%, #0ea5e9 50%, #818cf8 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 40px rgba(0, 212, 170, 0.08);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition: 260ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg: #f4f7fa;
  --bg-gradient: linear-gradient(165deg, #f4f7fa 0%, #e8eef4 40%, #f0f4f8 100%);
  --surface: rgba(255, 255, 255, 0.75);
  --surface-elevated: rgba(255, 255, 255, 0.88);
  --surface-glass: rgba(255, 255, 255, 0.6);
  --border: rgba(15, 23, 42, 0.08);
  --border-hover: rgba(13, 148, 136, 0.25);
  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --heading: #0f172a;
  --accent: #0d9488;
  --accent-alt: #0284c7;
  --accent-dim: rgba(13, 148, 136, 0.07);
  --accent-glow: rgba(13, 148, 136, 0.08);
  --gradient: linear-gradient(135deg, #0d9488 0%, #0284c7 50%, #6366f1 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 40px rgba(13, 148, 136, 0.05);
}

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

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

body {
  min-height: 100vh;
  color: var(--text);
  font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  background: var(--bg-gradient);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

ul {
  list-style: none;
}

h1, h2, h3 {
  color: var(--heading);
  line-height: 1.15;
  font-weight: 700;
}

/* ---------- Layout ---------- */
.container {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
}

/* ---------- Progress bar ---------- */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--gradient);
  z-index: 1001;
  transition: width 80ms linear;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 100px 0 60px;
}

.dag-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 20% 50%, rgba(0, 212, 170, 0.06), transparent),
    radial-gradient(ellipse 50% 50% at 80% 30%, rgba(14, 165, 233, 0.05), transparent);
  z-index: 1;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: min(100%, 38rem);
  max-width: 100%;
  margin-bottom: 20px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  gap: 4px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.hero-badge > span {
  width: 100%;
  white-space: normal;
}

.hero-tagline {
  display: block;
  min-width: 0;
  max-width: 100%;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.hero-credential {
  display: block;
  min-width: 0;
  max-width: 100%;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.hero-credential a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
  overflow-wrap: anywhere;
}

.hero-credential a:hover {
  color: var(--accent);
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.05;
  margin-bottom: 20px;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  max-width: 72ch;
  margin-bottom: 36px;
  color: var(--text-secondary);
  font-size: 1.08rem;
  line-height: 1.65;
}

/* Hero actions */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--accent);
  color: #0a0f1c;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: #00e8ba;
  border-color: #00e8ba;
  box-shadow: 0 0 24px rgba(0, 212, 170, 0.3);
  transform: translateY(-2px);
}

[data-theme="light"] .btn-primary {
  color: #fff;
}

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

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--accent-dim);
  transform: translateY(-2px);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  z-index: 2;
  animation: float 2.4s ease-in-out infinite;
}

.scroll-indicator svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-muted);
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ---------- Sticky Nav ---------- */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface-glass);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: box-shadow var(--transition);
}

.main-nav.scrolled {
  box-shadow: var(--shadow-md);
}

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

.nav-links {
  display: flex;
  gap: 6px;
}

.nav-link {
  position: relative;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.nav-link:hover {
  color: var(--text);
  background: var(--accent-dim);
}

.nav-link.active {
  color: #0a0f1c;
  background: var(--accent);
}

[data-theme="light"] .nav-link.active {
  color: #fff;
}

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

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--border-hover);
  background: var(--accent-dim);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* ---------- Sections ---------- */
.section {
  padding: 80px 0;
}

.section-label {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 8px;
}

.section-header {
  margin-bottom: 40px;
}

.section-desc {
  max-width: 72ch;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin-top: 12px;
}

/* ---------- About ---------- */
.about-intro {
  max-width: 84ch;
  margin-bottom: 40px;
}

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

.about-intro p:last-child {
  margin-bottom: 0;
}

.subsection-heading {
  margin: 42px 0 18px;
}

.subsection-heading h3 {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

/* Focus cards */
.focus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.focus-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition);
}

.focus-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-elevated);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.focus-card .card-tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.focus-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.focus-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* Industrial experience */
.industrial-experience {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.4fr);
  gap: 28px;
  align-items: start;
  margin-top: 36px;
}

.industrial-copy {
  padding-top: 4px;
}

.industrial-copy h3 {
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  margin-bottom: 14px;
}

.industrial-copy p {
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.65;
}

.industrial-note {
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid rgba(245, 158, 11, 0.18);
  border-left: 3px solid #f59e0b;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(245, 158, 11, 0.07);
}

.industrial-note strong {
  display: block;
  margin-bottom: 6px;
  color: var(--heading);
  font-size: 0.9rem;
}

.industrial-note span {
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.55;
}

.industrial-panel {
  display: grid;
  gap: 16px;
}

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

.industrial-metric {
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.04), transparent),
    var(--surface);
}

.industrial-metric strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  line-height: 1;
}

.industrial-metric span {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.industrial-layers {
  position: relative;
  display: grid;
  gap: 12px;
}

.industrial-layers::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 24px;
  width: 1px;
  background: linear-gradient(
    to bottom,
    rgba(0, 212, 170, 0.45),
    rgba(14, 165, 233, 0.16),
    rgba(245, 158, 11, 0.2)
  );
}

.industrial-layer {
  position: relative;
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: all var(--transition);
}

.industrial-layer:hover {
  border-color: var(--border-hover);
  background: var(--surface-elevated);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.layer-icon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border: 1px solid var(--border-hover);
  border-radius: 14px;
  background: var(--accent-dim);
  color: var(--accent);
}

.layer-icon svg {
  width: 26px;
  height: 26px;
}

.industrial-layer span {
  display: inline-block;
  margin-bottom: 5px;
  color: #f59e0b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.industrial-layer h4 {
  margin-bottom: 6px;
  color: var(--heading);
  font-size: 1rem;
}

.industrial-layer p {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.industrial-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.industrial-capabilities li {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.07);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
}

/* ---------- Why It Matters ---------- */
.section-intro {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 840px;
}

.pain-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 40px 0 56px;
}
.pain-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  transition: transform 0.25s, border-color 0.25s;
}
.pain-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}
.pain-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  color: var(--accent);
}
.pain-icon svg {
  width: 100%;
  height: 100%;
}
.pain-card h4 {
  font-size: 1rem;
  margin-bottom: 8px;
}
.pain-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* GenAI vs Causal AI */
.genai-block {
  margin: 0 0 56px;
}
.genai-block h3 {
  font-size: 1.25rem;
  margin-bottom: 20px;
}
.genai-roles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.genai-role {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  position: relative;
}
.genai-role.causal {
  border-color: var(--accent);
}
.role-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.genai-role.causal .role-badge {
  background: var(--accent);
  color: #000;
}
.genai-role.genai .role-badge {
  background: var(--border);
  color: var(--text);
}
.genai-role p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Examples */
.examples-header {
  margin-bottom: 28px;
}
.examples-header h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}
.examples-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.example-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  transition: transform 0.25s;
}
.example-card:hover {
  transform: translateY(-4px);
}
.example-card .card-tag {
  display: inline-block;
  background: var(--accent);
  color: #000;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.example-card h4 {
  font-size: 1.05rem;
  margin-bottom: 10px;
}
.example-symptom {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 20px;
  line-height: 1.5;
}
.example-compare {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 20px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.compare-col {
  flex: 1;
  padding: 16px;
}
.compare-col.correlation {
  background: rgba(255, 100, 100, 0.06);
}
.compare-col.causal {
  background: rgba(100, 255, 160, 0.08);
}
.compare-vs {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--surface);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.compare-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.compare-col.correlation .compare-label {
  color: #ff7070;
}
.compare-col.causal .compare-label {
  color: #5ddb8a;
}
.compare-action {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.compare-result {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.example-insight {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  font-style: italic;
  border-left: 3px solid var(--accent);
  padding-left: 14px;
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  gap: 16px;
}

/* Featured project */
.featured-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.04), rgba(14, 165, 233, 0.03));
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition);
}

.featured-card:hover {
  box-shadow: var(--shadow-lg), 0 0 60px rgba(0, 212, 170, 0.08);
  transform: translateY(-3px);
}

.featured-card .project-visual {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  border-right: 1px solid var(--border);
}

.featured-card .project-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-card .project-body {
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  width: fit-content;
}

.featured-label::before {
  content: "\2605";
  font-size: 0.68rem;
}

.featured-card h3 {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  margin-bottom: 14px;
}

.featured-card .project-summary {
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.6;
  margin-bottom: 18px;
}

.project-highlights {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.project-highlights li {
  position: relative;
  padding-left: 22px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.project-highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Regular project cards */
.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.project-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-elevated);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

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

.project-type {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project-card h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.project-card .project-summary {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 8px;
}

.project-card .project-detail {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.55;
  flex: 1;
}

.project-pwr {
  display: grid;
  gap: 10px;
  margin: 16px 0 4px;
}

.project-pwr div {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.project-pwr dt {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-pwr dd {
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.5;
}

/* Project links */
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  transition: all var(--transition);
}

.project-link:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-1px);
}

.project-link svg {
  width: 14px;
  height: 14px;
}

/* ---------- Publications ---------- */
.publications-grid {
  display: grid;
  gap: 14px;
}

.pub-card {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition);
}

.pub-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-elevated);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.pub-year {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 2px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.6;
  line-height: 1;
}

.pub-body h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  line-height: 1.35;
}

.pub-body h3 a {
  transition: color var(--transition);
}

.pub-body h3 a:hover {
  color: var(--accent);
}

.pub-venue {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.pub-authors {
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.5;
  margin-bottom: 6px;
}

.pub-note {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

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

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

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

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
  transition: color var(--transition);
}

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

.footer-link svg {
  width: 16px;
  height: 16px;
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }
.reveal-delay-4 { transition-delay: 320ms; }
.reveal-delay-5 { transition-delay: 400ms; }

/* Hero entrance */
.hero-content > * {
  opacity: 0;
  transform: translateY(20px);
  animation: hero-enter 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.2s; }
.hero-content > *:nth-child(3) { animation-delay: 0.35s; }
.hero-content > *:nth-child(4) { animation-delay: 0.5s; }
.hero-content > *:nth-child(5) { animation-delay: 0.65s; }

@keyframes hero-enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scroll-indicator {
  opacity: 0;
  animation: fade-in 0.6s 1.4s ease forwards;
}

@keyframes fade-in {
  to { opacity: 1; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-content > * {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .scroll-indicator {
    opacity: 1;
    animation: none;
  }

  .focus-card,
  .project-card,
  .featured-card,
  .pub-card,
  .btn,
  .nav-link,
  .theme-toggle,
  .project-link {
    transition: none;
  }
}

/* ---------- Diagrams ---------- */
.diagram-block {
  margin-top: 48px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ---------- Maintenance mode ---------- */
body.maintenance-mode {
  display: block;
  min-height: 100vh;
  padding: 20px 24px;
}

body.maintenance-mode > *:not(.maintenance-page) {
  display: none !important;
}

.maintenance-page {
  width: auto;
  text-align: left;
}

.maintenance-page h1 {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.4;
}

.diagram-title {
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.diagram-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 28px;
}

/* Pipeline (horizontal flow) */
.pipeline {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  min-width: 100px;
  max-width: 130px;
  flex: 0 1 auto;
}

.step-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-elevated);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.step-icon svg {
  width: 32px;
  height: 32px;
}

.pipeline-step:hover .step-icon {
  border-color: var(--border-hover);
  color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.accent-step .step-icon {
  border-color: var(--border-hover);
  background: var(--accent-dim);
  color: var(--accent);
}

.step-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--heading);
  line-height: 1.2;
}

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

.pipeline-arrow {
  display: flex;
  align-items: center;
  padding-top: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.pipeline-arrow svg {
  width: 28px;
  height: 14px;
}

/* Integration diagram (3-column) */
.integration-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.integ-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 0 1 auto;
}

.integ-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 16px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-elevated);
  min-width: 120px;
  transition: all var(--transition);
}

.integ-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm), var(--shadow-glow);
}

.integ-center {
  border-color: var(--border-hover);
  background: var(--accent-dim);
}

.integ-icon {
  color: var(--text-secondary);
  display: flex;
}

.integ-icon svg {
  width: 28px;
  height: 28px;
}

.integ-icon-accent {
  color: var(--accent);
}

.integ-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--heading);
  line-height: 1.2;
}

.integ-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.integ-arrows {
  flex-shrink: 0;
  color: var(--text-muted);
}

.integ-arrows svg {
  width: 36px;
  height: 90px;
}

/* Federated diagram */
.federated-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.fed-sites {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.fed-site {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  min-width: 100px;
}

.fed-site-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-elevated);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.fed-site-icon svg {
  width: 32px;
  height: 32px;
}

.fed-site:hover .fed-site-icon {
  border-color: var(--border-hover);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.fed-site-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--heading);
}

.fed-site-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.fed-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 4px 0;
}

.fed-flow-arrows {
  color: var(--text-muted);
}

.fed-flow-arrows svg {
  width: 200px;
  height: 40px;
}

.fed-flow-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border: 1px dashed var(--border-hover);
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.fed-flow-label svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.fed-center {
  margin-top: 4px;
}

.fed-center-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 20px 28px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  background: var(--accent-dim);
  transition: all var(--transition);
}

.fed-center-card:hover {
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transform: translateY(-2px);
}

.fed-center-icon {
  color: var(--accent);
}

.fed-center-icon svg {
  width: 44px;
  height: 44px;
}

.fed-center-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--heading);
}

.fed-center-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .featured-card {
    grid-template-columns: 1fr;
  }

  .featured-card .project-visual {
    min-height: 220px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .featured-card .project-body {
    padding: 24px;
  }

  .hero-title {
    font-size: clamp(1.8rem, 5vw, 3rem);
  }

  .pain-grid {
    grid-template-columns: 1fr 1fr;
  }

  .genai-roles {
    grid-template-columns: 1fr;
  }

  .examples-grid {
    grid-template-columns: 1fr;
  }

  .industrial-experience {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 28px);
  }

  .hero {
    min-height: 85vh;
    padding: 80px 0 50px;
  }

  .section {
    padding: 50px 0;
  }

  .focus-grid {
    grid-template-columns: 1fr;
  }

  .industrial-experience {
    margin-top: 28px;
    gap: 20px;
  }

  .industrial-metrics {
    grid-template-columns: 1fr;
  }

  .industrial-metric {
    min-height: 0;
  }

  .industrial-layer {
    grid-template-columns: 42px 1fr;
    gap: 12px;
    padding: 16px;
  }

  .industrial-layers::before {
    left: 21px;
  }

  .layer-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .layer-icon svg {
    width: 23px;
    height: 23px;
  }

  .pain-grid {
    grid-template-columns: 1fr;
  }

  .example-compare {
    flex-direction: column;
  }

  .compare-vs {
    justify-content: center;
    padding: 8px;
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  .project-cards {
    grid-template-columns: 1fr;
  }

  .project-pwr div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .pub-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .pub-year {
    justify-content: flex-start;
    font-size: 1.1rem;
  }

  .nav-links {
    gap: 4px;
  }

  .nav-link {
    padding: 6px 12px;
    font-size: 0.82rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .publications-grid {
    gap: 12px;
  }

  .diagram-block {
    padding: 20px;
    margin-top: 32px;
  }

  .pipeline {
    flex-direction: column;
    align-items: center;
  }

  .pipeline-arrow {
    padding-top: 0;
    transform: rotate(90deg);
  }

  .pipeline-step {
    max-width: none;
  }

  .integration-diagram {
    flex-direction: column;
    gap: 4px;
  }

  .integ-col {
    flex-direction: row;
    gap: 8px;
  }

  .integ-arrows svg {
    width: 60px;
    height: 30px;
    transform: rotate(90deg);
  }

  .integ-card {
    min-width: 0;
    flex: 1;
  }

  .fed-sites {
    gap: 12px;
  }

  .fed-site {
    min-width: 80px;
  }

  .fed-flow-arrows svg {
    width: 140px;
  }

  .fed-center-card {
    padding: 16px 20px;
  }
}
