/* CSS Variables */
:root {
    --background: hsl(120, 10%, 4%);
    --foreground: hsl(120, 60%, 75%);
    --card: hsl(120, 8%, 8%);
    --card-foreground: hsl(120, 60%, 75%);
    --popover: hsl(120, 8%, 8%);
    --popover-foreground: hsl(120, 60%, 75%);
    --primary: hsl(120, 100%, 50%);
    --primary-foreground: hsl(120, 10%, 4%);
    --secondary: hsl(120, 8%, 12%);
    --secondary-foreground: hsl(120, 60%, 75%);
    --muted: hsl(120, 6%, 14%);
    --muted-foreground: hsl(120, 20%, 40%);
    --accent: hsl(45, 100%, 55%);
    --accent-foreground: hsl(120, 10%, 4%);
    --destructive: hsl(0, 84.2%, 60.2%);
    --destructive-foreground: hsl(210, 40%, 98%);
    --border: hsl(120, 15%, 18%);
    --input: hsl(120, 15%, 18%);
    --ring: hsl(120, 100%, 50%);
    --font-mono: 'JetBrains Mono', 'IBM Plex Mono', 'Courier New', monospace;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-color: var(--border);
}

body {
    background: var(--background);
    color: var(--foreground);
    font-family: var(--font-mono);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-mono);
}

::selection {
    background: hsla(120, 100%, 50%, 0.3);
    color: hsl(120, 60%, 90%);
}

/* CRT scanline effect */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        hsla(120, 100%, 50%, 0.015) 2px,
        hsla(120, 100%, 50%, 0.015) 4px
    );
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: hsla(120, 100%, 50%, 0.3);
}

/* Utility Classes */
.min-h-screen {
    min-height: 100vh;
}

.bg-background {
    background-color: var(--background);
}

.bg-card {
    background-color: var(--card);
}

.bg-secondary {
    background-color: var(--secondary);
}

.bg-red {
    background-color: hsla(0, 84.2%, 60.2%, 0.8);
}

.bg-yellow {
    background-color: hsla(45, 100%, 55%, 0.8);
}

.bg-green {
    background-color: hsla(120, 100%, 50%, 0.8);
}

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

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

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

.text-muted {
    color: var(--muted-foreground);
}

