/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #121212;
    --bg-tertiary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-red: #ff2e2e;
    --border-color: #2a2a2a;
    --font-main: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
    cursor: none;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    letter-spacing: -0.02em;
    cursor: none;
}

::selection {
    background-color: var(--text-primary);
    color: var(--bg-primary);
}

::-moz-selection {
    background-color: var(--text-primary);
    color: var(--bg-primary);
}

::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--accent-red);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #ff4545;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-red) var(--bg-secondary);
}

/* ============================================
   STICKY HEADER
   ============================================ */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    z-index: 999;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}
.sticky-header.hidden {
    display: none;
}
.sticky-header.visible {
    transform: translateY(0);
    animation: slideDown 0.4s ease-out;
    display: block;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.header-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
    color: var(--text-primary);
    cursor: pointer;
}

.header-nav {
    display: flex;
    gap: 2rem;
}

.header-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}
.header-link:hover {
    color: var(--accent-red);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Custom Cursor */
.cursor-dot {
    width: 12px;
    height: 12px;
    background-color: var(--accent-red);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transition: transform 0.15s ease;
}

a, button, .project-card, .stack-item {
    cursor: none;
}

@media (hover: none) and (pointer: coarse) {
    body { cursor: auto !important; }
    .cursor-dot { display: none; }
    a, button, .project-card, .stack-item { cursor: pointer !important; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.neural-bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image:
        linear-gradient(rgba(255,46,46,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,46,46,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    z-index: 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
    transition: grid-template-columns 0.3s ease;
}
.hero-grid.terminal-hidden {
    grid-template-columns: 1fr;
    justify-items: center;
}
.hero-grid.terminal-hidden .hero-left {
    text-align: center;
    max-width: 700px;
    animation: slideToCenter 0.6s ease-out;
}
.hero-grid.terminal-hidden .label      { animation: techFadeIn 0.5s ease-out; }
.hero-grid.terminal-hidden .hero-name  { animation: techFadeIn 0.6s ease-out 0.1s both; }
.hero-grid.terminal-hidden .hero-tagline { animation: techFadeIn 0.7s ease-out 0.2s both; }
.hero-grid.terminal-hidden .hero-links { animation: techFadeIn 0.8s ease-out 0.3s both; }

@keyframes slideToCenter {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(0); opacity: 1; }
}
@keyframes techFadeIn {
    0%   { opacity: 0; transform: translateY(20px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.hero-grid.terminal-hidden .hero-right {
    display: none;
}

.label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent-red);
    margin-bottom: 1rem;
}

.hero-name {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.hero-name.fade-out {
    opacity: 0;
    transform: translateY(-20px);
}

.hero-tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.hero-links {
    display: flex;
    gap: 1.5rem;
}
.hero-grid.terminal-hidden .hero-links {
    justify-content: center;
}

.hero-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}
.hero-link:hover {
    border-color: var(--accent-red);
    background-color: rgba(255,46,46,0.05);
    transform: translateY(-2px);
}

/* ============================================
   TERMINAL BOX
   ============================================ */
.terminal-box {
    background-color: #000;
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
}
.terminal-box.maximized {
    position: fixed;
    top: 2rem; left: 2rem;
    right: 2rem; bottom: 2rem;
    z-index: 1000;
    max-width: none;
}
.terminal-box.maximized .terminal-box-body {
    height: calc(100vh - 8rem);
    max-height: none;
}
.terminal-box.minimized {
    height: 50px;
    overflow: hidden;
}
.terminal-box.minimized .terminal-box-body {
    display: none;
}
.terminal-box.hidden {
    display: none;
}

.terminal-box-header {
    background-color: #1a1a1a;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #333;
}

.terminal-dots {
    display: flex;
    gap: 0.5rem;
}
.terminal-dots span {
    width: 12px; height: 12px;
    border-radius: 50%;
    background-color: #444;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.3s ease;
}
.terminal-dots span:hover {
    transform: scale(1.2);
    opacity: 0.8;
}
.terminal-dots span:nth-child(1) { background-color: #ff5f56; }
.terminal-dots span:nth-child(2) { background-color: #ffbd2e; }
.terminal-dots span:nth-child(3) { background-color: #27c93f; }

.terminal-title {
    font-size: 0.75rem;
    color: #888;
    font-family: 'Courier New', monospace;
}

.terminal-box-body {
    padding: 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    height: 300px;
    max-height: 300px;
    color: #00ff00;
    background-color: #000;
    line-height: 1.4;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.terminal-box-body::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 60px;
    background: linear-gradient(to bottom, #000 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

#terminal-lines {
    margin-bottom: 0;
    position: relative;
}

.terminal-line {
    margin-bottom: 0.3rem;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
    color: #4ade80;
}
.terminal-line.term-command   { color: var(--accent-red); font-weight: 500; }
.terminal-line.term-success   { color: #4ade80; }
.terminal-line.term-process   { color: #60a5fa; }
.terminal-line.term-progress  { color: #fbbf24; }
.terminal-line.term-info      { color: #e5e5e5; }

@keyframes fadeIn {
    to { opacity: 1; }
}

.cursor {
    display: inline-block;
    width: 8px; height: 14px;
    background-color: #4ade80;
    animation: blink 1s infinite;
}
@keyframes blink {
    0%,50% { opacity: 1; }
    51%,100% { opacity: 0; }
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    padding: 6rem 0;
}
.section-header {
    margin-bottom: 3rem;
}
.section-line {
    height: 1px;
    background: linear-gradient(to right, var(--accent-red), transparent);
    margin-bottom: 1rem;
}
.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* ============================================
   PROJECTS GRID
   ============================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease !important;
    position: relative;
    overflow: hidden;
}
.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-red);
    transition: width 0.3s ease;
}
.project-card:hover {
    transform: translateY(-4px) !important;
    border-color: var(--accent-red);
    background-color: rgba(255,46,46,0.05);
    box-shadow: 0 8px 16px rgba(255,46,46,0.15);
}
.project-card:hover::before {
    width: 100%;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}
.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.project-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.project-metric {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-red);
    letter-spacing: -0.02em;
}

/* ============================================
   STACK ITEMS (used in categorized section)
   ============================================ */
.stack-item {
    background-color: rgba(18,18,18,0.6);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 0.65rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.stack-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-red);
    transition: width 0.3s ease;
}
.stack-item:hover {
    border-color: rgba(255,46,46,0.3);
    background-color: rgba(255,46,46,0.03);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,46,46,0.1);
}
.stack-item:hover::before {
    width: 100%;
}

/* ============================================
   EDUCATION & EXPERIENCE
   ============================================ */
.education-content,
.experience-content {
    max-width: 800px;
}
.education-item,
.experience-item {
    border-left: 2px solid var(--border-color);
    padding-left: 1.5rem;
    transition: border-color 0.3s ease;
}
.education-item:hover,
.experience-item:hover {
    border-left-color: var(--accent-red);
}
.education-degree,
.experience-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}
.education-school,
.experience-company {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}
.education-year,
.experience-year {
    font-size: 0.875rem;
    color: var(--accent-red);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}
.education-coursework {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-top: 1rem;
}
.education-coursework strong {
    color: var(--text-primary);
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact-content {
    max-width: 700px;
    margin: 0 auto;
}
.contact-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.contact-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background-color: rgba(18,18,18,0.6);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    min-height: 100px;
    position: relative;
    overflow: hidden;
}
.contact-link::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-red);
    transition: width 0.3s ease;
}
.contact-link:hover {
    border-color: rgba(255,46,46,0.3);
    background-color: rgba(255,46,46,0.03);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,46,46,0.1);
}
.contact-link:hover::before {
    width: 100%;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal.hidden {
    display: none;
}
.modal-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.9);
}
.modal-content {
    position: relative;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 3rem;
    z-index: 1001;
}
.modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    width: 40px; height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}
.modal-close:hover {
    color: var(--accent-red);
}
.modal-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.modal-section {
    margin-bottom: 2rem;
}
.modal-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-red);
    margin-bottom: 0.75rem;
}
.modal-section-content {
    color: var(--text-secondary);
    line-height: 1.7;
}
.modal-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}
.modal-link:hover {
    border-color: var(--accent-red);
    background-color: rgba(255,46,46,0.05);
}

