/* ===========================================
   AZHAN ARIF — PORTFOLIO STYLESHEET
   =========================================== */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* ===========================================
   1. CUSTOM PROPERTIES
   =========================================== */
:root {
    --bg:         #1C1C1E;
    --text:       #F2F0EF;
    --gray:       #BBBDBC;
    --teal:       #245F73;
    --teal-light: #5BB8D4;
    --rust:       #733E24;
    --rust-light: #C4764E;
    --black:      #111111;
    --white:      #ffffff;
    --card:       #2A2A2E;

    --font-body:    'Inter', sans-serif;
    --font-display: 'Outfit', sans-serif;
}

/* ===========================================
   2. RESET & BASE
   =========================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.section {
    position: relative;
    width: 100%;
}

/* ===========================================
   3. SCROLL PROGRESS LINE
   =========================================== */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 24px;
    width: 50px;
    height: 100vh;
    z-index: 100;
    pointer-events: none;
}

#scroll-path {
    fill: none;
    stroke: var(--rust-light);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ===========================================
   4. NAVIGATION
   =========================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 3rem;
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
}

.nav.scrolled {
    background-color: rgba(28, 28, 30, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text);
    letter-spacing: -0.03em;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-link {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--rust);
    transition: width 0.3s ease;
}

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

.nav-link:hover::after {
    width: 100%;
}

/* Hamburger toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text);
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

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

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

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

/* ===========================================
   5. HERO SECTION
   =========================================== */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    background-color: var(--bg);
}

.hero-bg-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(7rem, 20vw, 22rem);
    color: var(--text);
    opacity: 0.05;
    letter-spacing: 0.06em;
    white-space: nowrap;
    z-index: 1;
    user-select: none;
    pointer-events: none;
    animation: hero-breathe 10s ease-in-out infinite;
}

@keyframes hero-breathe {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50%      { transform: translate(-50%, -50%) scale(1.03); }
}

.hero-image-container {
    position: relative;
    z-index: 2;
    max-width: 650px;
    width: 85%;
    max-height: 82vh;
    margin: 0 auto;
    background-color: transparent;
}

.hero-image-container img {
    width: 100%;
    max-width: 650px;
    height: auto;
    max-height: 82vh;
    display: block;
    object-fit: contain;
    background-color: transparent;
}

/* Side text flanking the image */
.hero-side-text {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    pointer-events: none;
}

.hero-side-text span {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.4rem, 3.5vw, 3.2rem);
    color: var(--text);
    letter-spacing: -0.02em;
    text-transform: uppercase;
    writing-mode: vertical-lr;
    text-orientation: mixed;
}

.hero-side-left {
    left: 6%;
}

.hero-side-left span {
    transform: rotate(180deg);
}

.hero-side-right {
    right: 6%;
}

/* Scroll-down cue */
.hero::after {
    content: '↓';
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.4rem;
    color: var(--text);
    opacity: 0.4;
    animation: bounce-down 2s ease-in-out infinite;
    z-index: 5;
}

@keyframes bounce-down {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(8px); }
}

/* ===========================================
   6. ABOUT SECTION
   =========================================== */
.about-section {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background-color: var(--bg);
    overflow: hidden;
    display: flex;
    align-items: center;
}

#network-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.about-content {
    position: relative;
    z-index: 2;
    padding-left: 10%;
    padding-right: 5%;
    max-width: 650px;
}

.about-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    color: var(--text);
    letter-spacing: -0.03em;
    margin-bottom: 0.4rem;
    line-height: 1.15;
}

.about-subtitle {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2.5vw, 1.8rem);
    font-weight: 600;
    color: var(--rust-light);
    margin-bottom: 1.5rem;
    min-height: 1.5em;
}

.cursor {
    font-weight: bold;
    color: var(--rust-light);
    animation: blink 1s step-end infinite;
}

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

.about-description {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text);
    opacity: 0.75;
    max-width: 520px;
}

/* ===========================================
   7. SKILLS SECTION
   =========================================== */
.skills-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7rem 2rem;
    min-height: 80vh;
    background-color: var(--bg);
}

.skills-container {
    max-width: 880px;
    width: 100%;
}

.section-heading {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
    text-align: center;
}

.interests-note {
    font-size: 0.6em;
    font-weight: 400;
    opacity: 0.65;
    font-style: italic;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.9rem;
    margin-bottom: 3.5rem;
}

.skill-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.05rem 2.4rem;
    border-radius: 999px;
    background-color: var(--gray);
    color: var(--black);
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.015em;
    cursor: default;
    user-select: none;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.25s ease;
}

.skill-pill:hover {
    background-color: var(--black);
    color: var(--gray);
    transform: scale(1.06);
}

