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

:root {
  --bg: #05060a;
  --text: #e9f8ff;

  --panel: rgba(0, 0, 0, 0.72);

  /* nav control look */
  --nav-bg: rgba(0, 0, 0, 0.45);
  --nav-bg-hover: rgba(0, 0, 0, 0.60);
  --nav-stroke: rgba(255, 255, 255, 0.22);
  --nav-stroke-hover: rgba(255, 255, 255, 0.35);

  /* full-width glass bar behind nav controls */
  /* a bit clearer / more see-through */
  --topbar-glass: rgba(6, 8, 14, 0.26);
  --topbar-glass-hi: rgba(255, 255, 255, 0.12);
  --topbar-glass-border: rgba(255, 255, 255, 0.16);
}

:root{
  /* terminal / accent colors — changed to grey to desaturate nav theme */
  --term-green: #8b8f94; /* primary accent (now grey) */
  --term-green-dim: rgba(139,143,148,0.65); /* dimmer accent */
  --term-green-muted: rgba(139,143,148,0.22);
  --term-green-outline: rgba(139,143,148,0.10);
  --term-green-soft: rgba(139,143,148,0.06);
  --term-green-hover-border: rgba(139,143,148,0.18);
  --term-green-caret: rgba(139,143,148,0.90);
  --term-muted: rgba(180,190,200,0.55);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  font-family: Consolas, "Lucida Console", "Courier New", monospace;
  color: var(--text);
}

a {
  color: #4da8ff; /* Lighter blue */
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== NAV (NO BANNER) ===== */
.topbar{
  position: fixed;
  top: 12px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  z-index: 20;

  width: fit-content;
  max-width: calc(100vw - 24px);

  display: flex;
  justify-content: center;
  pointer-events: none;
}

.topbar-spacer { height: 80px; }

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 10px;

  /* buttons stay clickable */
  pointer-events: auto;
}

/* One quiet bar holding every control, rather than a row of bordered pills */
.nav-right{
  position: relative;
  padding: 6px 10px;
  border-radius: 14px;
  width: 100%;

  background: rgba(10, 12, 15, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);

  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
}

/* Fix: keep the desktop nav items in one horizontal row */
.nav-desktop{
  display: flex;
  align-items: center;
  gap: 12px;           /* spacing inside desktop group too */
  flex: 0 0 auto;
}

/* Fix: don’t let the topbar wrap into multiple lines */
.nav-right{
  display: flex;
  align-items: center;
  gap: 12px;           /* <-- spacing between ALL buttons */
  pointer-events: auto;
  flex-wrap: nowrap;
}

/* Clear clickable cursor */
.nav-control,
.dropdown-btn,
.dropdown-item,
.icon-link,
.brand {
  cursor: pointer;
}

/* Show pointer cursor when hovering the scene */
.scene {
  cursor: pointer;
}

/* Plain text links — no per-item box, border, or shadow.
   Font is set explicitly so the nav reads the same on every page. */
.nav-control {
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;

  display: inline-flex;
  align-items: center;

  background: transparent;
  border: 0;

  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 450;
  letter-spacing: 0;
  line-height: 1;
  color: rgba(255, 255, 255, 0.66);

  text-decoration: none;
  cursor: pointer;
  user-select: none;

  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-control:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-control:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: 2px;
}

.brand {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  white-space: nowrap;
  margin-right: 4px;
}

.brand:hover { background: transparent; }

@media (max-width: 420px) {
  /* ultra-small devices: keep one line without breaking layout */
  .brand {
    max-width: 46vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Floating Projects dropdown container (outside nav-right) */
.dropdown{
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 2005;
  pointer-events: none; /* enabled when open */
}

.dropdown-btn {
  /* button element: remove default styles that can affect sizing */
  appearance: none;
  -webkit-appearance: none;
}

/* ================================
   TERMINAL DROPDOWN (Projects menu)
   ================================ */

/* Terminal panel */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 12px; /* small gap below nav glass */
  min-width: 300px;
  padding: 8px;
  border-radius: 14px;

  /* matches the nav bar */
  background: rgba(10, 12, 15, 0.82) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45) !important;

  /* 3. MATCH NAV BAR BLUR & SATURATION */
  -webkit-backdrop-filter: blur(24px) saturate(170%) !important;
  backdrop-filter: blur(24px) saturate(170%) !important;

  /* Animation & Interaction logic */
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top left;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* ✅ JS-driven open state (no :has dependency) */
#projectsDropdown { pointer-events: none; }
#projectsDropdown.is-open { pointer-events: auto; }

#projectsDropdown.is-open .dropdown-menu{
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}


