@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');

:root {
    --bg-dark: #09090b;
    --bg-card: #18181b;
    --text-main: #f4f4f5;
    --text-muted: #a1a1aa;
    --accent: #F0D4B5;
    --border-color: #27272a;
    --font-display: 'Chakra Petch', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-mono);
    line-height: 1.6;
    background-image: 
        linear-gradient(rgba(240, 212, 181, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(240, 212, 181, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    background-position: center;
    background-attachment: fixed;
    overflow-x: hidden;
}

/* Animations */
@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 48px;
    border-bottom: 2px solid var(--border-color);
    background-color: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

header h1 a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.3s;
}

header h1 a:hover {
    color: var(--accent);
}

header h1 small a img {
    margin-bottom: -4px;
    margin-left: 8px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

header h1 small a:hover img {
    opacity: 1;
}

nav {
    display: flex;
    gap: 24px;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 4px;
    transition: color 0.3s;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

nav a:hover {
    color: var(--text-main);
}

nav a:hover::after {
    width: 100%;
}

/* Main Content Layout */
main {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

/* Profile Section (Hero) */
.hero {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.profile-card {
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    padding: 60px 80px;
    min-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s, transform 0.3s;
}

.profile-card::before {
    content: 'SYS.USR';
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.7rem;
    color: var(--border-color);
}

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

.profile-pic-container {
    position: relative;
    margin-bottom: 24px;
}

.profile-pic {
    width: 200px;
    height: 200px;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.2);
    border: 2px solid var(--text-muted);
    transition: filter 0.3s, border-color 0.3s;
}

.profile-card:hover .profile-pic {
    filter: grayscale(0%) contrast(1.1);
    border-color: var(--accent);
}

.profile-card h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: var(--text-main);
}

.profile-card p {
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Info Grid */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.info-card {
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    padding: 32px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s ease;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background-color: var(--accent);
    transition: height 0.3s ease;
}

.info-card:hover {
    transform: translateX(5px);
    border-color: var(--text-muted);
}

.info-card:hover::before {
    height: 100%;
}

.info-card h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-card h3 span {
    color: var(--accent);
}

.info-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.info-card p strong {
    color: var(--text-main);
    font-weight: 600;
}

/* Project Frames */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
}

.frame {
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    padding: 32px;
    position: relative;
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-muted);
    display: block;
}

.frame::after {
    content: '↗';
    position: absolute;
    top: 24px;
    right: 24px;
    color: var(--border-color);
    font-family: var(--font-display);
    font-size: 1.5rem;
    transition: all 0.3s;
}

.frame:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--bg-dark);
}

.frame:hover::after {
    color: var(--bg-dark);
    transform: translate(3px, -3px);
}

.frame h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.frame h3 a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.3s;
}

.frame:hover h3 {
    color: var(--bg-dark);
}

.frame:hover h3 a {
    color: var(--bg-dark);
}

.frame p {
    transition: color 0.3s;
}

.frame:hover p {
    color: var(--bg-dark);
    opacity: 0.9;
}

/* Featured Project Card */
.featured-project {
    background: linear-gradient(145deg, var(--bg-card) 0%, #111113 100%);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 48px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.featured-project::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(45deg, transparent 40%, var(--accent) 50%, transparent 60%);
    z-index: -1;
    background-size: 200% 200%;
    animation: borderGlow 6s linear infinite;
    opacity: 0.5;
    border-radius: 18px;
}

@keyframes borderGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.featured-project:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 15px 40px rgba(240, 212, 181, 0.1);
}

.featured-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 1;
}

