﻿/* --- CSS RESET --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base Body Styles */
html,
body {
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    background-color: #FAF7F2;
    /* Very faint warm dot-matrix pattern */
    background-image: radial-gradient(#d9cfc5 1px, transparent 1px);
    background-size: 16px 16px;
    color: #1F2937;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

/* Typography Constraints */
h1,
h2,
h3,
h4,
h5,
h6,
.nav-logo {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
}

ul {
    list-style: none;
}

a {
    color: #1F2937;
    text-decoration: none;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

/* --- NAVIGATION --- */
#navbar {
    position: sticky;
    top: 0;
    background-color: #FAF7F2;
    border-bottom: 2px solid #1F2937;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 0;
}

.nav-logo {
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 2px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: #1F2937;
    bottom: -2px;
    left: 0;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a:focus::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* --- BUTTONS --- */
.btn {
    display: inline-block;
    background-color: #1F2937;
    color: #FAF7F2;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.8rem 1.5rem;
    border: 2px solid #1F2937;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

.btn:hover,
.btn:focus {
    background-color: #FAF7F2;
    border-color: #1F2937;
    color: #1F2937;
}

.btn-block {
    display: block;
    width: 100%;
}

/* --- SECTIONS --- */
.section {
    padding: 6rem 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    word-break: break-word;
    /* Prevent long words like INITIALIZE_CONTACT from breaking layout */
    hyphens: auto;
}

.section-title::after {
    content: '';
    display: block;
    width: 50%;
    height: 4px;
    background-color: #B45309;
    margin-top: 5px;
}

/* --- HERO SECTION --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 5%;
    margin-top: -65px;
    overflow: hidden;
}

.hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    gap: 2rem;
}

/* Hero content fades up on load */
.hero-content {
    max-width: 600px;
    flex: 1;
    opacity: 0;
    transform: translateY(30px);
    animation: heroFadeUp 0.9s ease forwards;
    animation-delay: 0.2s;
}

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

/* Photo slides in from right */
.hero-photo-wrapper {
    flex-shrink: 0;
    width: 340px;
    height: 420px;
    border: 4px solid #1F2937;
    box-shadow: 10px 10px 0px #1F2937;
    overflow: hidden;
    align-self: flex-end;
    position: relative;
    bottom: -30px;
    opacity: 0;
    transform: translateX(60px);
    animation: heroSlideIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: 0.5s;
    cursor: pointer;
}

@keyframes heroSlideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Corner accent decoration */
.hero-photo-wrapper::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    width: 40px;
    height: 40px;
    border-top: 4px solid #B45309;
    border-left: 4px solid #B45309;
    z-index: 3;
    pointer-events: none;
}

.hero-photo-wrapper::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 40px;
    height: 40px;
    border-bottom: 4px solid #B45309;
    border-right: 4px solid #B45309;
    z-index: 3;
    pointer-events: none;
}

.hero-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s ease;
    filter: contrast(1.05) brightness(1.02);
    max-width: 100%;
}

/* Hover: zoom + glow */
.hero-photo-wrapper:hover .hero-photo {
    transform: scale(1.06);
    filter: contrast(1.1) brightness(1.05) saturate(1.1);
}

/* Amber glow overlay on hover */
.hero-photo-wrapper .photo-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(180, 83, 9, 0.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
    pointer-events: none;
}

.hero-photo-wrapper:hover .photo-glow {
    opacity: 1;
}

/* Scan-line shimmer on hover */
.hero-photo-wrapper .photo-scanline {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 3px,
            rgba(0, 0, 0, 0.04) 3px,
            rgba(0, 0, 0, 0.04) 4px);
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hero-photo-wrapper:hover .photo-scanline {
    opacity: 1;
}

@media (max-width: 768px) {
    .hero {
        padding-top: 5rem;
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
    }

    .hero-inner {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 3rem;
    }

    .hero-photo-wrapper {
        width: 250px;
        height: 310px;
        align-self: center;
        margin-bottom: 2rem;
        bottom: 0;
    }

    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

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

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 5rem);
    margin-bottom: 1rem;
    line-height: 1.1;
    min-height: 6rem;
    /* Prevents layout jump when text types */
}

/* Typing cursor */
#typewriter {
    border-right: 4px solid #B45309;
    white-space: pre-wrap;
    animation: blink-cursor 0.8s step-end infinite;
}

@keyframes blink-cursor {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: #B45309;
    }
}

.hero .subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    font-family: 'Space Mono', monospace;
    color: #6B5E4E;
}

/* --- ABOUT SECTION --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: flex-start;
}

@media (min-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.profile-pic-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 4px solid #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f4f4f4;
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    color: #000000;
    text-align: center;
    padding: 1rem;
    /* Diagonal striped background constraint */
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, #e0e0e0 10px, #e0e0e0 20px);
}

