/* Quiet Dev / Firefighter — christian-witt.eu */

@font-face {
    font-family: "IBM Plex Sans";
    src: url("../assets/fonts/ibm-plex-sans-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("../assets/fonts/ibm-plex-sans-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("../assets/fonts/ibm-plex-sans-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("../assets/fonts/ibm-plex-sans-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Mono";
    src: url("../assets/fonts/ibm-plex-mono-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Mono";
    src: url("../assets/fonts/ibm-plex-mono-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #121418;
    --bg-elevated: #1a1e24;
    --bg-muted: #242933;
    --text: #ece8e1;
    --text-soft: #a7adb8;
    --accent: #d0453c;
    --accent-text: #e8645a;
    --accent-soft: rgba(208, 69, 60, 0.12);
    --accent-deep: #b0342c;
    --ok: #4fbf7a;
    --border: rgba(236, 232, 225, 0.12);
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    --grid-line: rgba(236, 232, 225, 0.045);
    --header-bg: rgba(18, 20, 24, 0.88);
    --radius: 14px;
    --wrap: 1100px;
    --font-sans: "IBM Plex Sans", "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", "Consolas", monospace;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--text);
    background:
        radial-gradient(1100px 560px at 8% -8%, rgba(208, 69, 60, 0.14), transparent 55%),
        radial-gradient(900px 500px at 92% 0%, rgba(70, 110, 140, 0.1), transparent 50%),
        var(--bg);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    transition: color 180ms var(--ease), opacity 180ms var(--ease);
}

a:hover {
    color: var(--accent-text);
}

:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 3px;
    border-radius: 4px;
}

.bg-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.wrap {
    width: min(100% - 2rem, var(--wrap));
    margin-inline: auto;
}

.mono {
    font-family: var(--font-mono);
}

/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(14px);
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 4rem;
}

.brand {
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.nav {
    display: none;
    gap: 1.25rem;
    margin-left: auto;
    font-size: 0.95rem;
}

.nav a {
    text-decoration: none;
    color: var(--text-soft);
}

.nav a:hover,
.nav a.is-active {
    color: var(--text);
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0 auto;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-soft);
    font-size: 0.75rem;
    white-space: nowrap;
    cursor: help;
}

.status[hidden] {
    display: none;
}

.nav + .status {
    margin-left: 1.25rem;
}

.status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 0 rgba(79, 191, 122, 0.6);
    animation: status-pulse 2.4s ease-out infinite;
}

@keyframes status-pulse {
    0% { box-shadow: 0 0 0 0 rgba(79, 191, 122, 0.55); }
    70% { box-shadow: 0 0 0 0.45rem rgba(79, 191, 122, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 191, 122, 0); }
}

/* Hero */

.hero {
    position: relative;
    padding: clamp(4rem, 12vw, 7.5rem) 0 clamp(7rem, 16vw, 10.5rem);
    overflow: hidden;
}

.hero-horizon {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: clamp(6.5rem, 16vw, 11rem);
    pointer-events: none;
    z-index: 0;
}

.hero-horizon::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: 0.28;
    mask-image: linear-gradient(to top, black 10%, transparent 75%);
    pointer-events: none;
}

.hero-mountains {
    display: block;
    width: 100%;
    height: 100%;
}

.hero .wrap {
    position: relative;
    z-index: 1;
}

.mountain {
    fill: #0b0d11;
}

/* ferne Vorkette */
.mountain-far {
    opacity: 0.22;
}

/* Wetterstein: Zugspitze (links, hoch) + breiter Schneefernerkopf + Alpspitze (rechts) */
.mountain-mid {
    opacity: 0.58;
}

/* Talboden / Vorberge vor Garmisch */
.mountain-near {
    opacity: 0.7;
}

