/* ═══════════════════════════════════════════════════
   Patrick Chojnacki — Cyberpunk Futuristic Theme
   ═══════════════════════════════════════════════════ */

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

:root {
  --bg-deep: #050510;
  --bg-card: #0d0d20;
  --border: rgba(100, 200, 255, 0.08);
  --border-hover: rgba(100, 200, 255, 0.25);
  --text: #e2e8f0;
  --text-muted: #64748b;
  --neon-blue: #00d4ff;
  --neon-purple: #a855f7;
  --neon-pink: #f472b6;
  --neon-green: #22c55e;
  --neon-yellow: #fbbf24;
  --glow-blue: 0 0 20px rgba(0, 212, 255, 0.3);
  --glow-purple: 0 0 20px rgba(168, 85, 247, 0.3);
  --gradient-main: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
  overflow-x: hidden;
  position: relative;
}

/* ── Animated Grid Background ── */
.grid-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(60px, 60px); }
}

/* ── Floating Glow Orbs ── */
.glow-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.15;
  will-change: transform;
  z-index: 0;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--neon-blue);
  top: 10%;
  left: -10%;
  animation: float1 15s ease-in-out infinite;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: var(--neon-purple);
  top: 50%;
  right: -5%;
  animation: float2 20s ease-in-out infinite;
}

.orb-3 {
  width: 250px;
  height: 250px;
  background: var(--neon-pink);
  bottom: 10%;
  left: 30%;
  animation: float3 18s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, 30px); }
}

@keyframes float2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30px, -40px); }
}

@keyframes float3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -20px); }
}

/* ── Scanline & Noise ── */
.scanline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.015) 2px,
    rgba(0, 0, 0, 0.015) 4px
  );
}

.noise {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Selection ── */
::selection {
  background: rgba(0, 212, 255, 0.3);
  color: #fff;
}

/* ── Links ── */
a {
  color: var(--neon-blue);
  text-decoration: none;
  transition: color 0.3s, text-shadow 0.3s;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--neon-blue);
  outline-offset: 3px;
}

a:hover {
  color: #fff;
  text-shadow: 0 0 8px var(--neon-blue);
}

/* ── Navigation ── */
header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(5, 5, 16, 0.85);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--neon-blue);
  letter-spacing: -0.5px;
}

.logo:hover {
  color: var(--neon-blue);
  text-shadow: var(--glow-blue);
}

.logo-bracket {
  color: var(--neon-purple);
}

.blink {
  animation: blink 1s step-end infinite;
  color: var(--neon-green);
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav ul a {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  transition: color 0.3s;
  position: relative;
}

nav ul a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gradient-main);
  transition: width 0.3s;
}

nav ul a:hover {
  color: var(--neon-blue);
  text-shadow: none;
}

nav ul a:hover::after {
  width: 100%;
}

.menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--neon-blue);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
}

/* ── Main ── */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

section {
  padding: 7rem 0 5rem;
}

h2 {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 2.5rem;
  color: var(--text);
}

.section-num {
  color: var(--neon-blue);
  margin-right: 0.5rem;
}

