/* ============================================
   LEVAN — iOS Developer Portfolio
   Modern dark theme with accent colors
   ============================================ */

/* --- CSS Variables --- */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-tertiary: #1a1a24;
    --bg-card: #14141e;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent: #3b82f6;
    --accent-light: #60a5fa;
    --accent-dark: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --gradient-start: #3b82f6;
    --gradient-end: #8b5cf6;
    --border: #27272a;
    --border-light: #3f3f46;
    --success: #22c55e;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

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

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

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

ul {
    list-style: none;
}

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

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: all var(--transition);
}

.navbar.scrolled {
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-md);
}

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

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    transition: color var(--transition);
}

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

.logo-bracket {
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 400;
}

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

.nav-link {
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    position: relative;
}

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

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

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

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

.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);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 60px;
    position: relative;
    z-index: 1;
}

.hero-greeting {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 16px;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.2s;
}

.hero-name {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    min-height: 1.2em;
}

.typewriter {
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--gradient-end) 50%, var(--accent-light) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s ease-in-out infinite;
}

.cursor {
    display: inline-block;
    color: var(--accent);
    font-weight: 300;
    animation: blink 0.7s step-end infinite;
    margin-left: 2px;
    -webkit-text-fill-color: var(--accent);
}

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

@keyframes shimmer {
    0%, 100% { background-position: 200% 0; }
    50% { background-position: -200% 0; }
}

.hero-title {
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.6s;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.8s;
}

.hero-description strong {
    color: var(--accent-light);
    font-weight: 600;
}

.hero-cta {
    display: flex;
    gap: 16px;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 1s;
}

/* Phone Mockup */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.6s;
}

.phone-mockup {
    width: 272px;
    height: 572px;
    background: linear-gradient(145deg, #3a3a3c 0%, #2c2c2e 50%, #1c1c1e 100%);
    border-radius: 50px;
    padding: 2px;
    position: relative;
    box-shadow: 
        var(--shadow-lg),
        var(--shadow-glow),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.5);
    transform: perspective(1000px) rotateY(-5deg) rotateX(2deg);
    transition: transform 0.5s ease;
}

.phone-mockup:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

