:root {
    /* Petrol zu Grau Farbthema */
    --bg-color: #111827;
    /* Dunkles Grau/Slate Basis */
    --card-bg: #1f2937;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;

    /* Petrol Akzente */
    --accent: #2dd4bf;
    /* Teal-400 - helles Petrol */
    --accent-dark: #0f766e;
    /* Teal-700 - dunkles Petrol */
    --accent-glow: rgba(45, 212, 191, 0.3);

    --gradient-petrol-gray: linear-gradient(135deg, #ccfbf1 0%, #94a3b8 100%);
    /* Helle Petrol zu Grau Verlauf */
    --gradient-bg: radial-gradient(circle at top right, #115e59 0%, transparent 40%),
        radial-gradient(circle at bottom left, #374151 0%, transparent 40%);

    --font-main: 'Outfit', sans-serif;
    --card-border: 1px solid rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Hintergrund Animation/Verlauf */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: var(--bg-color);
    /* Subtile Petrol & Grau Flecken */
    background-image: var(--gradient-bg);
}

/* Hero (Start) Bereich */
.hero-section {
    min-height: 40vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 10px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 800px;
    animation: fadeInUp 1s ease-out;
    z-index: 1;
}

.profile-frame {
    width: 180px;
    height: 180px;
    margin: 0 auto 30px;
    border-radius: 50%;
    padding: 5px;
    background: linear-gradient(45deg, var(--accent), #4b5563);
    box-shadow: 0 0 40px var(--accent-glow);
}

.hero-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-color);
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.1;
}

.gradient-text {
    /* Petrol Farbverlauf Text */
    background: linear-gradient(to right, #2dd4bf, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.typing-container {
    font-size: 1.5rem;
    color: var(--text-secondary);
    min-height: 1.6em;
    margin-bottom: 40px;
}

.cursor {
    display: inline-block;
    animation: blink 0.7s infinite;
    color: var(--accent);
    font-weight: bold;
}

/* Buttons */
.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn {
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.btn.primary {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
    border: none;
}

.btn.primary:hover {
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn.secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn.secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn:hover {
    transform: translateY(-3px);
}

/* Grid Layout (Bento) - Custom Areas */
.grid-container {
    max-width: 1200px;
    margin: 0 auto 100px;
    padding: 20px;
    display: grid;
    /* 3 Spalten: 1. Spalte für Stats, 2. & 3. für Skills */
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;

    /* Layout Definition via Areas */
    grid-template-areas:
        "about about about"
        "stat1 skills skills"
        "stat2 skills skills"
        "stat3 skills skills"
        "github github github"
        "timeline timeline timeline"
        "contact contact contact";
}

/* Fallback auto rows */
.grid-container>* {
    min-height: 180px;
}

.bento-item {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 25px;
    border: var(--card-border);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Subtiles Leuchten beim Drüberfahren (Hover) */
.bento-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(45, 212, 191, 0.05), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.bento-item:hover::after {
    opacity: 1;
}

.bento-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-dark);
}

/* Spezifische Karten Styles */
/* Zuweisung der Areas */
.about-card {
    grid-area: about;
    text-align: center;
}

.about-card p {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
}

.about-card h2 {
    color: var(--accent);
    margin-bottom: 15px;
}

.stat-card {
    align-items: center;
    text-align: center;
}

/* Stats explizit zuweisen */
.stat-location {
    grid-area: stat1;
}

.stat-age {
    grid-area: stat2;
}

.stat-stack {
    grid-area: stat3;
}

.stat-card i {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.skills-card {
    grid-area: skills;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.skills-card h2 i {
    margin-right: 10px;
    color: var(--accent);
}

/* Separator Line */
.separator-line {
    width: 60%;
    max-width: 200px;
    height: 2px;
    background: radial-gradient(ellipse at center, rgba(168, 118, 56, 0.6) 0%, transparent 70%);
    margin: 10px auto 20px;
}

/* Open Book Icon */
.open-book-icon {
    width: 60px;
    height: 40px;
    margin: 0 auto 20px;
    /* Center underneath the title */
    position: relative;
    perspective: 600px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.open-book-icon .page {
    width: 28px;
    height: 35px;
    background: #fef3c7;
    /* Parchment */
    border: 1px solid #d4d4d8;
    position: relative;
    transform-origin: center bottom;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.open-book-icon .left-page {
    border-radius: 5px 0 0 5px;
    transform: rotateY(15deg) skewY(-5deg);
    background: linear-gradient(to right, #e2e8f0 0%, #fef3c7 20%, #fef3c7 100%);
    box-shadow: -5px 5px 10px rgba(0, 0, 0, 0.2);
}

.open-book-icon .right-page {
    border-radius: 0 5px 5px 0;
    transform: rotateY(-15deg) skewY(5deg);
    background: linear-gradient(to left, #e2e8f0 0%, #fef3c7 20%, #fef3c7 100%);
    box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2);
}

/* Lines imitating text */
.open-book-icon .page::after {
    content: "";
    position: absolute;
    top: 5px;
    left: 4px;
    right: 4px;
    height: 20px;
    background: repeating-linear-gradient(transparent,
            transparent 3px,
            rgba(0, 0, 0, 0.1) 4px);
}

/* Book binding center */
.open-book-icon::before {
    content: '';
    position: absolute;
    bottom: -2px;
    width: 60px;
    height: 8px;
    background: #3f2e18;
    /* Leather color from checks */
    border-radius: 4px;
    z-index: -1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Skills Chart (Bücherstapel) */
.skills-chart-container {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 100%;
    min-height: 250px;
    padding: 20px 0 10px;
    gap: 15px;
    perspective: 1000px;
}

.skill-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    position: relative;
    transition: transform 0.3s;
    transform-style: preserve-3d;
}

.skill-column:hover {
    transform: translateY(-5px) rotateY(5deg);
}

.book-stack {
    display: flex;
    flex-direction: column-reverse;
    width: 100%;
    max-width: 55px;
    gap: 1px;
    /* Schatten unter dem Stapel */
    filter: drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.5));
}

.book {
    width: 100%;
    border-radius: 2px 4px 4px 2px;
    position: relative;
    transition: transform 0.2s, margin 0.2s;
    /* Basis-Stil für Buchrücken (Leder-Effekt) */
    background-image: linear-gradient(90deg,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0) 20%,
            rgba(0, 0, 0, 0.2) 80%,
            rgba(0, 0, 0, 0.4) 100%);
    box-shadow: inset 1px 0 2px rgba(255, 255, 255, 0.3),
        inset -1px 0 2px rgba(0, 0, 0, 0.5),
        0 1px 1px rgba(0, 0, 0, 0.3);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(0, 0, 0, 0.5);
    z-index: 1;
}

/* Goldene Bünde am Buchrücken */
.book::after {
    content: '';
    position: absolute;
    top: 10%;
    bottom: 10%;
    left: 4px;
    right: 4px;
    background: transparent;
    /* Gold-Linien simulieren */
    border-top: 1px solid rgba(255, 215, 0, 0.4);
    border-bottom: 1px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 4px 0 0 transparent,
        0 -4px 0 0 transparent;
    opacity: 0.7;
}

/* Alternative Gold-Verzierung für manche Bücher */
.book:nth-child(odd)::after {
    border-top: 2px double rgba(255, 215, 0, 0.5);
    border-bottom: 2px double rgba(255, 215, 0, 0.5);
}

.book:hover {
    transform: translateX(10px) scale(1.05);
    z-index: 100;
    margin-bottom: 3px;
    margin-top: 3px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.6);
}

/* Altmodische Buch-Farben (Leder) */
.book-1 {
    height: 16px;
    background-color: #581c1c;
    /* Dunkelrot */
}

.book-2 {
    height: 20px;
    background-color: #1e3a8a;
    /* Navy Blau */
}

.book-3 {
    height: 18px;
    background-color: #14532d;
    /* Waldgrün */
}

.book-4 {
    height: 22px;
    background-color: #3f2e18;
    /* Dunkles Lederbraun */
}

.book-5 {
    height: 19px;
    background-color: #2e1065;
    /* Tiefes Violett */
}

/* Titel als Etikett auf dem Buchrücken (optional, hier nur angedeutet) */
.book::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 15%;
    height: 4px;
    background: rgba(197, 169, 107, 0.3);
    /* Gold/Papier */
    transform: translateY(-50%);
    border-radius: 1px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}

.skill-label {
    margin-top: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #cbd5e1;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-family: 'Georgia', serif;
    /* Serifenschrift für altmodischen Look */
    letter-spacing: 0.5px;
}

.skill-column:hover .skill-label {
    color: #fbbf24;
    /* Amber/Gold */
}

/* Tooltips im Pergament-Stil */
.skill-tooltip {
    position: absolute;
    top: -45px;
    background: #fef3c7;
    /* Pergament-Farbe */
    color: #78350f;
    /* Braune Schrift */
    border: 1px solid #b45309;
    padding: 6px 12px;
    border-radius: 2px;
    font-family: 'Times New Roman', serif;
    font-style: italic;
    font-size: 0.9rem;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    transform: translateY(10px) rotate(-2deg);
    opacity: 0;
    z-index: 20;
    white-space: nowrap;
}

.skill-column:hover .skill-tooltip {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
}

/* GitHub Bereich */
.github-card {
    grid-area: github;
    min-height: 300px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header h2 i {
    margin-right: 10px;
}

.github-controls {
    display: flex;
    gap: 10px;
}

#github-username {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 8px;
    color: white;
    outline: none;
    font-family: inherit;
}

#github-username:focus {
    border-color: var(--accent);
}

.icon-btn {
    background: var(--accent-dark);
    border: none;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: var(--accent);
}

.repo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.repo-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.2s, border-color 0.2s;
}

.repo-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.repo-card h4 {
    color: var(--accent);
    margin-bottom: 10px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.repo-placeholder {
    color: var(--text-secondary);
    font-style: italic;
    grid-column: span 3;
    text-align: center;
    padding: 20px;
}

/* Zeitstrahl Bereich */
.timeline-section {
    grid-column: span 3;
    padding: 60px 0;
}

.timeline-section h2 {
    margin-bottom: 50px;
    text-align: center;
    font-size: 2.5rem;
    color: var(--text-primary);
}

.timeline-section h2 i {
    color: var(--accent);
    margin-right: 15px;
}

.timeline-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

/* Vertikale Linie des Zeittstrahls */
.timeline-container::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), var(--bg-color));
}

