/* About photo with chamfered edges */
.about-photo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.2rem;
}
.about-photo-chamfer {
  width: 160px;
  max-width: 38vw;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 32px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.13), 0 0 0 4px #fff3;
  border: 2.5px solid #00ff88;
  background: #e0e0e0;
  margin-bottom: 0.5rem;
  transition: transform 0.18s cubic-bezier(.4,1.4,.6,1);
}
.about-photo-chamfer:hover {
  transform: scale(1.045) rotate(-2deg);
  box-shadow: 0 8px 32px rgba(0,255,136,0.13), 0 0 0 4px #00ff8855;
}
@media (max-width: 600px) {
  .about-photo-chamfer {
    width: 96px;
    max-width: 60vw;
    border-radius: 18px;
  }
}
/* Make contact form wider */
.contact-form {
  max-width: 720px;
  width: 100%;
  margin: 0 auto 1.2rem auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
/* Contact form submit button style override */
.btn-blue {
  background: #1976d2 !important;
  color: #fff !important;
  border: 1px solid #1976d2 !important;
  text-shadow: none !important;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.18);
  font-weight: 600;
}
.btn-blue:hover, .btn-blue:focus {
  background: #00ff88 !important;
  color: #111 !important;
  border-color: #00ff88 !important;
}
/* Blinking cursor for subtitle */
.term-caret {
  display: inline-block;
  margin-left: 2px;
  color: var(--neon, #00ff88);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Smart City modal images: smaller on desktop, responsive on mobile */
 .scity-img {
  width: 100%;
  max-width: 420px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  background: #e0e0e0;
  aspect-ratio: 4/3;
  object-fit: cover;
  margin-bottom: 1.2rem;
}
@media (max-width: 900px) {
  .scity-img {
    width: 100%;
    max-width: 96vw;
    min-width: 90px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    margin-bottom: 1rem;
  }
}
/* FireShark modal flex layout and images */
.fires-flex {
  display: flex;
  flex-direction: row;
  gap: 2.2rem;
  align-items: flex-start;
  justify-content: space-between;
}
.fires-flex-text {
  flex: 2 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.fires-flex-imgs {
  flex: 1 1 320px;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  align-items: flex-end;
  min-width: 180px;
  max-width: 480px;
  justify-content: flex-start;
}
.fires-img {
  width: 100%;
  max-width: 420px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  background: #e0e0e0;
  aspect-ratio: 4/3;
  object-fit: cover;
  margin-bottom: 1.2rem;
}
@media (max-width: 900px) {
  .fires-flex {
    flex-direction: column;
    gap: 1.2rem;
  }
  .fires-flex-imgs {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    gap: 1rem;
  }
  .fires-img {
    width: 100%;
    max-width: 96vw;
    min-width: 90px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    margin-bottom: 1rem;
  }
}
/* Project Detail Modal Styles */
.project-detail-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 20;
  background: rgba(0,0,0,0.72);
  display: block;
  animation: fadein 0.18s;
}
.project-detail-modal .modal-content {
  position: fixed;
  inset: 10% 8%;
  background: rgba(245, 248, 250, 0.96);
  color: #2c3e50;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  padding: 2.2rem 2.2rem 1.5rem 2.2rem;
  font-family: 'Inter', 'JetBrains Mono', monospace;
  border: 1px solid rgba(0, 255, 136, 0.2);
  backdrop-filter: blur(3px);
  overflow-y: auto;
  max-height: 80vh;
}
.project-detail-modal h3 {
  margin-top: 0;
  color: #2980b9;
  font-family: 'JetBrains Mono', monospace;
  font-size: 2rem;
}
.project-detail-modal p {
  color: #34495e;
  font-size: 1.12rem;
  margin-bottom: 1.2rem;
  line-height: 1.7;
}
.project-detail-modal .btn {
  display: inline-block;
  margin-top: 0.7rem;
  font-size: 1.08rem;
  font-family: 'JetBrains Mono', monospace;
  padding: 0.55em 1.4em;
  border-radius: 6px;
  border: none;
  background: #2980b9;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  text-decoration: none;
  cursor: pointer;
}
.project-detail-modal .btn:hover, .project-detail-modal .btn:focus {
  background: #00ff88;
  color: #222;
  box-shadow: 0 4px 18px rgba(0,255,136,0.13);
  text-decoration: none;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #888;
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}
.modal-close:hover {
  color: #2980b9;
}
@media (max-width: 768px) {
  .project-detail-modal .modal-content {
    inset: 6% 2% 6% 2%;
    padding: 1.1rem 0.7rem 1.1rem 0.7rem;
    max-height: 88vh;
  }
  .project-detail-modal h3 {
    font-size: 1.3rem;
  }
  .project-detail-modal p {
    font-size: 0.98rem;
  }
}
@import url('https://fonts.googleapis.com/css2?family=VT323&family=JetBrains+Mono:wght@400;500;600&family=Inter:wght@400;500;600&display=swap');

:root {
  --neon: #00ff88;
  --neon-soft: #33ffcc;
  --bg: radial-gradient(circle at 50% 90%, #001100 0%, #000 70%);
  --tiltX: 0deg;
  --tiltY: 0deg;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(0, 255, 136, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 42, 166, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(0, 200, 255, 0.05) 0%, transparent 50%),
    var(--bg);
  color: var(--neon);
  font-family: 'VT323', monospace;
  overflow: hidden;
  /* use small viewport height so mobile browser chrome doesn't cut content */
  height: 100svh;
  perspective: 1200px;
  position: relative;
}

/* Stage & layers */
.stage { position: fixed; inset: 0; transform-style: preserve-3d; }
.layer {
  position: absolute; inset: 0; transform-style: preserve-3d;
  will-change: transform;
}
canvas#stars, canvas#sun, canvas#grid { width: 100%; height: 100%; }
#stars { z-index: 0; } #sun { z-index: 2; } #grid { z-index: 3; }

/* CRT vibes with enhanced depth */
.scanlines::before { 
  content:''; 
  position:absolute; 
  inset:0;
  background: 
    repeating-linear-gradient(to bottom, 
      rgba(0,255,136,.04) 0px, 
      rgba(0,255,136,.04) 2px, 
      transparent 3px),
    linear-gradient(45deg, 
      transparent 0%, 
      rgba(0, 255, 136, 0.01) 50%, 
      transparent 100%);
  pointer-events:none; 
  mix-blend-mode: overlay;
}

.vignette::after { 
  content:''; 
  position:absolute; 
  inset:0;
  background: 
    radial-gradient(ellipse at center, 
      transparent 40%, 
      rgba(0,0,0,.3) 70%,
      rgba(0,0,0,.7) 100%),
    radial-gradient(ellipse at 80% 20%, 
      rgba(255, 42, 166, 0.03) 0%, 
      transparent 40%),
    radial-gradient(ellipse at 20% 80%, 
      rgba(0, 255, 136, 0.02) 0%, 
      transparent 40%); 
  pointer-events:none; 
}

.content {
  position: fixed; top: 32px; left: 48px; z-index: 4; text-align: left;
  animation: fadein 1.2s ease-out; transform: translateZ(60px);
  backdrop-filter: blur(2px);
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.3) 0%, 
    rgba(0, 255, 136, 0.05) 50%, 
    rgba(0, 0, 0, 0.2) 100%);
  border-radius: 12px;
  padding: 20px 24px;
  border: 1px solid rgba(0, 255, 136, 0.2);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
h1 { 
  font-size: 2.8rem; 
  letter-spacing: 2px; 
  margin: 0 0 .25rem 0; 
  background: linear-gradient(45deg, var(--neon), var(--neon-soft), #fff);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px rgba(0, 255, 136, 0.5));
  text-shadow: none;
}
h2 { 
  color: var(--neon-soft); 
  font-weight: normal; 
  font-size: 1.2rem; 
  margin: 0 0 .4rem 0; 
  min-height: 1.2em;
  text-shadow: 0 0 4px rgba(51, 255, 204, 0.3);
}
.menu { display:flex; gap:0.6rem; margin-top:.6rem; flex-wrap:wrap; }
.menu a {
  color: var(--neon);
  text-decoration: none;
  font-size: 0.95rem;
  position: relative;
  padding: 4px 10px;
  border: 1px solid var(--neon);
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.85) 0%, 
    rgba(0, 255, 136, 0.05) 50%, 
    rgba(0, 0, 0, 0.85) 100%);
  transition: all .25s;
  text-shadow: 0 0 4px rgba(0, 255, 136, 0.3);
  font-family: 'VT323', monospace;
  letter-spacing: 0.5px;
  line-height: 1.2;
  min-width: 60px;
  text-align: center;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(0, 255, 136, 0.1);
}
.menu a:hover { 
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.95) 0%, 
    rgba(51, 255, 204, 0.1) 50%, 
    rgba(0, 0, 0, 0.95) 100%);
  border-color: var(--neon-soft); 
  color: var(--neon-soft);
  box-shadow: 
    0 4px 16px rgba(0, 255, 136, 0.2),
    inset 0 1px 0 rgba(51, 255, 204, 0.2);
  transform: translateY(-1px);
}
.menu a::after { display: none; }

