/* ==========================================================================
   styles-index.css - Index Page Specific Styles
   Used only by index.html
   ========================================================================== */

/* Override line height for index page */
:root {
    --line-height-tight: 1.2;
    --line-height-normal: 1.2;
}

/* Typewriter Animation */
.hero h1 {
    font-size: clamp(60px, 12vw, 180px);
    margin-bottom: var(--space-sm);
}

.hero h1 .ka-prefix {
    background: linear-gradient(to bottom right, var(--color-highlight), var(--color-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.typewriter {
    display: inline-block;
    position: relative;
    min-width: 0.5ch;
    margin-right: 8px;
}

.typewriter::after {
    content: '';
    position: absolute;
    right: -12px;
    top: 10%;
    bottom: 10%;
    width: 8px;
    background: linear-gradient(to bottom, var(--color-highlight), var(--color-dark));
    animation: blink 0.7s step-end infinite;
}

.typewriter-be {
    display: inline-block;
    position: relative;
    min-width: 0.5ch;
    margin-right: 8px;
}

.typewriter-be::after {
    content: '';
    position: absolute;
    right: -12px;
    top: 10%;
    bottom: 10%;
    width: 4px;
    background: linear-gradient(to bottom, var(--color-highlight), var(--color-dark));
    animation: blink 0.7s step-end infinite;
}

.typewriter-dead {
    display: inline-block;
    position: relative;
    min-width: 0.5ch;
    margin-right: 8px;
}

.typewriter-dead::after {
    content: '';
    position: absolute;
    right: -12px;
    top: 10%;
    bottom: 10%;
    width: 4px;
    background: linear-gradient(to bottom, var(--color-highlight), var(--color-dark));
    animation: blink 0.7s step-end infinite;
}

.typewriter-human {
    display: inline-block;
    position: relative;
    min-width: 0.5ch;
    margin-right: 8px;
}

.typewriter-human::after {
    content: '';
    position: absolute;
    right: -12px;
    top: 10%;
    bottom: 10%;
    width: 4px;
    background: linear-gradient(to bottom, var(--color-highlight), var(--color-dark));
    animation: blink 0.7s step-end infinite;
}

@keyframes blink {
    from, to {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* Hero Section */
.hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-xl) 0 var(--space-md);
}

.hero-subtitle {
    font-size: 32px;
    line-height: var(--line-height-normal);
    margin-bottom: var(--space-lg);
    max-width: none;
}

.hero-subtitle p {
    max-width: none;
}

/* Navigation */
.main-nav {
    display: flex;
    gap: var(--space-xl);
    margin: var(--space-lg) 0;
}

.nav-link {
    font-size: 32px;
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--color-text-light);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--color-highlight);
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    text-decoration: none;
    transition: color 0.3s ease;
    cursor: pointer;
}

.nav-icon:hover {
    color: var(--color-highlight);
}

.nav-icon svg {
    width: 32px;
    height: 32px;
}

.nav-tab.active {
    color: var(--color-highlight);
}

/* Tab Slides System */
.tab-slides {
    position: relative;
    width: 100%;
}

.tab-slide {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-slide.active {
    display: block;
}

/* Full width for non-home tabs */
.tab-slide[data-content="experience"],
.tab-slide[data-content="about"] {
    grid-column: 1 / -1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Experience List */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.experience-item {
    padding-bottom: 0;
}

.experience-item h6 {
    margin-bottom: var(--space-xs);
}

.experience-date {
    font-size: var(--font-size-footnote);
    color: var(--color-highlight);
    margin-bottom: var(--space-xs);
    max-width: none;
}

.experience-item p:last-child {
    max-width: 100%;
    color: var(--color-text-light);
    margin-bottom: 0;
}

/* About Text */
.about-text p {
    margin-bottom: var(--space-lg);
    max-width: 100%;
    color: var(--color-text-light);
}

/* Tab Headlines */
.tab-headline {
    position: relative;
}

.tab-headline-content {
    display: none;
}

.tab-headline-content.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

/* Hide headline column when not on home tab */
#work:has(.tab-slide[data-content="experience"].active) .tab-headline,
#work:has(.tab-slide[data-content="about"].active) .tab-headline {
    display: none;
}

/* Floating Actions override for index (smaller gap) */
.floating-actions {
    gap: var(--space-sm);
}

/* Button */
.button {
    display: inline-block;
    padding: var(--space-md) var(--space-xl);
    background: transparent;
    color: var(--color-text);
    text-decoration: none;
    border-radius: 100px;
    font-size: 32px;
    border: 2px solid var(--color-text);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.1s ease-out;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.button span {
    display: inline-block;
    transition: transform 0.1s ease-out;
}

.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom right, var(--color-highlight), var(--color-dark));
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.button:hover {
    border-color: transparent;
    color: #FFFDFC;
    transform: translateY(-2px);
}

.button:hover::before {
    opacity: 1;
}

/* Image Grid */
.image-grid {
    display: grid;
    gap: var(--space-md);
    margin: var(--space-2xl) 0;
}

.grid-layout-1 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 200px);
}

.grid-layout-1 .grid-item:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / 3;
}

.grid-layout-1 .grid-item:nth-child(2) {
    grid-column: 2;
    grid-row: 1 / 3;
}

.grid-layout-1 .grid-item:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
}

.grid-layout-1 .grid-item:nth-child(4) {
    grid-column: 3;
    grid-row: 2;
}

.grid-layout-1 .grid-item:nth-child(5) {
    grid-column: 1;
    grid-row: 3;
}

