:root {
    --bg-color: #ffffff;
    --text-color: #111111;
    --sub-color: #555555;
    --border-color: #e5e5e5;
    --accent-color: #0033cc;
    --wind-speed-factor: 1;
}

@media print {

    /* 1. Force Clean White Paper Look */
    :root {
        --bg-color: #ffffff !important;
        --text-color: #000000 !important;
        --sub-color: #333333 !important;
    }

    body {
        background-color: white !important;
        color: black !important;
        padding: 0 !important;
    }

    /* 2. Hide Digital-Only Elements */
    .windpark-container,
    #email-trigger,
    noscript {
        display: none !important;
    }

    /* 3. Make Links Usable on Paper */
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #555;
    }

    /* 4. Prevent Awkward Cuts */
    section,
    .item {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    h1 {
        border-bottom: 2px solid black;
        padding-bottom: 5px;
    }
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Consolas, Monaco, 'Courier New', monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    font-size: 14px;
    padding: 4rem 1rem 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status {
    font-size: 0.9rem;
    color: var(--sub-color);
    display: block;
    margin-bottom: 3rem;
}

/* Sections */
section {
    margin-bottom: 3.5rem;
}

h2 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--sub-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    font-weight: normal;
}

/* Experience Blocks */
.item {
    margin-bottom: 2.5rem;
}

.item-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.item-sub {
    color: var(--sub-color);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.item-body {
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
    font-size: 0.95rem;
}

/* Lists within items */
.detail-list {
    list-style: none;
}

.detail-list li {
    margin-bottom: 0.4rem;
    position: relative;
    padding-left: 1rem;
}

.detail-list li::before {
    content: "-";
    position: absolute;
    left: 0;
    color: var(--sub-color);
}

/* Specification Table */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.spec-table td {
    padding: 0.6rem 0;
    vertical-align: top;
    border-bottom: 1px solid var(--border-color);
}

.spec-key {
    width: 170px;
    color: var(--sub-color);
    padding-right: 1rem;
}

.spec-val {
    color: var(--text-color);
}

/* Links */
a {
    color: var(--text-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
    text-decoration: none;
}

ul.links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 1rem;
}

/* Email Obfuscation Style */
.email-protect {
    color: var(--sub-color);
    cursor: text;
}

/* Windpark Animation */
.windpark-container {
    margin-top: auto;
    padding-top: 4rem;
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
}

.windpark {
    font-family: monospace;
    white-space: pre;
    line-height: 1;
    font-size: 24px;
    color: #999;
    margin-bottom: -4px;
    display: block;
}

@media (max-width: 600px) {
    .windpark-container {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .windpark {
        font-size: 16px;
    }
}

.turbine {
    display: inline-block;
    position: relative;
}

.turbine::before {
    content: "|";
    display: inline-block;
    animation: spin 1.2s steps(4) infinite;
    transform-origin: center;
}

.t1::before {
    animation-duration: calc(1.2s / var(--wind-speed-factor));
}

.t2::before {
    animation-duration: calc(0.9s / var(--wind-speed-factor));
}

.t3::before {
    animation-duration: calc(1.5s / var(--wind-speed-factor));
}

@keyframes spin {
    0% {
        content: "|";
    }

    25% {
        content: "/";
    }

    50% {
        content: "-";
    }

    75% {
        content: "\\";
    }
}

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

/* Projects Carousel */
.projects-track-wrapper {
    margin-top: 1rem;
    overflow: hidden;
}

.projects-track {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-right: 2rem;
    position: relative;
}

.projects-track::-webkit-scrollbar {
    display: none;
}

.project-slide {
    flex: 0 0 calc(88% - 0.375rem);
    scroll-snap-align: start;
}

.project-card {
    border: 1px solid var(--text-color);
    padding: 1.5rem;
    cursor: pointer;
    height: 100%;
    box-sizing: border-box;
}

.project-card:hover .project-view-link {
    background-color: var(--text-color);
    color: var(--bg-color);
    text-decoration: none;
}

.carousel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
}

.project-dots {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: 1px solid var(--text-color);
    background: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s;
}

.dot.active {
    background: var(--text-color);
}

.carousel-nav-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text-color);
    padding: 0 0.15rem;
}

