@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ==========================================================================
   1. CORE VARIABLES & RESET
   ========================================================================== */
:root {
  --bg-primary: #0b0c0e;
  --bg-secondary: #17181c;
  --bg-card: #1c1d22;
  --bg-nav: rgba(11, 12, 14, 0.88);

  --text-primary: #eef0f2;
  --text-muted: #93979e;
  --text-dim: #55585f;

  --accent-cyan: #45c6f5;
  --accent-amber: #f0a94e;
  --accent-green: #52d17c;
  --accent-border: #28292f;
  --accent-border-hover: #40424a;

  --font-display: 'Space Grotesk', var(--font-sans);
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --max-width: 1080px;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 76px;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
}

/* ==========================================================================
   2. STICKY NAVIGATION BAR
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  max-width: var(--max-width);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--accent-border);
  z-index: 1000;
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.btn-resume {
  padding: 6px 14px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary) !important;
  transition: all 0.2s ease;
}

.btn-resume:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(69, 198, 245, 0.15);
}

/* ==========================================================================
   3. LAYOUT CONTAINER & SECTIONS
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--max-width);
  padding: 0 24px;
}

section {
  padding: 64px 0;
  border-bottom: 1px solid var(--accent-border);
}

section:last-of-type {
  border-bottom: none;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-cyan);
  margin-bottom: 32px;
}

/* ==========================================================================
   4. ABOUT / HERO
   ========================================================================== */
.hero-panel {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: start;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-bottom: 10px;
}

.hero-subtitle {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.card-description {
  color: var(--text-muted);
  font-size: 0.98rem;
  max-width: 62ch;
  margin-bottom: 16px;
}

.card-description b {
  color: var(--text-primary);
  font-weight: 600;
}

.credo {
  border-left: 2px solid var(--accent-cyan);
  padding-left: 16px;
  color: var(--text-dim);
  font-size: 0.92rem;
  max-width: 56ch;
  margin: 24px 0 8px 0;
}

.credo b {
  display: block;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 500;
}

/* Photo with corner-bracket frame */
.hero-photo-frame {
  position: relative;
  padding: 14px;
}

.hero-photo-frame::before,
.hero-photo-frame::after {
  content: "";
  position: absolute;
  width: 32px;
  height: 32px;
  border-color: var(--accent-cyan);
  border-style: solid;
}

.hero-photo-frame::before {
  top: 0;
  left: 0;
  border-width: 2px 0 0 2px;
}

.hero-photo-frame::after {
  bottom: 0;
  right: 0;
  border-width: 0 2px 2px 0;
}

.hero-photo-frame img {
  width: 100%;
  height: auto;
  display: block;
  filter: grayscale(15%);
}

/* Vitals row - inline stat strip, not boxed cards */
.vitals-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 36px;
}

.vital {
  flex: 1 1 200px;
  padding: 0;
}

.vital-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.vital-value {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.skills-row {
  margin-top: 40px;
}

.skills-row .section-title {
  font-size: 0.75rem;
  margin-bottom: 16px;
}

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

.tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--accent-cyan);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-border);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.tag:hover {
  border-color: var(--accent-cyan);
  background: rgba(69, 198, 245, 0.08);
}

/* ==========================================================================
   5. MEDIA GALLERY
   ========================================================================== */
.side-scroll-gallery {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-border) transparent;
}

.side-scroll-gallery::-webkit-scrollbar {
  height: 6px;
}

.side-scroll-gallery::-webkit-scrollbar-thumb {
  background: var(--accent-border);
  border-radius: var(--radius-sm);
}

.gallery-card {
  position: relative;
  flex: 0 0 auto !important;
  width: auto !important;
  height: 380px !important;
  aspect-ratio: auto !important;
  scroll-snap-align: start;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-secondary);
}

.gallery-card img {
  width: auto !important;
  height: 100% !important;
  object-fit: contain !important;
  display: block;
}

.gallery-card-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 16px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 10%, rgba(0,0,0,0.55) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gallery-card-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
}

.gallery-card-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}
/* ==========================================================================
   6. PROJECT ENTRIES (spec-sheet layout)
   ========================================================================== */
.experience-list {
  display: flex;
  flex-direction: column;
}

.project-entry {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 40px;
  padding: 44px 0;
  border-top: 1px solid var(--accent-border);
}

.project-entry:first-child {
  border-top: none;
}

