/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #000000;
  --bg2:       #0a0a0a;
  --surface:   #111111;
  --border:    rgba(255,255,255,0.12);
  --white:     #ffffff;
  --gray:      #888888;
  --gray2:     #555555;
  --text:      #d0d0d0;
  --muted:     #555555;
  --radius:    2px;
  --glow-w:    0 0 8px rgba(255,255,255,0.4), 0 0 20px rgba(255,255,255,0.15);
  --glow-s:    0 0 6px rgba(255,255,255,0.2);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Courier New', 'Consolas', monospace;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Scanlines overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255,255,255,.012) 2px,
    rgba(255,255,255,.012) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* Grid background */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ===== GLITCH KEYFRAMES ===== */
@keyframes glitch {
  0%   { clip-path: inset(0 0 95% 0); transform: translate(-3px, 0); }
  10%  { clip-path: inset(30% 0 50% 0); transform: translate(3px, 0); }
  20%  { clip-path: inset(60% 0 20% 0); transform: translate(-2px, 0); }
  30%  { clip-path: inset(80% 0 5% 0);  transform: translate(2px, 0); }
  40%  { clip-path: inset(10% 0 80% 0); transform: translate(-1px, 0); }
  50%  { clip-path: inset(50% 0 30% 0); transform: translate(0, 0); }
  100% { clip-path: inset(0 0 95% 0);   transform: translate(0, 0); }
}

@keyframes flicker {
  0%, 95%, 100% { opacity: 1; }
  96%           { opacity: .7; }
  97%           { opacity: 1; }
  98%           { opacity: .4; }
  99%           { opacity: 1; }
}

@keyframes neon-pulse {
  0%, 100% { text-shadow: 0 0 6px #fff, 0 0 18px rgba(255,255,255,0.3); }
  50%       { text-shadow: 0 0 2px #fff; }
}

@keyframes scan {
  0%   { top: -10%; }
  100% { top: 110%; }
}

/* ===== HERO ===== */
.hero {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem 2.5rem;
  position: relative;
  z-index: 1;
  background: #000;
  overflow: hidden;
}

/* Matrix canvas */
#matrix-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .18;
  z-index: 1;
}

/* Moving scan line */
.hero::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: scan 5s linear infinite;
  z-index: 2;
}

.hero-content { position: relative; z-index: 3; }

/* Name */
.hero h1 {
  font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--white);
  animation: neon-pulse 4s ease-in-out infinite, flicker 10s infinite;
  position: relative;
}

.hero h1::before,
.hero h1::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero h1::before {
  color: rgba(255,255,255,0.6);
  animation: glitch 4s infinite steps(1);
  opacity: .5;
}

.hero h1::after {
  color: rgba(200,200,200,0.4);
  animation: glitch 4s infinite steps(1) reverse;
  opacity: .3;
  animation-delay: .1s;
}

.tagline {
  font-size: clamp(.75rem, 1.8vw, .9rem);
  color: var(--gray);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  margin-top: .4rem;
}

.tagline::after {
  content: '_';
  animation: flicker .8s step-end infinite;
}

/* Discord box hero */
.discord-box {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.2);
  padding: .4rem 1rem;
  font-size: .82rem;
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}

.discord-icon { display: flex; align-items: center; color: #7289da; filter: drop-shadow(0 0 4px #7289da); }
.discord-label { color: var(--muted); letter-spacing: 1px; font-size: .82rem; }
.discord-tag { font-weight: 700; color: var(--white); letter-spacing: 1px; }

/* ===== NAV ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  padding: .9rem 1rem;
}

.navbar a {
  color: var(--muted);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: color .2s;
  position: relative;
}

.navbar a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 1px;
  background: var(--white);
  transform: scaleX(0);
  transition: transform .2s;
}

.navbar a:hover { color: var(--white); }
.navbar a:hover::after { transform: scaleX(1); }

/* ===== SECTIONS ===== */
.section { padding: 5rem 1.5rem; position: relative; z-index: 1; }
.section-dark { background: var(--bg2); }

.section-title {
  text-align: center;
  font-size: clamp(1.2rem, 3.5vw, 1.8rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--white);
  text-shadow: var(--glow-s);
  margin-bottom: .75rem;
}

.section-title::before { content: '// '; color: var(--gray2); }
.section-title::after  { content: ' //'; color: var(--gray2); }

.section-sub {
  text-align: center;
  color: var(--muted);
  margin-bottom: 3rem;
  letter-spacing: 1px;
  font-size: .88rem;
}

.section-title + .section-sub::before,
.section-title + p::before {
  content: '───────────────────────';
  display: block;
  text-align: center;
  color: rgba(255,255,255,.08);
  margin-bottom: .75rem;
  letter-spacing: 0;
}

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  max-width: 900px;
  margin: 3rem auto 0;
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  position: relative;
  transition: transform .25s;
  cursor: default;
}

