/* ============================================
   TERMINAL PORTFOLIO — Dan Narita
   Themed as a Linux terminal
   ============================================ */

/* --- Design Tokens --- */
@property --accent {
    syntax: '<color>';
    initial-value: #00ff41;
    inherits: true;
}

:root {
    --accent: #00ff41;
    --accent-dim: color-mix(in srgb, var(--accent), transparent 85%);
    --accent-glow: color-mix(in srgb, var(--accent), transparent 65%);
    --accent-neon: color-mix(in srgb, var(--accent), transparent 50%);
    --bg: #0a0a0a;
    --bg-secondary: #0f0f0f;
    --bg-tertiary: #161616;
    --bg-card: #111111;
    --border: var(--accent);
    --text: #c8c8c8;
    --text-dim: #666;
    --text-blue: #5c9aff;
    --font: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    --radius: 10px;
    --transition: 0.25s ease;
}

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

html,
body {
    height: 100%;
    background: #050505;
    background-image:
        radial-gradient(ellipse at 50% 0%, var(--accent-dim) 0%, transparent 60%),
        linear-gradient(0deg, rgba(0, 0, 0, 0.4) 0%, transparent 100%),
        repeating-linear-gradient(90deg, transparent, transparent 79px, rgba(255, 255, 255, 0.008) 79px, rgba(255, 255, 255, 0.008) 80px),
        repeating-linear-gradient(0deg, transparent, transparent 79px, rgba(255, 255, 255, 0.008) 79px, rgba(255, 255, 255, 0.008) 80px);
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Terminal Window --- */
.terminal-window {
    display: flex;
    flex-direction: column;
    width: calc(100vw - 50px);
    height: calc(100vh - 50px);
    margin: 25px auto;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 20% 50%, var(--accent-dim) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, var(--accent-dim) 0%, transparent 40%);
    box-shadow:
        0 0 30px var(--accent-dim),
        0 0 80px var(--accent-dim),
        inset 0 0 60px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    position: relative;
    transition: border-color var(--transition), box-shadow var(--transition);
}

