/* ============================================
   mgms.me — Style Sheet
   mxcl.dev Architectural Pivot · Deep Blue Vignette
   100% Opaque Tactile Surfaces · Zero Muddy Blur
   ============================================ */

:root {
  /* Rich Blue & Deep Navy Palette */
  --bg-deep:         #070d1a;
  --bg-navy:         #0f172a;
  --bg-glow:         #0369a1;
  --surface-solid:   #0b1329;
  --surface-card:    #0e1a33;
  --surface-raised:  #14254b;
  --surface-subtle:  #101d3b;

  /* Hairlines & Precision Borders */
  --hairline:        #1e293b;
  --hairline-light:  rgba(255, 255, 255, 0.14);
  --border-focus:    #38bdf8;
  --border-subtle:   #19253d;

  /* Accents & Brand */
  --accent-cyan:     #38bdf8;
  --accent-blue:     #0284c7;
  --accent-glow:     rgba(3, 105, 161, 0.45);

  /* High-Contrast Typography */
  --white:           #ffffff;
  --text-slate:      #cbd5e1;
  --text-md:         #94a3b8;
  --text-lo:         #64748b;
  --text-muted:      rgba(255, 255, 255, 0.4);

  /* Dimensions & Spacing */
  --nav-h:           64px;
  --r:               8px;
  --ease:            0.15s cubic-bezier(0.2, 0, 0, 1);
  --grid-max-w:      1400px;
  --grid-padding:    24px;
}

@media (max-width: 768px) {
  :root {
    --nav-h:         58px;
    --grid-padding:  16px;
  }
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  background-color: var(--bg-deep);
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(ellipse 95% 75% at 50% 12%, rgba(3, 105, 161, 0.42) 0%, rgba(15, 23, 42, 0.94) 65%, #070d1a 100%),
    linear-gradient(180deg, #0b1426 0%, #070d1a 100%);
  background-attachment: fixed;
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* ---- Vanilla HTML5 Snow Canvas at z-index: 0 ---- */
#snow-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ============================================
   MASTER PAGE GRID & STRUCTURAL ALIGNMENT
   Modeled on mxcl.dev: Desktop min(1400px, calc(100% - 48px))
   Mobile: calc(100% - 32px)
   ============================================ */
.container {
  width: min(var(--grid-max-w), calc(100% - (var(--grid-padding) * 2)));
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
}

/* ============================================
   NAVBAR — Minimal Top Navigation + High-Contrast Pill CTA
   100% Opaque Solid Surface, Zero Blur
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 999;
  background: var(--surface-solid);
  border-bottom: 1px solid var(--hairline);
  transition: border-color var(--ease), box-shadow var(--ease);
}

.navbar.scrolled {
  border-bottom-color: var(--hairline-light);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.navbar .nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: 100%;
  max-width: none;
  padding: 0 clamp(2rem, 4vw, 5rem);
}

.nav-brand {
  font-family: 'Nunito', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -.02em;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  cursor: pointer;
  transition: opacity var(--ease);
}
.nav-brand span { color: var(--accent-cyan); }
.nav-brand:hover { opacity: 0.85; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
}

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

.nav-links a {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-slate);
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: color var(--ease), background var(--ease);
}

.nav-links a:hover {
  color: var(--white);
  background: var(--surface-card);
}

.nav-links a.active {
  color: var(--white);
  background: var(--surface-raised);
}

/* High-Contrast Pill CTA */
.nav-pill-cta {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1.15rem !important;
  background: var(--accent-cyan) !important;
  color: #070d1a !important;
  font-weight: 750 !important;
  font-size: 0.82rem !important;
  border-radius: 9999px !important;
  border: 1px solid var(--accent-cyan) !important;
  letter-spacing: 0.02em;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.12s ease, background 0.12s ease !important;
}

.nav-pill-cta:hover {
  background: #7dd3fc !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
  text-decoration: none !important;
}

.nav-pill-cta:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Mobile Toggle Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all var(--ease);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============================================
   PAGES
   ============================================ */
.page {
  display: none;
  position: relative;
  z-index: 1;
  min-height: calc(100vh - var(--nav-h));
  padding-top: calc(var(--nav-h) + 2.5rem);
  padding-bottom: 4rem;
  animation: fadeUp .3s ease both;
}
.page.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   HOME / STRICT DYNAMIC RESPONSIVE SCALING (mxcl.dev model)
   ============================================ */
#home {
  position: relative;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  padding: 0;
}

#home .hero-container {
  position: relative;
  height: 100%;
  min-height: 100vh;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(2rem, 4vw, 4rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}

.hero {
  display: flex;
  width: 100%;
  position: static;
  padding: 0;
  min-height: 0;
  flex: 1;
}

/* Left Column Typography & Alignment — vertically centered */
.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  align-self: center;
  margin: auto 0;
  width: 52%;
  max-width: 720px;
  position: relative;
  z-index: 10;
  text-align: left;
}

.hero-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: clamp(.82rem, 1vw, .95rem);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 0.85rem;
  line-height: 1.2;
}

