/* ==========================================================================
   PRECISION ENGINEERING DRAFTING THEME & LAYOUT ENGINE
   ========================================================================== */
:root {
  --bg-primary: #0f131a;
  --bg-surface: rgba(22, 27, 36, 0.96);
  --theme-ares: #00f0ff;
  --theme-ares-glow: rgba(0, 240, 255, 0.35);
  --theme-accent: #ff3366;
  --text-primary: #f0f4f8;
  --text-muted: #8a99ad;
  --font-sans: 'Sora', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  
  --grid-gap: clamp(1rem, 2vw, 2.5rem);
  --tile-inner-spacing: 1.25rem;
  --header-height: 4rem;
  --overlay-top-buffer: 1.25rem;
}

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

html {
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
  background-color: var(--bg-primary);
  scrollbar-gutter: stable;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  font-size: clamp(0.9rem, 1vw + 0.5rem, 1.1rem);
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

body.modal-open {
  overflow: hidden !important;
}

.container {
  width: 100%; 
  max-width: 100%; 
  margin: 0 auto; 
  padding: 0 var(--grid-gap); 
}

.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.tech-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--theme-ares);
  letter-spacing: 0.08em;
}

/* ==========================================================================
   HEADER BRANDING & NAVIGATION
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(15, 19, 26, 0.96);
  backdrop-filter: blur(12px);
  padding: 0.8rem 0;
  height: var(--header-height);
  width: 100%;
  border-bottom: 1px solid rgba(0, 240, 255, 0.1);
}

.nav-container {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 100%;
}

.header-nav.left-nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.25rem;
  grid-column: 1;
}

.centered-logo { 
  font-family: var(--font-mono); 
  font-weight: 700; 
  color: var(--text-primary); 
  text-decoration: none; 
  font-size: 1.25rem; 
  letter-spacing: 0.03em;
  text-align: center;
  grid-column: 2;
}

.header-telemetry.right-nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  grid-column: 3;
}

.telemetry-badge {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.status-dot {
  color: var(--theme-ares);
  font-size: 0.75rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  transform: translateY(-1px);
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.nav-contact-link {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--theme-ares);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-contact-link:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

/* ==========================================================================
   8x4 MESH GRID HERO
   ========================================================================== */
.hero-section {
  width: 100%;
  max-width: 100%;
  position: relative;
  background-color: var(--bg-primary);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0.5rem;
}

.grid-mesh-container {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  width: 100%;
  gap: 8px;
}

.grid-tile {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #161b24;
  border-radius: 4px;
  overflow: hidden;
  border: none;
  transform: translateZ(0);
}

.grid-mesh-container .grid-tile:not(.hero-center-tile) img.bg-img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: var(--tile-pos, 50% 50%) !important;
  transform: scale(var(--tile-zoom, 1)) !important;
  filter: grayscale(100%) contrast(110%);
  opacity: 0.85;
  transition: filter 0.5s ease-out, opacity 0.5s ease-out !important;
}

.grid-mesh-container .grid-tile:not(.hero-center-tile):hover img.bg-img {
  filter: grayscale(0%) contrast(100%) !important;
  opacity: 1 !important;
  transition: filter 0.05s ease-in, opacity 0.05s ease-in !important;
}

.hero-center-tile {
  grid-column: 3 / span 4;
  grid-row: 2 / span 2;
  aspect-ratio: auto !important;
  border: 1.5px solid var(--theme-ares);
  box-shadow: 0 0 30px var(--theme-ares-glow);
  z-index: 10;
  overflow: hidden;
  border-radius: 6px;
}

.grid-mesh-container .hero-center-tile img.bg-img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: 50% 30% !important;
  filter: grayscale(0%) contrast(100%) !important;
  opacity: 1 !important;
}

/* ==========================================================================
   PROJECTS GRID WITH STRICT MATCHING PREVIEWS & CONTAINER TYPOGRAPHY
   ========================================================================== */