.dropdown-item{
  display: block;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  line-height: 1.3;

  padding: 10px 12px;
  border-radius: 8px;

  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  border: 0;
  position: relative;

  transition: background-color 0.12s ease, color 0.12s ease;
}

.dropdown-item:hover{
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none; /* override the global a:hover underline */
}

/* the project you're currently looking at */
.dropdown-item[aria-current="page"]{
  color: #fff;
}

.dropdown-item[aria-current="page"]::after{
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 16px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.55);
}

.dropdown-item:focus-visible{
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: -2px;
}

.dropdown-item .title{
  display: block;
  font-size: 0.94rem;
  font-weight: 500;
  color: #fff;
}

/* subtitles stay hidden (kept from the earlier design decision) */
.dropdown-item .sub{ display: none; }



/* ================================
   TERMINAL DROPDOWN (Projects menu)
   ================================ */

/* Wrap button + menu so hover works */
/* ================================
   PORTALED Projects dropdown (REAL blur)
   ================================ */

#projectsDropdown{
  position: fixed;
  left: 0;
  top: 0;
  z-index: 5000;
  pointer-events: none;
}

#projectsDropdown .projects-dropdown-menu{
  position: absolute;
  left: 0;
  top: 0;

  /* center under portal origin */
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -6px) scale(0.98);
  transform-origin: top center;
  transition: opacity 0.15s ease, transform 0.15s ease;

  -webkit-backdrop-filter: blur(24px) saturate(170%) !important;
  backdrop-filter: blur(24px) saturate(170%) !important;
}

#projectsDropdown.is-open{ pointer-events: auto; }

#projectsDropdown.is-open .projects-dropdown-menu{
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}


/* Open state */
.projects-dropdown.is-open{
  pointer-events: auto;
}
.projects-dropdown.is-open .projects-dropdown-menu{
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}


/* Open on hover OR keyboard focus */
.projects-wrap:hover .dropdown-menu,
.projects-wrap:focus-within .dropdown-menu{
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}


/* Open on hover OR keyboard focus */
.projects-wrap:hover .dropdown-menu,
.projects-wrap:focus-within .dropdown-menu{
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}







/* Icon buttons: bare glyphs, matching the text links */
.icon-link {
  width: 34px;
  height: 34px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 8px;
  background: transparent;
  border: 0;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.6);

  transition: color 0.15s ease, background-color 0.15s ease;
}

.icon-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.icon-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: 2px;
}

.icon-link svg { width: 18px; height: 18px; fill: currentColor; }

/* a small gap before the social icons, so they read as a separate group */
.icon-link:first-of-type { margin-left: 6px; }

/* ===== SCENE ===== */
.scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 1;
}

.scene__layer {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  position: absolute;
  inset: 0;
}

.scene__bg { z-index: 1; }
/* Start with lights OFF on the index page (room + robots) */
body.lights-off .scene__layer {
  filter: brightness(0.15) contrast(1.05) saturate(0.9);
}

/* Dim hold (barely visible room + robots) */
body.lights-dim .scene__layer {
  filter: brightness(0.22) contrast(1.08) saturate(0.92);
}

/* One-time flicker ON sequence (room only animates) */
body.lights-on .scene__bg {
  animation: lightsFlickerOn 1.25s ease-out forwards;
}

/* Keep robots visible during flicker (no animation, just final state) */
body.lights-on .robot {
  filter: inherit;
}

/* Keep the outside/window light layers “on” even when room is dark */
body.lights-off .window-light,
body.lights-dim .window-light {
  filter: brightness(1.05) contrast(1.05) saturate(1.1) !important;
  opacity: 1 !important;
}

@keyframes lightsFlickerOn {
  0%   { filter: brightness(0.10) contrast(1.10) saturate(0.85); }
  12%  { filter: brightness(0.90) contrast(1.05) saturate(1.00); }
  18%  { filter: brightness(0.25) contrast(1.10) saturate(0.90); }
  28%  { filter: brightness(1.00) contrast(1.02) saturate(1.02); }
  36%  { filter: brightness(0.55) contrast(1.06) saturate(0.95); }
  52%  { filter: brightness(1.05) contrast(1.02) saturate(1.03); }
  62%  { filter: brightness(0.78) contrast(1.04) saturate(0.98); }
  100% { filter: brightness(1.00) contrast(1.00) saturate(1.00); }
}

