/* ============================================
   Reset & Foundation
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --accent: #00ff87;
    --purple: #8b5cf6;
    --blue: #0ea5e9;
    --orange: #f59e0b;
    --bg-dark: #0f0f0f;
    --bg-light: #1a1a1a;
    --surface: #262626;
    --text-primary: #f5f5f5;
    --text-secondary: #a3a3a3;
    --text-muted: #737373;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --glow: 0 0 20px rgba(0, 255, 135, 0.1);
    --space-xs: clamp(0.5rem, 2vw, 1rem);
    --space-sm: clamp(1rem, 3vw, 1.5rem);
    --space-md: clamp(1.5rem, 4vw, 2.5rem);
    --space-lg: clamp(2rem, 6vw, 4rem);
    --space-xl: clamp(3rem, 8vw, 6rem);
    --space-xxl: clamp(4rem, 12vw, 8rem);
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 300;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: default;
}

body * { cursor: inherit; }
a, button { cursor: pointer; }
html { scroll-behavior: smooth; }

/* ============================================
   Typography
   ============================================ */
.display {
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-weight: 200;
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.headline {
    font-size: clamp(1.25rem, 4vw, 2.25rem);
    font-weight: 300;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.subhead {
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    font-weight: 400;
    line-height: 1.35;
}

.body {
    font-size: clamp(0.9rem, 1.8vw, 1.05rem);
    font-weight: 300;
    line-height: 1.65;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
}

/* ============================================
   Layout
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 3rem);
}

.grid {
    display: grid;
    gap: clamp(1.5rem, 4vw, 3rem);
}

/* ============================================
   Navbar
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

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

.navbar-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: color 0.3s ease;
    position: relative;
}

.navbar-links a:hover,
.navbar-links a.active {
    color: var(--accent);
}

.navbar-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--accent);
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    min-height: 100vh;
    display: grid;
    place-content: center;
    position: relative;
    padding: var(--space-xl) var(--space-md);
}

.hero-content {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.hero-name {
    margin-bottom: var(--space-sm);
    background: linear-gradient(135deg, var(--accent), var(--blue), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1.2s ease-out;
}

.hero-title {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    animation: fadeInUp 1.2s ease-out 0.2s both;
}

.hero-description {
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto;
    animation: fadeInUp 1.2s ease-out 0.4s both;
}

.hero-cta { animation: fadeInUp 1.2s ease-out 0.6s both; }

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

/* ============================================
   Navigation Dots
   ============================================ */
.nav-indicator {
    position: fixed;
    top: 50%;
    right: 3rem;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.3s ease;
    opacity: 0.4;
}

.nav-dot.active {
    background: var(--accent);
    opacity: 1;
    box-shadow: var(--glow);
}

/* ============================================
   Expertise Section
   ============================================ */
.expertise {
    padding: var(--space-xl) 0;
    position: relative;
}

.expertise-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.expertise-header .headline { margin-bottom: var(--space-sm); }

.expertise-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.expertise-item {
    background: linear-gradient(135deg, var(--surface), rgba(38, 38, 38, 0.5));
    border: 1px solid var(--border-subtle);
    border-radius: 1rem;
    padding: var(--space-lg);
    position: relative;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.expertise-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    transform: translateX(-100%);
    transition: transform 0.8s ease;
}

.expertise-item:hover::before { transform: translateX(100%); }

.expertise-item:hover {
    transform: translateY(-8px);
    border-color: rgba(0, 255, 135, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), var(--glow);
}

.expertise-number {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.expertise-title {
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.expertise-description {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    font-size: 0.95rem;
}

.expertise-skills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.skill-tag {
    padding: 0.4rem 0.8rem;
    background: rgba(0, 255, 135, 0.1);
    color: var(--accent);
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 400;
    border: 1px solid rgba(0, 255, 135, 0.2);
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* ============================================
   Contact Section
   ============================================ */
.contact {
    padding: 8rem 0 4rem;
    text-align: center;
}

.contact-button {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2.5rem;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 400;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.contact-button::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: var(--accent);
    transition: left 0.4s ease;
    z-index: -1;
}

.contact-button:hover::before { left: 0; }

.contact-button:hover {
    color: var(--bg-dark);
    transform: translateY(-2px);
    box-shadow: var(--glow);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    padding: var(--space-xl) 0 var(--space-md);
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}

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

.footer-links { margin-top: var(--space-sm); }

.footer-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.footer-link:hover {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

/* ============================================
   Blog List
   ============================================ */
.blog-header {
    text-align: center;
    padding: calc(var(--space-xxl) + 60px) 0 var(--space-xl);
}

.blog-header .headline { margin-bottom: var(--space-sm); }

.blog-list {
    max-width: 800px;
    margin: 0 auto var(--space-xl);
}

.blog-item {
    display: block;
    text-decoration: none;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-subtle);
    transition: all 0.3s ease;
}

.blog-item:first-child {
    border-top: 1px solid var(--border-subtle);
}

.blog-item:hover .blog-item-title {
    color: var(--text-primary);
}

.blog-item-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
    font-family: 'JetBrains Mono', monospace;
}

.blog-item-title {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 400;
    line-height: 1.35;
    color: var(--accent);
    margin: 0.4rem 0;
    transition: color 0.3s ease;
}

.blog-item-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    font-weight: 300;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: var(--space-lg) 0;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 400;
    font-size: 0.9rem;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.pagination a::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: var(--accent);
    transition: left 0.4s ease;
    z-index: -1;
}

.pagination a:hover::before { left: 0; }
.pagination a:hover { color: var(--bg-dark); }

/* ============================================
   Article Page
   ============================================ */
.article-header {
    text-align: center;
    padding: calc(var(--space-xxl) + 60px) 0 var(--space-xl);
}

.article-header .headline {
    color: var(--accent);
}

.article-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.article-content {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: var(--space-xxl);
}

.article-content p {
    color: var(--text-secondary);
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    line-height: 1.8;
    margin-bottom: var(--space-md);
}

.article-content h2 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 400;
    color: var(--text-primary);
    margin: var(--space-xl) 0 var(--space-md);
}

.article-content h3 {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    font-weight: 400;
    color: var(--text-primary);
    margin: var(--space-lg) 0 var(--space-sm);
}

.article-content ul, .article-content ol {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.article-content code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--surface);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.article-content pre {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: 0.5rem;
    padding: var(--space-md);
    overflow-x: auto;
    margin-bottom: var(--space-md);
}

.article-content pre code {
    background: none;
    padding: 0;
}

.article-content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.article-content a:hover {
    border-bottom-color: var(--accent);
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-md);
    font-size: 0.95rem;
}

.article-content th,
.article-content td {
    padding: 0.65rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.article-content th {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.article-content td {
    color: var(--text-secondary);
}

.article-content tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 767px) {
    .article-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.article-content strong {
    color: var(--text-primary);
    font-weight: 500;
}

.article-content hr {
    border: none;
    height: 1px;
    background: var(--border-subtle);
    margin: var(--space-xl) 0;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: var(--space-md) 0;
}

.article-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: var(--space-md);
    margin: var(--space-lg) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: all 0.3s ease;
    margin-bottom: var(--space-lg);
}

.back-link:hover { color: var(--text-primary); }

/* ============================================
   Tag Badges
   ============================================ */
.tag-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: rgba(139, 92, 246, 0.15);
    color: var(--purple);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tag-badge:hover {
    background: rgba(139, 92, 246, 0.3);
    color: var(--text-primary);
}

.tag-badge-small {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: rgba(139, 92, 246, 0.15);
    color: var(--purple);
    border-radius: 1rem;
    font-size: 0.7rem;
}

.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: var(--space-sm);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: var(--space-sm);
}

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

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

.expertise-item.reveal:nth-child(1) { transition-delay: 0.1s; }
.expertise-item.reveal:nth-child(2) { transition-delay: 0.2s; }
.expertise-item.reveal:nth-child(3) { transition-delay: 0.3s; }
.expertise-item.reveal:nth-child(4) { transition-delay: 0.4s; }
.expertise-item.reveal:nth-child(5) { transition-delay: 0.5s; }
.expertise-item.reveal:nth-child(6) { transition-delay: 0.6s; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 767px) {
    .expertise-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }
}