/* --- Title Bar --- */
.title-bar {
    display: flex;
    align-items: center;
    height: 42px;
    padding: 0 16px;
    background: linear-gradient(180deg, #121212 0%, var(--bg-secondary) 100%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 12px var(--accent-dim);
    flex-shrink: 0;
    transition: border-color var(--transition), box-shadow var(--transition);
    position: relative;
    z-index: 2;
}

.title-bar__dots {
    display: flex;
    gap: 8px;
    margin-right: 16px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: transform 0.2s;
}

.dot:hover {
    transform: scale(1.25);
}

.dot--red {
    background: #ff5f57;
}

.dot--yellow {
    background: #febc2e;
}

.dot--green {
    background: #28c840;
}

.title-bar__title {
    font-size: 13px;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    user-select: none;
}

.title-bar__spacer {
    flex: 1;
}

/* --- Terminal Body --- */
.terminal-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* --- Sidebar --- */
.sidebar {
    width: 200px;
    min-width: 200px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, #080808 100%);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    overflow-y: auto;
    flex-shrink: 0;
    transition: border-color var(--transition);
    box-shadow: 1px 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
    scrollbar-width: none;
    /* Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar__category {
    margin-bottom: 20px;
}

.sidebar__comment {
    display: block;
    padding: 0 16px;
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 1px;
    user-select: none;
}

.sidebar__item {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 7px 16px;
    background: none;
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
}

.sidebar__item:hover {
    background: linear-gradient(90deg, var(--accent-dim) 0%, transparent 100%);
    color: var(--accent);
    padding-left: 22px;
    text-shadow: 0 0 8px var(--accent-neon);
}

.sidebar__item.active {
    color: var(--accent);
    background: linear-gradient(90deg, var(--accent-dim) 0%, transparent 100%);
    border-left: 2px solid var(--accent);
    text-shadow: 0 0 10px var(--accent-neon);
}

.prompt-symbol {
    color: var(--accent);
    font-weight: 600;
    transition: color var(--transition);
}

/* ==========================================================================
   MODAL (Admin Experience Editor)
   ========================================================================== */
   
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 5, 5, 0.4);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.modal--active {
  display: flex !important;
  opacity: 1;
}

.modal-content {
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  min-height: 550px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background-color: rgba(15, 15, 15, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), 0 0 10px var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  animation: modal-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-body {
  padding: 30px 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Hidden honeypot field (anti-spam) */
.cv-honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

#experienceForm {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between; /* Spreads out fields */
}

.form-group {
    margin-bottom: 20px;
}

/* Fix generic inputs inside modal */
.command-bar__input[type="text"],
.command-bar__input[type="password"],
.command-bar__input,
textarea#expBody {
  background: rgba(0,0,0,0.3) !important;
  border-radius: 8px; /* Rounded corners */
}

/* Modal Specific Layout Classes */
.form-group--row {
    display: flex;
    gap: 15px;
}

.form-group__field {
    flex: 1;
}

.sort-key-container {
    display: flex;
    gap: 5px;
}

.form-group--body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.char-count {
    text-align: right;
    font-size: 11px;
    color: var(--accent);
    margin-top: 2px;
}

.modal-input {
    border: 1px solid var(--bg-tertiary);
    padding: 5px;
    background: rgba(0,0,0,0.3);
}

.exp-body-textarea {
    flex-grow: 1;
    width: 100%;
    border: 1px solid var(--bg-tertiary);
    padding: 5px;
    background: rgba(0,0,0,0.3);
    color: var(--text-main);
    font-family: var(--font);
    resize: none;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 10px;
}

.form-actions .sidebar__item {
    width: auto;
    padding: 5px 15px;
}

/* Custom Dropdown instead of native Select */
.custom-select {
  position: relative;
  user-select: none;
  cursor: pointer;
  font-family: var(--font);
}

.custom-select__trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--bg-tertiary);
  padding: 6px 10px;
  background: rgba(0,0,0,0.3);
  color: var(--text-main);
  border-radius: 8px;
}

.custom-select__options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(15, 15, 15, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  margin-top: 4px;
  z-index: 10000;
  max-height: 145px; /* Fits exactly 5 items approx */
  overflow-y: auto;
  display: none;
  box-shadow: 0 4px 15px rgba(0,0,0,0.8);
}

.custom-select.open .custom-select__options {
  display: block;
}

.custom-option {
  padding: 8px 10px;
  color: var(--accent);
  transition: background 0.2s, color 0.2s;
}

.custom-option:hover {
  background: var(--accent-dim);
  color: #fff;
}


.timeline__admin-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

.timeline__action-btn {
  background: none;
  border: 1px solid var(--bg-tertiary);
  color: var(--text-dim);
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s ease;
}

.timeline__action-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(var(--accent-rgb, 0, 255, 65), 0.1);
}

.timeline__action-btn--delete:hover {
  color: #ff5252;
  border-color: #ff5252;
  background: rgba(255, 82, 82, 0.1);
}

.empty-timeline-msg {
  color: var(--text-dim);
  font-style: italic;
  padding: 20px 0;
}

/* --- Main Content --- */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    position: relative;
    scroll-behavior: smooth;
    background-image: radial-gradient(ellipse at 50% 30%, var(--accent-dim) 0%, transparent 70%);
}

.content::-webkit-scrollbar {
    width: 6px;
}

.content::-webkit-scrollbar-track {
    background: transparent;
}

.content::-webkit-scrollbar-thumb {
    background: var(--accent-dim);
    border-radius: 3px;
}

.content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-glow);
}

/* --- History Log --- */
.history-log {
    margin-bottom: 8px;
}

.history-entry {
    font-size: 12px;
    color: var(--text-dim);
    padding: 2px 0;
    animation: fadeIn 0.2s ease;
}

.history-entry .accent {
    color: var(--accent);
}

/* --- Sections --- */
.section {
    display: none;
    animation: sectionIn 0.35s ease;
}

.section--active {
    display: block;
}

@keyframes sectionIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- Skeleton Loading --- */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
    height: 1em;
    margin-bottom: 10px;
}

