/* ── ARCADE SECTION — Odyssey Run ─────────────── */

.arcade-section {
  width: var(--container);
  margin: 0 auto;
  padding: 60px 0 40px;
}

.arcade-section .section-inner {
  display: grid;
  gap: 24px;
}

.arcade-wrap {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-0);
}

#arcadeCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.arcade-hud {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  font-family: 'Michroma', sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 12px color-mix(in oklab, var(--accent) 50%, transparent);
  z-index: 2;
}

.hud-score,
.hud-lives,
.hud-zone {
  background: color-mix(in oklab, var(--panel) 75%, transparent);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
}

.hud-lives {
  color: var(--accent-2);
  text-shadow: 0 0 12px color-mix(in oklab, var(--accent-2) 50%, transparent);
}

/* Start / Game Over overlay */
.arcade-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(4, 8, 19, 0.85);
  z-index: 5;
  transition: opacity 300ms var(--ease);
}

.arcade-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.arcade-overlay h3 {
  font-family: 'Michroma', sans-serif;
  color: var(--title);
  font-size: clamp(1.2rem, 3vw, 2rem);
  text-transform: uppercase;
  text-align: center;
}

.arcade-overlay p {
  color: var(--text-soft);
  text-align: center;
  max-width: 40ch;
}

.arcade-overlay .final-score {
  font-family: 'Michroma', sans-serif;
  font-size: clamp(2rem, 6vw, 4rem);
  color: var(--accent);
  text-shadow: 0 0 24px color-mix(in oklab, var(--accent) 60%, transparent);
}

.arcade-btn {
  font-family: 'Michroma', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bg-0);
  background: var(--accent);
  border: none;
  padding: 12px 28px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 200ms, box-shadow 200ms;
}

.arcade-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 0 20px color-mix(in oklab, var(--accent) 50%, transparent);
}

.arcade-highscore {
  font-family: 'Michroma', sans-serif;
  font-size: 0.6rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.arcade-controls-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-top: -8px;
}

/* ── PROJECT CARDS EXTRA STYLES ──────────────── */

.mission-card {
  position: relative;
}

.mission-cover {
  position: relative;
  overflow: hidden;
}

.mission-cover img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  transition: transform 400ms var(--ease);
}

.mission-card:hover .mission-cover img {
  transform: scale(1.04);
}

.cosmic-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: 'Michroma', sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: color-mix(in oklab, var(--panel) 80%, transparent);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid color-mix(in oklab, var(--line) 40%, transparent);
}

.project-subtitle {
  color: var(--accent) !important;
  font-size: 0.82rem !important;
  font-weight: 600;
}

.project-desc {
  font-size: 0.88rem !important;
  margin-top: 4px;
}

.project-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.stat {
  background: color-mix(in oklab, var(--panel-soft) 60%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 20%, transparent);
  border-radius: 8px;
  padding: 6px 8px;
  text-align: center;
}

.stat-val {
  display: block;
  font-family: 'Michroma', sans-serif;
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.stat-lbl {
  display: block;
  font-size: 0.6rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.project-features {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  display: grid;
  gap: 4px;
}

.project-features li {
  font-size: 0.82rem;
  color: var(--text);
  padding-left: 16px;
  position: relative;
}

.project-features li::before {
  content: '\25b8';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.stack-tag {
  font-family: 'Michroma', sans-serif;
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
  border-radius: 4px;
  color: color-mix(in oklab, var(--accent) 90%, var(--text));
  background: color-mix(in oklab, var(--accent) 8%, transparent);
}

.project-link {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
  margin-top: 6px;
  transition: border-color var(--ease);
}

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

.project-extended {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  animation: extFadeIn 400ms ease both;
}

.project-extended.collapsed {
  display: none;
}

@keyframes extFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.project-extended p {
  font-size: 0.86rem !important;
  line-height: 1.6;
}

.ext-context {
  color: var(--text) !important;
}

.ext-technical {
  color: var(--text-soft) !important;
}

.ext-achievements {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 4px;
}

.ext-achievements li {
  font-size: 0.82rem;
  padding-left: 16px;
  position: relative;
  color: var(--text);
}

.ext-achievements li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: #44ff88;
}

.ext-ecosystem {
  color: var(--text-soft) !important;
  font-size: 0.82rem !important;
}

.expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 50%, transparent);
  color: var(--accent);
  font-family: 'Michroma', sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
  transition: background 300ms ease, color 300ms ease, border-color 300ms ease, transform 200ms ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  z-index: 2;
}