.robot {
  z-index: 2;
  pointer-events: auto; /* hit test manually in JS */
  transition: transform 0.25s ease, filter 0.25s ease, opacity 0.25s ease;
  filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0));
}

.robot.robot--hover,
.robot.robot--active {
  filter: url(#white-outline) !important;
}

/* ===== SIMPLE CONTENT PAGES ===== */
.page {
  position: relative;
  z-index: 2;
  padding: 24px;
  max-width: 980px;
  margin: 0 auto;
}

.card {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.35);
  border-radius: 16px;
  padding: 18px;
}

/* Prism code blocks (let the Prism theme control colors/fonts) */
pre[class*="language-"] {
  max-height: 70vh;
  overflow: auto;
  padding: 16px;
  border-radius: 8px;
}

/* Only style inline code that is NOT a Prism-highlighted block */
code:not([class*="language-"]) {
  color: inherit;
  font-family: inherit;
  background: rgba(255,255,255,0.06);
  padding: 0.15em 0.35em;
  border-radius: 6px;
}

/* ===== Custom cursor states ===== */
:root {
  --cursor-open: auto;
  --cursor-mid: pointer;
  --cursor-closed: auto;
}

body.cursor-open,
body.cursor-open *,
body.cursor-open .scene,
body.cursor-open .scene * { cursor: var(--cursor-open) !important; }

body.cursor-mid,
body.cursor-mid *,
body.cursor-mid .scene,
body.cursor-mid .scene * { cursor: var(--cursor-mid) !important; }

body.cursor-closed,
body.cursor-closed *,
body.cursor-closed .scene,
body.cursor-closed .scene * { cursor: var(--cursor-closed) !important; }

body.cursor-mid .nav-control,
body.cursor-mid .icon-link,
body.cursor-mid .dropdown-btn,
body.cursor-mid .dropdown-item { cursor: var(--cursor-mid); }

body.cursor-open .nav-control,
body.cursor-open .icon-link,
body.cursor-open .dropdown-btn,
body.cursor-open .dropdown-item { cursor: var(--cursor-open); }

body.cursor-closed .nav-control,
body.cursor-closed .icon-link,
body.cursor-closed .dropdown-btn,
body.cursor-closed .dropdown-item { cursor: var(--cursor-closed); }

body.cursor-closed .nav-control,
body.cursor-closed .icon-link,
body.cursor-closed .dropdown-btn,
body.cursor-closed .dropdown-item,
body.cursor-closed .brand { cursor: pointer !important; }

/* ===== PROJECT PAGE BACKDROP (subtle, not distracting) ===== */
body.project-page {
  background: #000;
}

body.project-page::before {
  content: none;
}

body.project-page main {
  position: relative;
  z-index: 1;
}

/* keep content above vignette */
.page { position: relative; z-index: 1; }

/* --- Prism font size override (must be last) --- */
pre[class*="language-"] > code[class*="language-"] {
  font-size: 1.0rem;
  line-height: 1.55;
}

body.ambient-light .scene__bg{
  animation: roomLight 8s infinite;
}

@keyframes roomLight{
  5%   { filter: brightness(1) contrast(1); }
  12%  { filter: brightness(0.85) contrast(1.02); }
  18%  { filter: brightness(0.98) contrast(1.00); }
  55%  { filter: brightness(0.90) contrast(1.01); }
  100% { filter: brightness(1) contrast(1); }
}