/* Side buttons */
.phone-mockup::before {
    content: '';
    position: absolute;
    right: -3px;
    top: 140px;
    width: 3px;
    height: 64px;
    background: linear-gradient(180deg, #3a3a3c, #2c2c2e);
    border-radius: 0 2px 2px 0;
}

.phone-mockup::after {
    content: '';
    position: absolute;
    left: -3px;
    top: 120px;
    width: 3px;
    height: 32px;
    background: linear-gradient(180deg, #3a3a3c, #2c2c2e);
    border-radius: 2px 0 0 2px;
}

.phone-frame {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 48px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Dynamic Island */
.dynamic-island {
    width: 120px;
    height: 34px;
    background: #000;
    border-radius: 20px;
    margin-top: 12px;
    position: relative;
    z-index: 10;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 14px;
}

.island-camera {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #1a3a5c 0%, #0a1a2e 60%, #000 100%);
    box-shadow: 
        inset 0 0 2px rgba(255, 255, 255, 0.08),
        0 0 1px rgba(0, 0, 0, 0.5);
}

.island-camera::after {
    content: '';
    position: absolute;
    top: 14px;
    right: 16px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(50, 100, 180, 0.3) 0%, transparent 70%);
}

.phone-screen {
    flex: 1;
    width: 100%;
    background: var(--bg-primary);
    padding: 20px 16px 20px 28px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-indicator {
    width: 130px;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    margin-bottom: 8px;
}

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

.code-keyword { color: #ff79c6; }
.code-class { color: #8be9fd; }
.code-string { color: #f1fa8c; }
.code-func { color: #50fa7b; }
.code-comment { color: #6272a4; font-style: italic; }

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 1.5s;
}

.scroll-indicator p {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.mouse {
    width: 24px;
    height: 38px;
    border: 2px solid var(--text-muted);
    border-radius: 12px;
    position: relative;
}

.wheel {
    width: 3px;
    height: 8px;
    background: var(--accent);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s ease infinite;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-main);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--accent-light);
    border: 1.5px solid var(--accent);
}

.btn-outline:hover {
    background: var(--accent-glow);
    transform: translateY(-2px);
}

.btn-large {
    padding: 18px 48px;
    font-size: 1rem;
}

/* --- Section Styles --- */
.section {
    padding: 120px 0;
    position: relative;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    max-width: 300px;
}

.section-number {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 400;
    color: var(--accent);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-top: -32px;
    margin-bottom: 48px;
}

/* --- About Section --- */
.about-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 60px;
    align-items: start;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 1rem;
}

.about-text strong {
    color: var(--accent-light);
    font-weight: 600;
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- Experience Timeline --- */
.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 48px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -40px;
    top: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--border-light);
    z-index: 1;
    transition: all var(--transition);
}

.timeline-marker.current {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.timeline-item:hover .timeline-marker {
    border-color: var(--accent);
    transform: scale(1.2);
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all var(--transition);
}

.timeline-content:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-role {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.timeline-company {
    font-size: 0.95rem;
    color: var(--accent-light);
    font-weight: 500;
    margin-top: 2px;
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.timeline-details {
    list-style: none;
    margin-bottom: 16px;
}

.timeline-details li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.timeline-details li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 0.9rem;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-light);
    background: var(--accent-glow);
    padding: 4px 12px;
    border-radius: 20px;
}

/* --- Skills Section --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all var(--transition);
}

.skill-category:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.skill-icon {
    width: 44px;
    height: 44px;
    background: var(--accent-glow);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--accent-light);
}

.skill-icon svg {
    width: 22px;
    height: 22px;
}

.skill-category h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.skill-list li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 4px 0;
    position: relative;
    padding-left: 16px;
}

.skill-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.6;
}

/* --- Projects Section --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    display: flex;
    flex-direction: column;
    transition: all var(--transition);
    height: 100%;
}

.project-card:hover {
    border-color: var(--border-light);
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

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

.project-icon {
    width: 40px;
    height: 40px;
    color: var(--accent);
}

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

.project-link svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: color var(--transition);
}

.project-link:hover svg {
    color: var(--accent-light);
}

.project-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    transition: color var(--transition);
}

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

.project-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-grow: 1;
    margin-bottom: 20px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

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

/* --- Contact Section --- */
.contact {
    text-align: center;
}

.contact .section-title {
    justify-content: center;
}

.contact .section-title::after {
    display: none;
}

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

.contact-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 40px;
}

.social-link {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.social-link svg {
    width: 22px;
    height: 22px;
}

.social-link:hover {
    color: var(--accent-light);
    background: var(--accent-glow);
    transform: translateY(-3px);
}

/* --- Footer --- */
.footer {
    padding: 32px 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

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

.footer strong {
    color: var(--accent-light);
}

.footer-subtitle {
    font-size: 0.75rem;
    margin-top: 4px;
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scroll {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(12px);
    }
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-visual {
        order: -1;
    }

    .phone-mockup {
        width: 232px;
        height: 488px;
        border-radius: 44px;
        transform: none;
    }

    .phone-frame {
        border-radius: 42px;
    }

    .phone-mockup:hover {
        transform: none;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-stats {
        flex-direction: row;
    }

    .stat-card {
        flex: 1;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-secondary);
        border-left: 1px solid var(--border);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 4px;
        transition: right var(--transition);
    }

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

    .nav-link {
        font-size: 1rem;
        padding: 12px 24px;
    }

    .nav-toggle {
        display: flex;
    }

    .section {
        padding: 80px 0;
    }

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

    .hero-name {
        font-size: 2.5rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .about-stats {
        flex-direction: column;
    }

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

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

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

    .timeline {
        padding-left: 30px;
    }

    .timeline-marker {
        left: -30px;
        width: 14px;
        height: 14px;
    }

    .timeline-content {
        padding: 20px;
    }

    .timeline-header {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero-description {
        font-size: 1rem;
    }

    .phone-mockup {
        width: 196px;
        height: 412px;
        border-radius: 38px;
    }

    .phone-frame {
        border-radius: 36px;
    }

    .code-block {
        font-size: 0.55rem;
    }

    .btn {
        padding: 12px 24px;
        font-size: 0.85rem;
    }

    .btn-large {
        padding: 14px 36px;
    }
}