.skeleton--title { width: 40%; height: 1.2em; }
.skeleton--text { width: 100%; }
.skeleton--text-short { width: 70%; }

/* Snake D-Pad */
.snake-dpad {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .snake-dpad {
        display: flex;
    }
}

.dpad-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.dpad-btn {
    width: 60px;
    height: 60px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s, transform 0.1s, border-color 0.2s;
}

.dpad-btn:active {
    background: var(--accent);
    color: var(--bg-primary);
    transform: scale(0.95);
    border-color: var(--accent);
}

/* --- Accent utility --- */
/* --- Accent utility --- */
.accent {
    color: var(--accent);
    text-shadow: 0 0 6px var(--accent-neon);
    /* Transition removed to prevent conflict with RGB animation */
}

a.accent,
a .accent,
a:visited .accent {
    color: var(--accent);
    text-decoration: none;
}

.text-dim {
    color: var(--text-dim);
}

.text-blue {
    color: var(--text-blue);
}

/* --- Welcome --- */
.welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60%;
    text-align: center;
    gap: 16px;
}

.ascii-art {
    color: var(--accent);
    font-size: 12px;
    line-height: 1.3;
    transition: color var(--transition);
    white-space: pre;
    text-shadow: 0 0 20px var(--accent-neon), 0 0 40px var(--accent-dim);
    filter: drop-shadow(0 0 8px var(--accent-dim));
}

.welcome__tagline {
    font-size: 15px;
    color: var(--text);
    min-height: 1.5em;
}

.welcome__hint {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 8px;
}

/* --- About --- */
.about-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.about-block h3 {
    font-size: 14px;
    margin-bottom: 12px;
}

.terminal-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.terminal-list li {
    padding-left: 16px;
    position: relative;
    font-size: 13px;
    line-height: 1.6;
}

.terminal-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
}

.about-links {
    display: flex;
    flex-direction: row;
    gap: 16px;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    transition: all var(--transition);
}

.social-link:hover {
    background: var(--accent-dim);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--accent-dim);
}

.social-link--large {
    padding: 12px 24px;
    font-size: 14px;
}

/* --- Neofetch --- */
.neofetch {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 24px;
    border: 1px solid var(--bg-tertiary);
    border-radius: 8px;
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg) 100%);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.3);
}

.neofetch__ascii {
    color: var(--accent);
    font-size: 14px;
    line-height: 1.15;
    flex-shrink: 0;
    white-space: pre;
    transition: color var(--transition);
    text-shadow: 0 0 20px var(--accent-neon), 0 0 40px var(--accent-dim);
    filter: drop-shadow(0 0 6px var(--accent-dim));
}

.neofetch__info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
    min-width: 300px;
}

.neofetch__header {
    font-weight: 700;
    font-size: 16px;
    text-shadow: 0 0 12px var(--accent-neon);
}

.neofetch__sep {
    color: var(--text-dim);
    margin-bottom: 4px;
    opacity: 0.4;
}

.neofetch__colors {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.color-block {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    transition: transform 0.2s ease;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.color-block:hover {
    transform: scale(1.2);
}

/* --- Help Table --- */
.help-content {
    max-width: 600px;
}

.help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.help-table th {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--accent);
    font-weight: 500;
}

.help-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--bg-tertiary);
}

.help-table tr:hover td {
    background: var(--accent-dim);
}

/* --- Projects --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.project-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 1px solid var(--bg-tertiary);
    border-radius: 8px;
    background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-secondary) 50%, var(--accent-dim) 100%);
    backdrop-filter: blur(4px);
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px var(--accent-dim), 0 0 60px var(--accent-dim);
}

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

.project-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.project-card__icon {
    font-size: 22px;
}

.project-card__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
}

.project-card__desc {
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 14px;
    flex: 1;
}

.project-card__tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.tag {
    padding: 3px 10px;
    font-size: 11px;
    border-radius: 20px;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid transparent;
    transition: all var(--transition);
}

.project-card:hover .tag {
    border-color: var(--accent);
}

.project-card__footer {
    font-size: 12px;
    font-weight: 500;
}

/* --- Skills --- */
.skills-content {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.skills-block h3 {
    font-size: 14px;
    margin-bottom: 14px;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-badge {
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--accent);
    background: linear-gradient(135deg, var(--accent-dim) 0%, rgba(0, 255, 65, 0.08) 100%);
    transition: all var(--transition);
    text-shadow: 0 0 6px var(--accent-dim);
}

.skill-badge:hover {
    background: linear-gradient(135deg, var(--accent-glow) 0%, var(--accent-dim) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--accent-dim);
}

.skill-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
}