@media (min-width: 900px) {
  h1{font-size:3.2rem}
  h2{font-size:1.3rem}
  .menu a{font-size:1.05rem; padding: 5px 12px; min-width: 65px;}
}

/* Mobile-specific styles for stacking titles */
@media (max-width: 768px) {
  /* Reduce top block footprint so name + buttons don't dominate small screens */
  .content {
    top: 14px;
    left: 12px;
    right: 12px;
    padding: 8px 12px;
    position: fixed;
    width: auto;
    backdrop-filter: blur(2px);
  }
  
  h1 {
    font-size: 1.6rem;
    margin: 0 0 0.08rem 0;
    line-height: 1.05;
  }
  
  h2 { white-space: pre-line; line-height: 1.2; font-size: 0.95rem; margin-bottom: 0.18rem; }
  h2.mobile-stacked { white-space: pre-line; }
  .menu { gap: 0.45rem; margin-top: 0.35rem; }
  .menu a { font-size: 0.86rem; padding: 3px 7px; letter-spacing: 0.2px; min-width: 48px; }
  
  /* Ensure panels don't overflow on mobile */
  .panel { 
    inset: 6% 4% 6% 4%; 
    padding: 14px;
    max-height: 88vh;
    overflow-y: auto;
  }
}

@keyframes fadein {
  from { opacity:0; transform: translateY(10px) translateZ(60px); }
  to { opacity:1; transform: translateY(0) translateZ(60px); }
}

