/*
  Cyberpunk/Hacker Portfolio Theme
  - Dark canvas with neon accents
  - Glitch title animation
  - Matrix rain background (canvas behind content)
*/

:root {
  --bg: #070a0d;
  --bg-2: #0b1116;
  --text: #d6e5ff;
  --muted: #8aa0b7;
  --grid: #12202d;
  --card: #0e151c;
  --border: #132230;
  --accent: #00ffb2;      /* neon */
  --accent-2: #2ee6ff;    /* cyan */
  --shadow: 0 0 20px rgba(0,255,178,0.25), 0 0 60px rgba(0,255,178,0.12);
}

/* Magenta theme */
body[data-theme="magenta"] {
  --accent: #ff2bd1;
  --accent-2: #bd93f9;
  --shadow: 0 0 20px rgba(255,43,209,0.25), 0 0 60px rgba(255,43,209,0.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 800px at 20% -10%, rgba(0,255,178,0.07), transparent 60%),
              radial-gradient(1000px 700px at 120% 10%, rgba(46,230,255,0.06), transparent 55%),
              var(--bg);
  color: var(--text);
  font: 15px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0.2px;
}

#matrix {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.22;
  pointer-events: none;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(to bottom, rgba(7,10,13,0.9), rgba(7,10,13,0.65));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; }
.logo { color: var(--accent); filter: drop-shadow(0 0 6px var(--accent)); }
.brand-name { color: var(--text); text-decoration: none; font-weight: 700; }

.nav { display: flex; align-items: center; gap: 16px; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 6px;
}
.nav a:hover { color: var(--text); background: rgba(255,255,255,0.04); }

.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.login-nav {
  position: static;
  background: linear-gradient(to bottom, rgba(7,10,13,0.9), rgba(7,10,13,0.6));
  border-bottom: 1px solid var(--border);
}
.login-nav .nav-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.login-nav .nav-link:hover {
  color: var(--text);
}

.login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  padding: 60px 20px 80px;
  width: min(1024px, 100%);
  margin: 0 auto;
}

.login-info {
  display: grid;
  gap: 18px;
  align-content: start;
  color: var(--muted);
}
.login-info h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 70px);
}
.login-info p { margin: 0; color: var(--text); max-width: 480px; }
.login-hints {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  max-width: 420px;
}
.login-hints li {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
}
.login-hints li::before {
  content: '>>';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 1px;
}
.login-hints a { color: var(--accent); text-decoration: none; }
.login-hints a:hover { text-decoration: underline; }

.login-card {
  display: flex;
  justify-content: center;
}
.login-card .auth-card {
  width: min(360px, 100%);
  gap: 18px;
}
.login-card .auth-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.login-card .auth-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 640px) {
  .login-shell {
    padding-top: 40px;
    padding-bottom: 60px;
  }
  .login-info h1 { font-size: clamp(28px, 12vw, 48px); }
}

.user-chip {
  font-size: 12px;
  letter-spacing: 0.6px;
  color: var(--accent);
  border: 1px solid color-mix(in oklab, var(--accent) 40%, var(--border));
  border-radius: 999px;
  padding: 4px 10px;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(0,255,178,0.18);
}

#sessionUser[hidden] { display: none !important; }

.btn, .btn-ghost {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.2));
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.btn { border-color: color-mix(in oklab, var(--accent) 35%, var(--border)); box-shadow: var(--shadow); }
.btn:hover { background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(0,0,0,0.2)); }
.btn-ghost { background: transparent; }

.input {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 8px;
  outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 20%, transparent); }

.container {
  position: relative;
  z-index: 1;
  width: min(1100px, 92%);
  margin: 0 auto;
}
.hero {
  padding: 72px 0 32px;
  display: grid;
  gap: 14px;
  place-items: start;
}
.hero h1 {
  margin: 0;
  font-size: clamp(42px, 8vw, 92px);
  line-height: 0.9;
  letter-spacing: 4px;
  text-shadow:
    0 0 18px rgba(0,255,178,0.35),
    0 0 45px rgba(0,255,178,0.25);
}
#tagline {
  margin: 0;
  max-width: 520px;
  color: color-mix(in oklab, var(--text) 68%, var(--muted));
  font-size: 17px;
}

.links { display: flex; gap: 10px; flex-wrap: wrap; }
.links a { color: var(--accent); text-decoration: none; }
.links a:hover { text-decoration: underline; }

