@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;700;900&display=swap');

:root {
    --bg: #ffffff;
    --text: #000000;
    --muted: #666666;
    --border: #e0e0e0;
    --accent: #000000;
    --transition: 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

[data-theme="dark"] {
    --bg: #0a0a0a;
    --text: #ffffff;
    --muted: #a0a0a0;
    --border: #262626;
    --accent: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    border-color: var(--border);
}

body {
    background-color: var(--bg);
    color: var(--text);
    transition: background-color var(--transition), color var(--transition);
    line-height: 1.4;
}

/* Swiss Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 1100;
    transition: background-color var(--transition);
}

.nav-brand {
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -1px;
    font-size: 1.2rem;
    z-index: 1200;
    color: var(--text);
    text-decoration: none;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 1200;
}

.nav-links {
    display: none; /* Hidden on mobile by default */
    gap: 30px;
}

@media (min-width: 901px) {
    .nav-links { display: flex; }
    .menu-btn { display: none !important; }
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    transition: var(--transition);
}

/* Mobile Menu Button */
.menu-btn {
    background: none;
    border: none;
    color: var(--text);
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.8rem;
    cursor: pointer;
    letter-spacing: 1px;
    padding: 10px;
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    transform: translateY(-100%);
    transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1), background-color var(--transition);
}

.mobile-overlay.active {
    transform: translateY(0);
}

.mobile-overlay a {
    font-size: 3.5rem;
    font-weight: 900;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -2px;
}

.theme-toggle {
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text);
    display: flex;
    align-items: center;
}

/* Grid Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

section {
    padding: 100px 40px;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
}

.section-label {
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--muted);
}

/* Hero */
.hero {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    grid-column: 1 / -1;
    padding: 200px 40px;
    gap: 60px;
}

.hero-content {
    flex: 1;
}

.hero-image {
    flex: 0 0 400px;
    aspect-ratio: 4 / 5;
    background: var(--border);
    overflow: hidden;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1);
    transition: var(--transition);
}

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

.hero h1 {
    font-size: clamp(4rem, 15vw, 10rem);
    font-weight: 900;
    line-height: 0.85;
    letter-spacing: -0.05em;
    text-transform: uppercase;
    margin-bottom: 30px;
}

.hero p {
    font-size: clamp(1.2rem, 3vw, 2rem);
    max-width: 800px;
    font-weight: 300;
    line-height: 1.2;
}

.hero-actions {
    display: flex;
    gap: 20px;
    margin-top: 40px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid var(--text);
    transition: var(--transition);
    cursor: pointer;
    background: transparent;
    color: var(--text);
}

.button-primary {
    background: var(--text);
    color: var(--bg);
}

.button-primary:hover {
    background: transparent;
    color: var(--text);
}

.button-secondary:hover {
    background: var(--text);
    color: var(--bg);
}

/* Expertise */
.expertise-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.expertise-box h3 {
    font-size: 1.5rem;
    text-transform: uppercase;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.skill-list {
    list-style: none;
}

.skill-list li {
    font-size: 1rem;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

/* Portfolio with Images */
.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.project-card {
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: var(--transition);
}

.project-image-wrapper {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--border);
    overflow: hidden;
    position: relative;
}

.project-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    filter: grayscale(1);
    transition: var(--transition);
    opacity: 0.8;
}

.project-card:hover .project-image-wrapper img {
    filter: grayscale(0);
    transform: scale(1.05);
    opacity: 1;
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.project-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--muted);
}

.project-name {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

/* Archive List */
.archive-list {
    display: flex;
    flex-direction: column;
}

.archive-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
}

a.archive-item:hover {
    opacity: 0.7;
    padding-left: 10px;
}

.archive-name {
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
}

.archive-meta {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
}

/* Free Templates */
.templates-content {
    min-width: 0;
}

.templates-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
    align-items: end;
    gap: 64px;
    margin-bottom: 80px;
}

.templates-intro h2 {
    max-width: 760px;
    padding-right: 24px;
    font-size: clamp(2.8rem, 6vw, 5.5rem);
    font-weight: 900;
    line-height: 0.94;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}

.templates-intro p {
    max-width: 440px;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
    align-items: start;
}

.template-card {
    grid-column: auto;
}

.template-card-lead {
    grid-column: auto;
}

.template-preview {
    display: block;
    position: relative;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    padding: 0;
    border: 1px solid var(--border);
    background: var(--border);
    color: #ffffff;
    cursor: zoom-in;
    text-align: left;
}

.template-slides {
    position: absolute;
    inset: 0;
    display: block;
}

.template-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #111111;
    opacity: 0;
    transform: scale(1.01);
    transition: opacity 0.45s ease, filter var(--transition), transform 0.7s ease;
}

.template-slide.is-active {
    opacity: 1;
    transform: scale(1);
}

.template-preview:hover .template-slide.is-active,
.template-preview:focus-visible .template-slide.is-active {
    filter: saturate(1.12);
}

.template-preview-meta {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    padding: 11px 14px 10px;
    background: rgba(0, 0, 0, 0.78);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
}

.template-progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    height: 2px;
    overflow: hidden;
}

.template-progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: #ffffff;
    transform-origin: left;
}

.template-preview.is-running .template-progress span {
    animation: template-progress 2s linear infinite;
}

@keyframes template-progress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.template-preview-scroll .template-scroll-image {
    right: auto;
    bottom: auto;
    top: 0;
    width: 100%;
    height: auto;
    object-fit: initial;
    transform: translateY(0);
    transition: filter var(--transition);
    will-change: top, transform;
}

