:root {
  --bg:          #000000;
  --red:         #7700cc;
  --red-bright:  #bb00ff;
  --red-dim:     rgba(119, 0, 204, 0.07);
  --red-border:  rgba(119, 0, 204, 0.32);
  --glow-soft:   rgba(119, 0, 204, 0.3);
  --glow-hard:   rgba(187, 0, 255, 0.6);
  --text:        #e0e0e0;
  --text-muted:  #6a6a6a;
  --blue:        #4da6ff;
  --green:       #00cc66;
  --font:        'Share Tech Mono', 'Lucida Console', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 16px;
  line-height: 1.65;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0.013) 0px,
    rgba(255,255,255,0.013) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 9999;
}

::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: var(--red); border-radius: 3px; }
*                         { scrollbar-width: thin; scrollbar-color: var(--red) #000; }

/* ── HERO ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  opacity: 0.4;
}

.hero-glow {
  position: absolute;
  top: -10%; left: 50%;
  transform: translateX(-50%);
  width: 700px; height: 500px;
  background: radial-gradient(ellipse at center top,
    rgba(119,0,204,0.11) 0%,
    rgba(119,0,204,0.04) 40%,
    transparent 70%);
  pointer-events: none;
}

.hero-reaper {
  position: absolute;
  right: 0;
  bottom: 0;
  height: 92vh;
  width: auto;
  opacity: 0.18;
  filter: sepia(1) saturate(12) hue-rotate(240deg) brightness(1.1);
  pointer-events: none;
  mask-image: linear-gradient(to right, transparent 0%, black 30%),
              linear-gradient(to top, transparent 0%, black 15%);
  mask-composite: intersect;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 30%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 820px;
  width: 100%;
}

.terminal-block {
  display: inline-block;
  text-align: left;
  margin-bottom: 3rem;
}

.terminal-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  font-size: clamp(1rem, 3.2vw, 1.7rem);
}

.prompt  { display: inline-flex; align-items: baseline; }
.p-b     { color: var(--text-muted); }
.p-u     { color: var(--red-bright); text-shadow: 0 0 10px var(--glow-soft), 0 0 22px var(--glow-hard); }
.p-at    { color: var(--text-muted); }
.p-h     { color: var(--red-bright); text-shadow: 0 0 10px var(--glow-soft), 0 0 22px var(--glow-hard); }
.p-t     { color: var(--blue); text-shadow: 0 0 8px rgba(77,166,255,0.45); }
.p-d     { color: var(--text-muted); }
.typed-cmd { color: var(--text); }

.cursor {
  color: var(--red-bright);
  font-size: 0.85em;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

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

.terminal-output {
  margin-top: 0.25rem;
  font-size: clamp(2.4rem, 9vw, 5.5rem);
  color: var(--text);
  text-shadow:
    0 0 2px rgba(255,255,255,0.15),
    0 0 12px var(--glow-soft),
    0 0 32px var(--glow-hard);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  animation: handlePulse 3.5s infinite ease-in-out;
  animation-play-state: paused;
}

.terminal-output.visible {
  opacity: 1;
  transform: translateY(0);
  animation-play-state: running;
}

@keyframes handlePulse {
  0%, 100% {
    text-shadow:
      0 0 2px rgba(255,255,255,0.15),
      0 0 12px var(--glow-soft),
      0 0 32px var(--glow-hard);
  }
  50% {
    text-shadow:
      0 0 2px rgba(255,255,255,0.2),
      0 0 18px var(--glow-soft),
      0 0 46px var(--glow-hard);
  }
}

.tagline {
  color: var(--text-muted);
  font-size: clamp(0.62rem, 1.7vw, 0.82rem);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tagline .dot { color: var(--red); }

nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

nav a {
  color: var(--red);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-shadow: 0 0 8px var(--glow-soft);
  transition: color 0.15s, text-shadow 0.15s;
}

nav a:hover {
  color: var(--red-bright);
  text-shadow: 0 0 6px var(--glow-soft), 0 0 18px var(--glow-hard);
}

/* ── MAIN ── */
main {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.panel {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.panel.in-view {
  opacity: 1;
  transform: translateY(0);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 1rem;
  background: var(--red-dim);
  border: 1px solid var(--red-border);
  border-bottom: none;
}

.panel-fname {
  color: var(--red);
  font-size: 0.84rem;
  text-shadow: 0 0 6px var(--glow-soft);
  letter-spacing: 0.04em;
}

.panel-status        { font-size: 0.73rem; letter-spacing: 0.09em; }
.panel-status.ok     { color: var(--green); }
.panel-status.loaded { color: var(--blue); }
.panel-status.readme { color: var(--text-muted); }

.panel-body {
  border: 1px solid var(--red-border);
  padding: 1.75rem;
  background: linear-gradient(135deg, #010010 0%, #000 80%);
  box-shadow: inset 0 0 50px rgba(119,0,204,0.03), 0 4px 30px rgba(0,0,0,0.6);
}

.panel-body p {
  color: var(--text-muted);
  font-size: 0.93rem;
  margin-bottom: 1rem;
  line-height: 1.75;
}

.panel-body p:last-child { margin-bottom: 0; }
.panel-body strong       { color: var(--red-bright); }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tag {
  display: inline-block;
  border: 1px solid var(--red-border);
  color: var(--red);
  font-size: 0.78rem;
  padding: 0.28rem 0.7rem;
  letter-spacing: 0.07em;
  text-shadow: 0 0 6px var(--glow-soft);
  cursor: default;
  transition: all 0.18s ease;
}

.tag::before { content: '[ '; color: var(--text-muted); }
.tag::after  { content: ' ]'; color: var(--text-muted); }

.tag:hover {
  background: rgba(119,0,204,0.1);
  border-color: var(--red-bright);
  color: var(--red-bright);
  text-shadow: 0 0 8px var(--glow-soft), 0 0 18px var(--glow-hard);
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--red-border);
  padding: 2rem 1.5rem;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-handle        { color: var(--red); font-size: 0.88rem; text-shadow: 0 0 8px var(--glow-soft); }
.footer-links         { display: flex; gap: 1.5rem; }
.footer-links a       { color: var(--text-muted); text-decoration: none; font-size: 0.82rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--red-bright); }
.footer-motto         { color: rgba(255,255,255,0.1); font-size: 0.73rem; }

/* ── WRITEUP NAV ── */
.writeup-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.25rem 1.5rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--red-border);
  max-width: 900px;
  margin: 0 auto;
}

.writeup-nav a        { color: var(--red); text-decoration: none; transition: color 0.15s; text-shadow: none; }
.writeup-nav a:hover  { color: var(--red-bright); }
.wn-sep               { color: var(--text-muted); }
.wn-current           { color: var(--text-muted); }

/* ── WRITEUP INDEX ── */
.writeup-index {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.wi-desc {
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.07em;
  margin: 0 !important;
}

.we-list {
  display: flex;
  flex-direction: column;
}

.we-entry {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--red-border);
  border-top: none;
  text-decoration: none;
  transition: background 0.15s;
}

.we-entry:first-child { border-top: 1px solid var(--red-border); }
.we-entry:hover       { background: rgba(119,0,204,0.06); }

.we-type {
  flex-shrink: 0;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border: 1px solid;
  min-width: 90px;
  text-align: center;
}

.type-analysis { color: var(--red-bright); border-color: rgba(187,0,255,0.4); }
.type-cve      { color: #ff8c42;           border-color: rgba(255,140,66,0.4); }
.type-ctf      { color: var(--blue);       border-color: rgba(77,166,255,0.4); }
.type-script   { color: var(--green);      border-color: rgba(0,204,102,0.4); }
.type-offops   { color: #c084fc;           border-color: rgba(192,132,252,0.4); }

.we-title {
  flex: 1;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
  transition: color 0.15s;
}

.we-entry:hover .we-title { color: var(--text); }

.we-arrow {
  flex-shrink: 0;
  color: var(--red);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s, transform 0.15s;
}

.we-entry:hover .we-arrow { opacity: 1; transform: translateX(0); }

.we-wip       { opacity: 0.45; }
.we-wip:hover { opacity: 0.65; }

.we-wip-badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 0.2rem 0.5rem;
}

/* ── WRITEUP PAGE CONTENT ── */
.writeup-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
}

.writeup-content h1 {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  color: var(--text);
  text-shadow: 0 0 10px var(--glow-soft), 0 0 24px var(--glow-hard);
  margin-bottom: 2rem;
  line-height: 1.3;
  border-bottom: 1px solid var(--red-border);
  padding-bottom: 1.5rem;
}

.writeup-content h2 {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--red);
  text-shadow: 0 0 8px var(--glow-soft);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.writeup-content h3 {
  font-size: 0.95rem;
  color: var(--text-muted);
  border-left: 2px solid var(--red);
  padding-left: 0.75rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.writeup-content p         { margin-bottom: 1rem; }
.writeup-content strong    { color: var(--text); }
.writeup-content a         { color: var(--red); text-decoration: none; }
.writeup-content a:hover   { color: var(--red-bright); text-decoration: underline; }

.writeup-content pre {
  background: #060012;
  color: var(--red-bright);
  padding: 1rem 1.25rem;
  border-radius: 4px;
  font-family: var(--font);
  font-size: 0.85rem;
  overflow-x: auto;
  border: 1px solid rgba(119,0,204,0.25);
  box-shadow: inset 0 0 20px rgba(119,0,204,0.08);
  margin: 1.25rem 0;
  line-height: 1.6;
}

.writeup-content code {
  background: rgba(119,0,204,0.1);
  color: var(--red-bright);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.88em;
  font-family: var(--font);
}

.writeup-content pre code   { background: none; padding: 0; font-size: inherit; }

.writeup-content ul,
.writeup-content ol         { padding-left: 1.5rem; margin-bottom: 1rem; }
.writeup-content li         { margin-bottom: 0.4rem; }
.writeup-content li::marker { color: var(--red); }

.writeup-content img {
  display: block;
  margin: 1.5rem auto;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--red-border);
}

.writeup-content hr {
  border: none;
  border-top: 1px solid var(--red-border);
  margin: 2rem 0;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero-reaper  { display: none; }
}

@media (max-width: 600px) {
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .tagline      { font-size: 0.62rem; gap: 0.25rem; }
  .we-type      { min-width: 70px; font-size: 0.62rem; }
}

/* ── STATUS LINE ── */
.status-line {
  margin-top: 0.55rem;
  font-size: clamp(0.72rem, 1.5vw, 0.82rem);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.status-line.visible { opacity: 1; }

.status-prefix { color: rgba(119, 0, 204, 0.6); }

#status-text {
  color: var(--text-muted);
  transition: opacity 0.35s ease;
}

#status-text.fade { opacity: 0; }

.status-blink {
  color: var(--red);
  animation: blink 1s step-end infinite;
  opacity: 0.65;
  margin-left: 1px;
}

/* ── HTW HANDSTYLE ── */
.htw-handstyle-wrap {
  width: 100%;
  overflow: hidden;
  margin-bottom: 1.75rem;
}

.htw-handstyle {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  filter:
    drop-shadow(0 0 10px rgba(119, 0, 204, 0.5))
    drop-shadow(0 0 30px rgba(187, 0, 255, 0.25));
  opacity: 0.92;
  transition: filter 0.4s ease, opacity 0.4s ease;
}

.htw-handstyle:hover {
  filter:
    drop-shadow(0 0 14px rgba(119, 0, 204, 0.7))
    drop-shadow(0 0 40px rgba(187, 0, 255, 0.4));
  opacity: 1;
}

/* ── HTW GALLERY ── */
.htw-gallery {
  position: relative;
  margin-top: 1.75rem;
  border: 1px solid var(--red-border);
  overflow: hidden;
}

.htw-gallery-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #02000a;
}