.skill-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.skill-bar__label {
    width: 160px;
    font-size: 13px;
    flex-shrink: 0;
}

.skill-bar__track {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.skill-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-glow) 0%, var(--accent) 60%, color-mix(in srgb, var(--accent), white 20%) 100%);
    border-radius: 3px;
    transition: background var(--transition), width 0.8s ease;
    animation: barFill 1s ease forwards;
    box-shadow: 0 0 8px var(--accent-dim);
}

@keyframes barFill {
    from {
        width: 0;
    }
}

.skill-bar__tag {
    font-size: 11px;
    width: 80px;
    text-align: right;
    flex-shrink: 0;
}

/* --- CTFs --- */
.ctfs-content .about-block h3 {
    font-size: 14px;
    margin-bottom: 12px;
}

/* --- Contact --- */
.contact-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-content>p {
    font-size: 13px;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 360px;
}

/* --- Theme Selector --- */
.theme-desc {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 20px;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    max-width: 520px;
}

.theme-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--bg-tertiary);
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 11px;
    color: var(--text-dim);
    transition: all 0.25s ease;
}

.theme-swatch:hover {
    border-color: var(--swatch);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.theme-swatch.active {
    border-color: var(--swatch);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3), inset 0 0 15px rgba(255, 255, 255, 0.02);
}

.swatch-fill {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--swatch);
    box-shadow: 0 0 12px var(--swatch);
    transition: transform 0.2s;
}

.theme-swatch:hover .swatch-fill {
    transform: scale(1.15);
}

.swatch-label {
    letter-spacing: 0.5px;
}

/* --- Command Bar --- */
.command-bar {
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 16px;
    background: linear-gradient(0deg, #080808 0%, var(--bg-secondary) 100%);
    border-top: 1px solid var(--border);
    box-shadow: 0 -1px 12px var(--accent-dim);
    flex-shrink: 0;
    gap: 10px;
    transition: border-color var(--transition), box-shadow var(--transition);
    position: relative;
    z-index: 2;
}

.command-bar__prompt {
    font-size: 13px;
    white-space: nowrap;
    user-select: none;
    display: flex;
    gap: 0;
}

.command-bar__input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    caret-color: var(--accent);
    padding: 4px 0;
    animation: caretPulse 1.2s ease-in-out infinite;
}

@keyframes caretPulse {

    0%,
    100% {
        caret-color: var(--accent);
    }

    50% {
        caret-color: transparent;
    }
}

.command-bar__input:focus {
    animation: none;
    caret-color: var(--accent);
}

.command-bar__input::placeholder {
    color: var(--text-dim);
    font-style: italic;
    opacity: 0.5;
}

/* --- Error message --- */
.error-message {
    color: #ff5252;
    font-size: 13px;
    padding: 6px 0;
    animation: fadeIn 0.2s ease;
}

/* --- Particle Canvas --- */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* --- Welcome Cursor --- */
.welcome__cursor {
    color: var(--accent);
    font-weight: 700;
    animation: blink-cursor 1s step-end infinite;
}

