/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Variables ── */
:root {
  --bg:      #080810;
  --border:  #1c1c30;
  --accent:  #b36eff;
  --accent2: #7c3aed;
  --accent3: #e040fb;
  --text:    #e8e8f0;
  --muted:   #6b6b8a;
  --card-bg: #0f0f1d;
  --surface: #0f0f1d;
  --glow:    rgba(179, 110, 255, 0.10);
}

/* ── Base ── */
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Cursor glow (ambient only, does not hide the real cursor) ── */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 340px; height: 340px;
  margin: -170px 0 0 -170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(179,110,255,0.13) 0%, transparent 70%);
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
}

/* ── Scanlines overlay ── */
.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.06) 3px,
    rgba(0,0,0,0.06) 4px
  );
  pointer-events: none;
  z-index: 2;
  animation: scanPan 12s linear infinite;
}

@keyframes scanPan {
  from { background-position: 0 0; }
  to   { background-position: 0 100vh; }
}

/* ── Grid texture ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,255,255,0.015) 39px, rgba(255,255,255,0.015) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255,255,255,0.015) 39px, rgba(255,255,255,0.015) 40px);
  pointer-events: none;
  z-index: 0;
}

/* ── Ambient blobs ── */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.14;
  pointer-events: none;
  z-index: 0;
}

.blob-1 {
  width: 640px; height: 640px;
  background: var(--accent2);
  top: -220px; right: -160px;
  animation: drift 14s ease-in-out infinite alternate;
}

.blob-2 {
  width: 440px; height: 440px;
  background: var(--accent3);
  bottom: -120px; left: -120px;
  animation: drift 18s ease-in-out infinite alternate-reverse;
}

.blob-3 {
  width: 300px; height: 300px;
  background: #3b82f6;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.06;
  animation: drift 22s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, 20px) scale(1.08); }
}

/* ── Layout ── */
.wrapper {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ── Header ── */
header {
  padding: 72px 0 56px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: fadeUp 0.5s ease both;
}

.logo {
  width: 64px; height: 64px;
  object-fit: contain;
  border-radius: 8px;
  filter: drop-shadow(0 0 18px rgba(179, 110, 255, 0.35));
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 18px rgba(179,110,255,0.35)); }
  50%       { filter: drop-shadow(0 0 32px rgba(179,110,255,0.7)); }
}

.socials {
  display: flex;
  gap: 14px;
  align-items: center;
}

.socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, filter 0.2s;
}

.socials a:hover {
  transform: translateY(-4px) scale(1.12);
  filter: brightness(1.2) drop-shadow(0 0 14px rgba(179, 110, 255, 0.7));
}

.socials img {
  width: 36px; height: 36px;
  object-fit: contain;
  border-radius: 6px;
}

/* ── Tag pill ── */
.tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(179, 110, 255, 0.08);
  border: 1px solid rgba(179, 110, 255, 0.22);
  padding: 5px 14px;
  border-radius: 2px;
  width: fit-content;
  animation: fadeUp 0.5s 0.08s ease both;
}

/* ── Heading ── */
h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(28px, 4.8vw, 58px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  white-space: nowrap;
  animation: fadeUp 0.5s 0.14s ease both;
}

h1 .drive { color: var(--accent); }
h1 .path  { color: var(--muted); }

/* ── Typewriter ── */
#typewriter {
  color: var(--text);
  position: relative;
}
/* Cursor only shown while typing via JS-toggled class */
#typewriter.typing::after {
  content: '|';
  color: var(--accent);
  animation: cursorBlink 0.75s step-end infinite;
  margin-left: 2px;
}

/* ── Glitch on h1 hover ── */
h1.glitch-wrap:hover .drive {
  animation: glitch 0.4s steps(2) infinite;
}

@keyframes glitch {
  0%   { text-shadow: 2px 0 #e040fb, -2px 0 #3b82f6; }
  25%  { text-shadow: -2px 0 #e040fb, 2px 0 #3b82f6; clip-path: inset(20% 0 60% 0); }
  50%  { text-shadow: 2px 2px #e040fb, -2px -2px #3b82f6; }
  75%  { text-shadow: -2px 2px #e040fb, 2px -2px #3b82f6; clip-path: inset(60% 0 10% 0); }
  100% { text-shadow: 2px 0 #e040fb, -2px 0 #3b82f6; }
}

/* ── Subtitle ── */
.subtitle {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.03em;
  max-width: 440px;
  line-height: 1.75;
  animation: fadeUp 0.5s 0.20s ease both;
}

.subtitle a {
  color: var(--accent);
  text-decoration: none;
}
.subtitle a:hover { opacity: 0.75; }

/* ── Blinking block cursor ── */
.blink-cursor {
  color: var(--accent);
  animation: cursorBlink 1s step-end infinite;
  font-size: 0.85em;
  margin-left: 2px;
}

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

/* ── Divider ── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 65%);
  margin-bottom: 52px;
  animation: fadeUp 0.5s 0.26s ease both;
}

/* ── Section label ── */
.section-label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 26px;
  animation: fadeUp 0.5s 0.30s ease both;
}

/* ── Project grid ── */
#projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 20px;
  margin-bottom: 96px;
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

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

/* ── Card ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 30px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.25s cubic-bezier(.22,.68,0,1.2), box-shadow 0.3s;
}

/* Subtle top-left glow corner — doesn't obscure text */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 0% 0%, rgba(179,110,255,0.07) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}

.card:hover {
  border-color: rgba(179, 110, 255, 0.45);
  transform: translateY(-4px);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(179, 110, 255, 0.15),
    0 0 30px rgba(179, 110, 255, 0.08);
}

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

/* ── Card scan-line sweep ── */
.card-scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(179,110,255,0.05) 50%,
    transparent 100%
  );
  transform: translateY(-100%);
  transition: none;
  pointer-events: none;
}

.card:hover .card-scan {
  animation: scanSweep 0.6s ease forwards;
}

@keyframes scanSweep {
  from { transform: translateY(-100%); }
  to   { transform: translateY(100%); }
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-icon {
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover .card-icon {
  border-color: rgba(179,110,255,0.4);
  box-shadow: 0 0 12px rgba(179,110,255,0.25);
}

.card-icon svg { width: 18px; height: 18px; }

.card-arrow {
  color: var(--muted);
  transition: color 0.2s, transform 0.2s;
}

.card:hover .card-arrow {
  color: var(--accent);
  transform: translate(4px, -4px);
}

.card-name {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.card-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.78;
  letter-spacing: 0.02em;
}

.card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

/* ── Pills ── */
.pill {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: border-color 0.2s, color 0.2s;
}

.card:hover .pill {
  border-color: rgba(179,110,255,0.18);
  color: var(--text);
}

.pill.lang {
  border-color: rgba(179, 110, 255, 0.22);
  color: var(--accent);
  background: rgba(179, 110, 255, 0.07);
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

footer span {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

footer a {
  color: var(--accent);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.06em;
  transition: opacity 0.2s;
}

footer a:hover { opacity: 0.7; }

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 600px) {
  body { cursor: auto; }
  .cursor-glow { display: none; }
  header { padding: 48px 0 40px; }
  h1 { font-size: clamp(20px, 7vw, 36px); white-space: normal; }
  #projects-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; align-items: flex-start; }
}