.project-index {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.callsign {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.status-light {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-active .status-dot { background: var(--accent-cyan); box-shadow: 0 0 6px rgba(69,198,245,0.6); }
.status-active { color: var(--accent-cyan); }

.status-caution .status-dot { background: var(--accent-amber); box-shadow: 0 0 6px rgba(240,169,78,0.6); }
.status-caution { color: var(--accent-amber); }

.status-nominal .status-dot { background: var(--accent-green); box-shadow: 0 0 6px rgba(82,209,124,0.6); }
.status-nominal { color: var(--accent-green); }

.project-specs {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 8px;
  border-top: 1px solid var(--accent-border);
}

.project-specs .spec-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 3px;
}

.project-specs .spec-value {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.project-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.role-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
}

.role-subtitle {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.project-main .card-description {
  max-width: 68ch;
  margin-bottom: 0;
}

.project-media {
  margin-top: 4px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--accent-border);
}

.project-media img {
  width: 100%;
  height: auto;
  display: block;
}

.project-link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-cyan);
  text-decoration: none;
  width: fit-content;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

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

/* Alternate media side for rhythm on wide screens */
@media (min-width: 900px) {
  .project-entry.reverse .project-main {
    order: 2;
  }
  .project-entry.reverse .project-index {
    order: 1;
  }
}

/* ==========================================================================
   7. CONTACT
   ========================================================================== */
.contact-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--accent-border);
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-item .spec-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.contact-item a {
  color: var(--accent-cyan);
  text-decoration: none;
  font-size: 0.95rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
  width: fit-content;
}

.contact-item a:hover {
  border-bottom-color: var(--accent-cyan);
}

/* ==========================================================================
   8. PROJECT DETAIL PAGES
   ========================================================================== */
.detail-block {
  padding: 36px 0;
  border-top: 1px solid var(--accent-border);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.detail-block:first-child {
  border-top: none;
  padding-top: 0;
}

.detail-block .role-title {
  font-size: 1.15rem;
}

.detail-block .card-description {
  max-width: 70ch;
}

.detail-hero {
  padding-bottom: 40px;
  border-bottom: 1px solid var(--accent-border);
  margin-bottom: 8px;
}

.detail-hero .hero-title {
  font-size: 2.1rem;
}

.detail-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 28px;
  border-top: 1px solid var(--accent-border);
}

.detail-specs .vital {
  flex: 1 1 200px;
}

/* ==========================================================================
   9. FOOTER
   ========================================================================== */
footer {
  width: 100%;
  max-width: var(--max-width);
  padding: 32px 24px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
}

footer a:hover {
  color: var(--accent-cyan);
}

/* ==========================================================================
   10. RESPONSIVE
   ========================================================================== */
@media (max-width: 760px) {
  body { padding-top: 60px; }

  .navbar { padding: 0 16px; }
  .nav-links { gap: 12px; }
  .nav-links a:not(.btn-resume) {
    font-size: 0.75rem;
  }

  section {
    padding: 40px 0;
  }

  .container {
    padding: 0 18px;
  }

  .section-title {
    margin-bottom: 20px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-photo-frame {
    order: -1;
    max-width: 220px;
    margin: 0 auto 8px;
  }

  .hero-title {
    font-size: 1.9rem;
    margin-top: 4px;
  }

  .hero-subtitle {
    margin-bottom: 16px;
  }

  .card-description {
    margin-bottom: 12px;
  }

  .credo {
    margin: 16px 0 4px 0;
  }

  .vitals-row {
    flex-direction: column;
    gap: 14px;
    margin-top: 24px;
  }

  .vitals-row .vital {
    flex: 0 1 auto;
  }

  .skills-row {
    margin-top: 28px;
  }

  .project-entry {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 32px 0;
  }

  .project-index {
    gap: 12px;
  }

  .project-specs {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 6px;
  }

  .project-main {
    gap: 12px;
  }

  .detail-block {
    padding: 24px 0;
    gap: 12px;
  }

  .detail-hero {
    padding-bottom: 24px;
  }

  .detail-specs {
    margin-top: 20px;
  }

  .detail-specs .vital {
    flex: 1 1 45%;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 16px;
  }

  .contact-panel {
    gap: 14px;
  }

  .gallery-card {
    height: 300px;
  }

  footer {
    padding: 24px 18px;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .nav-links li:not(:last-child) {
    display: none;
  }
}