.vignette{
  position:absolute; inset:0;
  pointer-events:none;
  z-index:3;
  background: radial-gradient(circle at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  animation: vignettePulse 8s ease-in-out infinite;
}

@keyframes vignettePulse{
  0%,100% { opacity: 1; }
  50%     { opacity: .5; }
}

/* the tree layer element */
.tree-layer{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;     
  transform-origin: 70% 40%;
  animation: treeSway 6.5s ease-in-out infinite !important;
  will-change: transform; 
}

@keyframes treeSway{
  0%   { transform: rotate(-0.5deg) translateX(-2px); }
  50%  { transform: rotate( 0.5deg) translateX( 2px); }
  100% { transform: rotate(-0.5deg) translateX(-2px); }
}

@media (prefers-reduced-motion: reduce){
  .tree-layer{ animation: none; }
}

body.force-motion .tree-layer {
  animation: treeSway 6.5s ease-in-out infinite !important;
}

/* ===== Mobile nav ===== */
@media (max-width: 900px) {
  .topbar { pointer-events: auto; }
}

.nav-menu-btn {
  display: none;
  font-size: 1.25rem;
  width: 40px;
  height: 38px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  box-sizing: border-box;
  overflow: visible;
}

.drawer-backdrop,
.mobile-drawer {
  display: none;
}

@media (max-width: 900px) {
  .nav-desktop,
  .nav-right > .nav-desktop {
    display: none !important;
  }

  .nav-menu-btn {
    display: inline-flex !important;
  }

  .drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    opacity: 0;
    pointer-events: auto;
    transition: opacity 0.2s;
    z-index: 40;
  }

  .mobile-drawer {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(320px, 85vw);
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(12px);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    padding: 20px;
    z-index: 41;
  }

  .mobile-drawer a {
    display: block;
    padding: 12px 0;
    text-decoration: none;
    font-family: 'IBM Plex Sans', system-ui, sans-serif;
    color: rgba(255, 255, 255, 0.82);
  }

  .mobile-drawer a:hover { color: #fff; }

  /* section label, not a heading */
  .drawer-title {
    margin: 22px 0 2px;
    font-family: 'IBM Plex Sans', system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.38);
  }

  .mobile-drawer .drawer-title:first-child { margin-top: 4px; }

  body.drawer-open .drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.drawer-open .mobile-drawer {
    transform: translateX(0);
  }
}

.mobile-drawer a {
  font-size: 1.05rem;
  padding: 14px 0;
}
body.drawer-open {
  overflow: hidden;
}

.drawer-backdrop { z-index: 2000; }
.mobile-drawer   { z-index: 2001; }
.topbar          { z-index: 1500; }

.drawer-backdrop {
  pointer-events: none;
  opacity: 0;
}

body.drawer-open .drawer-backdrop {
  pointer-events: auto;
  opacity: 1;
}

.mobile-drawer {
  transform: translateX(105%);
}
body.drawer-open .mobile-drawer {
  transform: translateX(0);
}

.mobile-drawer .drawer-title + a,
.mobile-drawer .drawer-title ~ a {
  padding-left: 0;
}

@media (max-width: 700px) {
  .mobile-drawer .icon-link {
    display: inline-flex !important;
  }

  .drawer-social {
    display: flex;
    gap: 12px;
    margin-top: 10px;
  }

  .drawer-social .icon-link {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 900px) {
  .topbar {
    top: 10px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: calc(100vw - 24px);
  }

  .nav-right{
    width: 100%;
    justify-content: space-between;
  }

  .mobile-drawer {
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 24px;
  }
}

.icon-link svg{
  display: block;
}

/* ===== ABOUT DROP-DOWN OVERLAY ===== */

/* ===== ABOUT OVERLAY ===== */
.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(6, 7, 9, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  overflow-y: auto;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.about-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.about-sheet {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -12px);
  width: min(560px, 92vw);

  margin-top: clamp(90px, 16vh, 150px);
  margin-bottom: 60px;
  padding: 34px 36px 32px;

  background: rgba(16, 18, 22, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);

  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  color: #fff;

  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.about-overlay.is-open .about-sheet {
  transform: translate(-50%, 0);
}

.about-title {
  margin: 0 0 14px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #fff;
}

.about-lede {
  margin: 0 0 22px;
  font-size: 1.02rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.8);
}

.about-note {
  margin: 0 0 18px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 0.98rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.6);
}

.about-email {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;

  font-size: 0.96rem;
  color: #fff;
  text-decoration: none;

  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.about-email:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  text-decoration: none;
}

.about-email:focus-visible,
.about-close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: 2px;
}

.about-close {
  position: absolute;
  top: 14px;
  right: 14px;

  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;

  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;

  transition: color 0.15s ease, background-color 0.15s ease;
}

.about-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 520px) {
  .about-sheet { padding: 28px 22px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .about-overlay,
  .about-sheet { transition: none; }
}

/* Prevent native link/image drag cursors in the top nav */
.topbar, .topbar * {
  -webkit-user-drag: none;
  user-select: none;
}

/* ===== WINDOWS CMD PANEL (used by embedded code blocks) ===== */
.cmd{
  width: min(860px, 94vw);
  border: 1px solid rgba(255,255,255,0.18);
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0,0,0,0.75);
  font-family: Consolas, "Lucida Console", "Courier New", monospace;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
}

