/* ── Base ─────────────────────────────────── */
*, ::before, ::after { margin: 0; padding: 0; box-sizing: border-box; border-width: 0; border-style: solid; }
html { line-height: 1.5; -webkit-text-size-adjust: 100%; tab-size: 4; overflow-x: clip; max-width: 100vw; }
body { line-height: inherit; overflow-x: clip; max-width: 100%; }
/* Grid items must not expand beyond their track */
.grid > * { min-width: 0; }
a { color: inherit; text-decoration: inherit; }
b, strong { font-weight: bolder; }
button, input, optgroup, select, textarea { font-family: inherit; font-size: 100%; font-weight: inherit; line-height: inherit; color: inherit; margin: 0; padding: 0; }
button, select { text-transform: none; }
button, [type='button'], [type='reset'], [type='submit'] { -webkit-appearance: button; background-color: transparent; background-image: none; cursor: pointer; }
:-moz-focusring { outline: auto; }
:-moz-ui-invalid { box-shadow: none; }
img, svg, video, canvas, audio, iframe, embed, object { display: block; vertical-align: middle; }
img, video { max-width: 100%; height: auto; }
::selection { background: rgba(6,182,212,0.3); color: #fff; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #090909; }
::-webkit-scrollbar-thumb { background: #333; }
::-webkit-scrollbar-thumb:hover { background: #06b6d4; }

/* ── Hero ─────────────────────────────────── */
.hero-grid {
  background-image:
    linear-gradient(rgba(6,182,212,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6,182,212,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
}
.hero-glow {
  background: radial-gradient(ellipse 60% 60% at 30% 50%, rgba(6,182,212,0.08) 0%, transparent 100%);
}

/* ── Social Icons ─────────────────────────── */
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,0.1);
  color: #6b7280;
  transition: color 0.2s, border-color 0.2s;
}
.social-icon:hover {
  color: #06b6d4;
  border-color: rgba(6,182,212,0.4);
}

/* ── Scroll Indicator ─────────────────────── */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  animation: scroll-bounce 2s ease-in-out infinite;
  z-index: 10;
}
.scroll-indicator svg {
  display: block;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.scroll-indicator:hover svg {
  opacity: 1;
}
@keyframes scroll-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

/* ── Page Header ──────────────────────────── */
.page-header {
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(6,182,212,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6,182,212,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ── Scroll Reveal ────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── Card Glow ────────────────────────────── */
.card-glow {
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}
.card-glow:hover {
  box-shadow: 0 0 40px rgba(6,182,212,0.06), 0 0 80px rgba(6,182,212,0.03);
  border-color: rgba(6,182,212,0.3);
}

/* ── Tech Tags ────────────────────────────── */
.tech-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  margin: 0.2rem;
  color: #22d3ee;
  background: rgba(6,182,212,0.08);
  border: 1px solid rgba(6,182,212,0.15);
  transition: all 0.3s ease;
}
.tech-tag:hover {
  background: rgba(6,182,212,0.15);
  border-color: rgba(6,182,212,0.4);
}

/* ── Navigation ───────────────────────────── */
.nav-scrolled {
  background: rgba(5,5,5,0.95) !important;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.nav-link-active {
  color: #22d3ee !important;
}

/* Nav inner bar above mobile menu overlay */
#navbar > div:first-child {
  position: relative;
  z-index: 50;
  background: inherit;
}

/* Mobile menu: translucent + blur, full viewport */
#mobile-menu {
  background: rgba(5, 5, 5, 0.85) !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  height: 100vh !important;
  height: 100dvh !important;
  overflow-y: auto;
}
#mobile-menu > div {
  min-height: 100vh;
  min-height: 100dvh;
}

/* Blur page content when menu is open */
body.menu-open > *:not(#navbar):not(script) {
  filter: blur(8px);
  transition: filter 0.3s ease;
  pointer-events: none;
}
body > *:not(#navbar):not(script) {
  transition: filter 0.3s ease;
}

/* ── Terminal Block ────────────────────────── */
.terminal-block {
  background: #0d0d0d;
  border: 1px solid #1a1a1a;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Gradient Line ────────────────────────── */
.gradient-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(6,182,212,0.3), transparent);
}

/* ── Gradient Text ────────────────────────── */
.gradient-text {
  background: linear-gradient(to right, #22d3ee, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Image Placeholder ────────────────────── */
.img-placeholder {
  background: #0d0d0d;
  border: 1px dashed #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s ease;
}
.img-placeholder:hover {
  border-color: rgba(6,182,212,0.3);
}

/* ── Team Card ────────────────────────────── */
.team-card {
  transition: box-shadow 0.4s ease, border-color 0.4s ease, transform 0.2s ease;
}
.team-card:hover {
  transform: translateY(-2px);
}

/* ── Team Modal ──────────────────────────── */
#team-modal {
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
#team-modal.active {
  opacity: 1;
  pointer-events: auto;
}
#team-modal-content {
  transform: translateY(16px) scale(0.97);
  transition: transform 0.25s ease;
}
#team-modal.active #team-modal-content {
  transform: translateY(0) scale(1);
}
#service-modal {
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
#service-modal.active {
  opacity: 1;
  pointer-events: auto;
}
#service-modal-content {
  transform: translateY(16px) scale(0.97);
  transition: transform 0.25s ease;
}
#service-modal.active #service-modal-content {
  transform: translateY(0) scale(1);
}