/* ── Fade-in animation ── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 4rem;
}

.hero-content {
  width: 100%;
}

.glitch-container {
  margin-bottom: 1rem;
}

.glitch {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  color: #fff;
  position: relative;
  letter-spacing: -2px;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.glitch.glitch-active::before {
  color: var(--neon-blue);
  animation: glitch-1 0.3s steps(2, end) 3;
  clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%);
  opacity: 0.85;
  text-shadow: 2px 0 var(--neon-blue);
}

.glitch.glitch-active::after {
  color: var(--neon-pink);
  animation: glitch-2 0.25s steps(2, end) 4;
  clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);
  opacity: 0.85;
  text-shadow: -2px 0 var(--neon-pink);
}

.glitch.glitch-active {
  animation: glitch-base 0.4s steps(1, end) 2;
}

@keyframes glitch-base {
  0%   { transform: translate(0); }
  10%  { transform: translate(-3px, 2px); }
  20%  { transform: translate(3px, -1px); }
  30%  { transform: translate(-2px, -2px); text-shadow: 3px 0 var(--neon-blue), -3px 0 var(--neon-pink); }
  40%  { transform: translate(2px, 1px); }
  50%  { transform: translate(-1px, 3px); text-shadow: -2px 0 var(--neon-blue), 2px 0 var(--neon-pink); }
  60%  { transform: translate(3px, -2px); }
  70%  { transform: translate(-3px, 1px); }
  80%  { transform: translate(1px, -3px); text-shadow: 4px 0 var(--neon-blue), -4px 0 var(--neon-pink); }
  90%  { transform: translate(-2px, 2px); }
  100% { transform: translate(0); text-shadow: none; }
}

@keyframes glitch-1 {
  0%   { transform: translate(0); clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%); }
  25%  { transform: translate(-5px, 2px) skewX(-2deg); clip-path: polygon(0 10%, 100% 10%, 100% 45%, 0 45%); }
  50%  { transform: translate(4px, -1px) skewX(1deg); clip-path: polygon(0 5%, 100% 5%, 100% 35%, 0 35%); }
  75%  { transform: translate(-3px, 3px) skewX(-1deg); clip-path: polygon(0 15%, 100% 15%, 100% 50%, 0 50%); }
  100% { transform: translate(0); clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%); }
}

@keyframes glitch-2 {
  0%   { transform: translate(0); clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%); }
  25%  { transform: translate(5px, -2px) skewX(2deg); clip-path: polygon(0 55%, 100% 55%, 100% 90%, 0 90%); }
  50%  { transform: translate(-4px, 1px) skewX(-1deg); clip-path: polygon(0 65%, 100% 65%, 100% 95%, 0 95%); }
  75%  { transform: translate(3px, -3px) skewX(1deg); clip-path: polygon(0 50%, 100% 50%, 100% 85%, 0 85%); }
  100% { transform: translate(0); clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%); }
}

/* ── Background Glitch (Screen Tear + Chromatic Flash) ── */
.glitch-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9995;
  opacity: 0;
  background-color: transparent;
}

.glitch-overlay.active {
  opacity: 1;
  animation: screenFlash 0.15s ease-out;
}

.glitch-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 212, 255, 0.03);
  mix-blend-mode: screen;
}

@keyframes screenFlash {
  0%   { background-color: rgba(0, 212, 255, 0.08); }
  50%  { background-color: rgba(168, 85, 247, 0.05); }
  100% { background-color: transparent; }
}

/* Screen tear strips */
.tear-strip {
  position: fixed;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 9996;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

.tear-strip.active {
  opacity: 1;
  animation: tearFlicker 0.3s steps(3, end) forwards;
}

.tear-strip::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 212, 255, 0.15) 10%,
    rgba(168, 85, 247, 0.08) 30%,
    transparent 40%,
    rgba(244, 114, 182, 0.1) 60%,
    rgba(0, 212, 255, 0.12) 80%,
    transparent 100%
  );
}

.tear-strip::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(0, 212, 255, 0.6);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

@keyframes tearFlicker {
  0%   { opacity: 0; transform: translateX(0); }
  25%  { opacity: 1; transform: translateX(8px); }
  50%  { opacity: 0.6; transform: translateX(-5px); }
  75%  { opacity: 1; transform: translateX(3px); }
  100% { opacity: 0; transform: translateX(0); }
}

/* Chromatic aberration on body during glitch */
.bg-glitch {
  animation: chromaticShift 0.2s steps(2, end) 2;
}

@keyframes chromaticShift {
  0%   { filter: none; }
  25%  { filter: drop-shadow(2px 0 0 rgba(0, 212, 255, 0.3)) drop-shadow(-2px 0 0 rgba(244, 114, 182, 0.3)); }
  50%  { filter: drop-shadow(-1px 0 0 rgba(168, 85, 247, 0.4)) drop-shadow(1px 0 0 rgba(0, 212, 255, 0.3)); }
  75%  { filter: drop-shadow(3px 0 0 rgba(244, 114, 182, 0.3)) drop-shadow(-3px 0 0 rgba(0, 212, 255, 0.2)); }
  100% { filter: none; }
}

/* ── Glitch Bar (horizontal sweep) ── */
.glitch-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  pointer-events: none;
  z-index: 9997;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(0, 212, 255, 0.06) 20%,
    rgba(168, 85, 247, 0.1) 50%,
    rgba(0, 212, 255, 0.06) 80%,
    transparent
  );
  opacity: 0;
}

.glitch-bar.active {
  height: 60px;
  opacity: 1;
  animation: glitchBarSweep 0.6s linear forwards;
}

@keyframes glitchBarSweep {
  0%   { top: -60px; opacity: 0.8; }
  50%  { opacity: 1; }
  100% { top: 110vh; opacity: 0; }
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.typed-prefix {
  color: var(--neon-green);
  margin-right: 0.5rem;
}

.hero-terminal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  box-shadow: var(--glow-blue), inset 0 1px 0 rgba(255,255,255,0.03);
  max-height: min(60vh, 420px);
  overflow-y: auto;
  cursor: text;
  position: relative;
}