@keyframes blink-cursor {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* --- Inline Messages (Easter Eggs) --- */
.inline-message {
    color: var(--text);
    font-size: 13px;
    padding: 8px 12px;
    margin: 4px 0;
    border-left: 2px solid var(--accent);
    background: var(--bg-secondary);
    border-radius: 4px;
    animation: fadeIn 0.3s ease;
    white-space: pre-wrap;
    font-family: var(--font);
}

/* --- Output Area (above command bar) --- */
.output-area {
    max-height: 200px;
    overflow-y: auto;
    padding: 0 16px;
    border-top: 1px solid var(--bg-tertiary);
}

.output-area:empty {
    display: none;
}

/* --- Sound Toggle --- */
.sound-toggle {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.sound-toggle:hover {
    opacity: 1;
}

/* --- Experience Timeline --- */
.timeline {
    position: relative;
    padding-left: 32px;
    max-width: 700px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
}

.timeline__item {
    position: relative;
    margin-bottom: 28px;
}

.timeline__item::before {
    content: '';
    position: absolute;
    left: -28px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-neon);
    z-index: 1;
}

.timeline__date {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.timeline__card {
    padding: 16px;
    border: 1px solid var(--bg-tertiary);
    border-radius: 8px;
    background: var(--bg-secondary);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.timeline__card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-dim);
}

.timeline__card h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
}

.timeline__card p {
    margin: 0;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
}

/* --- GitHub Stats --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    text-align: center;
    padding: 20px 12px;
    border: 1px solid var(--bg-tertiary);
    border-radius: 8px;
    background: var(--bg-secondary);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-dim);
}

.stat-card__icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.stat-card__value {
    font-size: 28px;
    font-weight: 700;
}

.stat-card__label {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stats-languages {
    margin-top: 16px;
}

.stats-languages h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
}

.stats-lang-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stats-loading {
    padding: 24px;
    font-size: 13px;
    color: var(--text-dim);
}

/* --- Delete Animation Overlay --- */
.delete-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: auto;
    animation: fadeIn 0.3s ease;
}

.delete-output {
    font-family: var(--font);
    font-size: 12px;
    color: var(--text);
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-y: auto;
    flex: 1;
}

.delete-reboot {
    color: #ff5252;
    font-family: var(--font);
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    animation: glitch 0.3s ease infinite;
}

.delete-reveal {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.delete-reveal__emoji {
    font-size: 72px;
    margin-bottom: 16px;
}

.delete-reveal__text {
    color: var(--accent);
    font-family: var(--font);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
}

.delete-reveal__sub {
    color: var(--text-dim);
    font-family: var(--font);
    font-size: 14px;
}

@keyframes glitch {
    0% {
        transform: translate(0);
    }

    25% {
        transform: translate(-3px, 2px);
    }

    50% {
        transform: translate(3px, -1px);
    }

    75% {
        transform: translate(-1px, -2px);
    }

    100% {
        transform: translate(0);
    }
}

/* --- Matrix Canvas --- */
.matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9998;
    pointer-events: none;
}

/* --- Sidebar Backdrop (Mobile) --- */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

/* --- Mobile Header --- */
.mobile-header {
    display: none;
    height: 50px;
    height: calc(50px + env(safe-area-inset-top));
    align-items: center;
    justify-content: space-between;
    padding: env(safe-area-inset-top) 16px 0 16px;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--accent-neon);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10002; /* Even higher to stay on top */
}

.mobile-header__title {
    font-size: 14px;
    color: var(--accent);
    font-weight: 600;
    font-family: var(--font);
}

.mobile-header__btn {
    background: transparent;
    border: 1px solid var(--accent-neon);
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

/* --- Command Suggestions bar --- */
.suggestions-bar {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 10px;
    right: 10px;
    padding: 10px;
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid var(--accent-neon);
    border-radius: 8px;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    z-index: 99;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.5);
    scrollbar-width: none;
}

.suggestions-bar::-webkit-scrollbar {
    display: none;
}

.suggestion-chip {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-dim);
    color: var(--accent);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-chip:active {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    color: var(--text-dim);
}

.unlocked .achievement-badge {
    background: var(--accent);
    color: var(--bg-primary);
}

/* --- AI Chat (Inline Section) --- */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 75vh;
    min-height: 480px;
    background: rgba(10, 10, 10, 0.4);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chat-message {
    padding: 12px 18px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 14px;
    line-height: 1.6;
    animation: messageSlide 0.3s ease-out;
}