.bio p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* --- PROJECTS SECTION --- */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.project-card {
    border: 3px solid #1F2937;
    display: flex;
    flex-direction: column;
    background-color: #FFFDF9;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 8px 8px 0px #1F2937;
}

.project-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-bottom: 3px solid #1F2937;
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
    transition: transform 0.4s ease;
}

.project-card:hover .project-thumbnail img {
    transform: scale(1.05);
}

.project-img-placeholder {
    width: 100%;
    height: 200px;
    border-bottom: 3px solid #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    color: #000000;
    background-image: repeating-linear-gradient(-45deg, transparent, transparent 10px, #e0e0e0 10px, #e0e0e0 20px);
}

.project-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    letter-spacing: 0;
}

.project-info p {
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-tag {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 3px;
    border: 2px solid #1F2937;
    display: inline-block;
    padding: 0.2rem 0.5rem;
    width: fit-content;
    margin-bottom: 0.75rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

/* --- SKILLS SECTION --- */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.skill-badge {
    border: 2px solid #1F2937;
    padding: 0.5rem 1rem;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
    background-color: #FAF7F2;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.skill-badge:hover {
    background-color: #1F2937;
    border-color: #1F2937;
    color: #FAF7F2;
}

/* --- CONTACT SECTION --- */
.contact-form {
    max-width: 600px;
    border: 4px solid #1F2937;
    padding: 2rem;
    background-color: #FFFDF9;
    box-shadow: 12px 12px 0px #1F2937;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #000000;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    background-color: transparent;
    /* Makes background match the pixel dots outside, though it's inside a white box */
    transition: outline 0.2s ease, background-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    background-color: #FAF7F2;
    border-color: #1F2937;
    box-shadow: 4px 4px 0px #1F2937;
}

.form-group textarea {
    resize: vertical;
}

.btn-submit {
    width: 100%;
    font-size: 1.1rem;
}

/* --- FOOTER --- */
.footer {
    border-top: 2px solid #1F2937;
    padding: 2rem 0;
    background-color: #F0EBE3;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.footer-links a:hover {
    background-color: #1F2937;
    color: #FAF7F2;
    text-decoration: none;
}

/* --- CERTIFICATIONS & ACHIEVEMENTS SECTION --- */
.sub-section-label {
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #000;
    padding-bottom: 0.5rem;
}

/* Achievement Cards Grid */
.achievements-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .achievements-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

.achievement-card {
    border: 3px solid #1F2937;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background-color: #FFFDF9;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.achievement-card:hover {
    transform: translateY(-4px);
    box-shadow: 6px 6px 0px #1F2937;
}

/* Featured card â€” dark */
.achievement-card--featured {
    background-color: #1F2937;
    color: #FAF7F2;
    border-color: #1F2937;
}

.achievement-card--featured h4,
.achievement-card--featured p {
    color: #FAF7F2;
}

.achievement-tag {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 3px;
    border: 2px solid currentColor;
    display: inline-block;
    padding: 0.2rem 0.5rem;
    width: fit-content;
}

.achievement-card h4 {
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    text-transform: uppercase;
}

.achievement-card p {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Flat certifications list */
.cert-list-flat {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 768px) {
    .cert-list-flat {
        grid-template-columns: 1fr 1fr;
    }
}

.cert-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid #000;
    font-size: 0.95rem;
}

.cert-bullet {
    font-size: 0.55rem;
    margin-top: 5px;
    flex-shrink: 0;
}

/* --- GITHUB ICON IN NAVBAR --- */
.nav-social-icons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-github {
    display: flex;
    align-items: center;
    color: #1F2937;
    transition: opacity 0.2s ease;
}

.nav-github:hover {
    opacity: 0.6;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* simple fallback for tiny screens */
    }

    .hero h1 {
        min-height: 8rem;
        /* accomodate word wrap */
    }

    .section-title {
        font-size: 1.7rem;
        /* Make titles dramatically smaller for narrow screens */
        margin-bottom: 2rem;
    }

    .section-title::after {
        width: 100px;
    }

    .container {
        width: 95%;
        /* Give a bit more breathing room on mobile */
    }

    .achievement-card {
        padding: 1rem;
        /* Smaller padding on phones to save space */
    }

    .achievement-tag {
        font-size: 0.6rem;
        letter-spacing: 1px;
    }

    .skill-badge {
        font-size: 0.7rem;
        padding: 0.5rem 0.8rem;
    }
}

/* --- BACK TO TOP BUTTON --- */
#back-to-top {
    position: relative;
    width: 48px;
    height: 48px;
    background-color: #1F2937;
    color: #FAF7F2;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    margin-top: -10px;
    /* Moves it slightly up in the white space */
    transition: opacity 0.3s ease, background-color 0.2s;
}

#back-to-top.visible {
    opacity: 1;
}

#back-to-top:hover {
    background-color: #B45309;
}

/* --- DARK MODE TOGGLE BUTTON --- */
.dark-toggle {
    background: none;
    border: 2px solid #1F2937;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1F2937;
    transition: background-color 0.2s, color 0.2s;
}