.carousel-nav-btn:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
}

/* Project Popup */
#project-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

#project-popup.open {
    display: flex;
}

.popup-card {
    max-width: 520px;
    width: 100%;
    border: 1px solid var(--text-color);
    padding: 2rem;
    background: white;
    max-height: 90vh;
    overflow-y: auto;
}

.popup-card h2 {
    margin-top: 0;
    text-transform: uppercase;
    font-size: 1rem;
    border-bottom: 1px solid var(--text-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.popup-card img {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    margin: 0.75rem 0;
    border: none;
}

.popup-card p {
    font-size: 0.8rem;
    color: var(--sub-color);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.main-btn {
    background: var(--text-color);
    border: 1px solid var(--text-color);
    color: var(--bg-color);
    font-family: inherit;
    font-size: 0.75rem;
    padding: 0 1.2rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    height: 38px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin: 0;
}

.main-btn:hover {
    opacity: 0.9;
}

.github-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.75rem;
    padding: 0 1.2rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    background: none;
    height: 38px;
    box-sizing: border-box;
    line-height: 1;
    margin: 0;
}

.github-btn:hover {
    background: var(--text-color);
    color: var(--bg-color);
    text-decoration: none;
}

.github-btn svg {
    flex-shrink: 0;
}

@media print {
    #project-popup {
        display: none !important;
    }
}

/* Deep Dives Accordion */
.deep-dives-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.deep-dive-item {
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease;
    overflow: hidden;
}

.deep-dive-item:hover {
    border-color: var(--text-color);
}

.deep-dive-item.expanded {
    border-color: var(--text-color);
}

.deep-dive-header {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    user-select: none;
    font-weight: normal;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.deep-dive-toggle {
    font-family: monospace;
    width: 1.5rem;
    flex-shrink: 0;
    color: var(--sub-color);
}

.deep-dive-divider {
    color: var(--border-color);
    margin: 0 0.5rem;
    flex-shrink: 0;
    user-select: none;
}

.deep-dive-date {
    color: var(--sub-color);
    font-weight: normal;
    flex-shrink: 0;
}

.deep-dive-header-text {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
    gap: 0.15rem;
}

.deep-dive-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.deep-dive-tag {
    font-size: 0.7rem;
    color: var(--sub-color);
    line-height: 1.2;
}

.deep-dive-tag:not(:last-child)::after {
    content: "/";
    margin: 0 0.4rem;
    color: var(--border-color);
}

.deep-dive-title {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deep-dive-item.expanded .deep-dive-title {
    white-space: normal;
}

.deep-dive-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.2s ease-out;
}

.deep-dive-item.expanded .deep-dive-content {
    grid-template-rows: 1fr;
}

.deep-dive-inner {
    overflow: hidden;
}

.deep-dive-details {
    padding: 0.5rem 0.75rem 0.75rem 0.75rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
}

.deep-dive-abstract {
    color: var(--sub-color);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.deep-dive-link-container {
    margin-top: 0.35rem;
}

.deep-dive-link {
    font-size: 0.8rem;
    color: var(--text-color);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.deep-dive-link:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
    text-decoration: none;
}

@media print {
    .deep-dive-toggle {
        display: none !important;
    }
    .deep-dive-item {
        border: none !important;
        border-bottom: 1px solid var(--border-color) !important;
        margin-bottom: 1rem;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    .deep-dive-header {
        padding: 0.5rem 0 !important;
    }
    .deep-dive-content {
        grid-template-rows: 1fr !important;
    }
    .deep-dive-details {
        padding: 0.5rem 0 !important;
        border-top: none !important;
    }
    a[href^="writing/"]::after {
        content: " (olebehre.de/" attr(href) ")";
        font-size: 0.8em;
        color: #555;
    }
}

/* Footer */
footer {
    margin-top: 0;
    font-size: 0.75rem;
    color: #999;
    border-top: 1px solid var(--text-color);
    padding-top: 1rem;
}