.hero h1 {
  font-size: clamp(5rem, 7.2vw, 7.5rem);
  font-weight: 850;
  line-height: 1.0;
  letter-spacing: -0.025em;
  color: var(--white);
  margin-bottom: 0.85rem;
  max-width: 15ch;
  text-wrap: balance;
}
.hero h1 strong {
  font-weight: 850;
  color: var(--white);
}

.hero-alias {
  font-family: 'DM Mono', monospace;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  color: var(--text-md);
  margin-bottom: 0.5rem;
  letter-spacing: -.015em;
  line-height: 1.3;
}
.hero-alias span {
  color: var(--accent-cyan);
  font-style: italic;
  font-weight: 500;
}

.hero-sub {
  font-size: clamp(1.45rem, 2.2vw, 2.15rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #ffffff;
  max-width: 40ch;
  margin-bottom: 1.15rem;
}

.hero-bio {
  font-size: clamp(1.02rem, 1.25vw, 1.2rem);
  color: var(--text-md);
  line-height: 1.65;
  letter-spacing: -.01em;
  max-width: 58ch; /* Flow wider into center void */
  margin-bottom: 1.85rem;
}

/* Hero Action Buttons - Tactile & Prominent */
.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.85rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 1.02rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.btn-pill-accent {
  background: var(--accent-cyan) !important;
  color: #070d1a !important;
  font-weight: 750 !important;
  font-size: 1.05rem !important;
  padding: 0.85rem 2rem !important;
  border-radius: 9999px !important;
  border: 1px solid var(--accent-cyan) !important;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.3);
}

.btn-pill-accent:hover {
  background: #7dd3fc !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(56, 189, 248, 0.5);
  text-decoration: none !important;
}

.btn-pill-accent:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(56, 189, 248, 0.35);
}

.btn-secondary {
  background: var(--surface-card);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
  padding: 0.85rem 1.85rem;
  font-size: 1.02rem;
}

.btn-secondary:hover {
  border-color: var(--border-focus);
  background: var(--surface-raised);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.btn-secondary:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ============================================
   HERO AVATAR — NO FOREHEAD CLIPPING
   Reduced scale (1.1), max-height 85vh, bottom-right anchor
   ============================================ */
.hero-media {
  position: absolute;
  inset: 0;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}

.avatar-backdrop-glow {
  position: absolute;
  top: 20%;
  right: 5%;
  transform: translate(0, -10%);
  width: clamp(480px, 48vw, 750px);
  height: clamp(480px, 48vw, 750px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.48) 0%, rgba(3, 105, 161, 0.28) 45%, transparent 72%);
  filter: blur(55px);
  z-index: 1;
  pointer-events: none;
}

.hero-cutout-img {
  position: absolute !important;
  bottom: -22vh !important;
  right: -3% !important;
  height: 120vh !important;
  max-height: none !important;
  width: auto !important;
  max-width: none !important;
  object-fit: contain !important;
  transform: none !important;
  z-index: 2 !important;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 24px 52px rgba(0, 0, 0, 0.8)) !important;
  display: block;
}