/* Maximize / minimize control */
.terminal-controls {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: flex-end;
  gap: 0.25rem;
  margin: -0.5rem -0.5rem 0.25rem 0;
  pointer-events: none;
  z-index: 3;
}

.terminal-ctrl-btn {
  pointer-events: auto;
  background: rgba(10, 14, 28, 0.7);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--neon-blue);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.terminal-ctrl-btn:hover,
.terminal-ctrl-btn:focus-visible {
  background: rgba(0, 212, 255, 0.12);
  border-color: var(--neon-blue);
  color: #fff;
  outline: none;
}

.terminal-ctrl-icon { display: block; }
.icon-minimize { display: none; }
.hero-terminal.maximized .icon-maximize { display: none; }
.hero-terminal.maximized .icon-minimize { display: block; }

/* Maximized (fullscreen) state */
.hero-terminal.maximized {
  position: fixed;
  inset: 0;
  margin: 0;
  border-radius: 0;
  max-height: none;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  padding: 3rem 1.25rem 1.25rem;
  z-index: 1000;
  overflow-y: auto;
}

body.terminal-maximized-open {
  overflow: hidden;
}

.hero-terminal::-webkit-scrollbar {
  width: 6px;
}

.hero-terminal::-webkit-scrollbar-track {
  background: transparent;
}

.hero-terminal::-webkit-scrollbar-thumb {
  background: rgba(0, 212, 255, 0.2);
  border-radius: 3px;
}

.hero-terminal::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 212, 255, 0.4);
}

.terminal-history {
  min-height: 0;
}

.terminal-line {
  margin-bottom: 0.5rem;
}

.t-prompt {
  color: var(--neon-green);
  margin-right: 0.75rem;
  user-select: none;
}

.t-cmd {
  color: var(--text);
}

.t-cursor {
  color: var(--neon-blue);
  animation: blink 1s step-end infinite;
}

.terminal-output {
  margin: 0.25rem 0 0.75rem 1.5rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.terminal-output pre {
  font-family: inherit;
  font-size: inherit;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.terminal-output.t-loading pre {
  color: var(--neon-blue);
  animation: blink 1s step-end infinite;
}

.terminal-input-line {
  display: flex;
  align-items: center;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(100, 200, 255, 0.04);
}

.t-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  caret-color: var(--neon-blue);
  letter-spacing: 0.3px;
}

.t-input::placeholder {
  color: rgba(100, 116, 139, 0.5);
  font-style: italic;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--gradient-main);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: var(--glow-blue);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
  text-shadow: none;
}

.btn-ghost {
  display: inline-block;
  padding: 0.75rem 2rem;
  border: 1px solid var(--border-hover);
  color: var(--neon-blue);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.3s;
}

.btn-ghost:hover {
  background: rgba(0, 212, 255, 0.05);
  border-color: var(--neon-blue);
  transform: translateY(-2px);
  text-shadow: none;
}

/* ── About ── */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text p {
  margin-bottom: 1.25rem;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.9;
}

.stats-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--glow-purple);
}

.stat-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.stat-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--neon-blue);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
  min-width: 3.5rem;
}

.stat-key {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Stack ── */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stack-item {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.stack-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-main);
  opacity: 0;
  transition: opacity 0.3s;
}

.stack-item:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stack-item:hover::before {
  opacity: 1;
}

.stack-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.stack-item h3 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--neon-blue);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.stack-item p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Projects ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-main);
  opacity: 0;
  transition: opacity 0.3s;
}

.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(0, 212, 255, 0.03), transparent 60%);
  pointer-events: none;
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), var(--glow-blue);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card.featured {
  grid-column: 1 / -1;
  border-color: rgba(0, 212, 255, 0.15);
  background: linear-gradient(135deg, var(--bg-card), rgba(0, 212, 255, 0.02));
}

.project-card.featured::before {
  opacity: 1;
}

.project-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 0.25rem 0.75rem;
  border-radius: 3px;
  margin-bottom: 1rem;
  font-weight: 600;
}

