/* ===================================
   Editorial Portfolio Styles
   Dark theme, bold typography, creative layouts
   =================================== */

/* CSS Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-dark: #0a0a0a;
    --bg-card: #141414;
    --bg-card-hover: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a1a1a1;
    --text-muted: #666666;

    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;

    --gradient-1: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --gradient-2: linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
    --gradient-3: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899, #06b6d4);

    --border-light: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(99, 102, 241, 0.3);

    --font-display: 'Syne', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;

    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: 16px;
}

/* Smooth scroll only on desktop */
@media (hover: hover) and (pointer: fine) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Prevent horizontal scroll on mobile */
html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    /* Allow vertical scrolling */
    overflow-y: auto;
}

/* Better touch handling */
* {
    -webkit-tap-highlight-color: transparent;
}

button, a {
    touch-action: manipulation;
}

/* ===================================
   Custom Cursor
   =================================== */
.cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10000;
    mix-blend-mode: difference;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background: var(--text-primary);
    border-radius: 50%;
    position: fixed;
    transition: transform 0.1s;
}

.cursor-ring {
    width: 40px;
    height: 40px;
    border: 1px solid var(--text-primary);
    border-radius: 50%;
    position: fixed;
    transition: all 0.15s var(--transition-smooth);
}

@media (max-width: 768px), (hover: none) {
    .cursor { display: none; }
}

/* ===================================
   Navigation
   =================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.5rem 0;
    padding-top: max(1.5rem, env(safe-area-inset-top));
    background: transparent;
    transition: all 0.3s;
}

.navbar.scrolled {
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(20px);
    padding: 1rem 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
}

.logo-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    gap: 3rem;
    list-style: none;
}

.nav-link {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s;
}

.nav-link span {
    position: relative;
    display: inline-block;
}

.nav-link span::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    color: var(--accent-primary);
    overflow: hidden;
    width: 0;
    transition: width 0.3s var(--transition-smooth);
    white-space: nowrap;
}

.nav-link:hover span::before {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

/* ===================================
   Hero Section
   =================================== */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile browsers */
    display: flex;
    align-items: center;
    padding-top: max(80px, env(safe-area-inset-top) + 60px);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.gradient-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    animation: float 20s infinite;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-primary);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-secondary);
    bottom: -100px;
    left: -100px;
    animation-delay: 5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: var(--accent-cyan);
    top: 50%;
    left: 50%;
    animation-delay: 10s;
}

.noise-overlay {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-label {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--border-accent);
    border-radius: 100px;
    margin-bottom: 2rem;
}

.label-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.label-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    line-height: 0.95;
    margin-bottom: 2rem;
}

.title-word {
    display: block;
    opacity: 0;
    transform: translateY(50px);
    animation: slideUp 0.8s forwards;
    animation-delay: var(--delay);
}

.title-word-alt {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.subtitle-text {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.subtitle-line {
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    margin-bottom: 2.5rem;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 100px;
    text-decoration: none;
    transition: all 0.3s var(--transition-smooth);
    cursor: pointer;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-dark);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.2);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-outline:hover {
    background: var(--bg-card);
    border-color: var(--text-primary);
}

/* Code Preview */
.hero-code-preview {
    position: relative;
}

.code-window {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.code-header {
    display: flex;
    gap: 8px;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-light);
}

.code-header span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-light);
}