/* ============================================
   BOTTOM DOCK: ALIGNED TO CONSTRAINED WRAPPER
   ============================================ */
.project-ribbon {
  position: absolute;
  bottom: 2rem;
  left: clamp(2rem, 4%, 4rem);
  right: clamp(2rem, 4%, 4rem);
  width: auto;
  max-width: none;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface-solid);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.65);
  z-index: 10;
}

.ribbon-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.95rem;
  align-items: center;
  padding: 0.95rem 1.25rem;
  background: var(--surface-solid);
  text-decoration: none;
  color: var(--white);
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1), background var(--ease), border-color var(--ease);
}
.ribbon-card:last-child { border-right: none; }

.ribbon-card:hover {
  background: var(--surface-card);
  transform: translateY(-2px);
}
.ribbon-card:active {
  transform: translateY(1px);
}

.ribbon-mark {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: #080e1e;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  flex-shrink: 0;
  transition: border-color var(--ease), background var(--ease);
}
.ribbon-card:hover .ribbon-mark {
  border-color: var(--border-focus);
  background: var(--surface-raised);
}

.ribbon-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ribbon-copy strong {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.15rem;
  line-height: 1.2;
}

.ribbon-copy span:not(.ribbon-link) {
  font-size: 0.78rem;
  color: var(--text-slate);
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ribbon-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-md);
  margin-top: 0.45rem;
  letter-spacing: 0.02em;
  transition: color var(--ease);
}

/* ============================================
   SHARED: PAGE HEADER
   ============================================ */
.page-header {
  margin-bottom: 2.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--hairline-light);
}
.page-header h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.1;
  color: var(--white);
}
.page-header p {
  font-size: clamp(.88rem, 1.2vw, 1rem);
  color: var(--text-slate);
  margin-top: .4rem;
  max-width: 48ch;
  line-height: 1.5;
}

/* ============================================
   PORTFOLIO (100% Opaque Solid Surfaces)
   ============================================ */
.portfolio-section {
  margin-bottom: 2.75rem;
}
.portfolio-section h2 {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: 'DM Mono', monospace;
}
.section-icon { font-style: normal; }

.card {
  background: var(--surface-solid);
  border: 1px solid var(--hairline-light);
  border-radius: var(--r);
  padding: 1.35rem 1.5rem;
  margin-bottom: .85rem;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1), background var(--ease), border-color var(--ease);
}
.card:hover {
  background: var(--surface-card);
  border-color: var(--border-focus);
  transform: translateY(-2px);
}
.card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: .35rem;
  letter-spacing: -.01em;
}
.card p {
  font-size: .84rem;
  color: var(--text-slate);
  line-height: 1.6;
}

.exp-list {
  list-style: none;
  margin-top: .85rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: .5rem;
}
.exp-list li {
  font-size: .82rem;
  color: var(--text-slate);
  display: flex;
  align-items: baseline;
  gap: .55rem;
}
.exp-list li::before {
  content: '▸';
  color: var(--accent-cyan);
  font-size: .75rem;
  flex-shrink: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: .85rem;
}
.card-grid .card { margin-bottom: 0; }

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .85rem;
}
.pill {
  font-family: 'DM Mono', monospace;
  font-size: .68rem;
  padding: .2rem .5rem;
  border-radius: 4px;
  background: #080e1e;
  border: 1px solid var(--hairline-light);
  color: var(--text-slate);
}

/* ============================================
   PHOTOS & GALLERY (Opaque & Crisp)
   ============================================ */
