:root {
    --primary: #222222;
    --secondary: #5f5f5f;
    --tertiary: #F8F8F8;
    --white: #FFFFFF;
    --font-main: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--tertiary);
    color: var(--primary);
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 400;
    line-height: 1.1;
}

a {
    text-decoration: none;
    color: inherit;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(248, 248, 248, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.03);
    transition: all 0.3s ease;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.nav {
    display: flex;
    gap: 3rem;
}

.nav a {
    font-size: 0.95rem;
    color: var(--secondary);
    transition: color 0.3s ease;
    font-weight: 500;
}

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

.btn {
    font-size: 0.95rem;
    border-bottom: 1px solid var(--primary);
    padding-bottom: 4px;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.btn:hover {
    opacity: 0.6;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
    border-radius: 0.4rem;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    padding: 8rem 4rem 4rem;
    display: flex;
    position: relative;
    overflow: hidden;
}

.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 2;
}

.stats {
    display: flex;
    gap: 4rem;
    margin-bottom: 4rem;
}

.stat h3 {
    font-size: 2.5rem;
    font-weight: 300;
}

.stat p {
    font-size: 0.85rem;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.2rem;
}

.hero-title {
    font-size: 14vw;
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
    font-weight: 300;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--secondary);
    font-weight: 300;
}

.scroll-down {
    margin-top: auto;
    font-size: 0.9rem;
    color: var(--secondary);
    transition: color 0.3s ease;
}

.scroll-down:hover {
    color: var(--primary);
}

.hero-image {
    position: absolute;
    right: 5%;
    bottom: 0;
    width: 45%;
    height: 85vh;
    z-index: 1;
    display: flex;
    align-items: center;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 60%;
    filter: grayscale(100%);
    transition: filter 0.5s ease, transform 0.2s ease-out;
}

.hero-image img:hover {
    filter: grayscale(0%);
}

/* Background text */
.bg-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28vw;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.02);
    z-index: 0;
    pointer-events: none;
    user-select: none;
    letter-spacing: -0.05em;
}

/* General Sections */
section {
    padding: 8rem 4rem;
}

/* About Section */
.about {
    padding: 8rem 4rem;
}

.about-grid-3 {
    display: grid;
    grid-template-columns: 1.2fr 1.6fr 1fr;
    gap: 3.5rem;
    align-items: start;
}

.about-col {
    display: flex;
    flex-direction: column;
}

.left-col h2 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.03em;
}

.left-col > p {
    color: var(--secondary);
    font-size: 1.05rem;
    font-weight: 300;
    line-height: 1.8;
    margin-bottom: 3rem;
}

.feature-item {
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 1rem;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.feature-text h4 {
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: var(--primary);
}

.feature-text p {
    font-size: 0.95rem;
    color: var(--secondary);
    line-height: 1.6;
}

.feature-item.dark-icon .feature-icon {
    border-radius: 50%;
    width: 55px;
    height: 55px;
    font-size: 1.5rem;
}

.about-card {
    background-color: var(--white);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.03);
}

.stat-card {
    padding: 3rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.stat-card .card-icon {
    font-size: 1.5rem;
    margin: 0 auto 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-color: #ebf4ff;
    color: #4299e1;
}

.stat-card h2 {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    letter-spacing: -0.03em;
}

.stat-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-card p {
    font-size: 0.95rem;
    color: var(--secondary);
    font-weight: 300;
    line-height: 1.6;
}

.image-card {
    border-radius: 1rem;
}

.image-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    aspect-ratio: 4/5;
    border-radius: 1rem;
}

.image-button {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 1rem;
    background: transparent;
    overflow: hidden;
    cursor: pointer;
    font: inherit;
    text-align: inherit;
}

.image-button .clickable-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    transition: transform 0.35s ease, filter 0.35s ease, box-shadow 0.35s ease;
}

.item-desc .image-button .clickable-image {
    height: 100%;
}

.image-button:hover .clickable-image,
.image-button:focus-visible .clickable-image {
    transform: scale(1.02);
    box-shadow: 0 14px 36px rgba(0,0,0,0.06);
}

/* Tools & Systems */
.tools-system {
    padding: 0 0 6rem;
}

.tools-heading {
    max-width: 980px;
    padding: 0 4rem 1.6rem;
}

