/* ========================================
   CV Website — Semi Essessi
   ======================================== */

/* Nebula Sans — self-hosted, SIL Open Font License 1.1.
   Licence in assets/fonts/NebulaSans-OFL.txt. */
@font-face {
  font-family: 'Nebula Sans';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('assets/fonts/nebula-sans-300.woff2') format('woff2');
}

@font-face {
  font-family: 'Nebula Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/nebula-sans-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Nebula Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/nebula-sans-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Nebula Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/nebula-sans-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Nebula Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/nebula-sans-700.woff2') format('woff2');
}

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

:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a26;
  --surface: #16161f;
  --border: #2a2a3a;
  --border-light: #3a3a4f;
  --text: #e8e8ed;
  --text-muted: #8888a0;
  --text-dim: #5a5a72;
  --accent: #6c63ff;
  --accent-glow: #6c63ff40;
  --accent-bright: #8b83ff;
  --accent-secondary: #00d4aa;
  --accent-warm: #ff6b6b;
  --gradient-accent: linear-gradient(135deg, #6c63ff, #00d4aa);
  --font: 'Nebula Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-pixel: 'Silkscreen', 'Upheaval', 'Press Start 2P', monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pixel: 4px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

ul {
  list-style: none;
}

/* Pixel art utilities */
.pixel-img {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.section-sprite {
  width: 48px;
  height: 48px;
  vertical-align: middle;
  margin-left: 12px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========================================
   Navigation
   ======================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

.nav.scrolled {
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

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

.nav-links a {
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
  letter-spacing: 0.04em;
}

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

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

.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
}

/* ========================================
   Hero
   ======================================== */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 48px 48px 40px;
  max-width: 800px;
  background: rgba(10, 10, 15, 0.65);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(108, 99, 255, 0.12);
  border-radius: var(--radius);
  box-shadow: 0 0 60px rgba(108, 99, 255, 0.06),
              inset 0 0 40px rgba(10, 10, 15, 0.3);
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 12px;
  letter-spacing: 0.08em;
}

.hero-name {
  font-family: 'Upheaval', var(--font-pixel);
  font-size: clamp(2.8rem, 8vw, 5rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 0%, #c8c8d8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

.hero-title {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 24px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-light);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
  transform: translateY(-2px);
}

.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 1;
}

.hero-scroll span {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text);
  text-shadow: 0 0 8px rgba(108,99,255,0.5);
}

.hero-scroll-line {
  width: 2px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent-bright), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  50% { opacity: 0.4; transform: scaleY(0.6); }
}

/* ========================================
   Sections
   ======================================== */

.section {
  padding: 100px 0;
}

.section-title {
  font-family: var(--font-pixel);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-bottom: 56px;
  position: relative;
  display: inline-flex;
  align-items: center;
  text-shadow: 3px 3px 0px rgba(108, 99, 255, 0.3);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

/* ========================================
   About
   ======================================== */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

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

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 3px solid var(--border);
  border-radius: var(--radius-pixel);
  padding: 28px 24px;
  text-align: center;
  transition: all var(--transition);
  box-shadow: inset 0 0 0 1px rgba(108, 99, 255, 0.08);
}

.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(108, 99, 255, 0.15),
              inset 0 0 0 1px rgba(108, 99, 255, 0.2);
}

.stat-number {
  display: block;
  font-family: 'Upheaval', var(--font-pixel);
  font-size: 2.2rem;
  font-weight: 400;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
  text-shadow: none;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ========================================
   Timeline / Experience
   ======================================== */

.experience {
  background: var(--surface);
}

.timeline {
  position: relative;
  padding-left: 40px;
}

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

.timeline-item {
  position: relative;
  padding-bottom: 40px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s ease forwards;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -40px;
  top: 6px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-light);
  transition: all var(--transition);
  z-index: 1;
}

.timeline-marker.current {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.timeline-item:hover .timeline-marker {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.timeline-content {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-pixel);
  padding: 24px 28px;
  transition: all var(--transition);
}

.timeline-content:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}


.timeline-header h3 {
  font-family: var(--font-pixel);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.01em;
}

.timeline-company {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 2px;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
}

.timeline-details {
  margin-top: 8px;
}

.timeline-details li {
  position: relative;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 6px;
  line-height: 1.6;
}

.timeline-details li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