.timeline-entry {
    margin-bottom: 30px;
    position: relative;
    padding-left: 60px;
    cursor: pointer;
}

/* Punkt auf der Linie */
.timeline-dot {
    position: absolute;
    left: 11px;
    top: 0;
    width: 20px;
    height: 20px;
    background: var(--bg-color);
    border: 3px solid var(--accent);
    border-radius: 50%;
    z-index: 2;
    transition: background 0.3s, transform 0.3s;
}

.timeline-entry:hover .timeline-dot,
.timeline-entry.active .timeline-dot {
    background: var(--accent);
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Datums-Anzeige links */
.timeline-entry::before {
    content: attr(data-date);
    position: absolute;
    left: -180px;
    top: -2px;
    width: 160px;
    text-align: right;
    color: var(--accent);
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0.8;
}

.timeline-content {
    background: var(--card-bg);
    padding: 20px 25px;
    border-radius: 12px;
    border: var(--card-border);
    transition: border-color 0.3s;
}

.timeline-entry:hover .timeline-content {
    border-color: var(--accent-dark);
}

.timeline-content h3 {
    margin-bottom: 5px;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.timeline-content h4 {
    color: var(--text-secondary);
    margin-bottom: 0;
    font-weight: 400;
    font-size: 1rem;
}

.timeline-content .details {
    color: #cbd5e1;
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
    line-height: 1.7;
    animation: fadeIn 0.4s;
}

.timeline-entry.active .details {
    display: block;
}

/* Kontakt Footer */
.contact-footer {
    grid-column: span 3;
    text-align: center;
    padding: 60px 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(to bottom, var(--bg-color), #0f172a);
}

.contact-footer h2 {
    margin-bottom: 30px;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.contact-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-links a:hover {
    color: var(--accent);
}

/* Responsives Design */
@media (max-width: 900px) {
    .grid-container {
        /* Zurück zum einfachen Flow */
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "about about"
            "stat1 stat2"
            "stat3 skills"
            "github github"
            "timeline timeline"
            "contact contact";
    }

    .grid-container>.stat-card {
        min-height: 200px;
    }
}

@media (max-width: 600px) {
    .grid-container {
        grid-template-columns: 1fr;
        grid-template-areas:
            "about"
            "stat1"
            "stat2"
            "stat3"
            "skills"
            "github"
            "timeline"
            "contact";
    }

    .hero-section h1 {
        font-size: 2.5rem;
    }
}

/* Animationen - Blinken und Einblenden */
@keyframes blink {
    50% {
        opacity: 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Responsive Skills Chart */
@media (max-width: 1100px) {
    .skills-chart-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }

    .skill-column {
        flex: 1 1 30%;
        /* Etwa 3 Items pro Zeile -> Umbruch nach dem 3. */
        max-width: 30%;
        margin-bottom: 15px;
    }
}

@media (max-width: 600px) {
    .skill-column {
        flex: 1 1 45%;
        /* 2 Items pro Zeile auf Mobile */
        max-width: 45%;
    }
}