@import url('https://fonts.googleapis.com/css2?family=VT323&family=IBM+Plex+Mono:wght@400;700&display=swap');

:root {
  --green: #33ff33;
  --green-dim: #1a8a1a;
  --green-glow: #33ff3366;
  --amber: #ffb000;
  --amber-dim: #8a6000;
  --cyan: #00ffff;
  --bg: #0a0a0a;
  --bg-light: #111;
  --white: #cccccc;
}

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

body {
  background: var(--bg);
  color: var(--green);
  font-family: 'VT323', 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 18px;
  line-height: 1.4;
  overflow-x: hidden;
  min-height: 100vh;
}

/* CRT Effects */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.15) 2px,
    rgba(0,0,0,0.15) 4px
  );
  pointer-events: none;
  z-index: 1000;
}

body::after {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.6) 100%);
  pointer-events: none;
  z-index: 999;
}

/* Flicker animation */
@keyframes flicker {
  0%, 97%, 100% { opacity: 1; }
  98% { opacity: 0.95; }
  99% { opacity: 0.98; }
}

.crt { animation: flicker 4s infinite; }

/* Boot sequence */
#boot-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 500;
  padding: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

#boot-text {
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 14px;
  color: var(--green-dim);
}

#boot-text .highlight { color: var(--green); }
#boot-text .amber { color: var(--amber); }
#boot-text .error { color: #ff3333; }

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

.blink { animation: blink 1s step-end infinite; }

/* Main content */
#main-content {
  display: none;
  max-width: 900px;
  margin: 0 auto;
  padding: 10px;
}

.ascii-header {
  text-align: center;
  color: var(--green);
  font-size: 14px;
  line-height: 1.1;
  margin-bottom: 10px;
  overflow: hidden;
}

.ascii-header pre {
  display: inline-block;
  text-align: left;
}

/* ASCII Box components */
.box {
  margin: 15px 0;
  position: relative;
}

.box-top, .box-bottom, .box-mid {
  color: var(--green-dim);
  white-space: nowrap;
  overflow: hidden;
}

.box-content {
  padding: 0 2ch;
  position: relative;
}

.box-content::before,
.box-content::after {
  position: absolute;
  color: var(--green-dim);
}

/* Double-line box */
.box-double .box-top::before { content: "\2554"; }
.box-double .box-top::after { content: "\2557"; }
.box-double .box-bottom::before { content: "\255A"; }
.box-double .box-bottom::after { content: "\255D"; }

/* Status bar */
.status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--green);
  color: var(--bg);
  padding: 2px 10px;
  font-size: 14px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
}

/* Navigation */
.nav-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  margin: 15px 0;
}

.nav-item {
  color: var(--bg);
  background: var(--green);
  padding: 3px 12px;
  text-decoration: none;
  font-family: inherit;
  font-size: 18px;
  cursor: pointer;
  border: none;
  transition: all 0.1s;
}

.nav-item:hover {
  background: var(--amber);
  color: var(--bg);
  text-shadow: 0 0 5px var(--amber);
}

.nav-item.active {
  background: var(--cyan);
}

/* Sections */
.section-title {
  color: var(--amber);
  font-size: 22px;
  margin: 20px 0 5px;
  text-shadow: 0 0 10px var(--amber);
}

.divider {
  color: var(--green-dim);
  overflow: hidden;
  white-space: nowrap;
  margin: 10px 0;
}

/* Profile card */
.profile-area {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: start;
}

.ascii-portrait {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 1.5px;
  line-height: 1.5px;
  letter-spacing: 0;
  color: var(--green);
  white-space: pre;
  text-shadow: 0 0 1px var(--green-glow);
  border: 1px solid var(--green-dim);
  padding: 8px;
  background: rgba(0, 20, 0, 0.15);
  box-shadow: 0 0 12px rgba(51, 255, 51, 0.15), inset 0 0 20px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  max-width: 100%;
  margin: 0;
}

.ascii-portrait-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.portrait-stage {
  position: relative;
  display: inline-block;
}

.portrait-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  image-rendering: pixelated;
  border: 1px solid var(--green-dim);
  box-sizing: border-box;
  transition: opacity 0.15s;
}

.portrait-canvas.active {
  opacity: 1;
}

.portrait-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  box-sizing: border-box;
  transition: opacity 0.3s;
}

.portrait-overlay.active {
  opacity: 1;
}

.portrait-stage.running .ascii-portrait {
  opacity: 0.08;
  transition: opacity 0.3s;
}

.ascii-portrait-caption {
  color: var(--green-dim);
  font-size: 13px;
  text-align: center;
}