.template-preview-scroll.is-running .template-scroll-image {
    animation: template-page-scroll 16s cubic-bezier(0.65, 0, 0.35, 1) infinite alternate;
}

.template-preview-scroll.is-running .template-progress span {
    animation-duration: 16s;
}

@keyframes template-page-scroll {
    0%, 8% { top: 0; transform: translateY(0); }
    92%, 100% { top: 100%; transform: translateY(-100%); }
}

.template-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding-top: 20px;
}

.template-category {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.template-info h3 {
    font-size: clamp(1.35rem, 2.5vw, 2rem);
    line-height: 1;
    text-transform: uppercase;
}

.template-link {
    flex: 0 0 auto;
    padding-bottom: 4px;
    border-bottom: 1px solid currentColor;
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 900;
    text-decoration: none;
    text-transform: uppercase;
    transition: opacity var(--transition);
}

.template-link:hover {
    opacity: 0.55;
}

.template-dialog {
    width: min(1120px, calc(100% - 48px));
    max-height: calc(100vh - 48px);
    margin: auto;
    padding: 0;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}

.template-dialog::backdrop {
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(4px);
}

.template-dialog-shell {
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.template-dialog-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.template-dialog-header span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
}

.template-dialog-header h2 {
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    line-height: 1;
    text-transform: uppercase;
}

.template-dialog-close {
    display: inline-grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.template-dialog-close:hover,
.template-dialog-close:focus-visible {
    background: var(--text);
    color: var(--bg);
}

.template-dialog-grid {
    display: grid;
    gap: 1px;
    padding: 1px;
    background: var(--border);
}

.template-dialog-grid figure {
    background: var(--bg);
}

.template-dialog-grid img {
    display: block;
    width: 100%;
    height: auto;
}

.template-dialog-grid figcaption {
    padding: 12px 16px 16px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

body.dialog-open {
    overflow: hidden;
}

/* Journey */
.journey-item { margin-bottom: 60px; }
.journey-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 15px;
}
.journey-role { font-size: 1.5rem; font-weight: 900; text-transform: uppercase; }

/* Contact */
.contact-content { display: flex; flex-direction: column; gap: 20px; }
.contact-link {
    font-size: clamp(2rem, 8vw, 3rem);
    font-weight: 900;
    text-decoration: none;
    color: var(--text);
    line-height: 1;
    transition: var(--transition);
    width: fit-content;
}
.contact-link:hover { -webkit-text-stroke: 1px var(--text); color: transparent; }

footer {
    padding: 40px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    color: var(--muted);
}

.instagram-post {
    max-height: 540px;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.instagram-post blockquote {
    min-width: 100% !important;
    margin: 0 !important;
}

@media (max-width: 900px) {
    section { grid-template-columns: 1fr; gap: 30px; padding: 60px 20px; }
    .hero { padding: 150px 20px 80px 20px; flex-direction: column-reverse; text-align: center; }
    .hero-image { flex: 0 0 auto; width: 100%; max-width: 300px; }
    .portfolio-grid { grid-template-columns: 1fr; }
    .templates-intro { grid-template-columns: 1fr; gap: 24px; margin-bottom: 48px; }
    .templates-intro h2 { font-size: clamp(2.4rem, 12vw, 4.2rem); }
    .templates-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
    .template-card,
    .template-card-lead,
    .template-card:nth-child(3) { grid-column: 1; }
    .template-info { align-items: flex-start; flex-direction: column; gap: 16px; }
    .template-dialog { width: calc(100% - 24px); max-height: calc(100vh - 24px); }
    .template-dialog-shell { max-height: calc(100vh - 24px); }
    .template-dialog-header { padding: 16px; }
    .hero h1 { font-size: 3.5rem; margin-bottom: 20px; }
    nav { padding: 0 20px; }
    
    .expertise-grid {
        grid-template-columns: 1fr;
    }

    #instagram .portfolio-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 20px;
        gap: 30px;
    }
    
    #instagram .instagram-post {
        flex: 0 0 75%;
        max-width: 320px;
        scroll-snap-align: center;
    }

    .archive-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .journey-header {
        flex-direction: column;
        gap: 5px;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .mobile-overlay a {
        font-size: 2.5rem;
    }

    footer {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        text-align: center;
        padding: 40px 20px;
    }
}

@media (max-width: 560px) {
    .templates-grid { grid-template-columns: 1fr; gap: 48px; }
}

@media (prefers-reduced-motion: reduce) {
    .template-slide { transition: none; }
    .template-preview.is-running .template-progress span { animation: none; transform: scaleX(1); }
    .template-preview-scroll.is-running .template-scroll-image { animation: none; transform: translateY(0); }
}

body.menu-open {
    overflow: hidden;
}

/* Animation on Scroll */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1), transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: opacity, transform;
}

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

/* Stagger for grid items on desktop */
@media (min-width: 901px) {
    .portfolio-grid .reveal:nth-child(2) { transition-delay: 0.1s; }
    .portfolio-grid .reveal:nth-child(3) { transition-delay: 0.2s; }
    .portfolio-grid .reveal:nth-child(4) { transition-delay: 0.3s; }
    .portfolio-grid .reveal:nth-child(5) { transition-delay: 0.4s; }
    .portfolio-grid .reveal:nth-child(6) { transition-delay: 0.5s; }
}
