/* ============================================
   Brian Law - Personal Homesite
   Dark Navy + Teal Accent Theme
   ============================================ */

/* --- Custom Properties --- */
:root {
    --bg-dark: #0a192f;
    --bg-light: #112240;
    --bg-lighter: #233554;
    --accent: #64ffda;
    --accent-tint: rgba(100, 255, 218, 0.1);
    --text-primary: #ccd6f6;
    --text-secondary: #8892b0;
    --text-heading: #e6f1ff;
    --white: #e6f1ff;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    --nav-height: 70px;
    --transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-sans);
    background: var(--bg-dark);
    color: var(--text-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

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

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

/* --- Navigation --- */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    transition: var(--transition);
}

#navbar.scrolled {
    box-shadow: 0 10px 30px -10px rgba(2, 12, 27, 0.7);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 2px;
}

.logo-bracket {
    color: var(--accent);
    font-weight: 300;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-primary);
    transition: var(--transition);
}

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

.nav-number {
    color: var(--accent);
    font-size: 0.75rem;
    margin-right: 4px;
}

.nav-resume-btn {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 8px 16px;
    border-radius: 4px;
    transition: var(--transition);
}

.nav-resume-btn:hover {
    background: var(--accent-tint);
}

/* Hamburger */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 200;
}

.hamburger span {
    display: block;
    width: 28px;
    height: 2px;
    background: var(--accent);
    margin: 6px 0;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 400px;
    height: 100vh;
    background: var(--bg-light);
    z-index: 150;
    transition: right 0.3s ease;
    padding: 100px 40px;
}

.mobile-menu.open {
    right: 0;
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

.mobile-menu-links a {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-primary);
}

/* --- Side Elements --- */
.side-element {
    position: fixed;
    bottom: 0;
    z-index: 50;
}

.side-left {
    left: 30px;
}

.side-right {
    right: 30px;
}

.social-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.social-links a {
    color: var(--text-secondary);
    transition: var(--transition);
    padding: 8px;
}

.social-links a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.side-line {
    width: 1px;
    height: 90px;
    background: var(--text-secondary);
    margin: 20px auto 0;
}

.side-email {
    writing-mode: vertical-rl;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
    letter-spacing: 1.5px;
    padding: 8px;
}

.side-email:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 150px;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-content {
    max-width: 700px;
}

.hero-greeting {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 16px;
}

.hero-name {
    font-size: clamp(40px, 8vw, 72px);
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.1;
    margin-bottom: 8px;
}

.hero-tagline {
    font-size: clamp(32px, 6vw, 56px);
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1.1;
    margin-bottom: 24px;
}

.hero-description {
    font-size: 1.1rem;
    max-width: 540px;
    margin-bottom: 40px;
    line-height: 1.7;
}

.hero-cta {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 16px 32px;
    border-radius: 4px;
    display: inline-block;
    transition: var(--transition);
}

.hero-cta:hover {
    background: var(--accent-tint);
}

/* --- Fade Up Animation --- */
.fade-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.5s ease forwards;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll-triggered animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Sections --- */
.section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 100px 150px;
}

.section-heading {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 40px;
    white-space: nowrap;
}

.section-heading::after {
    content: '';
    display: block;
    width: 300px;
    height: 1px;
    background: var(--bg-lighter);
    margin-left: 20px;
}

.section-number {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--accent);
    margin-right: 10px;
}

/* --- About Section --- */
.about-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 50px;
    align-items: start;
}

.about-text p {
    margin-bottom: 16px;
    font-size: 1rem;
    line-height: 1.7;
}

.skills-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 16px;
    list-style: none;
    margin-top: 16px;
}

.skills-list li {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-primary);
    padding-left: 20px;
    position: relative;
}

.skills-list li::before {
    content: '\25B8';
    color: var(--accent);
    position: absolute;
    left: 0;
}

.about-image {
    display: flex;
    justify-content: center;
}

.image-wrapper {
    position: relative;
    width: 250px;
    height: 250px;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    background: var(--accent-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-mono);
    position: relative;
    z-index: 2;
    transition: var(--transition);
}

.image-wrapper:hover .image-placeholder {
    transform: translate(-4px, -4px);
}

.image-border {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent);
    border-radius: 4px;
    z-index: 1;
    transition: var(--transition);
}

.image-wrapper:hover .image-border {
    top: 12px;
    left: 12px;
}

/* --- Experience Section --- */
.experience-container {
    display: flex;
    gap: 30px;
}

.exp-tabs {
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 160px;
}

.exp-tab {
    background: none;
    border: none;
    border-left: 2px solid var(--bg-lighter);
    padding: 12px 20px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    transition: var(--transition);
}

.exp-tab:hover {
    background: var(--accent-tint);
    color: var(--accent);
}

.exp-tab.active {
    color: var(--accent);
    border-left-color: var(--accent);
}

.exp-panel {
    display: none;
}

.exp-panel.active {
    display: block;
}