/* Typing Cursor Animation */
.typing-cursor {
    display: inline-block;
    width: 6px;
    height: 15px;
    background-color: var(--accent);
    margin-left: 2px;
    vertical-align: middle;
    animation: blink 1s step-end infinite;
}

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

@keyframes messageSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message--user {
    align-self: flex-end;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-right-radius: 4px;
}

.chat-message--ai {
    align-self: flex-start;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-bottom-left-radius: 4px;
    color: #fff;
}

.chat-message--guard {
    align-self: center;
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid #ff5252;
    color: #ff9999;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    text-align: center;
}

.chat-message__sender {
    display: block;
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    opacity: 0.8;
}

.chat-input-container {
    padding: 20px;
    background: rgba(255, 255, 255, 0.02); /* Translucent input area */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-input-container #chatInput {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 15px;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 14px;
    transition: all 0.3s ease;
}

.chat-input-container #chatInput:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-dim);
}

.chat-send-btn {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    letter-spacing: 1px;
}

.chat-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--accent-dim);
    background: var(--accent) !important;
    color: #000 !important;
}

/* Custom Scrollbar for Chat */
.chat-history::-webkit-scrollbar { width: 6px; }
.chat-history::-webkit-scrollbar-track { background: transparent; }
.chat-history::-webkit-scrollbar-thumb { background: var(--bg-tertiary); border-radius: 10px; }
.chat-history::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }


/* --- Modals Animations --- */

@keyframes modal-slide-in {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: var(--accent);
}

/* --- Blog --- */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px;
}

.blog-entry {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-entry:hover {
    border-color: var(--accent);
    background: var(--bg-tertiary);
    transform: translateX(5px);
}

.blog-entry__main {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.blog-entry__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
}

.blog-entry__date {
    font-size: 12px;
    color: var(--text-dim);
}

.blog-post-body h1, .blog-post-body h2, .blog-post-body h3 {
    color: var(--accent);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.blog-post-body p {
    margin-bottom: 1em;
}

.blog-post-body code {
    background: var(--bg-tertiary);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

.blog-post-body pre {
    background: var(--bg-tertiary);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid var(--border);
    margin: 1.5em 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    /* Only target the main terminal window, not modals */
    body > .terminal-window {
        width: 100vw;
        height: calc(100vh - 50px - env(safe-area-inset-top));
        margin: calc(50px + env(safe-area-inset-top)) 0 0 0;
        border-radius: 0;
        border: none;
        box-shadow: none;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 50px;
        bottom: 0;
        z-index: 1001;
        width: 250px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        background: rgba(10, 10, 10, 0.95) !important;
        backdrop-filter: blur(20px);
        border-right: 1px solid var(--accent-neon);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }

    .title-bar {
        display: none !important; /* Force hide original title bar on mobile */
    }

    .command-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 10px 15px;
        background: rgba(10, 10, 10, 0.9);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--accent-neon);
        z-index: 999;
    }

    .terminal-body {
        height: calc(100vh - 110px); /* un poco más de margen para barra + teclado */
        padding-bottom: 100px;
    }

    .output-area {
        margin-bottom: 130px; /* Más espacio para barra de comandos fija y teclado móvil */
    }

    .suggestions-bar {
        display: flex; /* Show suggestions bar on mobile when needed */
    }

    .ascii-art {
        font-size: 7px;
        line-height: 1.1;
    }

    /* Modal Mobile Fixes */
    .modal-content.terminal-window {
        width: 100vw;
        height: 100dvh; /* Use dynamic viewport height */
        height: 100vh; /* Fallback */
        max-width: none;
        max-height: none;
        min-height: 0;
        margin: 0 !important;
        border: none;
        border-radius: 0;
        background-color: rgba(10, 10, 10, 0.98) !important; /* Slightly more opaque to hide background */
        padding-top: calc(50px + env(safe-area-inset-top)); /* Space for mobile header */
        z-index: 10005;
    }

    .modal-body {
        padding: 10px 15px;
        overflow-y: auto; /* ALLOW SCROLLING */
        display: block; /* Block flow is better for scrolling long forms */
    }

    #experienceForm {
        display: block; /* Remove flex constraints */
    }

    .form-group--row {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .form-group--body {
        display: block;
        margin-top: 10px;
    }

    .exp-body-textarea {
        height: 180px; /* Fixed height instead of flex-grow */
        flex-grow: 0;
    }

    .form-actions {
        display: flex;
        flex-direction: row; 
        justify-content: center;
        padding: 20px 0 calc(30px + env(safe-area-inset-bottom)) 0;
        background: transparent !important;
        margin-top: 10px;
    }

    .form-actions .sidebar__item {
        flex: 1;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .ascii-art {
        font-size: 6px;
    }

    .neofetch__ascii {
        display: none;
    }

    .about-links {
        flex-direction: column;
    }

    .theme-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .delete-reveal__text {
        font-size: 16px;
    }

    .delete-reveal__emoji {
        font-size: 48px;
    }
}

/* --- Scanline effect (subtle) --- */
.terminal-window::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.04) 2px,
            rgba(0, 0, 0, 0.04) 4px);
    z-index: 100;
}