.dark-toggle:hover {
    background-color: #1F2937;
    color: #FAF7F2;
}

/* --- DARK MODE --- */
body.dark {
    background-color: #0d0d0d;
    background-image: radial-gradient(#2a2a2a 1px, transparent 1px);
    color: #FAF7F2;
}

body.dark a {
    color: #FAF7F2;
}

body.dark #navbar {
    background-color: #111;
    border-bottom-color: #FAF7F2;
}

body.dark .nav-logo,
body.dark .nav-links a,
body.dark .nav-github {
    color: #FAF7F2;
}

body.dark .dark-toggle {
    border-color: #FAF7F2;
    color: #FAF7F2;
}

body.dark .dark-toggle:hover {
    background-color: #FAF7F2;
    color: #0d0d0d;
}

body.dark .hero .subtitle {
    color: #b0a090;
}

body.dark .section-title {
    color: #FAF7F2;
}

body.dark .project-card,
body.dark .achievement-card,
body.dark .contact-form,
body.dark .skill-badge {
    background-color: #1a1a1a;
    border-color: #FAF7F2;
    color: #FAF7F2;
}

body.dark .project-info h3,
body.dark .project-info p,
body.dark .bio p,
body.dark .achievement-card p,
body.dark .achievement-card h4,
body.dark .cert-item {
    color: #FAF7F2;
}

body.dark .achievement-card--featured {
    background-color: #FAF7F2;
    color: #0d0d0d;
    border-color: #FAF7F2;
}

body.dark .achievement-card--featured h4,
body.dark .achievement-card--featured p {
    color: #0d0d0d;
}

body.dark .footer {
    background-color: #111;
    border-top-color: #FAF7F2;
}

body.dark .footer-content p,
body.dark .footer-links a {
    color: #FAF7F2;
}

body.dark .footer-links a:hover {
    background-color: #FAF7F2;
    color: #0d0d0d;
}

body.dark .form-group input,
body.dark .form-group textarea {
    background-color: #1a1a1a;
    border-color: #FAF7F2;
    color: #FAF7F2;
}

body.dark .sub-section-label {
    border-bottom-color: #FAF7F2;
}

body.dark .cert-item {
    border-color: #444;
}

body.dark .btn {
    background-color: #FAF7F2;
    color: #0d0d0d;
    border-color: #FAF7F2;
}

body.dark .btn:hover {
    background-color: #0d0d0d;
    color: #FAF7F2;
}

body.dark #back-to-top {
    background-color: #FAF7F2;
    color: #0d0d0d;
}

/* =============================================
   CUSTOM CURSOR — Circle Design
   ============================================= */

*,
*::before,
*::after {
    cursor: none !important;
}

/* Inner dot — tiny filled circle */
#cursor-dot {
    position: fixed;
    width: 5px;
    height: 5px;
    background-color: #1F2937;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: width 0.15s ease, height 0.15s ease,
        background-color 0.15s ease, opacity 0.15s ease;
}

/* Outer ring — thin circle, lags */
#cursor-ring {
    position: fixed;
    width: 30px;
    height: 30px;
    border: 1.5px solid #1F2937;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: width 0.35s ease, height 0.35s ease,
        border-color 0.2s ease, opacity 0.2s ease,
        background-color 0.2s ease;
    opacity: 0.45;
}

/* Hover — ring expands + amber accent */
body.cursor-hover #cursor-ring {
    width: 46px;
    height: 46px;
    border-color: #B45309;
    opacity: 0.9;
    background-color: rgba(180, 83, 9, 0.04);
}

body.cursor-hover #cursor-dot {
    width: 4px;
    height: 4px;
    background-color: #B45309;
    opacity: 0.8;
}

/* Click — ring contracts sharply */
body.cursor-click #cursor-ring {
    width: 16px;
    height: 16px;
    border-color: #B45309;
    opacity: 1;
    transition: width 0.08s ease, height 0.08s ease, border-color 0.08s ease;
}

body.cursor-click #cursor-dot {
    width: 7px;
    height: 7px;
}

/* Dark mode */
body.dark #cursor-dot {
    background-color: #FAF7F2;
}

body.dark #cursor-ring {
    border-color: #FAF7F2;
}

body.dark.cursor-hover #cursor-ring {
    border-color: #B45309;
    background-color: rgba(180, 83, 9, 0.07);
}

body.dark.cursor-hover #cursor-dot {
    background-color: #B45309;
}

body.dark.cursor-click #cursor-ring {
    border-color: #B45309;
}


/* --- CURSOR TRAIL --- */
.trail-dot {
    position: fixed;
    width: 8px;
    height: 8px;
    background-color: #B45309;
    pointer-events: none;
    border-radius: 0;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: opacity 0.5s ease;
    opacity: 0.8;
}

body.dark .trail-dot {
    background-color: #FAF7F2;
}