.projects-section {
  padding: 1.5rem var(--grid-gap) 5rem var(--grid-gap);
  position: relative;
  width: 100%;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--grid-gap);
  width: 100%;
}

.project-tile {
  container-type: inline-size;
  container-name: tile;

  border-radius: 1rem;
  padding: var(--tile-inner-spacing);
  display: flex;
  flex-direction: column;
  gap: var(--tile-inner-spacing);
  justify-content: space-between;
  cursor: pointer;
  border: 1px solid rgba(0, 240, 255, 0.15);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  background: rgba(22, 27, 36, 0.92);
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.project-tile:hover {
  transform: translateY(-6px);
  border: 1.5px solid var(--theme-ares);
  box-shadow: 0 0 25px var(--theme-ares-glow);
}

.tile-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-shrink: 0;
}

.tile-number-badge {
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 3.2cqw, 0.9rem);
  font-weight: 700;
  color: var(--theme-ares);
  background: rgba(0, 240, 255, 0.08);
  padding: 0.15rem 0.5rem;
  border-radius: 0.35rem;
  border: none;
}

.tile-hero-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.5rem;
  overflow: hidden;
  flex-shrink: 0;
  background-color: transparent;
  margin: auto 0;
  position: relative;
}

.tile-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover !important;
  filter: none !important;
}

.tile-body {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
  overflow: hidden;
}

