/* ============================================
   ERJON BERISHA — Minimal 3D Portfolio
   Dark, spacious, let the experience breathe
   ============================================ */

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

:root {
    --black: #050505;
    --near-black: #0a0a0a;
    --dark: #111;
    --gray-800: #1a1a1a;
    --gray-600: #444;
    --gray-400: #777;
    --gray-200: #aaa;
    --white: #eee;
    --accent: #7c6aff;
    --accent-dim: rgba(124, 106, 255, 0.2);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 0;
}

body {
    font-family: var(--font);
    background: var(--black);
    color: var(--white);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ============================================
   NAV
   ============================================ */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 28px 48px;
    mix-blend-mode: difference;
    color: white;
    transition: all 0.5s var(--ease-out);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: white;
    transition: width 0.4s var(--ease-out);
}

.nav-links a:hover { opacity: 1; }
.nav-links a:hover::after { width: 100%; }

/* ============================================
   HERO — Three.js
   ============================================ */

.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
}

#three-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(5, 5, 5, 0.7) 0%,
        rgba(5, 5, 5, 0.1) 50%,
        rgba(5, 5, 5, 0.5) 100%
    );
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: absolute;
    bottom: 120px;
    left: 48px;
    z-index: 2;
    max-width: 600px;
}

.hero-label {
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 12px;
    animation: fadeUp 0.8s var(--ease-out) 0.3s both;
}

.hero-name {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 12px;
    animation: fadeUp 0.8s var(--ease-out) 0.5s both;
}

.hero-tagline {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 36px;
    animation: fadeUp 0.8s var(--ease-out) 0.7s both;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    background: white;
    color: var(--black);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0;
    transition: all 0.3s ease;
    animation: fadeUp 0.8s var(--ease-out) 0.9s both;
}

.hero-cta:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

.hero-scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: fadeUp 0.8s var(--ease-out) 1.2s both;
}

.hero-scroll span {
    display: block;
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 1; transform: scaleY(1); }
    50% { opacity: 0.2; transform: scaleY(0.6); }
}

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

/* ============================================
   SECTION LABEL
   ============================================ */

.section-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 60px;
    padding: 0 48px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.label-number {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    font-feature-settings: 'tnum';
}

.label-text {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--gray-600);
}

.label-text::after {
    content: '';
    display: inline-block;
    width: 32px;
    height: 1px;
    background: var(--gray-800);
    margin-left: 12px;
    vertical-align: middle;
}

/* ============================================
   DRAWING CANVAS
   ============================================ */

.draw {
    padding: 120px 48px 100px;
    background: var(--near-black);
}

.draw-container {
    max-width: 800px;
    margin: 0 auto;
}

.draw-hint {
    font-size: 0.875rem;
    color: var(--gray-400);
    margin-bottom: 24px;
    text-align: center;
}

.canvas-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--black);
    border: 1px solid var(--gray-800);
    cursor: crosshair;
    position: relative;
    overflow: hidden;
}

#draw-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.draw-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.color-picker {
    display: flex;
    gap: 8px;
}

.color-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.color-btn:hover {
    transform: scale(1.15);
}

.color-btn.active {
    border-color: white;
    box-shadow: 0 0 12px rgba(124, 106, 255, 0.3);
}

.size-picker {
    display: flex;
    gap: 4px;
    background: var(--dark);
    border-radius: 4px;
    padding: 4px;
}

.size-btn {
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font);
    background: transparent;
    color: var(--gray-400);
    border: none;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.size-btn.active {
    background: var(--accent);
    color: white;
}

.size-btn:hover:not(.active) {
    color: var(--white);
}

.clear-btn {
    padding: 8px 24px;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: var(--font);
    background: transparent;
    color: var(--gray-400);
    border: 1px solid var(--gray-800);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 2px;
}

.clear-btn:hover {
    color: #ff6b6b;
    border-color: #ff6b6b;
}

/* ============================================
   ABOUT
   ============================================ */

.about {
    padding: 120px 48px;
    max-width: 1200px;
    margin: 0 auto;
}

.about-content {
    max-width: 600px;
}

.about-role {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.about-role strong {
    color: var(--accent);
    font-weight: 700;
}

.about-line {
    font-size: 1rem;
    color: var(--gray-400);
    line-height: 1.7;
    margin-bottom: 48px;
}

.about-metrics {
    display: flex;
    gap: 48px;
}

.metric {
    display: flex;
    flex-direction: column;
}

.metric-number {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--white);
    line-height: 1;
    margin-bottom: 4px;
}