.timeline-details li:last-child {
  margin-bottom: 0;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation */
.timeline-item:nth-child(1) { animation-delay: 0.05s; }
.timeline-item:nth-child(2) { animation-delay: 0.1s; }
.timeline-item:nth-child(3) { animation-delay: 0.15s; }
.timeline-item:nth-child(4) { animation-delay: 0.2s; }
.timeline-item:nth-child(5) { animation-delay: 0.25s; }
.timeline-item:nth-child(6) { animation-delay: 0.3s; }
.timeline-item:nth-child(7) { animation-delay: 0.35s; }
.timeline-item:nth-child(8) { animation-delay: 0.4s; }
.timeline-item:nth-child(9) { animation-delay: 0.45s; }
.timeline-item:nth-child(10) { animation-delay: 0.5s; }
.timeline-item:nth-child(11) { animation-delay: 0.55s; }
.timeline-item:nth-child(12) { animation-delay: 0.6s; }
.timeline-item:nth-child(13) { animation-delay: 0.65s; }
.timeline-item:nth-child(14) { animation-delay: 0.7s; }
.timeline-item:nth-child(15) { animation-delay: 0.75s; }

/* ========================================
   Projects
   ======================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-pixel);
  padding: 28px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--transition);
}

.project-card:hover {
  border-color: var(--border-light);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.project-card:hover::before {
  opacity: 1;
}

.project-icon {
  font-size: 1.8rem;
  margin-bottom: 16px;
}

.project-card h3 {
  font-family: var(--font-pixel);
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  transition: color var(--transition);
}

a.project-card:hover h3 {
  color: var(--page-accent, var(--accent));
}

.project-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.project-card > p:not(.project-meta) {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 16px;
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-tags span {
  font-size: 0.72rem;
  padding: 4px 10px;
  background: rgba(108, 99, 255, 0.15);
  color: var(--accent-bright);
  border: 1px solid rgba(108, 99, 255, 0.25);
  border-radius: var(--radius-pixel);
  font-weight: 500;
}

/* ========================================
   Skills
   ======================================== */

.skills {
  background: var(--surface);
}

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.skill-group h3 {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 16px;
  font-weight: 400;
}

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

.skill-tag {
  font-size: 0.82rem;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-pixel);
  color: var(--text-muted);
  font-weight: 500;
  transition: all var(--transition);
}

.skill-tag:hover {
  border-color: #ffcc00;
  color: #fff;
  background: rgba(255, 204, 0, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 0 12px rgba(255, 204, 0, 0.2);
}

.skill-tag.primary {
  background: rgba(108, 99, 255, 0.15);
  border-color: rgba(108, 99, 255, 0.4);
  color: var(--accent-bright);
  box-shadow: 0 0 8px rgba(108, 99, 255, 0.1);
}

/* ========================================
   Publications
   ======================================== */

.publications-list {
  max-width: 700px;
}

.publication-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-pixel);
  padding: 28px;
  transition: all var(--transition);
}

.publication-card:hover {
  border-color: var(--border-light);
}

.publication-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
}

.publication-card h3 {
  font-family: var(--font-pixel);
  font-size: 1.05rem;
  font-weight: 400;
  margin: 8px 0;
}

.publication-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ========================================
   Contact
   ======================================== */

.contact {
  background: var(--surface);
  text-align: center;
}

.contact .section-title::after {
  left: 50%;
  transform: translateX(-50%);
}

.contact-text {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 40px;
}

.contact-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-pixel);
  padding: 16px 28px;
  transition: all var(--transition);
  font-family: var(--font-pixel);
  font-weight: 500;
}

.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(108, 99, 255, 0.1);
}

.contact-icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

/* ========================================
   Footer
   ======================================== */