.section {
  position: relative;
  padding: 32px 28px;
  margin: 28px 0;
  border-radius: 20px;
  border: 1px solid color-mix(in oklab, var(--border) 75%, transparent);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.25)),
    rgba(8,12,17,0.75);
  backdrop-filter: blur(12px);
  box-shadow:
    0 30px 80px rgba(0,0,0,0.45),
    0 0 0 1px rgba(0,255,178,0.08);
  overflow: hidden;
}
.section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% -10%, rgba(0,255,178,0.18), transparent 55%);
  opacity: 0.6;
  pointer-events: none;
}
.section-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.section h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #f0ffff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 14px;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(0,0,0,0.35));
  border: 1px solid color-mix(in oklab, var(--border) 65%, transparent);
  border-radius: 12px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  background: linear-gradient(130deg, rgba(0,255,178,0.25), transparent 45%, rgba(46,230,255,0.22) 75%);
  opacity: 0;
  z-index: -1;
  transition: opacity .25s ease;
  filter: blur(10px);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0,255,178,0.18);
}
.card:hover::after { opacity: 1; }
.card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.card p { margin: 0 0 14px; color: color-mix(in oklab, var(--text) 65%, var(--muted)); }
.card .tag {
  display: inline-block;
  font-size: 12px;
  color: var(--accent-2);
  background: rgba(46,230,255,0.12);
  border: 1px solid rgba(46,230,255,0.22);
  padding: 3px 10px;
  border-radius: 999px;
  margin: 0 6px 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.card .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.card .actions a {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.card .actions a:hover { text-decoration: underline; }

.timeline {
  position: relative;
  display: grid;
  gap: 18px;
  padding-left: 24px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: linear-gradient(180deg, rgba(0,255,178,0.6), rgba(46,230,255,0.05));
  opacity: 0.65;
}
.update {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 16px 20px 18px 32px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.3));
  border: 1px solid rgba(0,255,178,0.18);
  box-shadow: 0 12px 30px rgba(0,255,178,0.12);
}
.update::before {
  content: "";
  position: absolute;
  left: -19px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(0,255,178,0.9);
  background: rgba(7,10,13,0.95);
  box-shadow: 0 0 12px rgba(0,255,178,0.45);
}
.update .meta {
  color: var(--accent-2);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.update .title {
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #f4ffff;
}
.update .actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.update .actions a {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.update .actions a:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .hero { padding: 56px 0 24px; }
  .section {
    padding: 26px 20px;
    margin: 22px 0;
  }
  .timeline {
    padding-left: 18px;
  }
  .timeline::before {
    left: 4px;
  }
  .update {
    padding: 14px 16px 16px 26px;
  }
  .update::before {
    left: -14px;
  }
}

.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.contact-list a { color: var(--accent); text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }

.footer {
  border-top: 1px solid var(--border);
  margin-top: 28px;
  padding: 16px 20px 36px;
  color: var(--muted);
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between;
}

/* Glitch effect */
.glitch {
  position: relative;
  text-transform: uppercase;
  color: #eaffff;
  text-shadow: 0 0 12px rgba(0,255,178,0.5);
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 0;
  clip-path: inset(0 0 0 0);
}
.glitch::before { color: var(--accent); transform: translate(2px, -1px); animation: glitch 2.2s infinite linear alternate-reverse; opacity: .8; }
.glitch::after { color: var(--accent-2); transform: translate(-2px, 1px); animation: glitch 1.9s infinite linear alternate; opacity: .8; mix-blend-mode: screen; }
@keyframes glitch {
  0% { clip-path: inset(0 0 90% 0); }
  10% { clip-path: inset(10% 0 70% 0); }
  20% { clip-path: inset(40% 0 40% 0); }
  30% { clip-path: inset(80% 0 5% 0); }
  40% { clip-path: inset(10% 0 70% 0); }
  50% { clip-path: inset(0 0 90% 0); }
  60% { clip-path: inset(30% 0 50% 0); }
  70% { clip-path: inset(60% 0 20% 0); }
  80% { clip-path: inset(15% 0 65% 0); }
  90% { clip-path: inset(0 0 90% 0); }
  100% { clip-path: inset(0 0 90% 0); }
}

/* Subtle grid overlay (optional) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(1200px 800px at 50% 20%, rgba(0,0,0,0.35), rgba(0,0,0,0.9));
  pointer-events: none;
  z-index: 0;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(7,10,13,0.88);
  backdrop-filter: blur(10px);
  z-index: 20;
  transition: opacity .3s ease;
}
.auth-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.auth-card {
  display: grid;
  gap: 16px;
  min-width: min(360px, 90vw);
  padding: 26px 24px 28px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.35));
  box-shadow: var(--shadow);
}
.auth-card h2 { margin: 0; letter-spacing: 1px; }
.auth-card p { margin: 0; color: var(--muted); }
.auth-card label { display: grid; gap: 6px; font-size: 13px; }
.auth-card input {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
}
.auth-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 20%, transparent); outline: none; }

.auth-actions { display: flex; gap: 10px; }
.auth-error { color: #ff5370; min-height: 18px; font-size: 13px; }
.auth-note { color: var(--muted); font-size: 12px; margin: -6px 0 0; }

/* --- Custom Cursor ------------------------------------------------------- */
body.has-custom-cursor, body.has-custom-cursor * { cursor: none !important; }

#cursor {
  position: fixed;
  left: 0; top: 0;
  width: 22px; height: 22px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
  transition: opacity .2s ease;
}
#cursor.hidden { opacity: 0; }
#cursor .cursor-x, #cursor .cursor-check { position: absolute; inset: 0; display: grid; place-items: center; }
#cursor .cursor-x span {
  position: absolute; left: 50%; top: 50%;
  width: 2px; height: 18px;
  background: var(--text);
  box-shadow: 0 0 6px color-mix(in oklab, var(--accent) 40%, transparent);
  transform-origin: center;
}
#cursor .cursor-x span:first-child { transform: translate(-50%, -50%) rotate(45deg); }
#cursor .cursor-x span:last-child  { transform: translate(-50%, -50%) rotate(-45deg); }

#cursor .cursor-check { display: none; }
#cursor.check .cursor-x { display: none; }
#cursor.check .cursor-check { display: block; filter: drop-shadow(0 0 6px rgba(0,255,178,.6)); }
#cursor.spin { animation: cursor-spin .6s linear infinite; }
@keyframes cursor-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