body.modal-open > *:not(#team-modal):not(#service-modal):not(script) {
  filter: blur(8px);
  pointer-events: none;
}

/* ── Software Gallery ─────────────────────── */
.gallery-main {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
}
.gallery-main img {
  transition: transform 0.3s ease;
}
.gallery-main:hover img {
  transform: scale(1.02);
}
.gallery-badge {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  color: #d1d5db;
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  padding: 0.3rem 0.6rem;
  border-radius: 0.375rem;
  border: 1px solid rgba(255,255,255,0.1);
  pointer-events: none;
}
.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  min-width: 0;
  width: 100%;
}
.gallery-thumb {
  flex: 1 0 0;
  min-width: 0;
  width: auto;
  height: 3.2rem;
  border-radius: 0.375rem;
  overflow: hidden;
  border: 2px solid transparent;
  opacity: 0.5;
  transition: all 0.2s ease;
  cursor: pointer;
}
@media (min-width: 640px) {
  .gallery-thumbs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .gallery-thumb {
    flex: 0 0 auto;
    width: 5rem;
    height: 3.2rem;
  }
}
.gallery-thumb:hover,
.gallery-thumb.active {
  opacity: 1;
  border-color: rgba(6,182,212,0.5);
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Lightbox ────────────────────────────── */
#lightbox.active {
  display: flex;
}
#lightbox img {
  animation: lightbox-in 0.2s ease;
}
@keyframes lightbox-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ── CTA Pulse ────────────────────────────── */
@keyframes subtle-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(6,182,212,0.2); }
  50% { box-shadow: 0 0 20px 2px rgba(6,182,212,0.1); }
}
.cta-pulse:hover {
  animation: subtle-pulse 2s ease-in-out infinite;
}

/* ── Demo Page ───────────────────────────── */
.mode-card {
  cursor: pointer;
  touch-action: manipulation;
  border: 1px solid rgba(255,255,255,0.06);
  background: #0d0d0d;
  border-radius: 0.5rem;
  padding: 1.5rem;
  text-align: left;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease, background 0.25s ease;
}
.mode-card:hover {
  border-color: rgba(34,211,238,0.35);
  box-shadow: 0 0 32px rgba(34,211,238,0.07);
  transform: translateY(-2px);
}
.mode-card-active {
  border-color: rgba(34,211,238,0.65) !important;
  background: rgba(34,211,238,0.04) !important;
  box-shadow: 0 0 40px rgba(34,211,238,0.1) !important;
}

.role-card {
  cursor: pointer;
  touch-action: manipulation;
  border: 1px solid rgba(255,255,255,0.06);
  background: #0d0d0d;
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.role-card:hover {
  border-color: rgba(34,211,238,0.3);
  background: rgba(34,211,238,0.025);
  transform: translateY(-1px);
}
.role-card-active {
  border-color: rgba(34,211,238,0.6) !important;
  background: rgba(34,211,238,0.06) !important;
}

.stepper-num {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 0.3s ease, color 0.3s ease;
}
.stepper-connector {
  flex: 1;
  max-width: 5rem;
  height: 1px;
  background: rgba(255,255,255,0.08);
}
.stepper-step { transition: color 0.3s ease; }
.stepper-step.stepper-active .stepper-num   { background: #22d3ee; color: #000; }
.stepper-step.stepper-active .stepper-label { color: #fff; }
.stepper-step.stepper-done   .stepper-num   { background: rgba(34,211,238,0.15); color: #22d3ee; }
.stepper-step.stepper-done   .stepper-label { color: #22d3ee; }
.stepper-step.stepper-pending .stepper-num  { background: rgba(255,255,255,0.05); color: #444; }
.stepper-step.stepper-pending .stepper-label{ color: #444; }

.cred-box {
  background: #0d0d0d;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 0.5rem;
  overflow: hidden;
}
.cred-row {
  display: grid;
  grid-template-columns: 7.5rem 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.cred-row:last-child { border-bottom: none; }
.cred-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #4b5563;
  flex-shrink: 0;
}
.cred-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: #e5e7eb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid rgba(34,211,238,0.2);
  color: #22d3ee;
  background: rgba(34,211,238,0.05);
  cursor: pointer;
  border-radius: 0.25rem;
  transition: background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.copy-btn:hover {
  background: rgba(34,211,238,0.12);
  border-color: rgba(34,211,238,0.45);
}
.copy-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

@keyframes demoStepIn {
  from { transform: translateY(8px); }
  to   { transform: translateY(0); }
}
.demo-step-anim { animation: demoStepIn 0.2s ease forwards; }

.mode-label-chip {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  color: #22d3ee;
  background: rgba(34,211,238,0.07);
  border: 1px solid rgba(34,211,238,0.15);
  border-radius: 0.25rem;
  letter-spacing: 0.04em;
}
.role-icon-wrap {
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: 0.375rem;
  background: rgba(34,211,238,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #22d3ee;
}

/* Mobile: cred-row stacks label+btn / value full-width */
@media (max-width: 600px) {
  .cred-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.35rem 0.75rem;
  }
  .cred-label {
    grid-column: 1;
    grid-row: 1;
  }
  .copy-btn {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }
  .cred-value {
    grid-column: 1 / -1;
    grid-row: 2;
    white-space: normal;
    word-break: break-all;
    text-overflow: unset;
    overflow: visible;
  }
}