/* Panels */
.panel {
  position: fixed; inset: 10% 8%;
  display: none; z-index: 5; padding: 24px;
  background: rgba(245, 248, 250, 0.96);
  color: #2c3e50;
  border: 1px solid rgba(0, 255, 136, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  overflow: auto; backdrop-filter: blur(3px); transform: translateZ(90px);
}
.panel h3 { margin-top: 0; font-size: 2rem; color: #2980b9; text-shadow: none; font-family: 'JetBrains Mono', 'VT323', monospace; font-weight: 600; }
.panel p { line-height: 1.7; margin-bottom: 1rem; color: #34495e; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 1.05rem; }
.about-text p:first-child { margin-top: 0; }
/* Better readability for all panel content */
.panel ul, .panel li, .panel details, .panel summary { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.panel h4 { font-family: 'JetBrains Mono', monospace; color: #2c3e50; font-weight: 600; }
.panel a { color: #3498db; text-decoration: none; transition: color 0.3s ease; }
.panel a:hover { color: #2980b9; text-decoration: underline; }
.panel-close {
  position: absolute; top: 12px; right: 16px; cursor: pointer; color: #7f8c8d;
  background: none; border: none; font-size: 1.4rem; transition: color 0.3s ease; padding: 4px;
}
.panel-close:hover { color: #2980b9; }
.panel.show { display: block; animation: panelIn .28s ease-out; }
@keyframes panelIn { from { opacity:0; transform: translateZ(90px) translateY(6px);} to { opacity:1; transform: translateZ(90px) translateY(0);} }

/* =========================
   DOM Terminal overlay
   ========================= */
.terminal-dom {
  position: fixed !important;
  bottom: 12% !important;
  top: unset !important;
  left: 50% !important;
  transform: translateX(-50%) translateZ(120px) !important;
  width: clamp(320px, 62vw, 980px);
  /* use svh so browser chrome won't hide rows */
  height: clamp(220px, 36svh, 420px);
  max-height: calc(100svh - 120px);
  z-index: 6;
  display: none;
  background: 
    linear-gradient(135deg, 
      rgba(0,0,0,.98) 0%, 
      rgba(0,20,10,.98) 50%, 
      rgba(0,0,0,.98) 100%);
  border: 1px solid var(--neon);
  border-radius: 8px;
  box-shadow: 
    0 0 30px rgba(0,255,136,.6),
    0 0 60px rgba(0,255,136,.2),
    inset 0 1px 0 rgba(0,255,136,.3),
    inset 0 -1px 0 rgba(0,255,136,.1);
  color: #bfffe8;
  padding: 8px 12px 10px;
  overflow: hidden;
  backdrop-filter: blur(4px);
  position: relative;
}

.terminal-dom::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 30%;
  background: linear-gradient(180deg, 
    rgba(0, 255, 136, 0.05) 0%, 
    transparent 100%);
  pointer-events: none;
  border-radius: 8px 8px 0 0;
}
.terminal-dom .panel-close { position: absolute; right: 10px; top: 6px; }
.terminal-dom.show { display: block; }

/* Terminal top bar */
.terminal-bar {
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  height: 30px; line-height: 30px; padding: 0 4px 2px 4px; margin-bottom: 6px;
  border-bottom: 1px solid rgba(0,255,136,.25);
}
.terminal-bar .title { font-weight: 700; color: var(--neon-soft); letter-spacing: .5px; }
.terminal-bar .close {
  cursor:pointer; background: transparent; border: 1px solid var(--neon-soft);
  color: var(--neon-soft); width: 26px; height: 22px; line-height: 18px; text-align:center;
}

/* Simplified XTerm host - fills available space */
#xterm-host {
  position: relative;
  width: 100%;
  height: calc(100% - 34px); /* offset for title bar */
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Make xterm fill the host container completely */
#xterm-host .xterm {
  flex: 1;
  width: 100%;
  min-height: 0;
}

#xterm-host .xterm-screen {
  height: 100%;
}

#xterm-host .xterm-viewport {
  height: 100% !important;
  overflow-y: auto;
  padding-bottom: 6px;
}

/* Text wrapping for terminal content */
#xterm-host .xterm-rows { word-wrap: break-word; overflow-wrap: break-word; }
#xterm-host .xterm-char { word-break: break-all; }

/* Badge style for “SYSTEM ONLINE” (or similar) */
.term-badge,
.badge-online {
  display: inline-block;
  padding: 4px 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(180, 180, 180, 0.25);
  border: 1px solid rgba(180, 180, 180, 0.35);
  border-radius: 3px;
  backdrop-filter: blur(2px);
}

/* Responsive tweaks */
@media (max-width: 900px) {
  .terminal-dom {
    width: 88vw;
    height: clamp(220px, 54svh, 560px);
    max-height: calc(100svh - 100px);
  }
}

@media (max-width: 768px) {
  .terminal-dom {
    height: clamp(200px, 40svh, 380px);
    max-height: calc(100svh - 140px);
    bottom: 10%;
  }
}

@media (max-width: 480px) {
  .terminal-dom {
    height: clamp(180px, 35svh, 320px);
    max-height: calc(100svh - 120px);
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%) translateZ(120px);
  }
}

/* Fallback for browsers without svh support */
@supports not (height: 1svh) {
  body { height: 100vh; }
  .terminal-dom {
    height: clamp(220px, 48vh, 520px);
    max-height: calc(100vh - 120px);
  }
}

/* HUD buttons matching menu style */
.hud { 
  position: fixed; 
  bottom: 10px; 
  right: 14px; 
  z-index: 7; 
  display: flex; 
  gap: 10px; 
}

.btn {
  cursor: pointer; 
  padding: 4px 10px; 
  border: 1px solid var(--neon); 
  color: var(--neon);
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.85) 0%, 
    rgba(0, 255, 136, 0.05) 50%, 
    rgba(0, 0, 0, 0.85) 100%);
  border-radius: 4px;
  backdrop-filter: blur(4px);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(0, 255, 136, 0.1);
  transition: all 0.25s ease;
  font-family: 'VT323', monospace;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  line-height: 1.2;
  min-width: 60px;
  text-align: center;
  text-shadow: 0 0 4px rgba(0, 255, 136, 0.3);
  text-decoration: none;
}

.btn:hover {
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.95) 0%, 
    rgba(51, 255, 204, 0.1) 50%, 
    rgba(0, 0, 0, 0.95) 100%);
  border-color: var(--neon-soft); 
  color: var(--neon-soft);
  box-shadow: 
    0 4px 16px rgba(0, 255, 136, 0.2),
    inset 0 1px 0 rgba(51, 255, 204, 0.2);
  transform: translateY(-1px);
}