.project-tags {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.tag-math { background-color: rgba(243, 156, 18, 0.15); color: #f39c12; border: 1px solid rgba(243, 156, 18, 0.3); }
.tag-brain { background-color: rgba(155, 89, 182, 0.15); color: #9b59b6; border: 1px solid rgba(155, 89, 182, 0.3); }
.tag-web { background-color: rgba(46, 204, 113, 0.15); color: #2ecc71; border: 1px solid rgba(46, 204, 113, 0.3); }

.featured-content h2 {
    font-family: var(--font-display);
    font-size: 2.8rem;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--text-main);
}

.emoji-spin {
    display: inline-block;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.featured-project:hover .emoji-spin {
    transform: scale(1.2) rotate(15deg);
}

.featured-content p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 90%;
}

.tech-mini-grid {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.tech-pill {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.tech-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background-color: var(--accent);
    color: var(--bg-dark);
    padding: 16px 32px;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.3s;
    align-self: flex-start;
    border: 2px solid var(--accent);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(240, 212, 181, 0.2);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.btn-primary:hover .btn-icon {
    transform: translateX(5px);
}

.featured-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.math-visual-card {
    background-color: #0c0c0e;
    border: 2px solid var(--border-color);
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 350px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    position: relative;
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.featured-project:hover .math-visual-card {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg) scale(1.05);
    border-color: rgba(231, 76, 60, 0.5);
}

.math-equation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 30px;
}

.num { color: var(--text-main); }
.op { color: #e74c3c; } /* Red for operators */
.eq { color: var(--text-muted); }
.ans { color: var(--accent); }

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

@keyframes blinkCursor {
    50% { opacity: 0; }
}

.math-technique {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    padding: 16px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.math-technique span {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #e74c3c;
    font-weight: 600;
    text-transform: uppercase;
}

.technique-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.technique-bar .fill {
    height: 100%;
    width: 0%;
    background: #e74c3c;
    border-radius: 3px;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.featured-project:hover .technique-bar .fill {
    width: 100%;
}

@media (max-width: 900px) {
    .featured-project {
        grid-template-columns: 1fr;
        padding: 32px;
        gap: 32px;
    }
    .featured-content h2 {
        font-size: 2.2rem;
    }
    .math-visual-card {
        transform: none;
    }
    .featured-project:hover .math-visual-card {
        transform: scale(1.02);
    }
}

/* Tech Stack Section */
.tech-stack {
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    padding: 40px;
    text-align: center;
    position: relative;
}

.tech-stack::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--accent);
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--text-main);
    margin-bottom: 24px;
    display: inline-block;
}

.section-title span {
    color: var(--accent);
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 16px;
}

.tech-item {
    background-color: var(--bg-dark);
    border: 2px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tech-item img {
    width: 48px;
    height: 48px;
    filter: grayscale(100%) opacity(0.5);
    transition: all 0.3s ease;
}

.tech-item span {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-mono);
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.tech-item:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(240, 212, 181, 0.1);
}

.tech-item:hover img {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.15);
}

.tech-item:hover span {
    color: var(--text-main);
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    header {
        flex-direction: column;
        gap: 16px;
        padding: 20px;
    }
    .profile-card {
        padding: 24px;
    }
}

/* Terminal Popup System */
.terminal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.terminal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.terminal-window {
    background-color: #050505;
    border: 2px solid var(--accent);
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(240, 212, 181, 0.15);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font-mono);
}

.terminal-overlay.active .terminal-window {
    transform: translateY(0);
}

.terminal-header {
    background-color: var(--bg-card);
    border-bottom: 2px solid var(--border-color);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-title {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.terminal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s;
    font-weight: bold;
}

.terminal-close:hover {
    color: #ef4444;
}

.terminal-body {
    padding: 24px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-main);
}

.term-line {
    margin-bottom: 12px;
    word-break: break-word;
}

.fish-user { color: #4ade80; } /* Neon Green */
.fish-dir { color: #38bdf8; } /* Neon Blue */
.fish-char { color: var(--text-muted); }
.fish-error { color: #ef4444; } /* Red */
.fish-warn { color: #eab308; } /* Yellow */

.cursor-blink {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: var(--text-muted);
    vertical-align: bottom;
    animation: blink 1s step-end infinite;
    margin-left: 6px;
}

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

.term-input-line {
    display: flex;
    align-items: center;
    margin-top: 16px;
}

.term-input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    flex-grow: 1;
    outline: none;
    margin-left: 8px;
    caret-color: var(--text-muted);
}

.term-copy-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    cursor: pointer;
    margin-left: 12px;
    text-decoration: underline;
    transition: color 0.2s;
}

.term-copy-btn:hover {
    color: var(--accent);
}

.terminal-window.expanded-sandbox {
    max-width: 900px;
}

.expanded-sandbox .terminal-body {
    height: 550px;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
}

.v86-screen-container {
    width: 100%;
    flex-grow: 1;
    background-color: transparent;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    overflow: hidden;
    position: relative;
    margin-top: 16px;
    cursor: text;
}

.v86-screen-container div {
    font-family: var(--font-mono) !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
}