.cmd-titlebar{
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 10px;
  background: #0f0f10;
  border-bottom: 1px solid rgba(255,255,255,0.14);
}
.cmd-title{
  font-size: 0.85rem;
  color: rgba(255,255,255,0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmd-controls{
  display: inline-flex;
  gap: 2px;
}
.cmd-btn{
  width: 38px;
  height: 26px;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  border-radius: 4px;
  user-select: none;
}
.cmd-btn:hover{ background: rgba(255,255,255,0.08); }
.cmd-close:hover{ background: rgba(255,60,60,0.25); }

.cmd-body{
  padding: 12px 14px 6px;
  min-height: 240px;
  max-height: 48vh;
  overflow: hidden;
  color: rgba(255,255,255,0.92);
  font-size: 0.98rem;
  line-height: 1.45;
}

.cmd-line{
  white-space: pre-wrap;
}

.cmd-input{
  padding: 8px 14px 14px;
  display: flex;
  gap: 8px;
  align-items: baseline;
  color: rgba(255,255,255,0.92);
}

.cmd-path{ color: rgba(255,255,255,0.92); }
.typed{ color: rgba(255,255,255,0.92); }

.caret{
  width: 9px;
  height: 1.05em;
  background: rgba(255,255,255,0.85);
  display: inline-block;
  transform: translateY(2px);
  animation: caretBlink 0.8s steps(1) infinite;
}
@keyframes caretBlink{ 50%{ opacity: 0; } }

.cmd::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  -webkit-backdrop-filter: blur(24px) saturate(175%) !important;
  backdrop-filter: blur(24px) saturate(175%) !important;
}

.scroll-hint{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 12px);
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.9);
  font-size: 1rem;
  letter-spacing: 0.08em;
  opacity: 0;
  pointer-events: none;
  z-index: 120;
  text-shadow: 0 6px 28px rgba(0,0,0,0.4);
  transition: opacity 0.32s ease, transform 0.34s ease;
}

.scroll-hint--show{
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ===== Embedded CMD code panel (same style as loader) ===== */
.cmd.cmd--embed{
  width: 100%;
  max-width: none;
  position: relative;
}

.cmd-copy{
  margin-left: auto;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.88);
  font-family: inherit;
  cursor: pointer;
}
.cmd-copy:hover{ background: rgba(255,255,255,0.10); }

.typed--static{ opacity: 0.95; }

.cmd-body--code{
  max-height: 70vh;
  overflow: auto;
  padding: 0;
}

.cmd-body--code pre{
  margin: 0;
  padding: 12px 14px 14px;
  max-height: none;
  overflow: visible;
  background: transparent;
}

.cmd-body--code pre.line-numbers{
  padding-left: 3.2em;
}

.cmd-body--code code[class*="language-"],
.cmd-body--code pre[class*="language-"]{
  color: rgba(255,255,255,0.92);
  text-shadow: none;
}

.cmd-body--code{
  max-height: 70vh;
  overflow: auto;
  padding: 0;
}

.cmd-body--code .cmd-pre{
  margin: 0;
  padding: 12px 14px 14px;
  background: transparent;
  border-radius: 0;
  max-height: none;
  overflow: visible;
}

.cmd-body--code pre[class*="language-"],
.cmd-body--code code[class*="language-"]{
  background: transparent !important;
  text-shadow: none;
}

.cmd-body--code code[class*="language-"]{
  font-size: 0.98rem;
  line-height: 1.45;
}

.cmd-body--code pre,
.cmd-body--code code{
  background: transparent !important;
  text-shadow: none !important;
  font-family: Consolas, "Lucida Console", "Courier New", monospace !important;
  font-size: 0.98rem;
  line-height: 1.45;
  color: rgba(235, 240, 245, 0.92);
}

.cmd-body--code pre[class*="language-"]{
  background: transparent !important;
}

.cmd-body--code pre ::selection,
.cmd-body--code code ::selection{
  background: rgba(255,255,255,0.16);
}

.cmd-body--code .token.comment,
.cmd-body--code .token.prolog,
.cmd-body--code .token.doctype,
.cmd-body--code .token.cdata{
  color: rgba(170, 185, 200, 0.55);
  font-style: italic;
}

.cmd-body--code .token.punctuation{
  color: rgba(235, 240, 245, 0.70);
}

