/* ══════════════════════════════════════════════════════════════
   CSS VARIABLES
   ══════════════════════════════════════════════════════════════ */
:root {
  --bg: #050505;
  --bg-surface: #0d0d0d;
  --bg-card: #141414;
  --accent: #00FF41;
  --accent-dim: #00cc33;
  --text-primary: #E8E8E8;
  --text-secondary: #9A9A9A;
  --text-meta: #666666;
  --border-subtle: rgba(255,255,255,0.06);
  --border-accent: rgba(0,255,65,0.3);
}

/* ══════════════════════════════════════════════════════════════
   GLOBAL
   ══════════════════════════════════════════════════════════════ */

/* Comfortable reading size (18px base) */
html {
  font-size: 112.5%;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: "IBM Plex Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: -1;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 600;
}

.font-mono {
  font-family: "IBM Plex Mono", monospace;
}

/* ══════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ══════════════════════════════════════════════════════════════ */

/* Display heading — large bold name */
.display-name {
  font-family: "Rubik Mono One", monospace;
  font-size: clamp(1rem, 4.5vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════════════════════
   COMPONENTS
   ══════════════════════════════════════════════════════════════ */

.micro-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-meta);
  font-family: "IBM Plex Sans", sans-serif;
  font-weight: 500;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.soft-container {
  background-color: var(--bg-card);
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.input-field {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 14px 16px;
  width: 100%;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-field::placeholder {
  color: var(--text-meta);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,255,65,0.1);
}

/* Terminal CTA Button */
.terminal-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.terminal-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0,255,65,0.05);
}

.terminal-btn-primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.terminal-btn-primary:hover {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  color: var(--bg);
}

/* Skill Pill */
.skill-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px;
  transition: all 0.2s ease;
}

.skill-pill:hover {
  border-color: var(--text-meta);
  color: var(--text-primary);
}

/* Process List Item */
.process-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.process-item:last-child {
  border-bottom: none;
}

.process-pid {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 13px;
  color: var(--text-meta);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.process-title {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--text-primary);
}

/* Avatar with online dot */
.avatar-wrapper {
  position: relative;
  display: inline-block;
}

.avatar-wrapper::after {
  content: '';
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border: 2px solid var(--bg);
  border-radius: 50%;
}

/* Bio terminal block */
.bio-terminal {
  position: relative;
  padding: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

.bio-terminal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 6px 6px 0 0;
}

.bio-terminal-content {
  margin-top: 1rem;
}

/* ══════════════════════════════════════════════════════════════
   NAVIGATION
   ══════════════════════════════════════════════════════════════ */

/* Floating Dock Navigation */
.floating-dock {
  position: fixed;
  bottom: max(44px, calc(env(safe-area-inset-bottom, 20px) + 24px));
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(8, 8, 8, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 9999px;
  padding: 10px 22px;
  display: flex;
  gap: 1.75rem;
  z-index: 50;
  box-shadow: 0 4px 32px rgba(0,0,0,0.5);
}

.dock-link {
  color: var(--text-meta);
  transition: color 0.2s ease;
}

.dock-link:hover, .dock-link.nav-link-active {
  color: var(--accent);
}

/* Hide template navbar structure — using custom floating dock */
#navbar {
  display: none;
}

/* Subtle link styles */
.link-subtle {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-meta);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.link-subtle:hover {
  color: var(--text-primary);
}

/* Top bar brand area */
.top-bar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.top-bar-prompt {
  font-family: "Rubik Mono One", monospace;
  font-size: 16px;
  color: var(--accent);
  letter-spacing: 0;
}

.top-bar-name {
  font-family: "Rubik Mono One", monospace;
  font-size: 15px;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}

.top-bar-brand:hover .top-bar-name {
  color: var(--accent);
}

/* ══════════════════════════════════════════════════════════════
   PAGE LAYOUT
   ══════════════════════════════════════════════════════════════ */

.page-section {
  padding: 2rem 0;
}

.section-header {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: clamp(1.1rem, 3.5vw, 1.4rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Home date/time row */
.home-datetime-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 13px;
  color: var(--text-meta);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Hero role line */
.hero-role {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 16px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* Hero status line */
.hero-status {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 13px;
  color: var(--text-meta);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ══════════════════════════════════════════════════════════════
   SYS_DASHBOARD — parallax scene
   ══════════════════════════════════════════════════════════════ */

@keyframes cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: #ff79c6;
  vertical-align: middle;
  animation: cursor-blink 1s step-start infinite;
  border-radius: 1px;
  margin-left: 1px;
}

@keyframes pdash-float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-18px); }
}

.pdash-scene {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 360px;
  margin: 0 auto;
}

.pdash-win {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 13px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,0.55);
}