.photo-filters {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.filter-btn {
  font-family: 'DM Mono', monospace;
  font-size: .78rem;
  font-weight: 500;
  padding: .45rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--hairline-light);
  background: var(--surface-solid);
  color: var(--text-slate);
  cursor: pointer;
  letter-spacing: .02em;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1), background var(--ease), color var(--ease), border-color var(--ease);
}
.filter-btn:hover {
  background: var(--surface-card);
  color: var(--white);
  border-color: var(--border-focus);
  transform: translateY(-2px);
}
.filter-btn:active {
  transform: translateY(1px);
}
.filter-btn.active {
  background: var(--accent-cyan);
  color: #070d1a;
  border-color: var(--accent-cyan);
  font-weight: 700;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  gap: .85rem;
}
.gallery-item {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-solid);
  border: 1px solid var(--hairline-light);
  display: flex;
  align-items: flex-end;
  padding: 0;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), border-color var(--ease), box-shadow 0.2s ease;
}
.gallery-item:hover {
  transform: translateY(-3px);
  border-color: var(--border-focus);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.gallery-item.hidden { display: none; }
.gallery-item.tall { grid-row: span 2; }
.gallery-item.wide { grid-column: span 2; }

.gallery-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s cubic-bezier(0.2, 0, 0, 1);
}
.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7, 13, 26, 0.9) 0%, rgba(7, 13, 26, 0.35) 45%, transparent 75%);
  display: flex;
  align-items: flex-end;
  padding: 1rem 1.15rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
  pointer-events: none;
}
.gallery-item:hover .gallery-overlay,
.gallery-item:focus-visible .gallery-overlay {
  opacity: 1;
}
.gallery-caption {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}


/* Lightbox Modal (100% Opaque Solid Surface) */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(4, 8, 18, 0.94);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}
.lightbox.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}
.lightbox-content {
  position: relative;
  max-width: 88vw;
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #020617;
  border: 1px solid var(--hairline-light);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.85);
  z-index: 1005;
}
.lightbox-content img {
  max-width: min(1000px, 86vw);
  max-height: 76vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.lightbox-caption {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  padding: 0.4rem 1.25rem;
  text-align: center;
  max-width: 88vw;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}
.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: rgba(7, 13, 26, 0.85);
  border: 1px solid var(--hairline-light);
  color: var(--white);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ease), border-color var(--ease), transform var(--ease);
  z-index: 2020;
  backdrop-filter: blur(8px);
}
.lightbox-close:hover {
  background: var(--surface-card);
  border-color: var(--border-focus);
  transform: scale(1.08);
}
.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(7, 13, 26, 0.85);
  border: 1px solid var(--hairline-light);
  color: var(--white);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ease), border-color var(--ease), transform var(--ease);
  z-index: 2015;
  user-select: none;
  backdrop-filter: blur(8px);
}
.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--surface-card);
  border-color: var(--border-focus);
  transform: translateY(-50%) scale(1.08);
}
.lightbox-prev:active,
.lightbox-next:active {
  transform: translateY(-50%) scale(0.96);
}

/* ============================================
   BLOG (Opaque Cards & Precise Typography)
   ============================================ */
.blog-empty-state {
  background: var(--surface-solid);
  border: 1px solid var(--hairline-light);
  border-radius: var(--r);
  padding: 3.5rem 2rem;
  text-align: center;
  max-width: 600px;
  margin: 1.5rem auto 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.blog-empty-icon {
  font-size: 2.75rem;
  margin-bottom: 1rem;
  line-height: 1;
}
.blog-empty-state h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}
.blog-empty-state p {
  font-size: 0.92rem;
  color: var(--text-slate);
  line-height: 1.6;
  margin-bottom: 1.75rem;
  max-width: 460px;
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: .85rem;
}
.blog-card {
  background: var(--surface-solid);
  border: 1px solid var(--hairline-light);
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1), background var(--ease), border-color var(--ease);
}
.blog-card:hover {
  background: var(--surface-card);
  border-color: var(--border-focus);
  transform: translateY(-2px);
}
.blog-card-img {
  height: 140px;
  background: #080e1e;
  border-bottom: 1px solid var(--hairline-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}
.blog-card-body {
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.blog-card-body .meta {
  font-family: 'DM Mono', monospace;
  font-size: .72rem;
  color: var(--accent-cyan);
  margin-bottom: .45rem;
  letter-spacing: .02em;
}
.blog-card-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.35;
  margin-bottom: .45rem;
  letter-spacing: -.01em;
}
.blog-card-body p {
  font-size: .82rem;
  color: var(--text-slate);
  line-height: 1.55;
  flex: 1;
}
.read-more {
  font-family: 'DM Mono', monospace;
  font-size: .76rem;
  font-weight: 600;
  color: var(--text-md);
  margin-top: .85rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  transition: color var(--ease);
}
.blog-card:hover .read-more { color: var(--accent-cyan); }

/* Blog Single Post View */
.blog-post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--hairline-light);
}
.back-to-blog {
  font-family: 'DM Mono', monospace;
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent-cyan);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: 1rem;
  cursor: pointer;
  transition: opacity var(--ease);
}
.back-to-blog:hover { opacity: 0.8; }
.blog-post-header h1 {
  font-size: clamp(1.8rem, 3.8vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.15;
  color: var(--white);
  margin-top: .5rem;
}
.blog-post-img {
  height: 200px;
  background: var(--surface-solid);
  border: 1px solid var(--hairline-light);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5rem;
  margin-bottom: 2rem;
}
.blog-content {
  font-size: .95rem;
  line-height: 1.8;
  color: var(--text-slate);
  max-width: 68ch;
}
.blog-content p { margin-bottom: 1.25rem; }
.blog-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  margin: 1.75rem 0 .75rem;
  letter-spacing: -.02em;
}
.blog-content ol, .blog-content ul {
  margin: 1rem 0 1.25rem 1.5rem;
}
.blog-content li { margin-bottom: .5rem; }