.run-btn {
  background: transparent;
  color: var(--amber);
  border: 1px solid var(--amber-dim);
  font-family: inherit;
  font-size: 14px;
  padding: 4px 14px;
  cursor: pointer;
  margin-top: 2px;
  letter-spacing: 0.5px;
  transition: all 0.15s;
}

.run-btn:hover:not(:disabled) {
  background: var(--amber);
  color: var(--bg);
  box-shadow: 0 0 10px rgba(255, 176, 0, 0.6);
}

.run-btn:disabled {
  opacity: 0.35;
  cursor: wait;
  border-style: dashed;
}

.profile-info p {
  margin: 3px 0;
}

.label { color: var(--amber); }
.value { color: var(--green); }
.dim { color: var(--green-dim); }
.bright { color: var(--green); text-shadow: 0 0 8px var(--green-glow); }
.amber { color: var(--amber); text-shadow: 0 0 8px rgba(255,176,0,0.4); }
.cyan { color: var(--cyan); text-shadow: 0 0 8px rgba(0,255,255,0.4); }

a.cyan, .cyan a {
  text-decoration: none;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0,255,255,0.4);
  border-bottom: 1px dashed transparent;
  transition: border-color 0.15s, text-shadow 0.15s;
}

a.cyan:hover, .cyan a:hover {
  border-bottom-color: var(--cyan);
  text-shadow: 0 0 10px rgba(0,255,255,0.9);
}

/* Skills as progress bars */
.skill-bar {
  display: grid;
  grid-template-columns: 10% 88% 6%;
  align-items: center;
  margin: 3px 0;
  gap: 0.5ch;
  width: 100%;
}

.skill-name {
  color: var(--amber);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.skill-meter {
  display: block;
  width: 98%;
  height: 1.2em;
  background: var(--green-dim);
  position: relative;
  border-radius: 2px;
  overflow: hidden;
}

.skill-meter .filled {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green) 0%, var(--green) 100%);
  box-shadow: inset 0 0 3px rgba(0,255,0,0.5);
  font-size: 0;
}

.skill-meter .empty {
  display: none;
}

/* Project cards */
.project-card {
  border: 1px solid var(--green-dim);
  padding: 10px;
  margin: 10px 0;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.project-card:hover {
  border-color: var(--green);
  box-shadow: 0 0 10px var(--green-glow);
}

.project-card:hover .project-title {
  color: var(--amber);
}

.project-title {
  color: var(--cyan);
  font-size: 20px;
}

.project-tech {
  color: var(--green-dim);
  font-size: 14px;
}

/* Typing cursor */
.cursor::after {
  content: "\2588";
  animation: blink 0.7s step-end infinite;
}

/* Matrix rain background */
#matrix-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.05;
}

/* Responsive */
@media (max-width: 700px) {
  body { font-size: 14px; }
  .ascii-header { font-size: 8px; }
  .ascii-header pre { font-size: 8px; }
  .profile-area {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .ascii-portrait { font-size: 1px; line-height: 1px; margin: 0 auto; padding: 6px; }
  .skill-bar { grid-template-columns: 12% 82% 6%; }
  .skill-meter { width: 98%; }
  .skill-name { font-size: 11px; }
  .dim { font-size: 10px; }
  .nav-item { padding: 5px 10px; font-size: 16px; }
  #main-content { padding: 8px; }
  .status-bar { font-size: 12px; }
}

@media (max-width: 400px) {
  .ascii-header { font-size: 6px; }
  .ascii-header pre { font-size: 6px; }
  .ascii-portrait { font-size: 0.75px; line-height: 0.75px; padding: 4px; }
  .skill-bar {
    grid-template-columns: 20% 74% 6%;
    gap: 0.2ch;
  }
  .skill-meter { width: 98%; }
  .skill-name { font-size: 10px; }
  .skill-meter { font-size: 10px; }
  .dim { font-size: 9px; }
}

/* Scroll styling */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--green-dim); }
::-webkit-scrollbar-thumb:hover { background: var(--green); }

/* Easter egg */
.konami-active {
  animation: rainbow-shift 3s linear infinite;
}