/* --- Noise texture overlay --- */
.terminal-window::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    opacity: 0.015;
    z-index: 99;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- RGB Mode Theme --- */
:root.theme-rgb {
    animation: rgb-cycle 20s linear infinite;
}

@keyframes rgb-cycle {
    0% {
        --accent: #ff0000;
    }

    16% {
        --accent: #ffff00;
    }

    33% {
        --accent: #00ff00;
    }

    50% {
        --accent: #00ffff;
    }

    66% {
        --accent: #0000ff;
    }

    83% {
        --accent: #ff00ff;
    }

    100% {
        --accent: #ff0000;
    }
}

/* --- Statistics Dashboard --- */
.stats-dashboard {
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-top: 20px;
}

.stats-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.filter-btn {
    padding: 6px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-dim);
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 13px;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--text-main);
}

.filter-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* --- Metrics Charts in Terminal --- */
.metrics-charts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border: 1px solid var(--bg-tertiary);
}

.metrics-chart-box {
    flex: 1;
    min-width: 250px;
    max-width: 100%;
}

.metrics-chart-box h4 {
    font-size: 11px;
    color: var(--accent);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

.metrics-chart-canvas {
    width: 100% !important;
    height: 180px !important;
}

@media (max-width: 768px) {
    .metrics-charts-container {
        flex-direction: column;
    }
    .metrics-chart-canvas {
        height: 140px !important;
    }
}

/* --- Achievements --- */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 10px;
}

.achievement-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.achievement-card.locked {
    opacity: 0.6;
    filter: grayscale(1);
}

.achievement-card.unlocked {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-dim);
    animation: achievement-unlock 0.5s ease-out;
}

@keyframes achievement-unlock {
    0% { transform: scale(0.9); opacity: 0; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.achievement-icon {
    font-size: 32px;
    width: 60px;
    height: 60px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    transition: transform 0.3s;
}

.achievement-card.unlocked .achievement-icon {
    background: var(--accent-dim);
    color: var(--accent);
    transform: rotateY(360deg);
}

.achievement-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.achievement-desc {
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.4;
}

.achievement-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    color: var(--text-dim);
}

/* AI Chat UI Enhancements */
.chat-stop-btn:hover { background: #ff7675 !important; transform: scale(1.05); }


/* AI Chat UI Enhancements v1.1.16 */
.chat-stop-btn {
    display: none;
    background: #d32f2f !important;
    color: #fff !important;
    padding: 10px 20px !important;
    border: none !important;
    font-weight: bold !important;
    cursor: pointer !important;
    border-radius: 6px !important;
    font-family: 'Fira Code', monospace !important;
    box-shadow: 0 0 10px rgba(255, 82, 82, 0.4);
    transition: all 0.3s ease;
    animation: stopPulse 2s infinite;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes stopPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 82, 82, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 82, 82, 0); }
}

.chat-stop-btn:active { transform: scale(0.95); }