.expand-btn:hover {
  background: color-mix(in oklab, var(--accent) 18%, transparent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.expand-btn:active {
  transform: translateY(0) scale(0.97);
  background: color-mix(in oklab, var(--accent) 25%, transparent);
}

.expand-btn.active {
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  border-color: var(--accent);
}

/* Tier-based card sizing */
.tier-1 {
  grid-column: span 2;
}

.tier-3 .mission-body {
  padding: 10px 12px;
}

.tier-3 .project-features,
.tier-3 .project-stats {
  display: none;
}

/* ── FLIGHT LOG TIMELINE ─────────────────────── */

.flight-log-timeline {
  display: grid;
  gap: 0;
  position: relative;
  padding-left: 48px;
}

.flight-log-timeline::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0.4;
}

.log-entry {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  position: relative;
}

.log-marker {
  position: absolute;
  left: -48px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.log-idx {
  font-family: 'Michroma', sans-serif;
  font-size: 0.6rem;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.log-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}

.log-label {
  font-family: 'Michroma', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--title);
}

.log-period {
  font-size: 0.72rem;
  color: var(--accent);
  font-family: 'Michroma', sans-serif;
  letter-spacing: 0.06em;
}

.log-content p {
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.6;
}

.flight-quote {
  margin: 32px 0 0;
  padding: 20px 24px;
  border-left: 3px solid var(--accent);
  background: color-mix(in oklab, var(--panel-soft) 50%, transparent);
  border-radius: 0 12px 12px 0;
}

.flight-quote p {
  font-size: 1rem !important;
  color: var(--title) !important;
  font-style: italic;
}

.flight-quote cite {
  display: block;
  margin-top: 8px;
  font-family: 'Michroma', sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-style: normal;
}

/* ── TERRA FIRMA ─────────────────────────────── */

.terra-firma-section {
  background: linear-gradient(170deg,
    color-mix(in oklab, var(--bg-1) 90%, #2a3d1a),
    var(--bg-0) 70%
  );
}

.terra-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.terra-card {
  background: color-mix(in oklab, var(--panel) 70%, transparent);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  display: grid;
  gap: 10px;
  transition: border-color var(--ease);
}

.terra-card:hover {
  border-color: var(--line-strong);
}

.terra-icon {
  font-size: 2rem;
  color: var(--accent-2);
  filter: drop-shadow(0 0 8px color-mix(in oklab, var(--accent-2) 40%, transparent));
}

.terra-cosmic {
  font-family: 'Michroma', sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.terra-card h3 {
  font-size: 0.9rem;
  color: var(--title);
}

.terra-card p {
  font-size: 0.82rem;
  color: var(--text-soft);
}

.terra-count {
  font-family: 'Michroma', sans-serif;
  font-size: 0.6rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.terra-placeholder {
  font-size: 0.72rem;
  color: var(--text-soft);
  font-style: italic;
  opacity: 0.7;
}

.terra-skills {
  grid-column: 1 / -1;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.terra-skills h4 {
  font-family: 'Michroma', sans-serif;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 10px;
}

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

.skill-tag {
  font-size: 0.72rem;
  padding: 5px 12px;
  border: 1px solid color-mix(in oklab, var(--accent-2) 40%, transparent);
  border-radius: 6px;
  color: var(--text);
  background: color-mix(in oklab, var(--accent-2) 8%, transparent);
}

.terra-bridge {
  grid-column: 1 / -1;
  padding: 16px 20px;
  border-left: 3px solid var(--accent-2);
  background: color-mix(in oklab, var(--panel-soft) 40%, transparent);
  border-radius: 0 12px 12px 0;
}

.terra-bridge p {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.6;
}

/* ── TEXTURES & BACKGROUNDS ──────────────────── */

/* Starfield texture overlay on body (layers with existing gradient) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -3;
  background: url('../assets/generated/vimoi-web/textures/starfield.webp') repeat;
  background-size: cover;
  opacity: 0.15;
  pointer-events: none;
}

/* Nebula texture for flight-log section */
#flight-log {
  position: relative;
}

#flight-log::before {
  content: '';
  position: absolute;
  inset: -20px 0;
  z-index: -1;
  background: url('../assets/generated/vimoi-web/textures/nebula-01.webp') center / cover no-repeat;
  opacity: 0.08;
  border-radius: inherit;
  pointer-events: none;
  transform: translateY(var(--parallax-y, 0));
  will-change: transform;
}

/* Warm nebula for Terra Firma (ID selector to override .section+.section divider) */
#terra-firma {
  position: relative;
}

#terra-firma::before {
  content: '';
  position: absolute;
  inset: -20px 0;
  z-index: -1;
  background: url('../assets/generated/vimoi-web/textures/nebula-02.webp') center / cover no-repeat;
  opacity: 0.1;
  border-radius: inherit;
  pointer-events: none;
  transform: translateY(var(--parallax-y, 0));
  will-change: transform;
}

/* Grid texture for arcade section */
#arcade {
  position: relative;
}