.cmd-body--code .token.keyword{
  color: rgba(120, 190, 255, 0.95);
}

.cmd-body--code .token.function{
  color: rgba(255, 210, 120, 0.95);
}

.cmd-body--code .token.string,
.cmd-body--code .token.char,
.cmd-body--code .token.attr-value{
  color: rgba(150, 230, 170, 0.95);
}

.cmd-body--code .token.number{
  color: rgba(255, 170, 200, 0.92);
}

.cmd-body--code .token.boolean,
.cmd-body--code .token.constant{
  color: rgba(255, 170, 200, 0.92);
}

.cmd-body--code .token.operator{
  color: rgba(235, 240, 245, 0.72);
}

.cmd-body--code .token.class-name,
.cmd-body--code .token.builtin{
  color: rgba(180, 200, 255, 0.90);
}

.cmd-body--code .token.decorator,
.cmd-body--code .token.annotation{
  color: rgba(200, 170, 255, 0.90);
}


.topbar a:hover{
  text-decoration: none !important;
}

/* =========================
   TERMINAL ABOUT OVERLAY THEME
   ========================= */
/* ===== PORTALED PROJECTS DROPDOWN — FORCE CLEAN SHAPE ===== */
#projectsDropdown{
  /* portal container is just an anchor point */
  width: 0 !important;
  height: 0 !important;
}

/* target the actual panel */
#projectsDropdown .projects-dropdown-menu{
  width: 320px !important;          /* pick your vibe */
  max-width: min(92vw, 420px) !important;
  min-width: 280px !important;

  padding: 12px 12px !important;
  border-radius: 18px !important;   /* smoother */
  overflow: hidden !important;      /* fixes “weird” corners */

  /* stable glass + border */
  border: 1px solid rgba(255,255,255,0.16) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)),
    rgba(6, 8, 14, 0.18) !important;

  box-shadow:
    0 24px 70px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255,255,255,0.10) !important;

  -webkit-backdrop-filter: blur(24px) saturate(170%) !important;
  backdrop-filter: blur(24px) saturate(170%) !important;
}

/* make items feel aligned and reduce “tall column” awkwardness */
#projectsDropdown .dropdown-item{
  padding: 9px 12px !important;
  border-radius: 8px !important;
}

/* reduce weird multi-line spacing */
#projectsDropdown .dropdown-item .title{
  line-height: 1.15 !important;
}

/* ===== Projects dropdown final tweaks ===== */
#projectsDropdown { width: 0 !important; height: 0 !important; }

/* (2) left-aligned animation (no -50% centering) */
#projectsDropdown .projects-dropdown-menu{
  width: 260px !important;
  max-width: min(88vw, 320px) !important;

  padding: 8px !important;
  overflow: hidden !important;

  transform: translate(0, -6px) scale(0.98) !important;
  transform-origin: top left !important;
}

#projectsDropdown.is-open .projects-dropdown-menu{
  transform: translate(0, 0) scale(1) !important;
}
#projectsDropdown { overflow: visible !important; }

/* ---- Fix clipped YouTube icon in top nav ---- */

/* Allow the nav pill to render shadows/icons fully */
.nav-right{
  overflow: visible !important;
}

/* Ensure icon buttons never clip their SVG */
.icon-link{
  overflow: visible !important;
}

/* Make sure the SVG fits perfectly inside the button */
.icon-link svg{
  width: 18px !important;
  height: 18px !important;
  display: block !important;
}
/* Prevent the scanline overlay from affecting layout/clip */
.icon-link::after{
  border-radius: inherit;
  pointer-events: none;
}
.icon-link svg{
  fill: currentColor !important;
  stroke: currentColor !important;   /* <- this adds a 1px stroke */
}
/* Icons are fill-only; remove stroke to prevent SVG viewBox clipping */
.icon-link svg,
.icon-link svg * {
  stroke: none !important;
}
/* (Optional) tiny CRT vibe */
.cmd::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  -webkit-backdrop-filter: blur(24px) saturate(175%) !important;
  backdrop-filter: blur(24px) saturate(175%) !important;
}
/* (Optional) tiny CRT vibe — NO BLUR (keeps text crisp) */
.cmd::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;

  /* just a subtle scanline overlay */
  background: linear-gradient(to bottom, rgba(255,255,255,0.03), transparent 14%);
  opacity: 0.18;

  /* IMPORTANT: disable blur */
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
/* make sure nothing reintroduces strokes on icons */
.icon-link svg, .icon-link svg *{
  stroke: none !important;
}
/* Fix: last icon clipped by the nav pill edge */
.nav-right{
  padding-right: 22px !important; /* was ~14px; gives breathing room */
}