.tools-heading h2 {
    display: inline-block;
    margin-bottom: 1.25rem;
    color: var(--secondary);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tools-heading p {
    max-width: 780px;
    color: var(--primary);
    font-size: clamp(2rem, 3.6vw, 3.2rem);
    font-weight: 300;
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.tools-marquee {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background: rgba(255,255,255,0.92);
    border-top: 1px solid rgba(0,0,0,0.06);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 16px 40px rgba(0,0,0,0.028);
}

.tools-marquee::before,
.tools-marquee::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 2;
    width: 14%;
    pointer-events: none;
}

.tools-marquee::before {
    left: 0;
    background: linear-gradient(90deg, var(--white), rgba(255,255,255,0));
}

.tools-marquee::after {
    right: 0;
    background: linear-gradient(270deg, var(--white), rgba(255,255,255,0));
}

.tools-track {
    display: flex;
    width: max-content;
    min-width: max-content;
    animation: tools-marquee 60s linear infinite;
}

.tools-list {
    display: flex;
    flex: 0 0 auto;
    gap: 0.8rem;
    align-items: center;
    list-style: none;
    min-width: max-content;
    padding: 1rem 0.4rem;
}

.tools-list li {
    padding: 0.68rem 1.05rem;
    border: 1px solid rgba(0,0,0,0.09);
    border-radius: 999px;
    background: var(--tertiary);
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.tools-list li:hover {
    transform: translateY(-2px);
    border-color: rgba(0,0,0,0.16);
    background-color: var(--primary);
    color: var(--white);
}

.tools-list li.is-key {
    border-color: rgba(34,34,34,0.92);
    background-color: var(--primary);
    color: var(--white);
    box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}

.tools-list li.is-key:hover {
    background-color: #111111;
}

.tools-marquee:hover .tools-track {
    animation-play-state: paused;
}

@keyframes tools-marquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* Portfolio / Automations */
.section-header {
    margin-bottom: 5rem;
}

.tag {
    display: inline-block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
    color: var(--secondary);
    font-weight: 500;
}

.section-header h2 {
    font-size: 4rem;
    font-weight: 300;
    letter-spacing: -0.03em;
}

.portfolio-list {
    display: flex;
    flex-direction: column;
}

.portfolio-item {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 3rem;
    padding: 4rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    align-items: center;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-item:first-child {
    border-top: 1px solid rgba(0,0,0,0.05);
}

.portfolio-item:hover {
    transform: translateX(20px);
}

.item-title h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.item-title p {
    font-size: 0.95rem;
    color: var(--secondary);
}

.item-desc {
    color: var(--secondary);
    font-size: 1.1rem;
    font-weight: 300;
}

.item-tags {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.item-tags span {
    padding: 0.5rem 1.2rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 2rem;
    font-size: 0.85rem;
    color: var(--secondary);
    background: var(--white);
}

.experience-case-grid {
    display: grid;
    grid-template-columns: minmax(180px, 260px);
    gap: 1.5rem;
    margin-top: 2rem;
}

.experience-case-grid.two-up {
    grid-template-columns: repeat(2, minmax(180px, 240px));
    max-width: 520px;
}

.experience-case-card {
    min-width: 0;
}

.experience-case-image {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 1rem;
    background: var(--tertiary);
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
}

.experience-case-image::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(34, 34, 34, 0.22);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.experience-case-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

.experience-case-image span {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    font-size: 2.2rem;
    line-height: 1;
    transform: translate(-50%, -50%) scale(0.92);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.experience-case-image:hover::before,
.experience-case-image:focus-visible::before,
.experience-case-image:hover span,
.experience-case-image:focus-visible span {
    opacity: 1;
}

.experience-case-image:hover img,
.experience-case-image:focus-visible img {
    filter: grayscale(15%);
    transform: scale(1.035);
}

.experience-case-image:hover span,
.experience-case-image:focus-visible span {
    transform: translate(-50%, -50%) scale(1);
}

.experience-case-image:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

.experience-case-card h4 {
    margin-top: 1rem;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.25;
}

.experience-case-card p {
    margin-top: 0.35rem;
    color: var(--secondary);
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.55;
}

/* Ongoing Project Badge */
.ongoing-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.4rem 1rem 0.4rem 0.75rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(16, 185, 129, 0.06));
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 2rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: #16a34a;
    letter-spacing: 0.02em;
}

.ongoing-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #22c55e;
    flex-shrink: 0;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);
    }
}

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

    .tools-marquee {
        overflow: visible;
    }

    .tools-marquee::before,
    .tools-marquee::after {
        display: none;
    }

    .tools-track {
        width: auto;
        min-width: 0;
        padding: 1rem 4rem;
        animation: none;
    }

    .tools-list {
        min-width: 0;
        flex-wrap: wrap;
        padding: 0;
    }

    .tools-list[aria-hidden="true"] {
        display: none;
    }

    .ongoing-dot {
        animation: none;
    }
}