/* Mobile hint (kept, but works with new sizing) */
@media (max-width: 768px) {
  .terminal-dom::after {
    content: "👆 Tap to type";
    position: absolute;
    bottom: 6px; right: 8px; font-size: 11px; color: var(--neon-soft);
    opacity: 0.7; pointer-events: none;
  }
}

/* Network Panel Styles */
.network-skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.skill-category {
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.2);
  border-radius: 8px;
  padding: 16px;
}

.skill-category h4 {
  margin-top: 0;
  color: #2980b9;
  font-family: 'JetBrains Mono', monospace;
}

.skill-category ul {
  list-style: none;
  padding-left: 0;
}

.skill-category li {
  margin: 8px 0;
  padding-left: 20px;
  position: relative;
}

.skill-category li::before {
  content: "▸";
  color: var(--neon);
  position: absolute;
  left: 0;
  font-weight: bold;
}

.network-projects {
  margin-top: 30px;
}

.network-projects h4 {
  color: #2980b9;
  font-family: 'JetBrains Mono', monospace;
}

.project-item {
  background: rgba(0, 255, 136, 0.05);
  border-left: 3px solid var(--neon);
  padding: 12px 16px;
  margin: 12px 0;
  border-radius: 4px;
}

.project-item img {
  display: block;
  width: 100%;
  max-width: 340px;
  height: auto;
  object-fit: contain;
  object-position: top;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.project-item strong {
  color: #2980b9;
}

/* Mobile responsive for network panel */
@media (max-width: 768px) {
  .network-skills {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .skill-category {
    padding: 12px;
  }
  
  .project-item {
    padding: 10px 12px;
  }
}

@keyframes sunPulse {
  0%, 100% { 
    filter: brightness(1); 
    transform: rotateX(var(--tiltY)) rotateY(var(--tiltX)) scale(1); 
  }
  50% { 
    filter: brightness(1.3); 
    transform: rotateX(var(--tiltY)) rotateY(var(--tiltX)) scale(1.02); 
  }
}

@keyframes gridGlow {
  0%, 100% { 
    opacity: 0.8; 
    transform: rotateX(var(--tiltY)) rotateY(var(--tiltX)); 
  }
  50% { 
    opacity: 1; 
    transform: rotateX(var(--tiltY)) rotateY(var(--tiltX)); 
  }
}

@keyframes layerFloat {
  0%, 100% { transform: rotateX(var(--tiltY)) rotateY(var(--tiltX)) translateZ(0px); }
  50% { transform: rotateX(var(--tiltY)) rotateY(var(--tiltX)) translateZ(5px); }
}

/* Base layer transform */
.layer { 
  transform: rotateX(var(--tiltY)) rotateY(var(--tiltX)) !important; 
}

/* Apply specific animations to individual layers */
.layer:nth-child(2) { 
  animation: sunPulse 8s ease-in-out infinite !important; 
} /* sun layer */

.layer:nth-child(3) { 
  animation: gridGlow 4s ease-in-out infinite !important; 
} /* grid layer */

/* Stars layer gets subtle float */
.layer:nth-child(1) {
  animation: layerFloat 6s ease-in-out infinite;
}
/* Font size override for subtitle */
#subtitle {
  font-size: 1rem !important;
}