/* Optional: extra safety only for the last icon */
.nav-desktop > a.icon-link:last-child{
  margin-right: 6px !important;
}


/* ###################################################################
   PROJECT PAGES  (was css/project.css - merged in so the project page
   layout can never go missing because a second stylesheet failed)
   ################################################################### */

/* =========================================================
   PROJECT PAGES
   Big media, tight text, nothing decorative in the way.
   Scoped to body.project-page; loaded only by projects/*.html
   ========================================================= */

body.project-page {
  --sheet:   #0c0d0f;
  --rule:    rgba(255, 255, 255, 0.09);
  --rule-2:  rgba(255, 255, 255, 0.16);
  --ink:     #f2f3f4;
  --ink-dim: #a9aeb5;

  --display: 'Space Grotesk', system-ui, sans-serif;
  --body:    'IBM Plex Sans', system-ui, sans-serif;

  --gutter:  clamp(20px, 4vw, 64px);

  background: var(--sheet);
  color: var(--ink);
  font-family: var(--body);
}

body.project-page main {
  position: relative;
  z-index: 1;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--gutter) 120px;
}

body.project-page .project-section {
  scroll-margin-top: 96px;
}

/* =========================================================
   SECTIONS
   Media always takes the wider column. Sides alternate by
   position, because the markup's .reverse class doesn't
   reliably match the actual child order.
   ========================================================= */

.project-section {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 3.6vw, 64px);
  padding: clamp(40px, 5.5vh, 76px) 0;
  border-top: 1px solid var(--rule);
}

.project-section > .project-image { order: 1; }
.project-section > .project-text  { order: 2; }

.project-section:nth-of-type(even) {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
}

.project-section:nth-of-type(even) > .project-image { order: 2; }
.project-section:nth-of-type(even) > .project-text  { order: 1; }

/* A section with a code panel stacks: prose above, panel full width */
.project-section:has(> .cmd) {
  grid-template-columns: 1fr;
}

.project-section > .cmd {
  grid-column: 1 / -1;
  order: 3;
}

.project-section--wide {
  grid-template-columns: 1fr 1fr;
}

.cmd--wide {
  grid-column: 1 / -1;
  height: 74vh;
}

.cmd--wide .cmd-body--code {
  max-height: calc(74vh - 90px);
}

/* =========================================================
   MEDIA — as large as the column allows, never cropped
   ========================================================= */

.project-image {
  margin: 0;
  display: grid;
  place-items: center;
  width: fit-content;
  max-width: 100%;
  justify-self: center;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  background: transparent;
}

/* Explicit height, auto width: every block lands the same size and small
   source files scale UP instead of sitting tiny. Nothing is ever cropped. */
.project-image img,
.project-image video {
  display: block;
  height: var(--media-cap, 68vh);
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.project-image.project-model {
  width: 100%;
}

.project-image.project-model model-viewer {
  width: 100%;
  height: var(--media-cap, 76vh);
  min-height: 460px;
}

/* =========================================================
   TEXT
   ========================================================= */

.project-text {
  max-width: 52ch;
}

.project-text h2 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.5vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.12;
  color: var(--ink);
  margin: 0 0 18px;
}

.project-text ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.project-text li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 11px;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--ink-dim);
}

.project-text li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 8px;
  height: 1px;
  background: var(--rule-2);
}

.project-text li.ok::before,
.project-text li.warn::before,
.project-text li.err::before {
  background: var(--ink-dim);
}

.project-text p {
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--ink-dim);
  margin: 0 0 16px;
}

.project-text a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-2);
}

.project-text a:hover {
  border-bottom-color: var(--ink);
}

/* =========================================================
   HERO — name, one line, then straight into the media
   ========================================================= */

.project-section:first-of-type {
  grid-template-columns: 1fr;
  gap: clamp(20px, 2.6vh, 32px);
  padding: clamp(96px, 13vh, 138px) 0 clamp(36px, 5vh, 64px);
  border-top: 0;
}

.project-section:first-of-type > .project-text {
  order: 1;
  max-width: none;
}

.project-section:first-of-type > .project-image {
  order: 2;
  --media-cap: 78vh;
}