.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.font-bold {
    font-weight: 700;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-1 {
    flex: 1 1 0%;
    min-height: 0;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-1\.5 {
    gap: 0.375rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.space-y-1 > * + * {
    margin-top: 0.25rem;
}

.space-y-3 > * + * {
    margin-top: 0.75rem;
}

.space-y-4 > * + * {
    margin-top: 1rem;
}

.space-y-6 > * + * {
    margin-top: 1.5rem;
}

.space-y-8 > * + * {
    margin-top: 2rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-4 {
    padding: 1rem;
}

.p-5 {
    padding: 1.25rem;
}

.p-6 {
    padding: 1.5rem;
}

.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.px-5 {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.py-0\.5 {
    padding-top: 0.125rem;
    padding-bottom: 0.125rem;
}

.py-1\.5 {
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.pl-4 {
    padding-left: 1rem;
}

.pl-8 {
    padding-left: 2rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.ml-4 {
    margin-left: 1rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.border {
    border-width: 1px;
    border-style: solid;
}

.border-b {
    border-bottom-width: 1px;
    border-bottom-style: solid;
}

.border-t {
    border-top-width: 1px;
    border-top-style: solid;
}

.border-l-2 {
    border-left-width: 2px;
    border-left-style: solid;
}

.border-border {
    border-color: var(--border);
}

.border-primary {
    border-color: var(--primary);
}

.border-primary-20 {
    border-color: hsla(120, 100%, 50%, 0.2);
}

.border-primary-30 {
    border-color: hsla(120, 100%, 50%, 0.3);
}

.border-primary-40 {
    border-color: hsla(120, 100%, 50%, 0.4);
}

.border-primary-50 {
    border-color: hsla(120, 100%, 50%, 0.5);
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-y-auto {
    overflow-y: auto;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.left-0 {
    left: 0;
}

.top-0 {
    top: 0;
}

.top-2 {
    top: 0.5rem;
}

.bottom-2 {
    bottom: 0.5rem;
}

.w-full {
    width: 100%;
}

.w-px {
    width: 1px;
}

.w-24 {
    width: 6rem;
}

.h-24 {
    height: 6rem;
}

.h-90vh {
    height: 90vh;
}

.max-w-md {
    max-width: 28rem;
}

.max-w-2xl {
    max-width: 42rem;
}

.max-w-3xl {
    max-width: 48rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.shrink-0 {
    flex-shrink: 0;
}

.block {
    display: block;
}

.hidden {
    display: none !important;
}

/* Terminal View */
#terminal-view {
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateY(0);
    animation: fadeIn 0.5s ease-out;
    z-index: 1;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--card);
}

#terminal-view.hidden-view {
    display: none;
}

.section-view {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.section-view.active {
    z-index: 2;
}

.object-cover {
    object-fit: cover;
}

.text-center {
    text-align: center;
}

.leading-relaxed {
    line-height: 1.625;
}

.transition-colors {
    transition-property: color, background-color, border-color;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-all {
    transition-property: all;
    transition-duration: 150ms;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.hover\:text-primary:hover {
    color: var(--primary);
}

.hover\:bg-secondary:hover {
    background-color: var(--secondary);
}

.cursor-default {
    cursor: default;
}

/* Custom Component Classes */
.terminal-window {
    box-shadow: 0 0 80px hsla(120, 100%, 50%, 0.06);
    animation: fadeIn 0.5s ease-out;
    display: flex;
    flex-direction: column;
}

.window-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}

.section-view {
    height: 100%;
    width: 100%;
    display: none;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    filter: blur(6px);
}

.section-view.active {
    display: flex !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    filter: blur(0) !important;
    animation: slideIn 0.35s ease-out forwards;
}

.section-header {
    flex-shrink: 0;
    display: flex;
}

.section-view > div:last-child {
    flex: 1;
    overflow-y: auto;
}

.bg-secondary-50 {
    background-color: hsla(120, 8%, 12%, 0.5);
}

.border-primary-40 {
    border-color: hsla(120, 100%, 50%, 0.4);
}

.border-accent-40 {
    border-color: hsla(45, 100%, 55%, 0.4);
}

.shadow-glow {
    box-shadow: 0 0 80px hsla(120, 100%, 50%, 0.06);
}

/* Text Effects */
.text-glow {
    text-shadow:
        0 0 8px hsla(120, 100%, 50%, 0.6),
        0 0 20px hsla(120, 100%, 50%, 0.2);
}

.text-glow-accent {
    text-shadow:
        0 0 8px hsla(45, 100%, 55%, 0.6),
        0 0 20px hsla(45, 100%, 55%, 0.2);
}

/* Glitch Text Effect */
.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.glitch-text::before {
    left: 2px;
    color: hsla(45, 100%, 55%, 0.4);
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    z-index: -1;
}

.glitch-text::after {
    left: -2px;
    color: hsla(120, 100%, 50%, 0.3);
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
    z-index: -1;
}

/* Grid Layout */
.grid {
    display: grid;
}

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

/* Skill Card Hover */
.skill-card {
    cursor: default;
}

.skill-card:hover {
    transform: scale(1.05);
    border-color: hsla(120, 100%, 50%, 0.6);
}

/* Timeline */
.timeline-line {
    position: absolute;
    left: 7px;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 1px;
    background: var(--border);
}

.timeline-dot {
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 15px;
    height: 15px;
    border: 1px solid var(--primary);
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-dot > div {
    width: 5px;
    height: 5px;
    background: var(--primary);
}

/* Project Card */
.project-card:hover {
    transform: translateX(4px);
    border-color: hsla(120, 100%, 50%, 0.6);
}

.project-title {
    transition: color 150ms;
}

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

.project-arrow {
    transition: color 150ms;
}

.project-card:hover .project-arrow {
    color: var(--primary);
}

/* Terminal Output */
#terminal-output {
    font-family: var(--font-mono);
    flex: 1 1 auto;
    overflow-y: auto;
    font-size: 0.875rem;
    line-height: 1.625;
    color: hsl(120, 60%, 75%) !important;
    min-height: 100px;
}

/* Force visibility for all terminal content */
#terminal-output,
#terminal-output * {
    opacity: 1 !important;
    visibility: visible !important;
}

.terminal-line {
    color: hsl(120, 60%, 75%);
    margin-bottom: 0.125rem;
    opacity: 1;
}

.command-line {
    display: flex;
    gap: 0.5rem;
}

.command-prompt {
    color: var(--primary);
    text-shadow:
        0 0 8px hsla(120, 100%, 50%, 0.6),
        0 0 20px hsla(120, 100%, 50%, 0.2);
    flex-shrink: 0;
}

.command-input-line {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
    align-items: center;
}

#terminal-input {
    flex: 1;
    background: transparent;
    color: var(--foreground);
    outline: none;
    caret-color: var(--primary);
    font-size: 0.875rem;
    border: none;
    font-family: var(--font-mono);
}

.ascii-art {
    color: var(--primary);
    text-shadow:
        0 0 8px hsla(120, 100%, 50%, 0.6),
        0 0 20px hsla(120, 100%, 50%, 0.2);
    font-size: 0.875rem;
    line-height: 1.2;
    white-space: pre;
}

.error-text {
    color: var(--destructive);
}

.link-text {
    color: var(--accent);
    text-shadow:
        0 0 8px hsla(45, 100%, 55%, 0.6),
        0 0 20px hsla(45, 100%, 55%, 0.2);
    text-decoration: none;
    display: block;
    white-space: pre;
}

.link-text:hover {
    text-decoration: underline;
}

.header-text {
    color: var(--primary);
    text-shadow:
        0 0 8px hsla(120, 100%, 50%, 0.6),
        0 0 20px hsla(120, 100%, 50%, 0.2);
    white-space: pre;
}

.divider-space {
    height: 0.25rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
        filter: blur(6px);
    }
}

@keyframes flicker {
    0% { opacity: 0.97; }
    50% { opacity: 1; }
    100% { opacity: 0.98; }
}

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

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

@keyframes imgFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(-5deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Contact Links */
.contact-link {
    text-decoration: none;
}

/* Responsive Design */
@media (min-width: 640px) {
    .sm\:p-6 {
        padding: 1.5rem;
    }

    .sm\:p-10 {
        padding: 2.5rem;
    }

    .sm\:w-32 {
        width: 8rem;
    }

    .sm\:h-32 {
        height: 8rem;
    }

    .sm\:text-3xl {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }

    .sm\:flex-row {
        flex-direction: row;
    }

    .sm\:items-center {
        align-items: center;
    }

    .sm\:justify-between {
        justify-content: space-between;
    }

    .ascii-art {
        font-size: 0.875rem;
    }
}

/* Flex Wrapping */
.flex-wrap {
    flex-wrap: wrap;
}

/* Button Reset */
button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-mono);
}

/* Link Reset */
a {
    text-decoration: none;
}

/* Section Content Animations */
.section-view.active .max-w-2xl,
.section-view.active .max-w-md {
    animation: contentFadeIn 0.5s ease-out 0.2s both;
}

.section-view.active img {
    animation: imgFadeIn 0.5s ease-out 0.3s both;
}

.section-view.active .glitch-text {
    animation: contentFadeIn 0.5s ease-out 0.3s both;
}

.section-view.active .experience-item,
.section-view.active .project-card,
.section-view.active .skill-card {
    animation: contentFadeIn 0.5s ease-out both;
}

.section-view.active .experience-item:nth-child(1) {
    animation-delay: 0.3s;
}

.section-view.active .experience-item:nth-child(2) {
    animation-delay: 0.45s;
}

.section-view.active .experience-item:nth-child(3) {
    animation-delay: 0.6s;
}

.section-view.active .experience-item:nth-child(4) {
    animation-delay: 0.75s;
}