.metric-label {
    font-size: 0.8125rem;
    color: var(--gray-600);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ============================================
   CONTACT
   ============================================ */

.contact {
    padding: 120px 48px 100px;
    background: var(--near-black);
}

.contact-content {
    max-width: 1200px;
    margin: 0 auto;
}

.contact-heading {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 32px;
}

.contact-email {
    display: inline-block;
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    font-weight: 600;
    color: var(--accent);
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease;
    margin-bottom: 40px;
}

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

.contact-social {
    display: flex;
    gap: 32px;
}

.social-link {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-400);
    transition: color 0.3s ease;
    position: relative;
}

.social-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s var(--ease-out);
}

.social-link:hover { color: var(--white); }
.social-link:hover::after { width: 100%; }

/* ============================================
   FOOTER
   ============================================ */

.footer {
    padding: 32px 48px;
    background: var(--near-black);
    border-top: 1px solid var(--dark);
}

.footer p {
    font-size: 0.8125rem;
    color: var(--gray-600);
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================
   SCROLL REVEAL
   ============================================ */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

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

/* ============================================
   RESPONSIVE — Tablet
   ============================================ */

@media (max-width: 768px) {
    .nav { padding: 20px 24px; }
    .nav-links { gap: 24px; }

    .hero-content {
        bottom: 80px;
        left: 24px;
        right: 24px;
    }

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

    .section-label {
        padding: 0 24px;
        margin-bottom: 40px;
    }

    .draw { padding: 80px 24px 60px; }
    .draw-controls { gap: 20px; }

    .about { padding: 80px 24px; }
    .about-metrics { gap: 32px; }

    .contact { padding: 80px 24px 60px; }
    .contact-social { gap: 24px; }
    .footer { padding: 24px; }
}

/* ============================================
   RESPONSIVE — Phone
   ============================================ */

@media (max-width: 480px) {
    .nav { padding: 16px 20px; }
    .nav-brand { font-size: 1.1rem; }
    .nav-links { gap: 16px; }
    .nav-links a { font-size: 0.8rem; }

    .hero-content {
        bottom: 60px;
        left: 20px;
        right: 20px;
    }

    .hero-name { font-size: 2.5rem; }
    .hero-tagline { font-size: 0.95rem; margin-bottom: 28px; }
    .hero-cta {
        padding: 16px 28px;
        font-size: 0.85rem;
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }
    .hero-scroll { display: none; }

    .section-label {
        padding: 0 20px;
        margin-bottom: 32px;
    }

    .draw { padding: 60px 20px 50px; }

    .canvas-wrapper {
        aspect-ratio: 4 / 3;
        min-height: 260px;
    }

    .draw-controls {
        gap: 16px;
        flex-direction: column;
        align-items: stretch;
    }

    .color-picker {
        justify-content: center;
        gap: 12px;
    }

    .color-btn {
        width: 36px;
        height: 36px;
    }

    .size-picker {
        justify-content: center;
    }

    .size-btn {
        padding: 10px 18px;
        font-size: 0.85rem;
        min-height: 40px;
    }

    .clear-btn {
        padding: 12px 24px;
        font-size: 0.85rem;
        min-height: 44px;
        text-align: center;
    }

    .about { padding: 60px 20px; }
    .about-role { font-size: 1.25rem; }
    .about-line { font-size: 0.9rem; }
    .about-metrics {
        gap: 20px;
        flex-wrap: wrap;
    }
    .metric-number { font-size: 1.75rem; }
    .metric-label { font-size: 0.7rem; }

    .contact { padding: 60px 20px 50px; }
    .contact-heading { font-size: 1.75rem; }
    .contact-email { font-size: 1rem; }
    .contact-social {
        gap: 20px;
        flex-wrap: wrap;
    }
    .social-link { font-size: 0.85rem; }

    .footer { padding: 20px; }
    .footer p { font-size: 0.75rem; }
}

/* ============================================
   RESPONSIVE — Small phones
   ============================================ */

@media (max-width: 360px) {
    .hero-name { font-size: 2rem; }
    .canvas-wrapper { aspect-ratio: 1 / 1; min-height: 220px; }
    .about-metrics { flex-direction: column; gap: 16px; }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--gray-800); }
::-webkit-scrollbar-thumb:hover { background: var(--gray-600); }

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