#arcade::before {
  content: '';
  position: absolute;
  inset: -20px 0;
  z-index: -1;
  background: url('../assets/generated/vimoi-web/textures/nebula-03.webp') center / cover no-repeat;
  opacity: 0.06;
  border-radius: inherit;
  pointer-events: none;
  transform: translateY(var(--parallax-y, 0));
  will-change: transform;
}

/* Gallery nebula atmosphere */
#gallery {
  position: relative;
}

#gallery::before {
  content: '';
  position: absolute;
  inset: -20px 0;
  z-index: -1;
  background: url('../assets/generated/vimoi-web/textures/nebula-04.webp') center / cover no-repeat;
  opacity: 0.06;
  border-radius: inherit;
  pointer-events: none;
  transform: translateY(var(--parallax-y, 0));
  will-change: transform;
}

/* ── PLANET ICONS IN PROJECT CARDS ───────────── */

/* Floating planet decorations — shared base */
.mission-card .mission-cover::after {
  content: '';
  position: absolute;
  bottom: -20px;
  right: -10px;
  opacity: 0;
  pointer-events: none;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 0 12px var(--accent));
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}

/* Tier-1 — large planet (80px) */
.tier-1 .mission-cover::after {
  width: 80px;
  height: 80px;
  opacity: 0.25;
}

.tier-1:hover .mission-cover::after {
  opacity: 0.45;
  transform: scale(1.1) rotate(5deg);
}

/* Tier-2 — smaller planet (56px), top-right position */
.tier-2 .mission-cover::after {
  width: 56px;
  height: 56px;
  bottom: auto;
  top: -8px;
  right: -6px;
  opacity: 0.18;
}

.tier-2:hover .mission-cover::after {
  opacity: 0.35;
  transform: scale(1.08) rotate(-4deg);
}

/* Planet assignments by project ID */
[data-project="checkarch"] .mission-cover::after {
  background-image: url('../assets/generated/vimoi-web/planet/planet-01.webp');
}

[data-project="aigets"] .mission-cover::after {
  background-image: url('../assets/generated/vimoi-web/planet/planet-02.webp');
}

[data-project="telematrix"] .mission-cover::after {
  background-image: url('../assets/generated/vimoi-web/planet/planet-06.webp');
}

[data-project="researech-timeline"] .mission-cover::after {
  background-image: url('../assets/generated/vimoi-web/planet/planet-08.webp');
}

[data-project="markmaid"] .mission-cover::after {
  background-image: url('../assets/generated/vimoi-web/planet/planet-05.webp');
}

[data-project="crypto-bot"] .mission-cover::after {
  background-image: url('../assets/generated/vimoi-web/planet/planet-03.webp');
}

/* Terra Firma card planet decorations */
.terra-card:nth-child(1) .terra-icon {
  width: 48px;
  height: 48px;
  background: url('../assets/generated/vimoi-web/planet/planet-07.webp') center / contain no-repeat;
  font-size: 0;
  filter: drop-shadow(0 0 8px var(--accent-2));
}

.terra-card:nth-child(2) .terra-icon {
  width: 48px;
  height: 48px;
  background: url('../assets/generated/vimoi-web/planet/planet-03.webp') center / contain no-repeat;
  font-size: 0;
  filter: drop-shadow(0 0 8px var(--accent-2));
}