.project-tile h3,
.modal-preview-body h3 {
  font-size: clamp(1rem, 4.8cqw, 1.45rem);
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.project-tile p,
.modal-preview-body p {
  color: var(--text-muted);
  font-size: clamp(0.78rem, 3.6cqw, 1.02rem);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   FLIP ANIMATION ENGINE & OVERLAY CONTAINER
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  background: rgba(15, 19, 26, 0); 
  backdrop-filter: blur(0px); 
  -webkit-backdrop-filter: blur(0px);
  z-index: 99990; 
  display: none; 
  pointer-events: none;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-top: calc(var(--header-height) + var(--overlay-top-buffer));
  padding-bottom: clamp(1.5rem, 3vw, 3rem);
  padding-left: clamp(1rem, 3vw, 2.5rem);
  padding-right: clamp(1rem, 3vw, 2.5rem);
  box-sizing: border-box;
  transition: background 0.35s cubic-bezier(0.16, 1, 0.3, 1), backdrop-filter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  pointer-events: auto;
  background: rgba(15, 19, 26, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.expanding-card {
  container-type: inline-size;
  container-name: tile;
  
  position: fixed; 
  z-index: 99995; 
  background: var(--bg-surface);
  border: 1.5px solid var(--theme-ares);
  box-shadow: 0 0 40px var(--theme-ares-glow);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  will-change: top, left, width, height, padding, box-shadow;
}

.expanding-card.animating {
  position: fixed !important; 
  z-index: 99995 !important;
  transition: top 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              left 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              width 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              padding 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.expanding-card.closing {
  box-shadow: 0 0 0px rgba(0, 240, 255, 0) !important;
  border-color: rgba(0, 240, 255, 0.15) !important;
}

.expanding-card.expanded:not(.animating) {
  position: relative !important;
  margin: 0 auto !important;
  justify-content: flex-start;
}

.expanding-card.closing .expanded-body-content {
  display: none !important;
}
.expanding-card.closing .modal-preview-header,
.expanding-card.closing .modal-preview-body {
  opacity: 1 !important;
  position: static !important;
  pointer-events: auto !important;
  display: flex !important;
  transition: none !important;
}
.expanding-card.closing .banner-tile-wrapper.left-hero,
.expanding-card.closing .banner-tile-wrapper.right-hero {
  opacity: 0 !important;
  transition: none !important;
}

.expanded-hero-banner {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: transparent;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 0.5rem;
  padding: 0;
  margin: auto 0;
  border-bottom: none !important;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.expanding-card.expanded .expanded-hero-banner {
  height: auto;
  aspect-ratio: auto;
  padding: 1.25rem 1.25rem 0 1.25rem;
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
}

.banner-tile-wrapper {
  position: absolute;
  top: 0;
  height: 100%;
  overflow: hidden;
  border-radius: 8px;
  background-color: transparent;
  border: none !important;
  outline: none !important;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.expanding-card.expanded .banner-tile-wrapper {
  position: relative;
  top: 0;
  flex: 1;
  aspect-ratio: 16 / 9;
  height: auto;
}

.banner-tile-wrapper.center-hero {
  left: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  z-index: 2;
  border-radius: 0.5rem;
}

.expanding-card.expanded .banner-tile-wrapper.center-hero {
  left: 0;
  width: auto;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
}

.banner-tile-wrapper.left-hero,
.banner-tile-wrapper.right-hero {
  left: 0;
  width: auto;
  aspect-ratio: 16 / 9;
  opacity: 0;
  z-index: 1;
}

.expanding-card.expanded .banner-tile-wrapper.left-hero,
.expanding-card.expanded .banner-tile-wrapper.right-hero {
  left: 0;
  opacity: 1;
}

.banner-tile-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover !important;
  border: none !important;
  outline: none !important;
}

.modal-preview-header, .modal-preview-body {
  transition: opacity 0.2s ease;
  opacity: 1;
  flex-shrink: 0;
}
.modal-preview-header { padding-bottom: 0; display: flex; align-items: center; }
.modal-preview-body { display: flex; flex-direction: column; justify-content: flex-end; gap: 0.25rem; overflow: hidden; }

.expanding-card.expanded .modal-preview-header,
.expanding-card.expanded .modal-preview-body {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}
.expanding-card.expanded:not(.animating) .modal-preview-header,
.expanding-card.expanded:not(.animating) .modal-preview-body {
  display: none;
}

.expanded-body-content {
  display: none; 
  opacity: 0;
  padding: clamp(1.25rem, 2.5vw, 2.25rem);
  color: var(--text-primary);
  transition: opacity 0.3s ease 0.1s;
}
.expanding-card.expanded .expanded-body-content {
  display: block;
  opacity: 1;
}

.expanded-header-row { display: flex; justify-content: space-between; align-items: stretch; gap: 1.5rem; margin-bottom: 1rem; }
.expanded-title-group { flex: 1; }
.expanded-body-content h2 { font-family: var(--font-sans); font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 600; line-height: 1.25; margin-bottom: 0.35rem; color: var(--text-primary); }
.expanded-body-content p.expanded-subtitle { font-family: var(--font-sans); color: var(--text-muted); font-size: clamp(0.95rem, 1vw + 0.5rem, 1.1rem); line-height: 1.6; }

.collaborators-group { display: flex; align-items: stretch; gap: 0.85rem; flex-shrink: 0; }
.collaborator-item { display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center; height: 100%; }
.collab-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background-color: #262d3a; flex-shrink: 0; border: none !important; }

.collab-avatar-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #2b3342;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.collab-avatar-placeholder svg {
  display: block;
  opacity: 0.85;
}

.collab-text-wrapper { display: flex; flex-direction: column; align-items: center; }
.collab-name { font-size: 0.82rem; font-weight: 600; line-height: 1.2; }
.collab-role { font-size: 0.75rem; color: var(--text-muted); line-height: 1.2; }

/* ==========================================================================
   MODULAR CONTENT BLOCKS & TYPOGRAPHY STANDARDS
   ========================================================================== */
.project-blocks-container { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; width: 100%; }
.block-text { color: var(--text-primary); width: 100%; }
.block-text h2 { font-family: var(--font-mono); color: var(--theme-ares); font-size: clamp(1.1rem, 1.8vw, 1.35rem); margin: 1.25rem 0 0.5rem 0; font-weight: 600; text-transform: none; }
.block-text h3 { font-family: var(--font-mono); color: var(--theme-ares); font-size: 1.15rem; margin: 1rem 0 0.5rem 0; text-transform: none; }
.block-text h3.section-category-title {
  color: var(--theme-ares); /* or your exact title blue */
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;     /* Spacing above the section title */
  margin-bottom: 0.5rem;  /* Spacing between title and content below — matches text-section headers */
}
.block-text p { font-family: var(--font-sans); color: var(--text-muted); line-height: 1.6; margin-bottom: 0.75rem; font-size: clamp(0.95rem, 1vw + 0.5rem, 1.1rem); }
.block-text ul { font-family: var(--font-sans); padding-left: 1.25rem; color: var(--text-muted); margin-bottom: 1rem; font-size: clamp(0.95rem, 1vw + 0.5rem, 1.1rem); line-height: 1.6; }
.block-text li { font-family: var(--font-sans); font-size: clamp(0.95rem, 1vw + 0.5rem, 1.1rem); line-height: 1.6; margin-bottom: 0.35rem; }
.block-text strong { color: #cbd5e1; font-weight: 600; }

.block-media { width: 100%; border-radius: 8px; overflow: hidden; border: none !important; outline: none !important; background: #161b24; }
.block-media img { 
  width: 100%; 
  height: auto; 
  max-height: 500px;
  object-fit: cover !important; 
  display: block; 
  border: none !important;
  outline: none !important;
}
.block-media video {
  width: 100%;
  display: block;
  object-fit: cover;
  border: none !important;
  outline: none !important;
}
.block-media.block-media-full img {
  max-height: none;
  object-fit: contain !important;
}
.block-pdf {
  position: relative;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: none !important;
  outline: none !important;
  background: #161b24;
}
.block-pdf-pages {
  width: 100%;
  max-height: 40vh;
  overflow-y: auto;
  background: #f0f4f8;
}
.block-pdf-pages canvas {
  width: 100%;
  height: auto;
  display: block;
}
.block-pdf-pages canvas + canvas {
  margin-top: 2px;
}
.block-pdf-loading {
  padding: 2.5rem 1rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}
.pdf-open-btn {
  bottom: 12px;
  right: 12px;
}

.block-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: center; width: 100%; }

.block-split .split-text-content h4 {
  font-family: var(--font-sans);
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.block-split .split-text-content ul {
  font-family: var(--font-sans);
  padding-left: 1.2rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  font-size: clamp(0.95rem, 1vw + 0.5rem, 1.1rem);
  line-height: 1.6;
}

.block-split .split-text-content li {
  font-family: var(--font-sans);
  font-size: clamp(0.95rem, 1vw + 0.5rem, 1.1rem);
  margin-bottom: 0.3rem;
  line-height: 1.6;
}

.split-media-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
}

.split-media-wrapper img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover !important;
  border-radius: 6px;
  border: none !important;
  outline: none !important;
}

/* Stacked variant: both images pushed into one narrow left column instead of
   a side-by-side pair, so the text column can stretch wider. Opt-in via
   "layout": "stacked" on a split block — doesn't affect any other block. */
.block-split-stacked {
  grid-template-columns: 1fr 2fr;
}
.block-split-stacked .split-media-wrapper {
  grid-template-columns: 1fr;
}

/* Split Video Grid & Centered Play Icon Overlay */
.video-container-wrapper,
.split-video-wrapper {
  width: 100%;
}

.split-video-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.video-container-wrapper,
.split-video-item {
  position: relative;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  border: none !important;
  outline: none !important;
  background: #161b24;
}

.split-video-item {
  aspect-ratio: 1 / 1;
}

.video-container-wrapper video,
.split-video-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: default;
  border: none !important;
  outline: none !important;
  transition: transform 0.25s ease;
}

.split-video-item:hover video {
  transform: scale(1.03);
  border: none !important;
}

/* Centered Minimal Play Button Overlay */
.minimal-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(15, 19, 26, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 5;
}

.minimal-play-overlay svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: #ffffff;
  transform: translateX(1px);
}

.video-container-wrapper:hover .minimal-play-overlay,
.split-video-item:hover .minimal-play-overlay,
.video-container-wrapper.is-playing .minimal-play-overlay,
.split-video-item.is-playing .minimal-play-overlay {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
}

/* ==========================================================================
   CAD MODULE - EXACT TYPOGRAPHY MATCHING PROJECT DESCRIPTION
   ========================================================================== */
.block-cad-container {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.block-cad-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  width: 100%;
  border-radius: 8px;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  align-items: stretch;
}

/* Prevent layout baseline gaps and hide internal loading elements */
.cad-viewport-container { 
  width: 100%; 
  aspect-ratio: 16 / 9; 
  min-height: 320px; 
  background-color: transparent !important; 
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

model-viewer {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  background-color: transparent !important;
  --poster-color: transparent !important;
  --progress-bar-color: transparent !important;
  --progress-bar-height: 0px !important;
  --progress-mask: transparent !important;
  outline: none !important;
  border: none !important;
}

/* Hide model-viewer built-in loading poster slot & progress bar DOM */
model-viewer::part(default-progress-bar) {
  display: none !important;
}

model-viewer::part(poster) {
  background-color: transparent !important;
  border: none !important;
  display: none !important;
}
.cad-controls-panel { 
  padding: 0; 
  display: flex; 
  flex-direction: column; 
  justify-content: space-between; 
  border: none !important; 
  background: transparent !important; 
}

.cad-view-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: baseline; 
  margin-bottom: 0.5rem; 
  padding-bottom: 0;
  border: none !important;
}

.cad-view-label { 
  font-family: var(--font-sans); 
  font-size: 1.2rem; 
  font-weight: 600; 
  color: var(--text-primary); 
  line-height: 1.3;
}

.cad-view-counter { 
  font-family: var(--font-mono); 
  font-size: 0.85rem; 
  color: var(--text-muted); 
}

.cad-view-body { 
  font-family: var(--font-sans);
  color: var(--text-muted); 
  font-size: clamp(0.95rem, 1vw + 0.5rem, 1.1rem); 
  line-height: 1.6; 
  flex-grow: 1; 
}

.cad-view-body p {
  font-family: var(--font-sans);
  color: var(--text-muted);
  font-size: clamp(0.95rem, 1vw + 0.5rem, 1.1rem);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.glass-icon-btn {
  position: absolute;
  width: 48px;
  height: 48px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(15, 19, 26, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  cursor: pointer;
  z-index: 2;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.glass-icon-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.glass-icon-btn:hover {
  background: rgba(0, 240, 255, 0.25);
  border-color: var(--theme-ares);
}

.cad-arrow-btn {
  top: 50%;
  transform: translateY(-50%);
}

.cad-arrow-btn:active {
  transform: translateY(-50%) scale(0.92);
}

.cad-arrow-prev { left: 12px; }
.cad-arrow-next { right: 12px; }

/* ==========================================================================
   EMAIL COPY TOAST
   ========================================================================== */
.email-toast {
  position: fixed;
  top: calc(var(--header-height) + 0.75rem);
  left: 50%;
  transform: translate(-50%, -8px);
  background: var(--theme-ares);
  color: #0f131a;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.6rem 1.1rem;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100010;
  white-space: nowrap;
}
.email-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  padding: 3rem 0;
  text-align: center; 
  margin-top: 4rem; 
}

.footer-copyright {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ==========================================================================
   MOBILE BACK BUTTON (Visible strictly when tile is expanded on mobile)
   ========================================================================== */
.mobile-modal-back-btn {
  display: none;
}

.mobile-bottom-back-wrapper {
  display: none;
}

/* ==========================================================================
   MOBILE BREAKPOINTS
   ========================================================================== */
@media (max-width: 768px) {
  .site-header {
    height: auto;
    padding: 0.65rem 0;
  }

  .nav-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    height: auto;
    padding: 0 1rem;
  }

  .centered-logo {
    order: 1;
    grid-column: unset;
    font-size: 1.15rem;
    letter-spacing: 0.04em;
    padding: 0.1rem 0;
  }

  .header-nav.left-nav {
    order: 2;
    grid-column: unset;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.15rem;
    width: 100%;
  }

  .nav-contact-link {
    font-size: 0.82rem;
  }

  .header-telemetry.right-nav {
    order: 3;
    grid-column: unset;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
  }

  .telemetry-badge {
    font-size: 0.74rem;
  }

  .hero-section {
    padding: 0.5rem 6px;
    width: 100%;
    max-width: 100%;
  }

  .grid-mesh-container {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(8, auto);
    gap: 6px;
  }

  .hero-center-tile {
    grid-column: 1 / span 4 !important;
    grid-row: 4 / span 2 !important;
    aspect-ratio: 16 / 9 !important;
    min-height: 200px;
  }

  .projects-section {
    padding: 1.25rem 12px 4rem 12px;
  }

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

  .project-tile {
    padding: 1rem;
    border-radius: 0.85rem;
    -webkit-tap-highlight-color: transparent;
  }

  .modal-overlay {
    padding: 12px 12px 32px 12px;
    align-items: flex-start;
  }

  body.modal-open .mobile-modal-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    position: fixed;
    top: 26px;
    left: 26px;
    z-index: 100005;
    background: rgba(15, 19, 26, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid var(--theme-ares);
    color: var(--theme-ares);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.45rem 0.95rem;
    border-radius: 9999px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7), 0 0 15px var(--theme-ares-glow);
    cursor: pointer;
    outline: none;
    transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  body.modal-open .mobile-modal-back-btn:active {
    transform: scale(0.94);
    background: rgba(0, 240, 255, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 20px var(--theme-ares-glow);
  }

  .mobile-modal-back-btn svg {
    display: block;
    flex-shrink: 0;
  }

  body.modal-open .mobile-bottom-back-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 240, 255, 0.15);
  }

  .mobile-bottom-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 320px;
    padding: 0.85rem 1.25rem;
    background: rgba(0, 240, 255, 0.08);
    border: 1.5px solid var(--theme-ares);
    border-radius: 0.5rem;
    color: var(--theme-ares);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    box-shadow: 0 0 15px var(--theme-ares-glow);
    transition: background 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-bottom-back-btn:active {
    transform: scale(0.97);
    background: rgba(0, 240, 255, 0.22);
  }

  .expanding-card.expanded {
    border-radius: 1.25rem !important;
    max-width: 100% !important;
  }

  .expanding-card.expanded .expanded-hero-banner {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
    padding: 3.75rem 0.75rem 0.5rem 0.75rem !important;
  }

  .expanding-card.expanded .banner-tile-wrapper.center-hero {
    order: 1 !important;
    display: block !important;
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    opacity: 1 !important;
    border-radius: 6px !important;
  }

  .expanding-card.expanded .banner-tile-wrapper.right-hero {
    order: 2 !important;
    display: block !important;
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    opacity: 1 !important;
    border-radius: 6px !important;
  }

  .expanding-card.expanded .banner-tile-wrapper.left-hero {
    order: 3 !important;
    display: block !important;
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    opacity: 1 !important;
    border-radius: 6px !important;
  }

  .expanded-body-content {
    padding: 1.25rem 0.85rem 2rem 0.85rem;
  }

  .expanded-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
  }

  .expanded-body-content h2 {
    font-size: 1.35rem;
    line-height: 1.25;
  }

  .expanded-body-content p.expanded-subtitle,
  .block-text p,
  .block-text ul,
  .block-text li,
  .cad-view-body,
  .cad-view-body p,
  .block-split .split-text-content p,
  .block-split .split-text-content ul,
  .block-split .split-text-content li {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .collaborators-group {
    align-self: flex-start;
    flex-wrap: wrap;
    gap: 0.85rem;
  }

  .block-split, .block-cad-split {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .cad-viewport-container {
    min-height: 280px;
  }

  .cad-controls-panel {
    border-left: none;
    padding-top: 0.5rem;
  }

  .glass-icon-btn {
    width: 40px;
    height: 40px;
  }

  .glass-icon-btn svg {
    width: 18px;
    height: 18px;
  }
}