.exp-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-heading);
    margin-bottom: 4px;
}

.exp-company a {
    color: var(--accent);
}

.exp-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.exp-list {
    list-style: none;
}

.exp-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.exp-list li::before {
    content: '\25B8';
    color: var(--accent);
    position: absolute;
    left: 0;
    top: 2px;
}

/* --- Projects Section --- */
.featured-project {
    display: grid;
    grid-template-columns: 6fr 5fr;
    gap: 20px;
    align-items: center;
    margin-bottom: 80px;
}

.featured-project.reverse {
    grid-template-columns: 5fr 6fr;
}

.featured-project.reverse .project-content {
    order: 2;
    text-align: right;
}

.featured-project.reverse .project-image {
    order: 1;
}

.featured-project.reverse .project-tech {
    justify-content: flex-end;
}

.featured-project.reverse .project-links {
    justify-content: flex-end;
}

.project-overline {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 8px;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.project-title a {
    color: var(--text-heading);
    transition: var(--transition);
}

.project-title a:hover {
    color: var(--accent);
}

.project-description {
    background: var(--bg-light);
    padding: 24px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 0.95rem;
    line-height: 1.7;
    box-shadow: 0 10px 30px -15px rgba(2, 12, 27, 0.7);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    list-style: none;
    margin-bottom: 12px;
}

.project-tech li {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.project-links {
    display: flex;
    gap: 16px;
}

.project-links a {
    color: var(--text-primary);
    transition: var(--transition);
}

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

.project-image-placeholder {
    background: var(--bg-light);
    border-radius: 4px;
    padding: 30px;
    height: 100%;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bg-lighter);
    transition: var(--transition);
}

.project-image-placeholder:hover {
    border-color: var(--accent);
}

.code-block {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.code-comment { color: #546e7a; }
.code-keyword { color: #c792ea; }
.code-string { color: #c3e88d; }
.code-var { color: #82aaff; }
.code-num { color: #f78c6c; }

/* Other Projects Grid */
.other-projects-title {
    text-align: center;
    font-size: 1.4rem;
    color: var(--text-heading);
    margin-bottom: 40px;
    margin-top: 20px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.project-card {
    background: var(--bg-light);
    border-radius: 4px;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    cursor: default;
}

.project-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 20px 30px -15px rgba(2, 12, 27, 0.7);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.folder-icon {
    color: var(--accent);
}

.card-links {
    display: flex;
    gap: 12px;
}

.card-links a {
    color: var(--text-secondary);
    transition: var(--transition);
}

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

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 12px;
}

.card-description {
    font-size: 0.9rem;
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: 20px;
}

.card-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    list-style: none;
}

.card-tech li {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* --- Contact Section --- */
.contact-section {
    text-align: center;
    max-width: 600px;
    padding-top: 150px;
    padding-bottom: 150px;
}

.contact-overline {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 16px;
    display: block;
}

.contact-title {
    font-size: clamp(32px, 5vw, 50px);
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 20px;
}

.contact-description {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 40px;
}

.contact-btn {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 18px 50px;
    border-radius: 4px;
    display: inline-block;
    transition: var(--transition);
}

.contact-btn:hover {
    background: var(--accent-tint);
}

/* --- Footer --- */
footer {
    padding: 24px 0;
    text-align: center;
}

.footer-content p {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.footer-note {
    font-size: 0.7rem !important;
    color: var(--bg-lighter) !important;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .hero {
        padding: 0 80px;
    }

    .section {
        padding: 80px 80px;
    }

    .side-element {
        display: none;
    }

    .featured-project,
    .featured-project.reverse {
        grid-template-columns: 1fr;
    }

    .featured-project.reverse .project-content {
        order: 1;
        text-align: left;
    }

    .featured-project.reverse .project-image {
        order: 2;
    }

    .featured-project.reverse .project-tech,
    .featured-project.reverse .project-links {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 0 25px;
    }

    .section {
        padding: 60px 25px;
    }

    .nav-content {
        padding: 0 25px;
    }

    .nav-links {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .mobile-menu {
        display: block;
    }

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

    .about-image {
        order: -1;
    }

    .image-wrapper {
        width: 200px;
        height: 200px;
    }

    .experience-container {
        flex-direction: column;
    }

    .exp-tabs {
        flex-direction: row;
        overflow-x: auto;
        min-width: 0;
    }

    .exp-tab {
        border-left: none;
        border-bottom: 2px solid var(--bg-lighter);
    }

    .exp-tab.active {
        border-left: none;
        border-bottom-color: var(--accent);
    }

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

    .section-heading::after {
        width: 100%;
    }

    .contact-section {
        padding-top: 80px;
        padding-bottom: 80px;
    }
}

@media (max-width: 480px) {
    .hero-name {
        font-size: 36px;
    }

    .hero-tagline {
        font-size: 28px;
    }

    .skills-list {
        grid-template-columns: 1fr;
    }
}