.terra-card:nth-child(3) .terra-icon {
  width: 48px;
  height: 48px;
  background: url('../assets/generated/vimoi-web/planet/planet-04.webp') center / contain no-repeat;
  font-size: 0;
  filter: drop-shadow(0 0 8px var(--accent-2));
}

/* ── VISUAL ENHANCEMENTS & FEATURES ──────────── */

/* Smooth section dividers with gradient lines */
.section + .section::before {
  content: '';
  display: block;
  width: 60%;
  max-width: 400px;
  height: 1px;
  margin: 0 auto 0;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  opacity: 0.4;
}

/* Stat counter animation on scroll-reveal */
.stat-val {
  animation: countPulse 600ms var(--ease) both;
}

@keyframes countPulse {
  0% { opacity: 0; transform: translateY(8px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Stack tags subtle entrance */
.stack-tag {
  animation: tagSlide 400ms var(--ease) both;
}

.stack-tag:nth-child(1) { animation-delay: 50ms; }
.stack-tag:nth-child(2) { animation-delay: 100ms; }
.stack-tag:nth-child(3) { animation-delay: 150ms; }
.stack-tag:nth-child(4) { animation-delay: 200ms; }
.stack-tag:nth-child(5) { animation-delay: 250ms; }
.stack-tag:nth-child(6) { animation-delay: 300ms; }

@keyframes tagSlide {
  0% { opacity: 0; transform: translateX(-6px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* Mission card hover lift */
.mission-card {
  transition: transform 400ms var(--ease), box-shadow 400ms var(--ease);
}

.mission-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3),
              0 0 20px color-mix(in oklab, var(--accent) 10%, transparent);
}

/* Cosmic badge glow on hover */
.cosmic-badge {
  transition: text-shadow 400ms var(--ease);
}

.mission-card:hover .cosmic-badge {
  text-shadow: 0 0 12px currentColor;
}

/* Status dot pulse animation */
.status-dot {
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Flight log entry stagger animation */
.log-entry {
  animation: logEntrance 500ms var(--ease) both;
}

.log-entry:nth-child(1) { animation-delay: 0ms; }
.log-entry:nth-child(2) { animation-delay: 80ms; }
.log-entry:nth-child(3) { animation-delay: 160ms; }
.log-entry:nth-child(4) { animation-delay: 240ms; }
.log-entry:nth-child(5) { animation-delay: 320ms; }
.log-entry:nth-child(6) { animation-delay: 400ms; }

@keyframes logEntrance {
  0% { opacity: 0; transform: translateX(-16px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* Terra card hover glow */
.terra-card {
  transition: transform 400ms var(--ease), box-shadow 400ms var(--ease), border-color 400ms var(--ease);
}

.terra-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

/* Expand button ripple effect */
.expand-btn {
  position: relative;
  overflow: hidden;
}

.expand-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, color-mix(in oklab, var(--accent) 20%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 300ms;
  pointer-events: none;
}

.expand-btn:hover::after {
  opacity: 1;
}

/* Project link arrow animation */
.project-link::after {
  content: ' \2192';
  display: inline-block;
  transition: transform 300ms var(--ease);
}

.project-link:hover::after {
  transform: translateX(4px);
}

/* Gallery item hover shine effect */
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 30%, color-mix(in oklab, var(--accent) 8%, transparent) 50%, transparent 70%);
  opacity: 0;
  transition: opacity 400ms var(--ease);
  pointer-events: none;
}

.gallery-item:hover::after {
  opacity: 1;
}

/* Flight quote floating animation */
.flight-quote {
  animation: quoteFloat 6s ease-in-out infinite;
}

@keyframes quoteFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Scroll-triggered counter for stats — visible class from reveal observer */
.visible .stat-val { animation-play-state: running; }

/* ── RESPONSIVE ──────────────────────────────── */

@media (max-width: 980px) {
  .tier-1 { grid-column: span 1; }
  .terra-grid { grid-template-columns: 1fr; }
  .flight-log-timeline { padding-left: 40px; }
  .log-marker { left: -40px; width: 32px; height: 32px; }
}

@media (max-width: 640px) {
  .project-stats { grid-template-columns: repeat(2, 1fr); }
  .arcade-wrap { aspect-ratio: 4/3; }
  .arcade-hud { font-size: 0.5rem; }
}