.code-header span:nth-child(1) { background: #ef4444; }
.code-header span:nth-child(2) { background: #eab308; }
.code-header span:nth-child(3) { background: #22c55e; }

.code-body {
    padding: 1.5rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.875rem;
    line-height: 1.7;
    overflow-x: auto;
}

.c-keyword { color: #c792ea; }
.c-name { color: #82aaff; }
.c-key { color: #f78c6c; }
.c-str { color: #c3e88d; }

/* Scroll Hint */
.scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: var(--border-light);
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: var(--text-primary);
    animation: scrollDown 2s infinite;
}

/* ===================================
   Marquee Section
   =================================== */
.marquee-section {
    padding: 2rem 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    overflow: hidden;
}

.marquee-track {
    display: flex;
    animation: marquee 30s linear infinite;
}

.marquee-item {
    flex-shrink: 0;
    padding: 0 2rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ===================================
   Section Styles
   =================================== */
section {
    padding: 8rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

.section-number {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--accent-primary);
    display: block;
    margin-bottom: 1rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* ===================================
   Work Section
   =================================== */
.work {
    position: relative;
}

.work-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
}

.work-card {
    grid-column: span 6;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 2.5rem;
    transition: all 0.4s var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.work-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity 0.4s;
}

.work-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
}

.work-card:hover::before {
    opacity: 0.05;
}

.work-card.featured-card {
    grid-column: span 12;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.work-number {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 800;
    color: var(--border-light);
    position: absolute;
    top: 1rem;
    right: 2rem;
    line-height: 1;
    transition: color 0.3s;
}

.work-card:hover .work-number {
    color: var(--accent-primary);
}

.work-content {
    position: relative;
    z-index: 1;
}

.work-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.work-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.work-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.work-tags span {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.work-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.work-links a {
    color: var(--accent-primary);
    font-size: 0.875rem;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

.work-links a:hover {
    border-color: var(--accent-primary);
}

.work-visual {
    position: relative;
    z-index: 1;
}

.work-preview {
    background: var(--bg-dark);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 1rem;
}

.preview-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 1rem;
}

.preview-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-light);
}

.preview-skeleton {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    overflow: hidden;
}

.sk-hero {
    height: 150px;
    background: var(--gradient-2);
    opacity: 0.3;
}

.sk-content {
    padding: 1rem;
}

.sk-title {
    height: 20px;
    background: var(--border-light);
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.sk-text {
    height: 12px;
    background: var(--border-light);
    border-radius: 4px;
    width: 80%;
    margin-bottom: 0.5rem;
}

.sk-btn {
    height: 36px;
    background: var(--accent-primary);
    border-radius: 8px;
    width: 120px;
    margin-top: 1rem;
    opacity: 0.5;
}

/* ===================================
   About Section
   =================================== */
.about {
    position: relative;
}

.about-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.gradient-orb {
    position: absolute;
    width: 800px;
    height: 800px;
    background: var(--accent-primary);
    filter: blur(200px);
    opacity: 0.05;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.about-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.about-header {
    text-align: center;
    margin-bottom: 5rem;
}

.about-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
}

.about-intro {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.about-body {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.about-highlights {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.highlight {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.highlight-icon {
    font-size: 1.5rem;
}

.highlight-text {
    font-weight: 500;
    color: var(--text-primary);
}

.about-info-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.info-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
}

.info-icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    display: block;
}

.info-card h4 {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.info-card p {
    font-weight: 500;
    color: var(--text-primary);
}

/* ===================================
   Skills Section
   =================================== */
.skills-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.skill-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s;
}

.skill-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
}

.skill-card.skill-accent {
    background: var(--gradient-1);
}

.skill-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.skill-icon {
    font-size: 1.5rem;
}

.skill-header h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-list span {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.skill-accent .skill-list span {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

/* ===================================
   Experience Section
   =================================== */
.experience {
    background: rgba(255, 255, 255, 0.01);
}

.timeline {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

.timeline-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    padding-bottom: 3rem;
    position: relative;
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 24px;
    bottom: 0;
    width: 2px;
    background: var(--border-light);
}

.timeline-dot {
    width: 24px;
    height: 24px;
    background: var(--accent-primary);
    border-radius: 50%;
    border: 4px solid var(--bg-dark);
    flex-shrink: 0;
}

.timeline-date {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.timeline-content h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.timeline-company {
    color: var(--accent-primary);
    font-weight: 500;
    margin-bottom: 1rem;
}

.timeline-content ul {
    list-style: none;
}

.timeline-content li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.timeline-content li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
}

.publication {
    max-width: 900px;
    margin: 4rem auto 0;
    padding: 0 2rem;
}

.pub-card {
    background: var(--gradient-1);
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.pub-emoji {
    font-size: 2rem;
}

.pub-content {
    flex: 1;
}

.pub-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.8;
    display: block;
    margin-bottom: 0.5rem;
}

.pub-content h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.pub-content p {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* ===================================
   Contact Section
   =================================== */
.contact {
    position: relative;
}

.contact-bg {
    position: absolute;
    inset: 0;
    background: var(--gradient-1);
    opacity: 0.03;
}

.contact-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.contact-header {
    text-align: center;
    margin-bottom: 4rem;
}

.contact-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s;
}

.contact-link:hover {
    border-color: var(--accent-primary);
    transform: translateX(8px);
}

.link-icon {
    font-size: 1.5rem;
}

.link-info {
    display: flex;
    flex-direction: column;
}

.link-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.link-value {
    font-weight: 500;
    color: var(--text-primary);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--text-primary);
    color: var(--bg-dark);
    border: none;
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.2);
}

/* ===================================
   Footer
   =================================== */
.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border-light);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-left p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.footer-right {
    text-align: right;
}

.footer-right p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ===================================
   Animations
   =================================== */
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scrollDown {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(200%); }
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ===================================
   Responsive Design
   =================================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    /* Hero Section */
    .hero-container {
        grid-template-columns: 1fr 0.8fr;
        gap: 2rem;
    }

    .hero-description {
        max-width: 100%;
    }

    .hero-code-preview {
        transform: scale(0.85);
        transform-origin: top center;
    }

    /* Work Section */
    .work-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 1.5rem;
    }

    .work-card {
        grid-column: span 3;
    }

    .work-card.featured-card {
        grid-column: span 6;
        grid-template-columns: 1fr 0.9fr;
        gap: 2rem;
    }

    /* About Section */
    .about-grid {
        grid-template-columns: 1fr 0.8fr;
        gap: 2rem;
    }

    .about-intro {
        font-size: 1.25rem;
    }

    /* Skills Section */
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }

    /* Contact Section */
    .contact-content {
        grid-template-columns: 1fr 1.2fr;
        gap: 2rem;
    }

    /* Stats */
    .hero-stats {
        gap: 2rem;
    }

    .stat-value {
        font-size: 2rem;
    }

    /* Section padding */
    section {
        padding: 6rem 0;
    }
}

/* Mobile Landscape & Small Tablet (576px - 767px) */
@media (max-width: 767px) {
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-dark);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transform: translateX(100%);
        transition: transform 0.3s;
        z-index: 999;
        /* Ensure menu doesn't block clicks when closed */
        pointer-events: none;
    }

    .nav-menu.active {
        transform: translateX(0);
        /* Enable clicks when menu is open */
        pointer-events: auto;
    }

    .nav-link {
        font-size: 1.5rem;
        /* Enable clicks on links */
        pointer-events: auto;
    }

    .nav-toggle {
        display: flex;
        z-index: 1001;
    }

    /* Hero Section */
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-code-preview {
        display: none;
    }

    .hero-label {
        justify-content: center;
    }

    .hero-subtitle {
        justify-content: center;
        flex-direction: column;
        gap: 0.75rem;
    }

    .subtitle-line {
        width: 100px;
        height: 1px;
    }

    .hero-stats {
        justify-content: center;
        gap: 1.5rem;
    }

    .hero-actions {
        justify-content: center;
    }

    /* Marquee */
    .marquee-item {
        font-size: 1.25rem;
        padding: 0 1.5rem;
    }

    /* Section spacing */
    section {
        padding: 4rem 0;
    }

    .section-header {
        margin-bottom: 3rem;
    }

    /* Work Section */
    .work-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .work-card,
    .work-card.featured-card {
        grid-column: span 1;
        padding: 2rem;
    }

    .work-card.featured-card {
        grid-template-columns: 1fr;
    }

    .work-visual {
        order: -1;
    }

    .work-number {
        font-size: 2.5rem;
        top: 0.5rem;
        right: 1rem;
    }

    .work-title {
        font-size: 1.5rem;
    }

    /* About Section */
    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-info-cards {
        grid-template-columns: 1fr;
    }

    .about-intro {
        font-size: 1.25rem;
    }

    /* Skills Section */
    .skills-grid {
        grid-template-columns: 1fr;
    }

    /* Experience Section */
    .timeline-item {
        grid-template-columns: auto 1fr;
        gap: 1rem;
    }

    .timeline-content h3 {
        font-size: 1.25rem;
    }

    .pub-card {
        flex-direction: column;
        text-align: center;
    }

    /* Contact Section */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .footer-right {
        text-align: center;
    }

    /* Buttons */
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.8125rem;
    }

    /* Stats */
    .stat-value {
        font-size: 1.75rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }
}

/* Mobile Portrait (< 576px) */
@media (max-width: 575px) {
    /* Container padding */
    .nav-container,
    .hero-container,
    .work-grid,
    .skills-grid,
    .timeline,
    .publication,
    .contact-container,
    .footer-content {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    /* Hero */
    .hero {
        padding-top: 70px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-label {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }

    .hero-description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .hero-stats {
        gap: 1.25rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    /* Buttons */
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Section titles */
    .section-title {
        font-size: 2rem;
    }

    /* Work cards */
    .work-card {
        padding: 1.5rem;
    }

    .work-title {
        font-size: 1.25rem;
    }

    .work-tags span {
        font-size: 0.6875rem;
        padding: 0.375rem 0.75rem;
    }

    /* Skill cards */
    .skill-card {
        padding: 1.5rem;
    }

    .skill-header h3 {
        font-size: 1.125rem;
    }

    .skill-list span {
        font-size: 0.8125rem;
        padding: 0.375rem 0.75rem;
    }

    /* Contact form */
    .form-group input,
    .form-group textarea {
        padding: 0.875rem 1.25rem;
        font-size: 0.9375rem;
    }

    /* Marquee */
    .marquee-item {
        font-size: 1rem;
        padding: 0 1rem;
    }

    /* Timeline */
    .timeline-item {
        gap: 0.75rem;
    }

    .timeline-dot {
        width: 16px;
        height: 16px;
        border-width: 3px;
    }

    .timeline-item:not(:last-child)::before {
        left: 9.5px;
    }

    /* Scroll hint */
    .scroll-hint {
        bottom: 1rem;
    }

    /* Scroll to top button */
    .scroll-top {
        width: 3rem;
        height: 3rem;
        bottom: 1rem;
        right: 1rem;
    }

    .scroll-percent {
        font-size: 0.625rem;
    }
}

/* Extra small devices (< 375px) */
@media (max-width: 374px) {
    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .nav-logo {
        font-size: 1.25rem;
    }

    .work-card,
    .work-card.featured-card {
        padding: 1.25rem;
    }

    .skill-card {
        padding: 1.25rem;
    }

    .info-card {
        padding: 1.25rem;
    }
}

/* ===================================
   Touch Device Optimizations
   =================================== */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover-specific animations */
    .gradient-blob {
        animation: none;
    }

    /* Work cards - use active state instead of hover */
    .work-card:active {
        transform: scale(0.98);
    }

    /* Buttons - better touch feedback */
    .btn:active {
        transform: scale(0.95);
    }

    /* Contact links - better touch feedback */
    .contact-link:active {
        transform: translateX(4px);
    }

    /* Scroll hint - hide on touch devices */
    .scroll-hint {
        display: none;
    }

    /* Disable parallax on touch */
    .hero-bg,
    .gradient-blob {
        transform: none !important;
    }
}

/* ===================================
   Scroll to Top Button with Progress
   =================================== */

/* ===================================
   Scroll to Top Button with Progress
   =================================== */
.scroll-top {
    position: fixed;
    bottom: max(2rem, env(safe-area-inset-bottom) + 1rem);
    right: 2rem;
    width: 4rem;
    height: 4rem;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s var(--transition-smooth);
    z-index: 999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.scroll-top:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.3);
}

.scroll-top:active {
    transform: translateY(-2px) scale(1);
}

/* Progress SVG */
.scroll-progress {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.scroll-progress-bg {
    fill: none;
    stroke: var(--bg-card-hover);
    stroke-width: 3;
}

.scroll-progress-bar {
    fill: none;
    stroke: var(--accent-primary);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 0.1s linear;
}

/* Percentage text */
.scroll-percent {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    z-index: 1;
}

/* Arrow icon */
.scroll-arrow {
    position: absolute;
    width: 1rem;
    height: 1rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
}

.scroll-top:hover .scroll-percent {
    opacity: 0;
    transform: translateY(-10px);
}

.scroll-top:hover .scroll-arrow {
    opacity: 1;
    transform: translateY(0);
}

.scroll-top:hover .scroll-progress-bar {
    stroke: var(--accent-secondary);
}

@media (max-width: 768px) {
    .scroll-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 3.5rem;
        height: 3.5rem;
    }

    .scroll-percent {
        font-size: 0.65rem;
    }
}