/* Mini-Feuerwehr am Grat des rechten Gipfels (Alpspitze-ähnlich) */
.hero-truck {
    position: absolute;
    left: 61.1%;
    bottom: 56.5%;
    width: clamp(2rem, 3.8vw, 2.85rem);
    z-index: 2;
    transform: translate(-50%, 0) rotate(-30deg);
    transform-origin: 50% 100%;
    animation: truck-climb 18s linear infinite;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}

.hero-truck svg {
    display: block;
    width: 100%;
    height: auto;
}

.truck-body,
.truck-cab,
.truck-reel {
    fill: #d0453c;
}

.truck-shutter {
    fill: #a8b0b8;
}

.truck-stripe,
.truck-stripe-h,
.truck-badge {
    fill: #e8d84a;
}

.truck-window {
    fill: #1e2830;
}

.truck-doorline {
    fill: #b03830;
}

.truck-reel-inner {
    fill: #8a2e28;
}

.truck-wheel {
    fill: #1a1e24;
}

.truck-hub {
    fill: #8a9098;
}

.truck-light {
    fill: #4aa3ff;
    animation: blaulicht 0.7s steps(1, end) infinite;
}

@keyframes blaulicht {
    0%,
    49% { fill: #4aa3ff; opacity: 1; }
    50%,
    100% { fill: #1a4a8a; opacity: 0.55; }
}

/*
 * Gratpunkte (viewBox 1440×180), bottom etwas in die Silhouette gesetzt.
 * left = Mitte des Fahrzeugs (via translate -50%).
 * 880/74 → 930/42 → 960/28 → 985/38 → 1020/68 → 1060/96
 */
@keyframes truck-climb {
    0% {
        left: 61.1%;
        bottom: 56.5%;
        transform: translate(-50%, 0) rotate(-32deg) scale(0.92);
        opacity: 0;
    }
    5% { opacity: 1; }
    22% {
        left: 63.2%;
        bottom: 68%;
        transform: translate(-50%, 0) rotate(-31deg) scale(1);
        opacity: 1;
    }
    38% {
        left: 64.6%;
        bottom: 74.5%;
        transform: translate(-50%, 0) rotate(-28deg) scale(1);
        opacity: 1;
    }
    50% {
        left: 65.8%;
        bottom: 79.5%;
        transform: translate(-50%, 0) rotate(-18deg) scale(1);
        opacity: 1;
    }
    56% {
        left: 66.7%;
        bottom: 82%;
        transform: translate(-50%, 0) rotate(-2deg) scale(1);
        opacity: 1;
    }
    62% {
        left: 67.6%;
        bottom: 80%;
        transform: translate(-50%, 0) rotate(14deg) scale(1);
        opacity: 1;
    }
    70% {
        left: 68.4%;
        bottom: 76.5%;
        transform: translate(-50%, 0) rotate(22deg) scale(1);
        opacity: 1;
    }
    84% {
        left: 70.8%;
        bottom: 60%;
        transform: translate(-50%, 0) rotate(34deg) scale(0.97);
        opacity: 1;
    }
    100% {
        left: 73.2%;
        bottom: 45%;
        transform: translate(-50%, 0) rotate(40deg) scale(0.92);
        opacity: 0;
    }
}

.role-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.9rem;
    color: var(--accent-text);
    font-size: 0.88rem;
    letter-spacing: 0.03em;
}

.role-sep {
    color: var(--text-soft);
    opacity: 0.7;
}

.hero-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0 0 1rem;
}

.hero-avatar {
    flex: 0 0 auto;
    width: clamp(4.25rem, 12vw, 6.5rem);
    height: clamp(4.25rem, 12vw, 6.5rem);
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(208, 69, 60, 0.5);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
    background: var(--bg-muted);
}

.hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-name {
    margin: 0;
    font-size: clamp(2.4rem, 7vw, 5rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

.hero-lead {
    margin: 0;
    max-width: 36rem;
    color: var(--text-soft);
    font-size: clamp(1.05rem, 2.2vw, 1.25rem);
}

.facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0;
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
    color: var(--text-soft);
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

.facts li + li::before {
    content: "·";
    margin: 0 0.6rem;
    color: var(--accent-text);
}

.hero-meta {
    margin: 1.75rem 0 0;
}

.hero-meta a {
    color: var(--accent-text);
    text-decoration: none;
}

.hero-meta a:hover {
    opacity: 0.8;
}

/* Sections */

.section {
    padding: clamp(3rem, 8vw, 5rem) 0;
}

.section-head h2,
.section-contact h2 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    letter-spacing: -0.03em;
}

.section-intro {
    margin: 0.85rem 0 0;
    max-width: 36rem;
    color: var(--text-soft);
}

.section-head {
    margin-bottom: 2.5rem;
}

/* Projects */

.project-grid {
    display: grid;
    gap: 1.5rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 280ms var(--ease), border-color 280ms var(--ease);
}

.project-card:hover {
    transform: translateY(-3px);
    border-color: rgba(208, 69, 60, 0.45);
}

.project-media {
    display: block;
    overflow: hidden;
    background: var(--bg-muted);
    aspect-ratio: 16 / 10;
    text-decoration: none;
}

.project-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 500ms var(--ease);
}

.project-card:hover .project-media img {
    transform: scale(1.03);
}

.project-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.25rem 1.35rem 1.4rem;
}

.project-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.project-top h3 {
    margin: 0;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

.project-index {
    color: var(--text-soft);
    font-size: 0.85rem;
}

.project-body > p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.98rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tags li {
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-text);
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.tags-lg li {
    font-size: 0.78rem;
    padding: 0.35rem 0.7rem;
}

.project-link {
    align-self: flex-start;
    margin-top: auto;
    padding-top: 0.25rem;
    color: var(--accent-text);
    text-decoration: none;
    font-size: 0.9rem;
}

.project-link:hover {
    opacity: 0.8;
}

/* About */

.section-about {
    border-block: 1px solid var(--border);
    background:
        linear-gradient(135deg, rgba(208, 69, 60, 0.07), transparent 40%),
        color-mix(in srgb, var(--bg-elevated) 70%, transparent);
}

.section-about .section-head {
    margin-bottom: 1.5rem;
}

.about-content {
    max-width: 42rem;
}

.about-content p {
    margin: 0 0 1rem;
    color: var(--text-soft);
}

.about-content p:last-of-type {
    margin-bottom: 1.5rem;
}

/* Contact */

.contact-mail {
    display: inline-block;
    margin-top: 1.5rem;
    font-size: 1.15rem;
    color: var(--accent-text);
    text-decoration: none;
}

.contact-mail:hover {
    opacity: 0.85;
}

/* Footer */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0 2rem;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.footer-copy {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.82rem;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
}

.footer-nav a {
    color: var(--text-soft);
    text-decoration: none;
}

.footer-nav a:hover {
    color: var(--accent-text);
}

/* Reveal */

.js .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

.js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

.hero .reveal:nth-child(1) { transition-delay: 40ms; }
.hero .reveal:nth-child(2) { transition-delay: 120ms; }
.hero .reveal:nth-child(3) { transition-delay: 200ms; }
.hero .reveal:nth-child(4) { transition-delay: 280ms; }
.hero .reveal:nth-child(5) { transition-delay: 360ms; }

/* Legal pages */

.legal-page {
    padding: clamp(3rem, 8vw, 5rem) 0;
}

.legal-page h1 {
    margin: 0 0 1.5rem;
    font-size: clamp(2rem, 5vw, 2.8rem);
    letter-spacing: -0.03em;
}

.legal-page h2 {
    margin: 2rem 0 0.75rem;
    font-size: 1.2rem;
}

.legal-page p,
.legal-page li {
    color: var(--text-soft);
}

.legal-page ul {
    padding-left: 1.2rem;
}

.legal-back {
    display: inline-block;
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-text);
    text-decoration: none;
}