/* Interests pills — same look, identical behavior */
.interest-pill {
    border: 1px dashed rgba(196, 118, 78, 0.5);
}

/* ===========================================
   8. PROJECTS SECTION
   =========================================== */
.projects-section {
    padding: 7rem 2rem 6rem;
    background-color: var(--bg);
}

.projects-section .section-heading {
    margin-bottom: 4rem;
}

.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Central vertical line */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: rgba(187, 189, 188, 0.35);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.timeline-item.left {
    padding-right: 3.5rem;
    text-align: right;
}

.timeline-item.right {
    margin-left: 50%;
    padding-left: 3.5rem;
    text-align: left;
}

/* Timeline dot on the centre line */
.timeline-item::before {
    content: '';
    position: absolute;
    top: 2rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--rust);
    border: 3px solid var(--bg);
    z-index: 2;
}

.timeline-item.left::before {
    right: -7px;
}

.timeline-item.right::before {
    left: -7px;
}

/* Mac-style window card */
.mac-window {
    background-color: var(--card);
    border: 1px solid rgba(187, 189, 188, 0.18);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.35s ease;
}

.mac-window:hover {
    transform: translateY(-5px);
}

.mac-titlebar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 14px;
    background-color: var(--black);
}

.mac-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mac-dot.red    { background-color: #FF5F57; }
.mac-dot.yellow { background-color: #FEBC2E; }
.mac-dot.green  { background-color: #28C840; }

.mac-title {
    margin-left: 8px;
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.03em;
}

.mac-content {
    padding: 1.5rem;
    text-align: left;
}

.mac-content h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.65rem;
    letter-spacing: -0.015em;
}

.mac-content p {
    font-size: 0.85rem;
    line-height: 1.75;
    color: var(--text);
    opacity: 0.7;
}

/* ===========================================
   9. CONTACT SECTION
   =========================================== */
.contact-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 5rem 2rem;
    background-color: var(--teal);
    overflow: hidden;
}

.contact-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 960px;
    gap: 1rem;
}

.contact-hand {
    flex: 0 1 220px;
    color: var(--text);
    opacity: 0.2;
}

.contact-hand-right {
    transform: scaleX(-1);
}

.contact-content {
    text-align: center;
    z-index: 2;
    padding: 2rem 1.5rem;
    flex: 0 1 420px;
}

.contact-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.contact-subtitle {
    font-size: 1rem;
    color: var(--text);
    opacity: 0.6;
    margin-bottom: 2.25rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.7rem 1.6rem;
    border: 1px solid rgba(242, 240, 239, 0.25);
    border-radius: 999px;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.25s ease;
    white-space: nowrap;
}

.contact-link:hover {
    background-color: rgba(242, 240, 239, 0.12);
    border-color: rgba(242, 240, 239, 0.6);
    transform: translateY(-2px);
}

.contact-link svg {
    flex-shrink: 0;
}

/* ===========================================
   10. FOOTER
   =========================================== */
.footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--black);
    color: rgba(242, 240, 239, 0.4);
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

/* ===========================================
   11. RESPONSIVE — MOBILE
   =========================================== */
@media (max-width: 768px) {
    /* Nav */
    .nav {
        padding: 1rem 1.5rem;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 72%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--card);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2.25rem;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 1px solid rgba(187, 189, 188, 0.2);
    }

    .nav-links.open {
        right: 0;
    }

    /* Hero */
    .hero-bg-text {
        font-size: clamp(4rem, 22vw, 9rem);
    }

    .hero-side-text {
        display: none;
    }

    .hero-image-container {
        width: 65%;
        max-height: 65vh;
    }

    .hero-image-container img {
        max-height: 65vh;
    }

    /* About */
    .about-content {
        padding: 0 6%;
    }

    /* Timeline collapse to single column */
    .timeline-line {
        left: 16px;
    }

    .timeline-item,
    .timeline-item.left,
    .timeline-item.right {
        width: 100%;
        margin-left: 0;
        padding-left: 48px;
        padding-right: 0.75rem;
        text-align: left;
    }

    .timeline-item.left::before,
    .timeline-item.right::before {
        left: 10px;
        right: auto;
    }

    /* Contact */
    .contact-hand {
        display: none;
    }

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

    /* Scroll line */
    #scroll-progress {
        left: 8px;
        width: 28px;
    }
}

@media (max-width: 480px) {
    .hero-bg-text {
        font-size: clamp(3.5rem, 25vw, 6rem);
    }

    .about-title {
        font-size: 1.8rem;
    }

    .section-heading {
        font-size: 1.5rem;
    }

    .skill-pill {
        padding: 0.75rem 1.5rem;
        font-size: 0.92rem;
    }
}