/* Footer CTA */
.footer-cta {
    text-align: center;
    padding: 10rem 4rem;
    background-color: var(--tertiary);
}

.footer-cta h2 {
    font-size: 5rem;
    margin-bottom: 2rem;
    font-weight: 300;
    letter-spacing: -0.04em;
}

.footer-cta p {
    color: var(--secondary);
    font-size: 1.3rem;
    margin-bottom: 3rem;
    font-weight: 300;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Footer */
.footer {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background-color: #1f1f1f;
    color: var(--white);
    padding: 5.5rem 4rem;
}

.footer::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 150px 150px;
    opacity: 0.28;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 12%, #000 88%, transparent 100%);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 3rem;
    position: relative;
    z-index: 1;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.footer-links a {
    padding: 0.75rem 1.1rem;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.78);
    transition: color 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
    font-size: 0.95rem;
    font-weight: 400;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    transform: translateY(-1px);
}

.email-link {
    max-width: 100%;
    color: var(--white);
    font-size: clamp(2rem, 4.8vw, 4.5rem);
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.055em;
    text-align: right;
    overflow-wrap: anywhere;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.32);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.email-link:hover,
.email-link:focus-visible {
    opacity: 0.82;
    transform: translateY(-1px);
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 5vh;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.show {
    display: block;
    opacity: 1;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    padding: 0.25rem 0.55rem;
    border: 0;
    background: transparent;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: 300;
    line-height: 1;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
    outline-color: #f1f1f1;
}

.clickable-image {
    transform-origin: center;
}

/* Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-title { font-size: 16vw; }
    .hero-image { width: 55%; right: 0; }
    .about-grid-3 { grid-template-columns: 1fr; gap: 4rem; }
    .tools-track { animation-duration: 28s; }
    .portfolio-item { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .item-tags { justify-content: flex-start; grid-column: 1 / -1; }
    .experience-case-grid.two-up { grid-template-columns: 1fr; max-width: 560px; }
    .footer-cta h2 { font-size: 4rem; }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem 1.5rem;
        flex-wrap: wrap;
        gap: 0.75rem 1rem;
    }

    .nav {
        order: 3;
        display: flex;
        width: 100%;
        gap: 1rem;
        overflow-x: auto;
        padding: 0.25rem 0 0.1rem;
        scrollbar-width: none;
    }

    .nav::-webkit-scrollbar {
        display: none;
    }

    .nav a {
        flex: 0 0 auto;
        font-size: 0.86rem;
    }

    .header .btn {
        font-size: 0.9rem;
    }
    
    .hero { padding: 10rem 2rem 2rem; flex-direction: column; }
    .hero-content { align-items: flex-start; padding-top: 2rem; }
    .hero-title { font-size: 22vw; }
    .hero-image { position: relative; width: 100%; height: 55vh; margin-top: 2rem; }
    .stats { gap: 2rem; margin-bottom: 2rem; }
    
    section { padding: 5rem 2rem; }
    
    .about { margin: 0; padding: 5rem 2rem; }
    .about-grid-3 { grid-template-columns: 1fr; gap: 3rem; }
    .tools-system { padding: 0 0 4.5rem; }
    .tools-heading { padding: 0 2rem 1.25rem; }
    .tools-heading h2 { margin-bottom: 1rem; }
    .tools-heading p { font-size: 2rem; }
    .tools-track { animation-duration: 26s; }
    .tools-list { gap: 0.65rem; }
    .tools-list li { padding: 0.65rem 0.9rem; font-size: 0.86rem; }
    
    .portfolio-item { grid-template-columns: 1fr; gap: 1.5rem; padding: 3rem 0; }
    .portfolio-item:hover { transform: translateY(-5px); }
    .experience-case-grid,
    .experience-case-grid.two-up { grid-template-columns: 1fr; max-width: none; }
    .experience-case-image span { width: 60px; height: 60px; font-size: 1.8rem; opacity: 1; }
    .experience-case-image::before { opacity: 0.12; }
    
    .footer-cta { padding: 6rem 2rem; }
    .footer-cta h2 { font-size: 3rem; }
    .footer { padding: 4rem 1.5rem; }
    .footer-content { flex-direction: column; gap: 2.5rem; text-align: center; }
    .footer-links { justify-content: center; }
    .email-link { text-align: center; font-size: clamp(2rem, 10vw, 3rem); }
}