@keyframes rainbow-shift {
  0%   { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* Glitch effect on title */
@keyframes glitch {
  0%, 90%, 100% { transform: translate(0); }
  92% { transform: translate(-2px, 1px); }
  94% { transform: translate(2px, -1px); }
  96% { transform: translate(-1px, -1px); }
  98% { transform: translate(1px, 1px); }
}

.glitch-text {
  animation: glitch 3s infinite;
  display: inline-block;
}

/* Fun hover on links */
a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  color: var(--amber);
  text-shadow: 0 0 8px var(--amber);
}

.hidden { display: none; }

/* Contact section */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.contact-item {
  padding: 8px;
  border: 1px solid var(--green-dim);
}

/* Timeline preview */
.timeline-preview {
  position: relative;
  padding: 10px 0;
  border-left: 2px solid var(--green-dim);
  margin-left: 20px;
}

.timeline-dot {
  position: relative;
  padding: 5px 0 5px 20px;
}

.timeline-dot::before {
  content: "\25CF";
  position: absolute;
  left: -7px;
  color: var(--green);
}

.timeline-dot .year {
  color: var(--amber);
  font-size: 14px;
}

.timeline-dot .event {
  color: var(--green);
}

.timeline-more {
  padding: 5px 0 5px 20px;
  position: relative;
}

.timeline-more::before {
  content: "\25CB";
  position: absolute;
  left: -7px;
  color: var(--green-dim);
}

.timeline-more > summary {
  cursor: pointer;
  list-style: none;
  color: var(--green-dim);
  user-select: none;
  transition: color 0.15s;
}

.timeline-more > summary::-webkit-details-marker { display: none; }

.timeline-more > summary:hover,
.timeline-more[open] > summary {
  color: var(--green);
  text-shadow: 0 0 8px var(--green-glow);
}

.timeline-more > summary .year {
  color: var(--amber-dim);
  font-size: 14px;
}

.timeline-more[open] > summary .year { color: var(--amber); }

.timeline-more > summary .toggle {
  display: inline-block;
  width: 1.4em;
  color: var(--amber);
}

.timeline-more > summary .toggle::before { content: "[+]"; }
.timeline-more[open] > summary .toggle::before { content: "[-]"; }

.timeline-more .sub-list {
  margin: 6px 0 2px 20px;
  padding-left: 12px;
  border-left: 1px dashed var(--green-dim);
  animation: fadeIn 0.25s ease-in;
}

.timeline-more .sub-item {
  padding: 2px 0;
  color: var(--green-dim);
  font-size: 13px;
}

.timeline-more .sub-item::before {
  content: "\2514\2500 ";
  color: var(--green-dim);
}

.timeline-more .sub-item .role {
  color: var(--green);
}

.timeline-more .sub-item .place {
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0,255,255,0.4);
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.scanline-bright {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(51, 255, 51, 0.1);
  z-index: 998;
  animation: scanline 6s linear infinite;
}

@keyframes scanline {
  0% { top: -4px; }
  100% { top: 100vh; }
}

/* Konami modal */
#konami-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

#konami-modal.active {
  display: flex;
  animation: fadeIn 0.4s ease-in;
}

.konami-box {
  background: var(--bg);
  border: 2px solid var(--green);
  box-shadow: 0 0 30px var(--green-glow), inset 0 0 20px rgba(51,255,51,0.1);
  padding: 0;
  max-width: 480px;
  width: 100%;
  font-family: 'VT323', 'IBM Plex Mono', monospace;
  position: relative;
  animation: modalGlitch 4s infinite;
}

@keyframes modalGlitch {
  0%, 95%, 100% { transform: translate(0); }
  96% { transform: translate(-2px, 1px); }
  97% { transform: translate(2px, -1px); }
  98% { transform: translate(-1px, -1px); }
  99% { transform: translate(1px, 1px); }
}

.konami-titlebar {
  background: var(--green);
  color: var(--bg);
  padding: 4px 12px;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

.konami-content {
  padding: 24px 20px 20px;
  text-align: center;
  color: var(--green);
}

.konami-content .achievement {
  color: var(--amber);
  font-size: 16px;
  margin-bottom: 6px;
  text-shadow: 0 0 8px var(--amber);
  letter-spacing: 2px;
}

.konami-content .konami-q {
  font-size: 36px;
  color: var(--cyan);
  margin: 18px 0 22px;
  text-shadow: 0 0 12px var(--cyan);
  font-weight: bold;
}

.konami-content .konami-sub {
  color: var(--green-dim);
  font-size: 14px;
  margin-bottom: 20px;
  font-style: italic;
}

.konami-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

.konami-btn {
  background: var(--bg);
  color: var(--green);
  border: 1px solid var(--green);
  padding: 8px 24px;
  font-family: inherit;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 1px;
}

.konami-btn:hover {
  background: var(--green);
  color: var(--bg);
  box-shadow: 0 0 15px var(--green-glow);
}

.konami-btn.danger {
  border-color: var(--amber);
  color: var(--amber);
}

.konami-btn.danger:hover {
  background: var(--amber);
  color: var(--bg);
  box-shadow: 0 0 15px rgba(255,176,0,0.5);
}

.konami-response {
  margin-top: 18px;
  font-size: 18px;
  color: var(--amber);
  min-height: 1.5em;
  text-shadow: 0 0 8px var(--amber);
}