.neon-blue {
  color: var(--neon-blue);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.neon-green {
  color: var(--neon-green);
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.neon-purple {
  color: var(--neon-purple);
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.neon-pink {
  color: var(--neon-pink);
  background: rgba(244, 114, 182, 0.08);
  border: 1px solid rgba(244, 114, 182, 0.2);
}

.neon-yellow {
  color: var(--neon-yellow);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.project-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #fff;
}

.project-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.7;
}

.project-tech {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  opacity: 0.7;
}

.project-card a {
  display: inline-block;
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--neon-blue);
}

/* ── Services ── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.service-card {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.3s;
  position: relative;
}

.service-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gradient-main);
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: 2px;
}

.service-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.service-card:hover::before {
  opacity: 1;
}

.service-icon {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.service-card h3 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: #fff;
}

.service-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Contact ── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.contact-text p {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  line-height: 1.8;
}

.contact-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--neon-green);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
  animation: pulse 2s ease-in-out infinite;
}

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

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-soon {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-hover);
  border-radius: 8px;
  text-align: center;
}

/* ── Contact Form ── */
.contact-form-wrap {
  width: 100%;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--neon-blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.btn-submit {
  align-self: flex-start;
  cursor: pointer;
  position: relative;
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-error {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #ff4444;
  margin: 0;
}

.form-success {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--neon-green);
  margin: 0;
}

/* ── Footer ── */
footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-content p {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer-sub {
  margin-top: 0.25rem;
  opacity: 0.5;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .stats-panel {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .stat-row {
    border-bottom: none;
    padding-bottom: 0;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .project-card.featured {
    grid-column: auto;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .hero-terminal {
    max-height: min(55vh, 320px);
  }
}

@media (max-width: 600px) {
  body {
    font-size: 14px;
  }

  nav ul {
    position: fixed;
    top: 58px;
    left: 0;
    right: 0;
    background: rgba(5, 5, 16, 0.98);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
  }

  nav ul.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .menu-btn {
    display: block;
  }

  .glitch {
    font-size: 2rem;
  }

  .stack-grid {
    grid-template-columns: 1fr;
  }

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

  section {
    padding: 5rem 0 3rem;
  }

  /* Terminal mobile fixes */
  .hero-terminal {
    max-height: min(50vh, 260px);
    padding: 1rem;
    font-size: 0.78rem;
    margin-bottom: 1.5rem;
  }

  .hero-terminal.maximized {
    max-height: none;
    padding: 3rem 1rem 1rem;
    font-size: 0.85rem;
  }

  .terminal-input-line {
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    padding-top: 0.5rem;
    padding-bottom: 0.25rem;
    margin-top: 0.5rem;
    z-index: 2;
  }

  .t-input {
    font-size: 16px; /* prevents iOS zoom on focus */
  }

  .hero-cta {
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
  }

  .hero-cta .btn-primary, .hero-cta .btn-ghost {
    text-align: center;
    padding: 1rem 2rem;
  }

  .glow-orb { display: none; }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html { scroll-behavior: auto; }

  .grid-bg { animation: none; }
  .glow-orb { animation: none; }
  .glitch::before, .glitch::after { animation: none; clip-path: none; color: transparent; }
  .glitch.glitch-active { animation: none; text-shadow: none; }
  .bg-glitch { animation: none !important; filter: none !important; }
  .glitch-bar { display: none; }
  .glitch-overlay { display: none; }
  .tear-strip { display: none; }
}

/* ── Contact Share / QR ── */
.contact-share {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

.btn-qr {
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.contact-share-hint {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── QR Modal ── */
body.qr-modal-open {
  overflow: hidden;
}

.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.qr-modal[hidden] {
  display: none;
}

.qr-modal.open {
  opacity: 1;
}

.qr-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 16, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.qr-modal-panel {
  position: relative;
  width: min(420px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: 12px;
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.18), 0 20px 60px rgba(0, 0, 0, 0.6);
  text-align: center;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.18s ease;
}

.qr-modal.open .qr-modal-panel {
  transform: translateY(0) scale(1);
}

.qr-modal-close {
  position: absolute;
  top: 0.4rem;
  right: 0.6rem;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.qr-modal-close:hover,
.qr-modal-close:focus-visible {
  color: var(--neon-blue);
  outline: none;
}

.qr-modal-title {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text);
  margin: 0 0 1rem;
  letter-spacing: 0.05em;
}

.qr-modal-code {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 1rem;
  border-radius: 8px;
  margin: 0 auto 1rem;
  width: min(280px, 100%);
  aspect-ratio: 1 / 1;
}

.qr-modal-code svg {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-modal-url {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--neon-blue);
  word-break: break-all;
  margin: 0 0 1rem;
}

.qr-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.qr-modal-actions .btn-ghost {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.5rem 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  .qr-modal,
  .qr-modal-panel {
    transition: none;
  }
}
