/* ============================================
   CSS Variables & Reset
   ============================================ */
:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #141414;
    --bg-card: #1a1a1a;
    --bg-hover: #222222;

    --text-primary: #fafafa;
    --text-secondary: #a3a3a3;
    --text-muted: #525252;

    --accent: #22c55e;
    --accent-dim: rgba(34, 197, 94, 0.1);
    --accent-glow: rgba(34, 197, 94, 0.2);

    --border: #262626;
    --border-light: #333333;

    --font-mono: 'IBM Plex Mono', monospace;
    --font-sans: 'Space Grotesk', -apple-system, sans-serif;

    --sidebar-width: 280px;
    --transition: 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

::selection {
    background: var(--accent);
    color: var(--bg-primary);
}

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

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    z-index: 100;
}

.sidebar-header {
    margin-bottom: 3rem;
}

.logo {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all var(--transition);
    color: var(--text-secondary);
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-dim);
    color: var(--accent);
}

.nav-number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nav-item.active .nav-number {
    color: var(--accent);
}

.nav-text {
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar-footer {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all var(--transition);
}

.social-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ============================================
   Mobile Header
   ============================================ */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    align-items: center;
    justify-content: space-between;
    z-index: 200;
}

.mobile-header .logo {
    font-size: 1.5rem;
    margin: 0;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition);
}

.menu-toggle.active span:first-child {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:last-child {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-nav {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 150;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.mobile-nav.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-nav a {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color var(--transition);
}

.mobile-nav a:hover {
    color: var(--accent);
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.section {
    min-height: 100vh;
    padding: 6rem 4rem;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 4rem;
    align-content: start;
}

.section-about {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 4rem;
}

.section-label {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 6rem;
    align-self: start;
}

.label-number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
}

.label-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--accent), transparent);
}

.label-text {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.section-content {
    max-width: 800px;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
}

/* ============================================
   Hero / About Section
   ============================================ */
.section-about .section-content {
    max-width: 700px;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-title .highlight {
    color: var(--accent);
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

.stats-row {
    display: flex;
    gap: 3rem;
    margin-bottom: 2.5rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.cta-group {
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}

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

.btn-primary:hover {
    background: #16a34a;
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    border-color: var(--text-secondary);
}

/* ============================================
   Services Section
   ============================================ */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.service-item {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-primary);
    transition: background var(--transition);
}

.service-item:hover {
    background: var(--bg-secondary);
}

.service-number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    padding-top: 0.25rem;
}

.service-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.service-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   Tech Stack Section
   ============================================ */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.stack-category h3 {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.stack-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stack-list li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
    transition: color var(--transition);
}

.stack-list li:hover {
    color: var(--text-primary);
}

/* ============================================
   Projects Section
   ============================================ */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.project-item {
    padding: 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all var(--transition);
}

.project-item:hover {
    border-color: var(--border-light);
    transform: translateX(4px);
}

.project-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.project-category {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.project-year {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.project-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-stack span {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* Project Expandable Details */
.project-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.project-item.expanded .project-details {
    max-height: 500px;
    transition: max-height 0.4s ease-in;
}

.project-details-content {
    padding-top: 1.5rem;
    margin-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.detail-section {
    margin-bottom: 1.25rem;
}

.detail-section:last-of-type {
    margin-bottom: 1rem;
}

.detail-section h4 {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.detail-section p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.detail-section ul {
    list-style: none;
    padding: 0;
}

.detail-section li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 1rem;
    position: relative;
    margin-bottom: 0.35rem;
}

.detail-section li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-family: var(--font-mono);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    padding: 0.5rem 0.75rem;
    background: var(--accent-dim);
    border-radius: 4px;
    transition: all var(--transition);
}

.project-link:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

.project-link-private {
    color: var(--text-muted);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    cursor: default;
}

.project-link-private:hover {
    background: var(--bg-primary);
    color: var(--text-muted);
}

.project-expand-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.5rem 0;
    background: none;
    border: none;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition);
}

.project-expand-btn:hover {
    color: var(--accent);
}

.expand-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.project-item.expanded .expand-icon {
    transform: rotate(180deg);
}

.project-item.expanded .expand-text {
    color: var(--accent);
}

.project-item.expanded .project-expand-btn .expand-text::after {
    content: "Hide Details";
}

.project-item.expanded .project-expand-btn .expand-text {
    font-size: 0;
}

.project-item.expanded .project-expand-btn .expand-text::after {
    font-size: 0.75rem;
}

/* ============================================
   Contact Section
   ============================================ */
.contact-intro {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.875rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    transition: all var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-primary);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23525252' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-submit {
    width: auto;
    justify-self: start;
}

.btn-submit svg {
    width: 16px;
    height: 16px;
}

.contact-alt {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.contact-alt > p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.contact-methods {
    display: flex;
    gap: 1.5rem;
}

.contact-method {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all var(--transition);
}

.contact-method:hover {
    border-color: var(--accent);
}

.method-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.method-value {
    font-size: 0.9rem;
    color: var(--accent);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    padding: 3rem 4rem;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.footer-location {
    font-family: var(--font-mono);
    font-size: 0.75rem !important;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1200px) {
    .section {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 4rem 3rem;
    }

    .section-label {
        flex-direction: row;
        align-items: center;
        position: static;
    }

    .label-line {
        width: 60px;
        height: 1px;
        background: linear-gradient(to right, var(--accent), transparent);
    }

    .label-text {
        writing-mode: horizontal-tb;
        transform: none;
    }
}

@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .mobile-header {
        display: flex;
    }

    .mobile-nav {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding-top: 60px;
    }

    .section {
        padding: 3rem 1.5rem;
        min-height: auto;
    }

    .section-about {
        min-height: calc(100vh - 60px);
        justify-content: center;
    }

    .contact-form {
        grid-template-columns: 1fr;
    }

    .contact-methods {
        flex-direction: column;
    }

    .footer {
        padding: 2rem 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 2rem;
    }

    .stats-row {
        gap: 2rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .cta-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

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