@media (max-width: 768px) {
    .hero {
        min-height: 100svh;
        padding: var(--space-lg) var(--space-sm);
    }

    .expertise-item { padding: var(--space-md); }

    .expertise-number {
        top: var(--space-sm);
        right: var(--space-sm);
        font-size: 0.7rem;
    }

    .skill-tag {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }

    .contact-button {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.9rem;
        width: 100%;
        max-width: 280px;
    }
}

@media (min-width: 1400px) {
    .expertise-item { padding: var(--space-xl); }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .hero { padding: var(--space-xl) var(--space-lg); }
    .expertise-grid { gap: var(--space-lg); }
}

/* ============================================
   Accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --border-subtle: rgba(255, 255, 255, 0.3);
        --text-secondary: #e0e0e0;
    }
}

.contact-button:focus-visible,
.skill-tag:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (hover: none) {
    .expertise-item:hover { transform: none; }
    .skill-tag:hover { transform: none; }
}

@supports (padding: max(0px)) {
    .container {
        padding-left: max(var(--space-sm), env(safe-area-inset-left));
        padding-right: max(var(--space-sm), env(safe-area-inset-right));
    }
}

::selection {
    background: rgba(0, 255, 135, 0.2);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(0, 255, 135, 0.2);
    color: var(--text-primary);
}