.legal-page a {
    color: var(--accent-text);
}

/* 404 */

.error-page {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: 5.5rem 0 0;
    overflow: hidden;
}

.error-content {
    position: relative;
    z-index: 1;
    padding-bottom: clamp(8rem, 22vw, 12rem);
}

.error-code {
    margin: 0 0 0.75rem;
    color: var(--accent-text);
    font-size: 0.88rem;
}

.error-page h1 {
    margin: 0 0 1rem;
    font-size: clamp(2.2rem, 7vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.error-lead {
    max-width: 34rem;
    margin: 0;
    color: var(--text-soft);
}

.error-log {
    max-width: 34rem;
    margin: 1.75rem 0 0;
    padding: 1rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 4px);
    background: rgba(10, 12, 16, 0.55);
    color: var(--text-soft);
    font-size: 0.78rem;
    line-height: 1.65;
    white-space: pre-wrap;
    overflow: hidden;
}

.error-log-prompt {
    color: var(--accent-text);
}

.error-log-path {
    color: var(--text);
}

.error-log-fail {
    color: var(--accent-text);
}

.error-log-dim {
    color: var(--text-soft);
    opacity: 0.65;
}

.error-page .hero-meta {
    margin-top: 1.75rem;
}

.error-horizon {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: clamp(7.5rem, 20vw, 13rem);
    pointer-events: none;
    z-index: 0;
}

.error-horizon::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: 0.28;
    mask-image: linear-gradient(to top, black 12%, transparent 78%);
    pointer-events: none;
}

.error-coords {
    position: absolute;
    right: clamp(1rem, 4vw, 2.5rem);
    bottom: 0.85rem;
    z-index: 2;
    margin: 0;
    color: var(--text-soft);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    opacity: 0.55;
}

/* Rückfahrt zur Wache — gespiegelt, flacher Talboden */
.error-truck {
    position: absolute;
    left: 72%;
    bottom: 14%;
    width: clamp(2.1rem, 4vw, 3rem);
    z-index: 2;
    transform: translate(-50%, 0) scaleX(-1);
    transform-origin: 50% 100%;
    animation: truck-return 22s linear infinite;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
}

.error-truck svg {
    display: block;
    width: 100%;
    height: auto;
}

@keyframes truck-return {
    0% {
        left: 78%;
        bottom: 12%;
        transform: translate(-50%, 0) scaleX(-1) rotate(-2deg);
        opacity: 0;
    }
    6% { opacity: 1; }
    30% {
        left: 58%;
        bottom: 15%;
        transform: translate(-50%, 0) scaleX(-1) rotate(1deg);
        opacity: 1;
    }
    55% {
        left: 40%;
        bottom: 13%;
        transform: translate(-50%, 0) scaleX(-1) rotate(-1deg);
        opacity: 1;
    }
    80% {
        left: 22%;
        bottom: 16%;
        transform: translate(-50%, 0) scaleX(-1) rotate(2deg);
        opacity: 1;
    }
    92% { opacity: 1; }
    100% {
        left: 12%;
        bottom: 14%;
        transform: translate(-50%, 0) scaleX(-1) rotate(0deg);
        opacity: 0;
    }
}

/* Responsive */

@media (min-width: 720px) {
    .nav {
        display: flex;
    }

    .project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.75rem;
    }

}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .js .reveal,
    .project-card,
    .project-media img {
        transition: none;
    }

    .js .reveal {
        opacity: 1;
        transform: none;
    }

    .status-dot,
    .truck-light,
    .hero-truck,
    .error-truck {
        animation: none;
    }

    .hero-truck {
        left: 66.7%;
        bottom: 82%;
        opacity: 0.9;
        transform: translate(-50%, 0) rotate(-2deg);
    }

    .error-truck {
        left: 40%;
        bottom: 14%;
        opacity: 0.9;
        transform: translate(-50%, 0) scaleX(-1);
    }
}