/* W1 — back-left: code lines, ~60% visible */
.pdash-win-1 {
  width: 262px;
  top: 42px;
  left: -27px;
  z-index: 1;
  animation: pdash-float 6s ease-in-out infinite;
  animation-delay: 0s;
}

/* W2 — back-top: bar widget, peeking above main */
.pdash-win-2 {
  width: 278px;
  top: 12px;
  left: 83px;
  z-index: 2;
  animation: pdash-float 5s ease-in-out infinite;
  animation-delay: -1.5s;
}

/* W3 — front-center: main SYS_DASHBOARD window */
.pdash-win-3 {
  width: 342px;
  top: 78px;
  left: 69px;
  z-index: 3;
  animation: pdash-float 7s ease-in-out infinite;
  animation-delay: -2s;
}

/* W4 — back-right: partially off right, ~40% visible */
.pdash-win-4 {
  width: 248px;
  top: 113px;
  right: -27px;
  z-index: 1;
  animation: pdash-float 5.5s ease-in-out infinite;
  animation-delay: -3s;
}

.pdash-chrome {
  padding: 10px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}

.pdash-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pdash-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255,255,255,0.14);
}

/* Main window gets real macOS dot colors */
.pdash-win-3 .pdash-dots span:nth-child(1) { background: #ff5f57; }
.pdash-win-3 .pdash-dots span:nth-child(2) { background: #febc2e; }
.pdash-win-3 .pdash-dots span:nth-child(3) { background: #28c840; }

.pdash-win-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  color: var(--text-meta);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.pdash-body {
  padding: 16px 18px;
}

/* W1: horizontal code lines */
.pdash-code-line {
  height: 9px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  margin-bottom: 10px;
}
.pdash-code-line:last-child { margin-bottom: 0; }

/* W2 / W4: bar elements */
.pdash-bar-gray {
  height: 19px;
  background: rgba(200,200,200,0.18);
  border-radius: 4px;
  margin-bottom: 12px;
}

.pdash-bar-pink {
  height: 25px;
  background: rgba(255,105,180,0.45);
  border-radius: 4px;
}

/* W3: color blocks */
.pdash-blocks {
  display: flex;
  gap: 12px;
  margin-bottom: 15px;
}

.pdash-block-light {
  flex: 1;
  height: 57px;
  background: rgba(232,232,232,0.88);
  border-radius: 6px;
}

.pdash-block-pink {
  flex: 1;
  height: 57px;
  background: rgba(255,105,180,0.72);
  border-radius: 6px;
}

/* W3: progress bar */
.pdash-progress-track {
  height: 6px;
  background: var(--bg-surface);
  border-radius: 3px;
  overflow: hidden;
}

.pdash-progress-fill {
  width: 65%;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

/* ══════════════════════════════════════════════════════════════
   IMAGE LIGHTBOX
   ══════════════════════════════════════════════════════════════ */

#img-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

#img-lightbox.open {
  display: flex;
}

#img-lightbox img {
  max-width: min(90vw, 960px);
  max-height: 85vh;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 64px rgba(0,0,0,0.8);
  display: block;
}

#img-lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  color: var(--text-secondary);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  line-height: 1;
}

#img-lightbox-close:hover,
#img-lightbox-close:focus {
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.35);
  outline: none;
}

#img-lightbox-prev,
#img-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  color: var(--text-secondary);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 18px;
  padding: 10px 16px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, opacity 0.15s;
  line-height: 1;
  z-index: 1;
}

#img-lightbox-prev { left: 20px; }
#img-lightbox-next { right: 20px; }

#img-lightbox-prev:hover,
#img-lightbox-next:hover,
#img-lightbox-prev:focus,
#img-lightbox-next:focus {
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.35);
  outline: none;
}

@media (max-width: 768px) {
  #img-lightbox-prev,
  #img-lightbox-next {
    min-height: 160px;
    opacity: 0; /* Hide navigation buttons on mobile */
  }
}

.project-screenshot-btn {
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  cursor: zoom-in;
  border-radius: 6px;
  overflow: hidden;
  transition: opacity 0.15s;
}

.project-screenshot-btn:hover { opacity: 0.85; }
.project-screenshot-btn:focus { outline: 1px solid var(--accent); outline-offset: 2px; }

/* ══════════════════════════════════════════════════════════════
   SCROLL REVEAL
   ══════════════════════════════════════════════════════════════ */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered transition delays for lists */
.stagger-1 { transition-delay: 50ms; }
.stagger-2 { transition-delay: 100ms; }
.stagger-3 { transition-delay: 150ms; }
.stagger-4 { transition-delay: 200ms; }
.stagger-5 { transition-delay: 250ms; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 540px) {
  .pdash-scene {
    transform: scale(0.67);
    transform-origin: top center;
    margin-bottom: -119px; /* compensate: 360 * (1 - 0.67) ≈ 119 */
  }
}

@media (min-width: 640px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pdash-win { animation: none !important; }
}