.project-section:first-of-type .project-text h2 {
  font-family: var(--display);
  font-size: clamp(2.5rem, 6vw, 4.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.98;
  margin: 0 0 10px;
}

.project-section:first-of-type .project-text p {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  color: var(--ink-dim);
  margin: 0 0 10px;
  max-width: 62ch;
}

/* Headline specs read as one quiet line, not a panel */
.project-section:first-of-type .project-text ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 10px;
}

.project-section:first-of-type .project-text li {
  padding: 0;
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-dim);
}

.project-section:first-of-type .project-text li::before {
  content: "·";
  position: static;
  width: auto;
  height: auto;
  background: none;
  margin-right: 10px;
  color: var(--rule-2);
}

.project-section:first-of-type .project-text li:first-child::before {
  content: none;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {
  .project-section,
  .project-section:nth-of-type(even),
  .project-section--wide {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 36px 0;
  }

  /* media leads on every section, so the build is what you see */
  .project-section > .project-image,
  .project-section:nth-of-type(even) > .project-image { order: 1; }
  .project-section > .project-text,
  .project-section:nth-of-type(even) > .project-text { order: 2; }

  .project-text { max-width: none; }

  .project-image { --media-cap: 56vh; }
  .project-section:first-of-type > .project-image { --media-cap: 60vh; }

  .project-section:first-of-type {
    padding: 92px 0 32px;
  }

  .cmd--wide { height: auto; }
  .cmd--wide .cmd-body--code { max-height: 60vh; }
}


/* ###################################################################
   GALLERY  (was css/gallery.css)
   ################################################################### */

/* =========================================================
   GALLERY
   Justified rows: every photo keeps its own aspect, rows fill
   the width exactly, nothing is cropped.
   Reuses the tokens defined in the project-pages block above.
   ========================================================= */

body.project-page main.gallery-page {
  max-width: 1600px;
  margin: 0 auto;
  padding: clamp(96px, 13vh, 132px) var(--gutter) 100px;
}

.gallery-head {
  margin: 0 0 clamp(24px, 4vh, 40px);
}

.gallery-title {
  font-family: var(--display);
  font-size: clamp(2.5rem, 6vw, 4.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.98;
  color: var(--ink);
  margin: 0 0 10px;
}

.gallery-sub {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  color: var(--ink-dim);
  margin: 0;
}

/* ===== Rows ===== */

.gallery-rows {
  --gap: 14px;
  --row-target: 400px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

@media (max-width: 1200px) { .gallery-rows { --row-target: 300px; } }
@media (max-width: 800px)  { .gallery-rows { --row-target: 240px; --gap: 10px; } }
@media (max-width: 520px)  { .gallery-rows { --row-target: 200px; --gap: 8px; } }

.gallery-row {
  display: flex;
  gap: var(--gap);
}

/* A trailing row that can't fill the width keeps the target height
   instead of stretching its few photos across the whole page. */
.gallery-row--partial {
  justify-content: flex-start;
}

.gallery-item {
  display: block;
  padding: 0;
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  background: #101216;
  cursor: pointer;
  position: relative;
  transition: border-color 0.18s ease;
}

.gallery-item:hover,
.gallery-item:focus-visible {
  border-color: #6d757f;
}

.gallery-item:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* No opacity gating: a photo shows the moment it decodes. Nothing here can
   leave a tile blank while its image is sitting loaded in the DOM. */
.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== Lightbox ===== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 40px);
  background: rgba(6, 7, 9, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.lightbox.is-open { display: flex; }

.lightbox__img {
  max-width: min(1600px, 94vw);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid var(--rule);
}

.lightbox__bar {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  pointer-events: none;
}

.lightbox__count {
  font-size: 0.9rem;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}

.lb-btn {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  border: 1px solid var(--rule);
  background: rgba(0, 0, 0, 0.5);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.lb-btn:hover { border-color: var(--rule-2); background: rgba(0, 0, 0, 0.75); }
.lb-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 64px;
}

.lightbox__nav--prev { left: clamp(8px, 2vw, 24px); }
.lightbox__nav--next { right: clamp(8px, 2vw, 24px); }

@media (max-width: 620px) {
  .lightbox__nav { top: auto; bottom: 20px; transform: none; height: 48px; }
  .lightbox__nav--prev { left: 24px; }
  .lightbox__nav--next { right: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-item,
  .gallery-item img,
  .lb-btn { transition: none; }
  .gallery-item:hover { transform: none; }
}
