:root {
    --font-sans: "fang", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, monospace;

    /* Dark theme - shadcn inspired */
    --bg-primary: #09090b;
    --bg-secondary: #18181b;
    --bg-card: rgba(255, 255, 255, 0.02);
    --bg-card-hover: rgba(255, 255, 255, 0.05);
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #b4b4bc;
    --border-color: #27272a;
    --accent: #a855f7;
    --ring: rgba(168, 85, 247, 0.4);
    --radius: 8px;
}

/* Light mode - Gruvbox light inspired */
:root.light {
    --bg-primary: #fbf1c7;
    --bg-secondary: #f2e5bc;
    --bg-card: rgba(60, 56, 54, 0.04);
    --bg-card-hover: rgba(60, 56, 54, 0.08);
    --text-primary: #3c3836;
    --text-secondary: #504945;
    --text-muted: #7c6f64;
    --border-color: #d5c4a1;
    --accent: #b16286;
    --ring: rgba(177, 98, 134, 0.3);
}

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

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

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

html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
}

html {
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Background gradient - smooth, absolute top left */
body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: min(600px, 100vw);
    height: 500px;
    background: radial-gradient(ellipse at 0% 0%, rgba(147, 51, 234, 0.18) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

:root.light body::before {
    background: radial-gradient(ellipse at 0% 0%, rgba(177, 98, 134, 0.15) 0%, transparent 70%);
}

/* Subtle noise texture */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

:root.light body::after {
    opacity: 0.02;
}

main {
    flex: 1;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 6rem 1.5rem 2rem;
}

.content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Staggered fade-in animations for sections */
.content > section {
    animation: fadeInUp 0.6s ease-out both;
}

.content > section:nth-child(1) { animation-delay: 0.1s; }
.content > section:nth-child(2) { animation-delay: 0.2s; }
.content > section:nth-child(3) { animation-delay: 0.3s; }
.content > section:nth-child(4) { animation-delay: 0.4s; }
.content > section:nth-child(5) { animation-delay: 0.5s; }

/* Typography */
h1 {
    font-family: var(--font-sans);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

h2 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

h3 {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

h4 {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Links */
a {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--border-color);
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

a:focus-visible {
    outline: none;
    text-decoration-color: var(--accent);
}

/* Focus ring utility */
*:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

/* About section - Konfekt style */
.about-section {
    padding-bottom: 1rem;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.about-text {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--text-muted);
    font-weight: 400;
}

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

/* Services section */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

.service-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.service-content {
    flex: 1;
}

.service-card h4 {
    font-family: var(--font-sans);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.service-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.service-icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
}

.service-icon svg {
    width: 100%;
    height: 100%;
}

/* Service card color tints */
.service-card.card-purple {
    background: rgba(168, 85, 247, 0.06);
    border: 1px solid rgba(168, 85, 247, 0.12);
    border-radius: var(--radius);
    padding: 1rem;
}

.service-card.card-pink {
    background: rgba(236, 72, 153, 0.06);
    border: 1px solid rgba(236, 72, 153, 0.12);
    border-radius: var(--radius);
    padding: 1rem;
}

.service-card.card-cyan {
    background: rgba(34, 211, 238, 0.06);
    border: 1px solid rgba(34, 211, 238, 0.12);
    border-radius: var(--radius);
    padding: 1rem;
}

.service-card.card-green {
    background: rgba(52, 211, 153, 0.06);
    border: 1px solid rgba(52, 211, 153, 0.12);
    border-radius: var(--radius);
    padding: 1rem;
}

/* Light mode adjustments */
:root.light .service-card.card-purple {
    background: rgba(168, 85, 247, 0.08);
    border-color: rgba(168, 85, 247, 0.15);
}

:root.light .service-card.card-pink {
    background: rgba(236, 72, 153, 0.08);
    border-color: rgba(236, 72, 153, 0.15);
}

:root.light .service-card.card-cyan {
    background: rgba(34, 211, 238, 0.08);
    border-color: rgba(34, 211, 238, 0.15);
}

:root.light .service-card.card-green {
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.15);
}

/* Experience section */
.experience-section {
    display: flex;
    flex-direction: column;
}

.exp-visible {
    position: relative;
}

.exp-faded {
    position: relative;
}

.exp-faded::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, var(--bg-primary) 100%);
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.exp-faded .exp-item {
    border-bottom: none;
    padding-bottom: 0;
}

.experience-section.expanded .exp-faded::after {
    opacity: 0;
}

.experience-section.expanded .exp-faded .exp-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.875rem;
}

.exp-earlier {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.15s ease, opacity 0.1s ease;
}

.exp-earlier .exp-item:first-child {
    padding-top: 0.875rem;
}

.experience-section.expanded .exp-earlier {
    max-height: 600px;
    opacity: 1;
}

.exp-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.15s ease;
    align-self: center;
}

.exp-toggle:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.exp-toggle:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.exp-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.125rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border-color);
}

.exp-item:last-of-type {
    border-bottom: none;
}

.exp-meta {
    margin-bottom: 0.25rem;
}