/* ============================================
   TERMINAL EASTER EGG
   ============================================ */
.terminal-trigger-wrapper {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.terminal-trigger {
    width: 50px; height: 50px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.terminal-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}
.terminal-trigger:hover {
    border-color: var(--accent-red);
    background-color: rgba(255,46,46,0.05);
    transform: scale(1.1);
}
.terminal-trigger-wrapper:hover .terminal-label {
    color: var(--accent-red);
}

.terminal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.terminal-overlay.hidden {
    display: none;
}
.terminal-window {
    width: 95%;
    max-width: 900px;
    background-color: #0c0c0c;
    border: 1px solid rgba(255,46,46,0.3);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 15px rgba(255,46,46,0.1);
    animation: terminalIn 0.3s ease-out;
}
@keyframes terminalIn {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.terminal-header {
    background-color: #1a1a1a;
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #888;
}
.terminal-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px; height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}
.terminal-close:hover {
    color: var(--accent-red);
}
.terminal-body {
    padding: 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    min-height: 400px;
    max-height: 70vh;
    overflow-y: auto;
    color: #a0a0a0;
    line-height: 1.6;
    background-color: #000;
}
.terminal-body .terminal-line {
    margin-bottom: 0.4rem;
    color: #a0a0a0;
}
.terminal-body .terminal-line.term-welcome {
    color: #4ade80;
    font-weight: 600;
}
.terminal-prompt {
    color: var(--accent-red);
    margin-right: 0.5rem;
    font-weight: 600;
}
.terminal-input-line {
    display: flex;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #222;
}
.terminal-input {
    flex: 1;
    background: none;
    border: none;
    color: #4ade80;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    outline: none;
    padding: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .container { padding: 0 1.5rem; }
    .hero-name { font-size: 3.5rem; }
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .section { padding: 4rem 0; }
    .hero-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-areas: "top" "bottom" !important;
        gap: 2rem;
        padding-top: 1rem;
    }
    .hero-left  { grid-area: top !important; }
    .hero-right { grid-area: bottom !important; }
    .hero-name { font-size: 2.75rem; }
    .hero-tagline { font-size: 1rem; }

    .header-content {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }
    .header-nav {
        width: 100%;
        justify-content: center;
        gap: 1.5rem;
        overflow-x: auto;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .header-nav::-webkit-scrollbar { display: none; }
    .header-link { font-size: 0.8rem; }

    .projects-grid { grid-template-columns: 1fr; }
    .contact-links { grid-template-columns: 1fr; }
    .modal-content { padding: 1.5rem; margin: 1rem; max-height: 85vh; }
    .terminal-box { min-height: 300px; }
}

@media (max-width: 480px) {
    .hero-name { font-size: 2.25rem; }
    .section-title { font-size: 0.8rem; }
    .terminal-input-line { display: flex; flex-direction: row; align-items: center; gap: 0; }
    .terminal-input { width: auto; flex: 1; margin-left: 0.5rem; font-size: 0.85rem; }
    .terminal-prompt { font-size: 0.85rem; }
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}