/* ============================================
   CONTACT (Opaque Solid Surfaces)
   ============================================ */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
}

.contact-form-wrap,
.contact-aside {
  background: var(--surface-solid);
  border: 1px solid var(--hairline-light);
  border-radius: var(--r);
  padding: 1.75rem;
}

.form-group {
  margin-bottom: 1.15rem;
}
.form-group label {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: .74rem;
  font-weight: 500;
  color: var(--text-slate);
  margin-bottom: .45rem;
  letter-spacing: .02em;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: .7rem .9rem;
  font-family: inherit;
  font-size: .88rem;
  background: #080e1e;
  border: 1px solid var(--hairline-light);
  border-radius: 6px;
  color: var(--white);
  transition: border-color var(--ease);
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}
.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.btn-primary {
  background: var(--accent-cyan);
  color: #070d1a;
  border: 1px solid var(--accent-cyan);
  font-weight: 700;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.12s ease, background 0.12s ease;
}
.btn-primary:hover {
  background: #7dd3fc;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.4);
}
.btn-primary:active {
  transform: translateY(1px);
}

.contact-form button[type="submit"] {
  max-width: 100%;
  white-space: normal;
  text-align: center;
  line-height: 1.35;
}

.contact-aside h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1rem;
}
.social-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem;
  background: #080e1e;
  border: 1px solid var(--hairline-light);
  border-radius: 6px;
  text-decoration: none;
  color: var(--white);
  margin-bottom: .75rem;
  font-size: .88rem;
  font-weight: 600;
  transition: transform 0.12s cubic-bezier(0.2, 0, 0, 1), border-color var(--ease);
}
.social-link:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
}
.social-link:active {
  transform: translateY(1px);
}
.contact-note {
  font-size: .84rem;
  color: var(--text-slate);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.contact-meta .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--accent-cyan);
  background: #080e1e;
  border: 1px solid var(--hairline-light);
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
}
.contact-meta .dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

/* ============================================
   RESPONSIVE: CINEMATIC FULL-SCREEN COVER (max-width: 1023px)
   Avatar fills viewport as background, text bottom-docked
   with gradient scrim for readability
   ============================================ */