.grid-layout-1 .grid-item:nth-child(6) {
    grid-column: 2 / 4;
    grid-row: 3;
}

.grid-layout-2 {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: repeat(2, 250px);
}

.grid-layout-2 .grid-item:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / 3;
}

.grid-layout-2 .grid-item:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
}

.grid-layout-2 .grid-item:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
}

.grid-layout-2 .grid-item:nth-child(4) {
    grid-column: 3;
    grid-row: 1 / 3;
}

/* Grid Layout 3 - für 3 Bilder (1 groß links, 2 klein rechts) */
.grid-layout-3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
}

.grid-layout-3 .grid-item:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.grid-layout-3 .grid-item:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
}

.grid-layout-3 .grid-item:nth-child(3) {
    display: none;
}

.grid-item {
    background: var(--color-surface);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.grid-layout-2 .grid-item {
    min-height: 100%;
}

.grid-item img,
.grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.grid-item:hover img,
.grid-item:hover video {
    filter: blur(8px);
}

/* Hover Overlay */
.grid-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.7);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    padding: var(--space-lg);
}

.grid-item:hover .grid-item-overlay {
    opacity: 1;
}

.grid-item-overlay p {
    color: var(--color-text);
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
}

.grid-item-overlay p:first-child {
    font-size: var(--font-size-footnote);
    margin-bottom: var(--space-xs);
}

.grid-item-overlay p:last-child {
    font-size: var(--font-size-base);
}

/* Section */
.section {
    padding: var(--space-2xl) 0;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-2xl);
    align-items: start;
}

.section-title {
    position: sticky;
    top: var(--space-2xl);
}

.section-content h3 {
    font-size: clamp(32px, 4vw, 56px);
    margin-bottom: var(--space-md);
}

.section-content p {
    font-size: var(--font-size-base);
    color: var(--color-text-light);
}

/* Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-top: var(--space-2xl);
}

.card {
    background: transparent;
    overflow: visible;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-image {
    width: 100%;
    aspect-ratio: 3 / 2;
    background: var(--color-surface);
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    transition: background-color 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image:hover {
    background: #F9F4F0;
}

.card-icon {
    font-size: 64px;
    transition: transform 0.1s ease-out;
    user-select: none;
}

.card-image .card-icon-img {
    width: auto;
    height: 64px;
    transition: transform 0.1s ease-out;
    user-select: none;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover .card-image img {
    filter: blur(8px) brightness(1.5);
}

.card:hover .card-image .card-icon-img {
    filter: none;
}

.card-content {
    padding: var(--space-md) 0;
}

.card-title {
    font-size: var(--font-size-h6);
    font-family: var(--font-headings);
    font-weight: 400;
    margin-bottom: 0;
    letter-spacing: 0;
}

/* Footer override for index */
.footer {
    padding: var(--space-2xl) 0 var(--space-xl);
    border-top: 1px solid var(--color-border);
}

/* Portfolio Sections - always 120% of container */
.portfolio-section-wide {
    width: 120%;
    margin-left: -10%;
}

/* Responsive */
@media (max-width: 1024px) {
    section[style*="width: 120%"] {
        width: 120% !important;
        margin-left: -10% !important;
    }

    /* Curated/Print/Digital Sections - 1 column layout */
    #work,
    section[style*="grid-template-columns: 4fr 1fr"],
    section[style*="grid-template-columns: 1fr 4fr"] {
        grid-template-columns: 1fr !important;
        gap: var(--space-sm) !important;
    }

    /* Headline h4 margin reduzieren */
    .tab-headline h4,
    section[style*="grid-template-columns"] > div:not(.tab-slides):not(.image-grid) h4 {
        margin-bottom: var(--space-sm);
    }

    /* Headlines auf Content-Breite begrenzen */
    .tab-headline,
    section[style*="grid-template-columns"] > div:not(.tab-slides):not(.image-grid):has(h4) {
        width: calc(100% / 1.2);
        margin-left: calc(10% / 1.2);
    }

    /* Image grid margin reduzieren */
    .image-grid {
        margin: 0 !important;
    }

    /* Headlines immer zuerst - für 4fr 1fr Layout (Curated & Print) */
    section[style*="grid-template-columns: 4fr 1fr"] > .tab-slides,
    section[style*="grid-template-columns: 4fr 1fr"] > .image-grid {
        order: 2;
    }

    section[style*="grid-template-columns: 4fr 1fr"] > .tab-headline,
    section[style*="grid-template-columns: 4fr 1fr"] > div:not(.tab-slides):not(.image-grid) {
        order: 1;
    }

    .section {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .section-title {
        position: static;
    }

    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    section[style*="width: 120%"] {
        width: 120% !important;
        margin-left: -10% !important;
    }

    /* Content Section Text auf 100% Breite */
    section p[style*="max-width"] {
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Headlines auf Content-Breite begrenzen auf Mobile */
    .tab-headline,
    section[style*="grid-template-columns"] > div:not(.tab-slides):not(.image-grid):has(h4) {
        width: calc(100% / 1.2);
        margin-left: calc(10% / 1.2);
    }

    .break-mobile-ka::before {
        content: "\A";
        white-space: pre;
    }

    .main-nav {
        align-items: flex-start;
        flex-direction: column;
        gap: var(--space-md);
    }

    .grid-layout-1,
    .grid-layout-3,
    .grid-layout-2 {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .grid-layout-1 .grid-item,
    .grid-layout-3 .grid-item,
    .grid-layout-2 .grid-item {
        grid-column: 1 !important;
        grid-row: auto !important;
        min-height: 200px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }
}