.footer {
  padding: 32px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

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

/* ========================================
   Mobile nav overlay
   ======================================== */

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

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
  }

  .nav-links a {
    font-size: 1.2rem;
  }

  .nav-toggle {
    display: flex;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline-header {
    flex-direction: column;
    gap: 4px;
  }

  .section {
    padding: 72px 0;
  }

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

@media (max-width: 480px) {
  .about-stats {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 20px 16px;
  }

  .stat-number {
    font-size: 1.6rem;
  }

  .timeline {
    padding-left: 30px;
  }

  .timeline-marker {
    left: -30px;
    width: 12px;
    height: 12px;
  }

  .timeline-content {
    padding: 20px;
  }

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

/* ========================================
   Engine sub-pages (/native-engine, /unreal,
   /unity, /web)
   ======================================== */

/* Per-page accent — used for eyebrows, badges and rules so the
   sub-pages read as siblings rather than clones. */
.page-native  { --page-accent: #00d4aa; }
.page-unreal  { --page-accent: #5ec8ff; }
.page-unity   { --page-accent: #ff6b6b; }
.page-web     { --page-accent: #ffcc00; }

/* Compact hero band (same shader as the front page, shorter) */
.page-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.page-hero-bg canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.page-hero .container {
  position: relative;
  z-index: 1;
  padding-top: 128px;
  padding-bottom: 72px;
}

.page-hero-card {
  max-width: 760px;
  padding: 36px 40px;
  background: rgba(10, 10, 15, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(108, 99, 255, 0.14);
  border-radius: var(--radius);
  box-shadow: 0 0 60px rgba(108, 99, 255, 0.06),
              inset 0 0 40px rgba(10, 10, 15, 0.3);
}

.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  transition: color var(--transition);
}

.breadcrumb:hover {
  color: var(--page-accent, var(--accent));
}

.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--page-accent, var(--accent));
  margin-bottom: 10px;
}

.page-title {
  font-family: 'Upheaval', var(--font-pixel);
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 0%, #c8c8d8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-lede {
  color: var(--text);
  font-size: 1rem;
  max-width: 620px;
  margin-bottom: 28px;
}

.page-hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-accent {
  background: transparent;
  color: var(--page-accent, var(--accent));
  border: 1px solid currentColor;
}

.btn-accent:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

/* Generic auto-fitting card grid, reuses .project-card styling */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.card-grid.grid-2,
.demo-grid.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.card-grid .project-card:hover {
  border-color: var(--page-accent, var(--border-light));
}

.card-grid .project-card::before {
  background: linear-gradient(135deg, var(--accent), var(--page-accent, var(--accent-secondary)));
}

/* Key-fact strip */
.fact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 56px;
}

.fact-grid .stat-card:hover {
  border-color: var(--page-accent, var(--accent));
}

.section-lede {
  color: var(--text-muted);
  max-width: 720px;
  margin: -32px 0 32px;
  font-size: 0.95rem;
}

/* Demos & downloads */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.demo-card {
  position: relative;
  background: var(--bg-card);
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-pixel);
  padding: 28px;
  transition: all var(--transition);
}

/* Add .available to a demo card once a real download link is in place */
.demo-card.available {
  border-style: solid;
}

.demo-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--page-accent, var(--accent));
}

.demo-card h3 {
  font-family: var(--font-pixel);
  font-size: 1rem;
  font-weight: 400;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.demo-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.demo-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.demo-badge {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--radius-pixel);
  background: rgba(255, 204, 0, 0.12);
  color: #ffcc00;
  border: 1px solid rgba(255, 204, 0, 0.3);
}

.demo-badge.ready {
  background: rgba(0, 212, 170, 0.12);
  color: var(--accent-secondary);
  border-color: rgba(0, 212, 170, 0.35);
}

.demo-card.available .demo-badge.ready {
  transition: all var(--transition);
}

.demo-card.available:hover .demo-badge.ready {
  background: rgba(0, 212, 170, 0.22);
  border-color: var(--accent-secondary);
}

.demo-note {
  margin-top: 28px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.demo-note a {
  color: var(--page-accent, var(--accent));
}

/* Cross-links between the engine pages */
.engine-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.engine-nav a {
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  padding: 12px 22px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-pixel);
  color: var(--text-muted);
  transition: all var(--transition);
}

.engine-nav a:hover {
  color: var(--text);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.engine-nav a[aria-current='page'] {
  color: var(--page-accent, var(--accent));
  border-color: currentColor;
}

.engine-outro {
  text-align: center;
}

.engine-outro .section-title::after {
  left: 50%;
  transform: translateX(-50%);
}

@media (max-width: 768px) {
  .card-grid.grid-2,
  .demo-grid.grid-2 {
    grid-template-columns: 1fr;
  }

  .page-hero-card {
    padding: 28px 24px;
  }

  .page-hero .container {
    padding-top: 104px;
    padding-bottom: 56px;
  }

  .fact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.project-card .project-cta {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--page-accent, var(--accent));
}

.project-card:hover .project-cta {
  text-decoration: underline;
}

/* Section background alternation on the engine sub-pages */
.section-alt {
  background: var(--surface);
}

/* Shipped title credits */
.credits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.credit-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-pixel);
  padding: 20px 22px;
  transition: all var(--transition);
}

.credit-card:hover {
  border-color: var(--page-accent, var(--accent));
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
}

.credit-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--page-accent, var(--accent));
  letter-spacing: 0.04em;
}

.credit-card h3 {
  font-family: var(--font-pixel);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin: 6px 0 4px;
  transition: color var(--transition);
}

a.credit-card:hover h3 {
  color: var(--page-accent, var(--accent));
}

.credit-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.credit-role {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* A muted card for unannounced or cancelled work */
.credit-card.muted {
  border-style: dashed;
  background: transparent;
}

/* The hero "Play Demos" button targets the first demo tile. This stacks on
   top of the global scroll-padding-top, so keep it small. */
#demos {
  scroll-margin-top: 24px;
}

/* Closing line under the experience timeline */
.timeline-note {
  margin-top: 40px;
  padding-left: 40px;
  max-width: 760px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

@media (max-width: 480px) {
  .timeline-note {
    padding-left: 30px;
  }
}