@media (max-width: 1023px) {

  /* ── Full-screen viewport lock ── */
  #home {
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    padding: 0;
  }

  #home .hero-container {
    position: relative;
    height: 100%;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    max-width: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
  }

  .hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    min-height: 100vh;
    width: 100%;
    padding: 0;
    gap: 0;
  }

  /* ── Avatar as full-screen background ── */
  .hero-media {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 1 !important;
    overflow: hidden;
    pointer-events: none;
  }

  .hero-cutout-img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    bottom: auto !important;
    right: auto !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: none !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: center 15% !important;
    transform: none !important;
    margin: 0 !important;
    filter: none !important;
    display: block;
    z-index: 1 !important;
  }

  .avatar-backdrop-glow {
    display: none;
  }

  /* ── Bottom-docked text with gradient scrim ── */
  .hero-copy {
    position: relative;
    z-index: 10;
    margin-top: auto;
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
    padding: clamp(6rem, 18vh, 10rem) clamp(1.25rem, 5vw, 2rem) 1.25rem;
    align-self: stretch;
    align-items: center;
    text-align: center;
    /* Gradient scrim behind text */
    background: linear-gradient(
      to top,
      #020617 0%,
      rgba(2, 6, 23, 0.92) 25%,
      rgba(2, 6, 23, 0.7) 50%,
      rgba(2, 6, 23, 0.3) 75%,
      transparent 100%
    );
  }

  .hero-eyebrow {
    font-size: 0.78rem;
    margin-bottom: 0.5rem;
    color: rgba(56, 189, 248, 0.9);
  }

  .hero h1 {
    font-size: clamp(2.4rem, 8vw, 3.6rem);
    font-weight: 850;
    line-height: 1.05;
    letter-spacing: -0.02em;
    max-width: none;
    margin-bottom: 0.5rem;
    text-align: center;
    color: #ffffff;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
  }

  .hero-alias {
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
  }

  .hero-sub {
    font-size: clamp(1.1rem, 3.5vw, 1.5rem);
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.65rem;
    text-align: center;
    max-width: none;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
  }

  .hero-bio {
    font-size: clamp(0.88rem, 2.4vw, 1.02rem);
    line-height: 1.55;
    max-width: 44ch;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.25rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
  }

  .hero-actions {
    justify-content: center;
    width: 100%;
    gap: 0.85rem;
  }

  /* ── Project cards below text, above avatar ── */
  .project-ribbon {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    width: 100%;
    max-width: 100%;
    margin: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }
  .ribbon-card:nth-child(2) {
    border-right: none;
  }
  .ribbon-card:nth-child(1),
  .ribbon-card:nth-child(2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--surface-solid);
    border-bottom: 1px solid var(--hairline-light);
    padding: 1rem;
    gap: 0.4rem;
    transform: translateY(-110%);
    transition: transform var(--ease);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.6);
    visibility: hidden;
    pointer-events: none;
  }
  .nav-links.open {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }
  .nav-links a {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.92rem;
  }
  .nav-pill-cta {
    width: 100%;
    border-radius: 6px !important;
    padding: 0.75rem 1rem !important;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 150px;
  }
  .contact-layout {
    grid-template-columns: 1fr;
  }
  .card-grid, .blog-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .project-ribbon {
    grid-template-columns: 1fr;
  }
  .ribbon-card {
    border-right: none;
    border-bottom: 1px solid var(--hairline-light);
  }
  .ribbon-card:last-child {
    border-bottom: none;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: clamp(2.3rem, 9vw, 2.9rem);
  }
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .ribbon-card {
    padding: 1.1rem;
    gap: 0.85rem;
  }
  .ribbon-mark {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 240px;
  }
  .gallery-item.tall { grid-row: span 1; }
  .gallery-item.wide { grid-column: span 1; }
}

/* ============================================
   ACCESSIBILITY FOCUS OUTLINES
   ============================================ */
.nav-links a:focus-visible,
.nav-brand:focus-visible,
.btn:focus-visible,
.ribbon-card:focus-visible,
.filter-btn:focus-visible,
.card:focus-visible,
.blog-card:focus-visible,
.social-link:focus-visible,
.gallery-item:focus-visible,
.back-to-blog:focus-visible,
.lightbox-close:focus-visible,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* ============================================
   FOOTER (Minimalist & Semantic Credits)
   ============================================ */
footer,
.site-footer {
  margin-top: 4rem;
  padding: 2.25rem 1rem 3rem;
  border-top: 1px solid var(--hairline-light);
  background: transparent;
  position: relative;
  z-index: 10;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.footer-line-primary {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.6;
}

.footer-line-secondary {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.5;
}
