/* Sidebar toggle button for mobile */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 0.4rem;
    z-index: 300;
    background: none !important;
    box-shadow: none !important;
    color: var(--accent-purple);
    border: none;
    border-radius: 8px;
    font-size: 2rem;
    padding: 0.4em 0.7em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
/* Skills terminal window */
.skills-terminal {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 650px;
    background: rgba(8, 8, 8, 0.82);
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 60px rgba(0,0,0,0.5), 0 0 20px rgba(167,139,250,0.04);
    animation: fadeInUp 0.5s ease-out both;
    font-family: 'Monaspace Krypton', monospace;
}
.skills-terminal__bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #111;
    border-bottom: 1px solid #222;
}
.skills-terminal__dots { display: flex; gap: 6px; }
.skills-terminal__dot  { width: 11px; height: 11px; border-radius: 50%; }
.skills-terminal__dot--red    { background: #ff5f57; }
.skills-terminal__dot--yellow { background: #ffbd2e; }
.skills-terminal__dot--green  { background: #28c840; }
.skills-terminal__path {
    flex: 1;
    text-align: center;
    font-size: 0.72rem;
    color: #444;
    letter-spacing: 0.04em;
}
.skills-terminal__body {
    padding: 1.2rem 1.4rem 1.4rem;
    font-size: 0.82rem;
    line-height: 1.75;
    color: #ccc;
}
.st-prompt { color: #555; user-select: none; }
.st-cmd    { color: #a78bfa; }
.st-flag   { color: #7dd3a7; }

.st-table  { margin-top: 0.5rem; width: 100%; border-collapse: collapse; }
.st-table tr { border-bottom: 1px solid rgba(255,255,255,0.03); }
.st-table tr:hover { background: rgba(167,139,250,0.05); }

.st-total  { margin-top: 0.3rem; color: #555; font-size: 0.75rem; }
.st-final  { margin-top: 0.8rem; }

.st-cursor {
    display: inline-block;
    width: 0.55em;
    height: 0.95em;
    background: #22c55e;
    vertical-align: -0.1em;
    margin-left: 2px;
    animation: blink 1s step-end infinite;
}

/* Column classes */
.c-perms { color: #555; padding-right: 1.2rem; white-space: nowrap; }
.c-size  { color: #555; padding-right: 1.2rem; white-space: nowrap; font-size: 0.75rem; text-align: right; }
.c-date  { color: #555; padding-right: 1.2rem; white-space: nowrap; font-size: 0.75rem; }
.c-name  { color: #a78bfa; padding-right: 1.2rem; white-space: nowrap; }
.c-name--dim { color: #444; padding-right: 1.2rem; }

/* Reveal column: show ext/tag on skill-row hover */
.c-reveal { font-size: 0.75rem; min-width: 90px; }
.reveal-inner {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.st-row-skill:hover .reveal-inner { opacity: 1; }
.r-ext { color: #7dd3a7; }
.r-tag { color: #555; }

/* Meta rows (. and ..) slightly more muted */
.st-row-meta td { opacity: 0.5; }
.st-row-meta:hover td { opacity: 0.7; }

@media (min-width: 769px) {
    .sidebar-toggle {
        display: none !important;
    }
}

.sidebar-back {
    display: none;
    background: transparent !important;
    border: none;
    font-size: 2rem;
    color: var(--accent-purple);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

@media (max-width: 768px) {
    .sidebar-back {
        display: block !important;
    }
}

@media (min-width: 769px) {
    .sidebar-back {
        display: none !important;
    }
}
.sidebar-toggle:active {
    background: rgba(60,60,60,0.98);
    color: var(--accent-green);
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 200;
        box-shadow: 2px 0 16px rgba(0,0,0,0.35);
    }
    .sidebar.sidebar-open {
        display: flex;
        flex-direction: column;
    }
    .sidebar-toggle {
        display: block;
    }
    .main {
        margin-left: 0;
    }
}
@media (min-width: 769px) {
    .sidebar-toggle {
        display: none;
    }
}
/* Skill swap: show label instead of logo on hover */
.skill-swap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}
.skill-swap img {
    display: block;
    width: 46px;
    height: 46px;
    opacity: .9;
    filter: brightness(1.2);
    transition: opacity 0.18s, filter 0.3s, transform 0.3s;
}
.skill-card:hover .skill-swap img {
    opacity: 0;
    filter: blur(2px) brightness(1.2);
    transform: scale(0.7);
}
.skill-swap::after {
    content: attr(data-label);
    position: absolute;
    left: 0; right: 0; top: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #22223a;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    user-select: none;
    letter-spacing: 0.01em;
    transition: opacity 0.18s;
    white-space: pre-line;
}
.skill-card:hover .skill-swap::after {
    opacity: 0.97;
}

/* Font imports */
@font-face {
    font-family: 'Monaspace Krypton';
    src: url('../../fonts/MonaspaceKrypton-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Monaspace Krypton';
    src: url('../../fonts/MonaspaceKrypton-SemiBold.otf') format('opentype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Monaspace Krypton';
    src: url('../../fonts/MonaspaceKrypton-Italic.otf') format('opentype');
    font-weight: 400;
    font-style: italic;
}

/* CSS variables */
:root {
    --bg-dark: #1a1a1a;
    --card-bg: #0a0a0a;
    --sidebar-bg: #0a0a0a;
    --text-bg: #1a1a1a;
    --border-color: #4a4a4a;
    --text-primary: #ffffff;
    --text-secondary: #999999;
    --accent-purple: #a78bfa;
    --accent-green: #7dd3a7;
    --semantic-green: #7dd3a7;
    
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    --border-radius: 16px;
    --sidebar-width: 280px;
    --transition: all 0.3s ease;
}

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

/* Base styles */
body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Monaspace Krypton', monospace;
    font-weight: 400;
    line-height: 1.6;
    min-height: 100vh;
}

/* Layout */
.app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: #080808;
    border-right: 1px solid #333333;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
}

.sidebar__content {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-sm);
    overflow-y: auto;
}

.sidebar__top {
    padding: 0.75rem var(--spacing-sm);
    border-bottom: 1px solid #222222;
    background-color: #0b0b0b;
}

.sidebar__vault-title {
        background-color: transparent !important;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: lowercase;
    color: var(--accent-purple);
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar__logo {
    width: 20px;
    height: 20px;
    opacity: 0.85;
}

.sidebar__folder {
    margin-bottom: var(--spacing-xs);
}

.sidebar__folder-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
    font-size: 0.9rem;
    opacity: 0.85;
}

.sidebar__folder-header:hover {
    background-color: #151515;
    opacity: 1;
}

.sidebar__folder-toggle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.sidebar__folder-toggle.open {
    transform: rotate(90deg);
}

.sidebar__folder-name {
    color: var(--text-primary);
}

.sidebar__folder-items {
    margin-left: 1.25rem;
    display: none;
}

.sidebar__folder-items.open {
    display: block;
}

.sidebar__folder-skills {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
    font-size: 0.9rem;
    opacity: 0.85;
    margin-left: 0;
    color: var(--text-primary);
    box-shadow: 0 0 8px rgba(139, 122, 255, 0.15);
}

.sidebar__folder-skills:hover {
    background-color: #151515;
    opacity: 1;
}

.sidebar__item {
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition);
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.sidebar__item:hover {
    background-color: #151515;
    color: var(--text-primary);
}

.sidebar__item.active {
    background-color: #1a1a1a;
    color: var(--accent-purple);
    border-left: 2px solid var(--accent-purple);
    padding-left: calc(0.5rem - 2px);
}

.sidebar__footer {
    padding: var(--spacing-sm);
    border-top: 1px solid #222222;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    background-color: #0d0d0d;
    min-height: 48px;
}

.sidebar__footer a {
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar__footer a:hover {
    color: var(--accent-purple);
}

/* Main content */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 600px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Use full note area for floating skills */
body.skills-active .container {
    max-width: none;
    width: 100%;
    height: 100%;
    min-height: 70vh;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: calc(var(--spacing-xl) * 0.75);
}

.header__title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    background: linear-gradient(
        90deg,
        var(--text-primary),
        var(--accent-purple)
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: var(--spacing-sm);
    animation: fadeInDown 0.8s ease-out;
    display: inline-block;
    padding: 0.25rem 0.5rem;
    position: relative;
}

/* Label */
.label {
    color: var(--semantic-green);
    font-weight: 500;
    margin-right: 0.25rem;
    white-space: nowrap;
}

/* Card */
.card {
    background-color: rgba(10, 10, 10, 0.8);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.75rem;
    margin-bottom: var(--spacing-xl);
    transition: var(--transition);
    animation: fadeInUp 0.8s ease-out;
    position: relative;
}

/* Knowledge graph (Obsidian-style, minimal) */
.graph-node {
    fill: rgba(167, 139, 250, 0.75);
    stroke: rgba(167, 139, 250, 0.9);
    stroke-width: 0.6;
}

.graph-edge {
    stroke: rgba(167, 139, 250, 0.35);
    stroke-width: 1;
    stroke-dasharray: 2 4;
}

.graph-label {
    font-size: 9px;
    fill: rgba(167, 139, 250, 0.75);
    opacity: 0;
    transition: opacity 0.2s ease;
}

#knowledge-graph:hover .graph-label {
    opacity: 1;
}

.sidebar__graph {
    padding: 0.25rem 0.75rem 0.5rem;
    background: transparent;
    opacity: 0.35;
    transition: opacity 0.35s ease;
}

.sidebar:hover .sidebar__graph {
    opacity: 0.85;
}

.sidebar__graph svg {
    width: 100%;
    height: 160px;
}

.card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-2px);
}

.card__title {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--accent-purple);
    margin-bottom: var(--spacing-lg);
}

.card__content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.card__text-block {
    background-color: var(--text-bg);
    padding: var(--spacing-md);
    border-radius: 8px;
    border-left: 3px solid var(--accent-purple);
    padding-left: var(--spacing-md);
}

.card__text {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.8;
}

.card__highlight {
    color: var(--accent-purple);
    font-style: italic;
}

/* Hint card */
.hint {
    background-color: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(2px);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    max-width: 400px;
    margin: 0 auto;
    transition: var(--transition);
    animation: fadeInUp 0.8s ease-out 0.2s both;
    margin-top: var(--spacing-lg);
    opacity: 0.6;
    font-family: var(--mono-font, 'Monaspace Krypton', monospace);
}

.caret {
    display: inline-block;
    width: 0.2em;
    height: 1.05em;
    margin-left: 3px;
    vertical-align: -0.15em;
    background-color: #22c55e;
    visibility: hidden;
}

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

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

.binary {
    color: #22c55e;
}

.hint:hover {
    border-color: #428f5e;
    transform: translateY(-2px);
}

.hint__title {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--accent-purple);
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}

.hint__body {
    background-color: var(--text-bg);
    padding: 1rem;
    border-radius: 8px;
}

.hint__link {
    color: var(--text-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 1rem;
    transition: color 0.3s ease;
}

.hint__link:hover {
    color: #22c55e;
}

.hint__link::before {
    content: '←';
    font-size: 1.2rem;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* Responsive styles */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main {
        margin-left: 0;
    }

    .card,
    .hint {
        padding: var(--spacing-md);
    }

    .card__title,
    .hint__title {
        font-size: 2rem;
    }
}

@keyframes sidebar-glow {
    0%   { box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5); }
    40%  { box-shadow: 2px 0 20px rgba(167, 139, 250, 0.4); }
    70%  { box-shadow: 2px 0 20px rgba(167, 139, 250, 0.4); }
    100% { box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5); }
}

@keyframes grid-breathe {
    0%   { filter: opacity(0.75); }
    50%  { filter: opacity(0.95); }
    100% { filter: opacity(0.8); }
}

@keyframes grid-drift {
    0%   { background-position: 0px 0px, 0px 0px, 0% 0%, 0% 0%, 0% 0%; }
    50%  { background-position: 4px -3px, -3px 5px, 0% 0%, 0% 0%, 0% 0%; }
    100% { background-position: 0px 0px, 0px 0px, 0% 0%, 0% 0%, 0% 0%; }
}

.sidebar.glow {
    animation: sidebar-glow 1.2s ease-in-out;
}

.main {
    transition: opacity 0.25s ease, filter 0.25s ease;
}

body.sidebar-spotlight .main {
    opacity: 0.32;
    filter: saturate(0.88);
}

@keyframes sidebar-attention {
    0%   { transform: translateX(0); }
    18%  { transform: translateX(8px); }
    42%  { transform: translateX(-2px); }
    68%  { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

.sidebar.attention {
    animation: sidebar-attention 0.8s ease-out;
}

.hint-pulse {
    animation: hint-pulse 1s ease-out;
}

@keyframes hint-pulse {
    0%   { background-color: rgba(167, 139, 250, 0.05); }
    30%  { background-color: rgba(167, 139, 250, 0.24); }
    100% { background-color: rgba(167, 139, 250, 0.05); }
}

@keyframes skills-glow {
    0%   { box-shadow: 0 0 8px rgba(139, 122, 255, 0.15); }
    40%  { box-shadow: 0 0 20px rgba(167, 139, 250, 0.6); }
    70%  { box-shadow: 0 0 20px rgba(167, 139, 250, 0.6); }
    100% { box-shadow: 0 0 8px rgba(139, 122, 255, 0.15); }
}

.sidebar__folder-skills.glow {
    animation: skills-glow 1.2s ease-in-out;
}

/* Boot terminal */
#boot-terminal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0a0a0a;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 5vh 0 0 3vw;
}

#terminal-output {
    font-family: 'Monaspace Krypton', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e0e0e0;
    white-space: pre-wrap;
    padding: 0;
    max-width: 700px;
}

.prompt {
    color: #666666;
    user-select: none;
}

.error {
    color: #ff6b6b;
}

.cursor {
    display: inline-block;
    width: 0.6em;
    height: 1.2em;
    margin-left: 2px;
    animation: none;
    visibility: hidden;
}

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

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

.boot-fade {
    animation: fadeOut 0.7s ease-out forwards;
}

@keyframes fadeOut {
    to { opacity: 0; }
}

/* Skills cards (glass floating) */
.skills-grid {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

@media (max-width: 900px) {
    .skills-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 520px) {
    .skills-grid { grid-template-columns: repeat(2, 1fr); }
}

.skill-card {
    width: 110px;
    height: 110px;
    background: rgba(147, 147, 190, 0.82);
    border-radius: 12px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1.5px solid rgba(200, 200, 200, 0.8);
    box-shadow: 0 2px 12px 0 rgba(0,0,0,0.07), inset 0 0 0 1px rgba(220,220,220,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease, background .3s ease;
    position: absolute;
    pointer-events: auto;
    animation: float 3.5s ease-in-out infinite, borderPulse 2.4s ease-in-out 1, drift 4s ease-in-out infinite;
}

@keyframes drift {
    0%   { transform: translateY(-10px); }
    50%  { transform: translateY(10px); }
    100% { transform: translateY(-10px); }
}

.skill-card:nth-child(1) { animation-delay: 0s; }
.skill-card:nth-child(2) { animation-delay: .5s; }
.skill-card:nth-child(3) { animation-delay: 1s; }
.skill-card:nth-child(4) { animation-delay: 1.5s; }
.skill-card:nth-child(5) { animation-delay: 2s; }

@keyframes float {
    0%   { transform: translateY(0) rotate(0deg); }
    50%  { transform: translateY(-10px) rotate(1.5deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

@keyframes borderPulse {
    0%   { box-shadow: inset 0 0 0 1px rgba(0,255,170,0.9), 0 0 0 rgba(0,255,170,0); }
    50%  { box-shadow: inset 0 0 0 1px rgba(0,255,170,0.9), 0 0 16px rgba(0,255,170,0.35); }
    100% { box-shadow: inset 0 0 0 1px rgba(64,64,64,0.8), 0 0 0 rgba(0,255,170,0); }
}

.skill-card img {
    width: 46px;
    height: 46px;
    opacity: .9;
    filter: brightness(1.2);
    transition: transform .3s ease, filter .3s ease;
}

.skill-card:hover {
    transform: translateY(-12px) scale(1.1);
    border-color: rgba(0, 255, 170, 0.9);
    box-shadow: 0 0 20px rgba(0, 255, 170, .4);
}

.skill-card:hover img {
    filter: brightness(1.6) saturate(1.2);
    transform: scale(1.1);
}

#skills-bg { display: none; }

#scanlines {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.13) 2px,
        rgba(0, 0, 0, 0.13) 3px
    );
}