.htw-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.htw-slide.htw-slide-active { opacity: 1; }

.htw-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.htw-slide-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(119, 0, 204, 0.25);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
}

.htw-gal-prev,
.htw-gal-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--red-border);
  color: var(--red);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.3rem;
  font-family: var(--font);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  padding: 0;
}

.htw-gal-prev { left: 0.5rem; }
.htw-gal-next { right: 0.5rem; }

.htw-gal-prev:hover,
.htw-gal-next:hover {
  background: rgba(119, 0, 204, 0.2);
  border-color: var(--red-bright);
  color: var(--red-bright);
}

.htw-dots {
  position: absolute;
  bottom: 0.55rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.45rem;
  z-index: 2;
}

.htw-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  opacity: 0.3;
  cursor: pointer;
  transition: opacity 0.2s, background 0.2s;
}

.htw-dot.htw-dot-active {
  opacity: 1;
  background: var(--red-bright);
  box-shadow: 0 0 6px var(--glow-hard);
}

/* ── CONTACT ── */
.contact-grid {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.85rem 1.5rem;
  align-items: center;
}

.contact-platform {
  color: var(--text-muted);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.contact-platform::before { content: '> '; color: var(--red); }

.contact-handle {
  color: var(--red-bright);
  text-decoration: none;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  text-shadow: 0 0 8px var(--glow-soft);
  transition: color 0.15s, text-shadow 0.15s;
}

a.contact-handle:hover {
  color: #fff;
  text-shadow: 0 0 8px var(--glow-soft), 0 0 22px var(--glow-hard);
}

/* ── CURSOR TRAIL ── */
.trail-dot {
  position: fixed;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--red-bright);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.trail-dot.trail-on {
  animation: trailFade 0.55s ease forwards;
}

@keyframes trailFade {
  0%   { opacity: 0.5;  transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0;    transform: translate(-50%, -50%) scale(0.2); }
}

/* ── GLITCH ── */
#terminal-output { position: relative; }

#terminal-output::before,
#terminal-output::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
}

#terminal-output.glitching::before {
  color: var(--blue);
  animation: glitchA 0.35s steps(2) forwards;
  clip-path: polygon(0 15%, 100% 15%, 100% 45%, 0 45%);
}

#terminal-output.glitching::after {
  color: var(--red-bright);
  animation: glitchB 0.35s steps(2) forwards;
  clip-path: polygon(0 55%, 100% 55%, 100% 85%, 0 85%);
}

@keyframes glitchA {
  0%   { opacity: 0.8; transform: translateX(-4px); }
  50%  { opacity: 0.6; transform: translateX(3px); }
  100% { opacity: 0;   transform: translateX(0); }
}

@keyframes glitchB {
  0%   { opacity: 0.8; transform: translateX(4px); }
  50%  { opacity: 0.6; transform: translateX(-3px); }
  100% { opacity: 0;   transform: translateX(0); }
}