.exp-dates {
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.exp-content h3 {
    margin-bottom: 0.25rem;
}

.exp-company {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.exp-company a {
    color: var(--text-secondary);
    text-decoration-color: transparent;
}

.exp-company a:hover {
    color: var(--text-primary);
    text-decoration-color: var(--text-muted);
}

.exp-desc {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
}


/* Skills section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.skill-group {
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: border-color 0.15s ease;
}

.skill-group:hover {
    border-color: var(--text-muted);
}

/* Subtle purple color variations */
.skill-group:nth-child(1) {
    background: rgba(168, 85, 247, 0.03);
    border-color: rgba(168, 85, 247, 0.12);
}
.skill-group:nth-child(2) {
    background: rgba(139, 92, 246, 0.03);
    border-color: rgba(139, 92, 246, 0.12);
}
.skill-group:nth-child(3) {
    background: rgba(124, 58, 237, 0.03);
    border-color: rgba(124, 58, 237, 0.12);
}
.skill-group:nth-child(4) {
    background: rgba(109, 40, 217, 0.03);
    border-color: rgba(109, 40, 217, 0.12);
}

:root.light .skill-group:nth-child(1) { background: rgba(168, 85, 247, 0.05); }
:root.light .skill-group:nth-child(2) { background: rgba(139, 92, 246, 0.05); }
:root.light .skill-group:nth-child(3) { background: rgba(124, 58, 237, 0.05); }
:root.light .skill-group:nth-child(4) { background: rgba(109, 40, 217, 0.05); }

.skill-group h4 {
    margin-bottom: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.skill-group p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Resume page */
.resume-hero {
    padding-bottom: 1rem;
}

.resume-header {
    text-align: left;
}

.resume-name {
    font-size: 1.5rem;
    margin-bottom: 0.125rem;
}

.resume-title {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.resume-contact {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.resume-experience .exp-item {
    border-bottom: 1px solid var(--border-color);
}

.resume-experience .exp-item:last-of-type {
    border-bottom: none;
}

/* Education section */
.edu-item {
    padding: 0.5rem 0;
}

.edu-degree {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.edu-school {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Connect section */
.connect-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.connect-links a {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.connect-links a:hover {
    color: var(--text-primary);
}

.connect-sep {
    color: var(--text-muted);
    margin: 0 0.5rem;
}

/* Footer */
.footer {
    padding: 1.5rem;
    margin-top: auto;
    text-align: center;
    animation: fadeIn 0.5s ease-out 0.5s both;
}

.footer-copy {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Header nav */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    animation: fadeIn 0.4s ease-out;
    transition: backdrop-filter 0.2s ease, background 0.2s ease;
}

.site-header.scrolled {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(9, 9, 11, 0.8);
}

:root.light .site-header.scrolled {
    background: rgba(251, 241, 199, 0.8);
}

.header-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.site-header .site-name {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.2s ease;
    letter-spacing: -0.01em;
}

.site-header .site-name:hover {
    opacity: 0.5;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-link {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

.nav-link:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

/* Mobile bottom bar - hidden on desktop, shown on mobile */
.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    left: 50%;
    -webkit-transform: translateX(-50%) translateZ(0);
    transform: translateX(-50%) translateZ(0);
    z-index: 9999;
    background: rgba(24, 24, 27, 0.9);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    padding: 0.5rem;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    width: auto;
}

:root.light .mobile-bottom-bar {
    background: rgba(251, 241, 199, 0.9);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.bottom-bar-link {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-card-hover);
    border: none;
    text-decoration: none;
    padding: 0.625rem 1.125rem;
    border-radius: 100px;
    transition: background 0.15s ease;
}

.bottom-bar-link:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.copy-email-btn {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #ffffff;
    background: var(--accent);
    border: none;
    padding: 0.625rem 1.125rem;
    border-radius: 100px;
    cursor: pointer;
    transition: opacity 0.15s ease, background 0.15s ease;
    position: relative;
}

.copy-email-btn:hover {
    opacity: 0.9;
}

.copy-email-btn .email-text {
    display: inline;
}

.copy-email-btn .copied-text {
    display: none;
}

.copy-email-btn.copied .email-text {
    display: none;
}

.copy-email-btn.copied .copied-text {
    display: inline;
}

.copy-email-btn.copied {
    background: #22c55e;
}

/* Responsive */
@media (min-width: 640px) {
    html {
        font-size: 18px;
    }

    main {
        padding: 7rem 2rem 2rem;
    }

    .content {
        gap: 3rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    .about-text {
        font-size: 1.375rem;
        line-height: 1.5;
    }

    .exp-item {
        display: grid;
        grid-template-columns: 140px 1fr;
        gap: 2rem;
    }

    .exp-meta {
        margin-bottom: 0;
        text-align: right;
    }

    .skills-grid {
        gap: 0.75rem 1.25rem;
    }

    .header-inner {
        padding: 0 2rem;
    }
}

@media (max-width: 639px) {
    main {
        padding-top: 5rem;
        padding-bottom: 4rem;
    }

    .about-content {
        gap: 1.25rem;
    }

    .service-icon {
        width: 48px;
        height: 48px;
    }

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

    .exp-item {
        gap: 0.5rem;
    }

    .mobile-bottom-bar {
        display: inline-flex !important;
    }

    .footer {
        padding-bottom: 5rem;
    }
}