.skill-card:hover { transform: translateY(-4px); }

.skill-card:hover {
  border-color: rgba(255,255,255,.35);
  box-shadow: var(--glow-w);
}

.skill-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.skill-icon svg { width: 30px; height: 30px; }

.html  { color: #ccc; }
.css   { color: #ccc; }
.node  { color: #ccc; }
.react { color: #ccc; }

.skill-card h3 {
  font-size: 1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: .5rem;
}
.skill-card p { font-size: .82rem; color: var(--muted); }

.skill-card::after {
  content: '';
  position: absolute;
  top: 0; right: 16px;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 16px 16px 0;
  border-color: transparent rgba(255,255,255,.15) transparent transparent;
}

/* ===== SECURITY ===== */
.security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  max-width: 1000px;
  margin: 3rem auto 0;
}

.sec-item {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5rem 1rem;
  text-align: center;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  transition: border-color .2s, transform .2s, box-shadow .2s;
  cursor: default;
}

.sec-item:hover {
  border-color: rgba(255,255,255,.3);
  box-shadow: var(--glow-s);
  transform: translateY(-3px);
}

.sec-icon { font-size: 1.8rem; display: block; margin-bottom: .6rem; filter: grayscale(1); }

.sec-item h4 {
  font-size: .8rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gray);
}

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 0 100%);
  transition: transform .25s, box-shadow .25s, border-color .25s;
  overflow: visible;
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255,255,255,.3);
  box-shadow: var(--glow-w);
}

.project-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.placeholder-thumb {
  height: 180px;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  color: var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.thumb-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: .5rem 1rem;
  background: rgba(255,255,255,.03);
  border-top: 1px solid var(--border);
  font-size: .78rem;
  color: var(--gray);
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.thumb-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 4px #fff;
  flex-shrink: 0;
  animation: flicker 3s infinite;
}

.project-info { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }

.project-info h3 {
  font-size: .9rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: .5rem;
}

.project-info h3::before { content: '[ '; color: var(--gray2); }
.project-info h3::after  { content: ' ]'; color: var(--gray2); }

.project-info p { font-size: .84rem; color: var(--muted); flex: 1; }

.project-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; }

.tag {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.15);
  color: var(--gray);
  font-size: .72rem;
  padding: .2rem .6rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.btn-project {
  display: inline-block;
  color: var(--white);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: opacity .2s;
  margin-top: auto;
  opacity: .7;
}

.btn-project::before { content: '>> '; color: var(--gray2); }
.btn-project:hover { opacity: 1; }

/* ===== CONTACT ===== */
.contact-grid {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2.5rem 3.5rem;
  text-align: center;
  clip-path: polygon(16px 0%, 100% 0%, calc(100% - 16px) 100%, 0% 100%);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}

.discord-card { border-color: rgba(114,137,218,.3); }

.discord-card:hover {
  transform: translateY(-5px);
  border-color: rgba(114,137,218,.7);
  box-shadow: 0 0 16px rgba(114,137,218,.25);
}

.discord-logo {
  color: #7289da;
  filter: drop-shadow(0 0 6px rgba(114,137,218,.5));
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.contact-card h3 {
  font-size: .8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .75rem;
}

.discord-username {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--white);
  letter-spacing: 2px;
}

.discord-hint {
  font-size: .78rem;
  color: var(--muted);
  margin-top: .5rem;
  letter-spacing: 1px;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.footer::before { content: '> '; color: rgba(255,255,255,.2); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #333; }
::-webkit-scrollbar-thumb:hover { background: #666; }

/* ===== SELECTION ===== */
::selection { background: #fff; color: #000; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .navbar { gap: 1rem; font-size: .75rem; }
  .section { padding: 3rem 1rem; }
  .security-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-card { padding: 2rem 2rem; clip-path: none; }
}
