/* =====================================================================
   NEO-BRUTALIST EDITORIAL ON PAPER
   Jakob Heigl-Auer · jakobheuer
   ===================================================================== */

/* ---------- 1. Tokens ------------------------------------------------ */
:root {
    --canvas: #F2EBDC;
    --paper:  #FAF6EC;
    --ink:    #1A1814;
    --ink-soft: #1A18148C;

    /* 10 editorial accents */
    --accent-coral:    #E85D4E;
    --accent-rose:     #D94E7A;
    --accent-mustard:  #D4A017;
    --accent-forest:   #2D5A3D;
    --accent-teal:     #2A7A8C;
    --accent-violet:   #6B4E9B;
    --accent-ochre:    #C77A2E;
    --accent-cobalt:   #2D4A8C;
    --accent-burgundy: #8B2E3D;
    --accent-olive:    #6B7A3D;

    /* Per-card accent default; PHP overrides inline */
    --card-accent: var(--ink);

    --border: 1.5px solid var(--ink);
    --shadow-hard: 4px 4px 0 0 var(--ink);

    --f-serif: 'Fraunces', 'Times New Roman', Georgia, serif;
    --f-sans:  'Manrope', system-ui, -apple-system, sans-serif;
    --f-mono:  'JetBrains Mono', 'Courier New', monospace;

    --max-w: 1280px;
}

/* ---------- 2. Reset -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    overflow-x: clip;          /* Stronger: prevents scroll even with off-screen children */
}
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote {
    margin: 0;
    padding: 0;
}
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ---------- 3. Body & global grain ----------------------------------- */
body {
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--f-sans);
    font-size: 16px;
    line-height: 1.55;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-x: clip;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

/* iPhone notch / Dynamic Island shield. A fixed paper-colored strip pinned
   to the very top of the viewport, exactly the height of the system safe
   area. Always present, never moves, blocks scrolled content from peeking
   into the notch area regardless of where the sticky header is.
   Requires viewport-fit=cover in the HTML meta tag, otherwise
   env(safe-area-inset-top) resolves to 0px and the strip has no height
   (which is the correct no-op on non-notched devices). */
html::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top, 0px);
    background: var(--paper);
    z-index: 60;
    pointer-events: none;
}

/* CSS-only paper grain — SVG turbulence as data URI */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.8 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Secondary subtle paper fiber pattern */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.025;
    background-image:
            repeating-linear-gradient(0deg, var(--ink) 0 1px, transparent 1px 38px),
            repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 38px);
}

/* ---------- 4. Typography -------------------------------------------- */
h1, h2, h3, h4 {
    font-family: var(--f-serif);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.02em;
    color: var(--ink);
}

h1 {
    font-size: clamp(3.2rem, 11vw, 9.5rem);
    font-weight: 900;
    letter-spacing: -0.04em;
}
h2 { font-size: clamp(2rem, 5vw, 4rem); }
h3 { font-size: clamp(1.4rem, 2.6vw, 2rem); }

.italic, em { font-style: italic; }

.eyebrow {
    font-family: var(--f-sans);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-weight: 600;
}

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

/* ---------- 5. Layout primitives ------------------------------------- */
.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 1.25rem;
}

@media (min-width: 768px) {
    .container { padding: 0 2rem; }
}

section { padding: 4rem 0; }
@media (min-width: 768px) { section { padding: 6rem 0; } }

.rule {
    border: 0;
    border-top: var(--border);
    margin: 0;
}

/* ---------- 6. Header / Navigation ----------------------------------- */
.site-header {
    border-bottom: var(--border);
    background: var(--paper);
    position: sticky;
    top: 0;
    z-index: 50;
    /* iPhone notch / Dynamic Island: extend the paper background up into
       the safe area so scrolling content doesn't show through that strip.
       Requires viewport-fit=cover in the meta tag (set in header.php). */
    padding-top: env(safe-area-inset-top, 0px);
}

/* Mobile-first: stack brand above nav so neither gets squeezed */
.nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    padding: 0.75rem 0;
    gap: 0.7rem;
}

@media (min-width: 720px) {
    .nav {
        flex-direction: row;
        align-items: center;
        padding: 0.9rem 0;
        gap: 1rem;
    }
}

.brand {
    font-family: var(--f-serif);
    font-weight: 900;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.4rem;
    white-space: nowrap;
}
.brand em { color: var(--accent-coral); font-style: italic; }

@media (min-width: 720px) {
    .brand {
        font-size: 1.5rem;
        gap: 0.5rem;
        justify-content: flex-start;
    }
}

.brand-mark {
    display: inline-block;
    width: 0.8rem; height: 0.8rem;
    background: var(--ink);
    transform: rotate(45deg);
    margin-right: 0.3rem;
    flex-shrink: 0;
    align-self: center;
}

@media (min-width: 720px) {
    .brand-mark { width: 1rem; height: 1rem; margin-right: 0.4rem; }
}

/* Nav links: a contained row. No negative margins — those caused
   horizontal page overflow on iOS. If the four buttons ever don't fit
   on a very narrow phone, the row scrolls inside the container, never
   pushing the page sideways. */
.nav-links {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.nav-links::-webkit-scrollbar { display: none; }

@media (min-width: 720px) {
    .nav-links {
        gap: 0.5rem;
        width: auto;
        overflow: visible;
        justify-content: flex-end;
    }
}

.nav-link {
    font-family: var(--f-sans);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.4rem 0.6rem;
    border: var(--border);
    background: var(--paper);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (min-width: 720px) {
    .nav-link {
        font-size: 0.85rem;
        letter-spacing: 0.12em;
        padding: 0.45rem 0.85rem;
    }
}

.nav-link:hover {
    transform: translate(-2px, -2px);
    box-shadow: 2px 2px 0 0 var(--ink);
}
.nav-link.active { background: var(--ink); color: var(--paper); }

/* ---------- 7. Status Bar -------------------------------------------- */
.status-bar {
    background: var(--ink);
    color: var(--paper);
    font-family: var(--f-mono);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    border-top: var(--border);
    border-bottom: var(--border);
    overflow: hidden;
}

@media (min-width: 720px) {
    .status-bar { font-size: 0.78rem; }
}

.status-bar-inner {
    display: flex;
    align-items: center;
    gap: 0.45rem 1.5rem;
    padding: 0.6rem 0;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
}

@media (min-width: 720px) {
    .status-bar-inner {
        align-items: center;
        padding: 0.75rem 0;
        justify-content: space-between;
        text-align: left;
    }
}

.status-light {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-transform: uppercase;
    flex: 0 0 auto;
}
.status-dot {
    width: 0.65rem; height: 0.65rem;
    background: var(--accent-mustard);
    border-radius: 50%;
    animation: pulse 1.6s ease-in-out infinite;
    box-shadow: 0 0 0 0 var(--accent-mustard);
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--accent-mustard); }
    50%      { box-shadow: 0 0 0 6px transparent; }
}

/* On mobile: location and date stack as their own centered lines so
   nothing gets clipped at the right edge. On wider screens, inline + left. */
.status-marquee {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex: 1 1 100%;
    min-width: 0;
    text-align: center;
}
.status-marquee > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

@media (min-width: 720px) {
    .status-marquee {
        flex-direction: row;
        align-items: center;
        flex: 0 0 auto;
        gap: 2rem;
        text-align: left;
    }
}

/* ---------- 8. Hero -------------------------------------------------- */
.hero {
    padding: 3rem 0 5rem;
    border-bottom: var(--border);
    position: relative;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: end;
}

@media (min-width: 900px) {
    .hero-grid {
        grid-template-columns: 1fr auto;
        gap: 3rem;
    }
}

.hero-title {
    text-transform: uppercase;
}
.hero-title .name-row {
    display: block;
    overflow: hidden;
    padding-bottom: 0.1em;
}
.hero-title em {
    font-style: italic;
    font-weight: 300;
    color: var(--accent-burgundy);
}

.hero-meta {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    font-family: var(--f-sans);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 600;
    padding: 0.35rem 0.7rem;
    border: var(--border);
    background: var(--paper);
}

.hero-portrait {
    width: clamp(190px, 28vw, 280px);
    aspect-ratio: 4 / 5;
    background: var(--paper);
    border: var(--border);
    box-shadow: 10px 10px 0 0 var(--ink);
    position: relative;
    overflow: hidden;
    justify-self: end;
}
.hero-portrait svg { width: 100%; height: 100%; display: block; }

.hero-portrait-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: var(--paper);
    border-top: var(--border);
    padding: 0.45rem 0.7rem;
    font-family: var(--f-mono);
    font-size: 0.68rem;
    display: flex;
    justify-content: space-between;
    letter-spacing: 0.08em;
}

.hero-lede {
    font-family: var(--f-serif);
    font-size: clamp(1.1rem, 1.7vw, 1.4rem);
    line-height: 1.45;
    max-width: 58ch;
    margin-top: 2rem;
    border-left: 4px solid var(--ink);
    padding-left: 1.1rem;
}
.hero-lede em { color: var(--accent-teal); }

/* ---------- 9. Section heads ---------------------------------------- */
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: var(--border);
    padding-bottom: 0.9rem;
    margin-bottom: 2.5rem;
}
.section-head h2 em { color: var(--accent-violet); font-style: italic; font-weight: 400; }
.section-head .eyebrow { color: var(--ink-soft); }

/* ---------- 10. Project Cards --------------------------------------- */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.75rem;
}
@media (min-width: 720px)  { .projects-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .projects-grid { grid-template-columns: repeat(3, 1fr); } }

.card {
    background: var(--paper);
    border: var(--border);
    padding: 1.6rem 1.4rem 1.4rem;
    box-shadow: var(--shadow-hard);
    position: relative;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
/* JS-gated entry animation: only hide when JS confirms it can reveal */
html.js-ready .card {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
}
html.js-ready .card.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: transform 0.55s cubic-bezier(.2,.7,.2,1), opacity 0.55s ease, box-shadow 0.18s ease;
}
.card:hover {
    transform: translate(-4px, -4px);
    box-shadow: 8px 8px 0 0 var(--card-accent);
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px dashed var(--ink);
    padding-bottom: 0.7rem;
}
.card-num {
    font-family: var(--f-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}
.card-status {
    font-family: var(--f-mono);
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
    background: var(--card-accent);
    color: var(--paper);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.card-title {
    font-family: var(--f-serif);
    font-weight: 800;
    font-size: 1.55rem;
    line-height: 1.05;
    letter-spacing: -0.015em;
}
.card-title em { font-style: italic; font-weight: 500; color: var(--card-accent); }
.card-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--ink);
}
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: auto;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--ink);
}
.card-tag {
    font-family: var(--f-mono);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--ink);
}

/* ---------- 11. Ledger (PGP) ---------------------------------------- */
.ledger {
    background: var(--paper);
    border: 3px solid var(--ink);
    padding: 2rem 1.5rem;
    position: relative;
    box-shadow: 6px 6px 0 0 var(--ink);
}
@media (min-width: 720px) { .ledger { padding: 2.5rem 2.5rem 2.25rem; } }

.ledger::before, .ledger::after {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid var(--ink);
    pointer-events: none;
}
.ledger::after {
    inset: 12px;
    border-style: dashed;
    opacity: 0.45;
}

.ledger-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1.5px solid var(--ink);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    position: relative;
    z-index: 1;
}
.ledger-title {
    font-family: var(--f-serif);
    font-weight: 900;
    font-size: clamp(1.7rem, 3.5vw, 2.6rem);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: -0.01em;
}
.ledger-title em { font-style: italic; font-weight: 400; color: var(--accent-forest); }

.ledger-stamp {
    border: 2px solid var(--accent-burgundy);
    color: var(--accent-burgundy);
    font-family: var(--f-serif);
    font-weight: 800;
    font-style: italic;
    padding: 0.4rem 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transform: rotate(-6deg);
    font-size: 0.85rem;
    background: var(--paper);
    box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px var(--accent-burgundy);
}

.ledger-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem 2rem;
    position: relative;
    z-index: 1;
}
@media (min-width: 720px) {
    .ledger-grid { grid-template-columns: 220px 1fr; }
}

.ledger-row dt {
    font-family: var(--f-sans);
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 0.2rem;
}
.ledger-row dd {
    font-family: var(--f-mono);
    font-size: 0.86rem;
    word-break: break-all;
    margin-left: 0;
}

.ledger-key {
    margin-top: 1.5rem;
    background: var(--canvas);
    border: 1.5px solid var(--ink);
    padding: 1rem;
    font-family: var(--f-mono);
    font-size: 0.76rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
    position: relative;
    z-index: 1;
}
.ledger-key-label {
    display: inline-block;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--f-mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    padding: 0.18rem 0.5rem;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
}

.ledger-foot {
    margin-top: 1.25rem;
    border-top: 1.5px solid var(--ink);
    padding-top: 0.9rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-family: var(--f-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

/* ---------- 12. Now / Interests ------------------------------------- */
.now-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
@media (min-width: 720px) { .now-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px){ .now-grid { grid-template-columns: repeat(4, 1fr); } }

.now-card {
    border: var(--border);
    background: var(--paper);
    padding: 1.2rem;
    box-shadow: var(--shadow-hard);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 170px;
}
.now-card:hover {
    transform: translate(-4px, -4px);
    box-shadow: 8px 8px 0 0 var(--card-accent);
}
.now-card .eyebrow { color: var(--card-accent); }
.now-card h3 {
    font-family: var(--f-serif);
    font-size: 1.6rem;
    line-height: 1;
}
.now-card h3 em { font-style: italic; font-weight: 400; }
.now-card p { font-size: 0.9rem; color: var(--ink); }

/* ---------- 13. CV / Git Tree --------------------------------------- */
.cv-intro {
    border-bottom: var(--border);
    padding-bottom: 3rem;
    margin-bottom: 4rem;
}

.git-tree {
    position: relative;
    padding: 2rem 0 4rem;
}

/* The main branch line */
.git-tree::before {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    left: 24px;
    width: 2px;
    background: var(--ink);
}
@media (min-width: 900px) {
    .git-tree::before { left: 50%; transform: translateX(-1px); }
}

.git-meta {
    font-family: var(--f-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    background: var(--ink);
    color: var(--paper);
    display: inline-block;
    padding: 0.3rem 0.65rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

/* Each node */
.cv-node {
    position: relative;
    padding-left: 70px;
    margin-bottom: 2.5rem;
}
@media (min-width: 900px) {
    .cv-node { padding-left: 0; width: 50%; }
    .cv-node.right { margin-left: 50%; padding-left: 60px; }
    .cv-node.left  { padding-right: 60px; text-align: right; }
}

/* The commit dot on the main branch */
.cv-dot {
    position: absolute;
    top: 1.5rem;
    left: 16px;
    width: 18px; height: 18px;
    border: var(--border);
    background: var(--paper);
    border-radius: 50%;
    z-index: 2;
}
.cv-dot::after {
    content: "";
    position: absolute;
    inset: 3px;
    background: var(--card-accent);
    border-radius: 50%;
}
@media (min-width: 900px) {
    .cv-node.right .cv-dot { left: calc(-30px - 9px); }
    .cv-node.left  .cv-dot { left: auto; right: calc(-30px - 9px); }
}

/* The curve from branch line to the card — pure SVG */
.cv-curve {
    position: absolute;
    top: 1rem;
    left: 24px;
    width: 50px;
    height: 30px;
    pointer-events: none;
    overflow: visible;
}
.cv-curve path {
    fill: none;
    stroke: var(--ink);
    stroke-width: 1.5;
}
@media (min-width: 900px) {
    .cv-node.right .cv-curve { left: -30px; width: 60px; }
    .cv-node.left  .cv-curve {
        left: auto;
        right: -30px;
        width: 60px;
        transform: scaleX(-1);
    }
}

.cv-card {
    background: var(--paper);
    border: var(--border);
    box-shadow: var(--shadow-hard);
    padding: 1.3rem 1.35rem 1.2rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
html.js-ready .cv-card {
    opacity: 0;
    transform: translateY(14px);
}
html.js-ready .cv-card.is-visible {
    opacity: 1;
    transform: translateY(0);
    transition: transform 0.55s cubic-bezier(.2,.7,.2,1), opacity 0.55s ease, box-shadow 0.18s ease;
}
.cv-card:hover {
    transform: translate(-4px, -4px);
    box-shadow: 8px 8px 0 0 var(--card-accent);
}
.cv-date {
    font-family: var(--f-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cv-date-chip {
    padding: 0.15rem 0.45rem;
    background: var(--card-accent);
    color: var(--paper);
    letter-spacing: 0.08em;
}
.cv-role {
    font-family: var(--f-serif);
    font-style: italic;
    font-weight: 600;
    font-size: 1.55rem;
    line-height: 1.05;
    letter-spacing: -0.01em;
}
.cv-role-where {
    font-family: var(--f-sans);
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.2rem;
}
.cv-desc {
    font-family: var(--f-sans);
    font-size: 0.93rem;
    margin-top: 0.7rem;
    line-height: 1.5;
}
.cv-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.9rem;
}
.cv-node.left .cv-tags { justify-content: flex-end; }
.cv-tag {
    font-family: var(--f-mono);
    font-size: 0.66rem;
    padding: 0.15rem 0.45rem;
    border: 1px solid var(--ink);
    letter-spacing: 0.04em;
}

/* "Merge commit" marker — for synthesis/big moments */
.cv-node.merge .cv-dot {
    width: 24px; height: 24px;
    background: var(--ink);
    top: 1.3rem;
}
.cv-node.merge .cv-dot::after {
    inset: 5px;
    background: var(--paper);
}

/* ---------- 14. Footer ---------------------------------------------- */
.site-footer {
    border-top: var(--border);
    background: var(--paper);
    padding: 2.5rem 0 3rem;
    margin-top: 4rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 720px) {
    .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
.footer-brand h3 {
    font-family: var(--f-serif);
    font-weight: 900;
    font-size: 2.2rem;
    line-height: 1;
}
.footer-brand h3 em { color: var(--accent-coral); }
.footer-brand p {
    font-size: 0.9rem;
    margin-top: 0.6rem;
    max-width: 38ch;
}
.footer-col h4 {
    font-family: var(--f-sans);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.7rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--ink);
}
.footer-col ul li {
    font-family: var(--f-mono);
    font-size: 0.82rem;
    margin-bottom: 0.35rem;
}
.footer-col ul li a:hover { color: var(--accent-coral); }

.colophon {
    margin-top: 2.5rem;
    padding-top: 1.2rem;
    border-top: var(--border);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    font-family: var(--f-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.colophon em { color: var(--accent-rose); font-style: italic; }

/* ---------- 15. Utility --------------------------------------------- */
.flex-wrap { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.muted { color: var(--ink-soft); }
.text-center { text-align: center; }

/* ---------- 16. New: section blurb ---------------------------------- */
.section-blurb {
    font-family: var(--f-serif);
    font-style: italic;
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    line-height: 1.5;
    max-width: 62ch;
    margin: -1.5rem 0 2.25rem;
    color: var(--ink);
}

/* ---------- 17. New: card-kind label (under card head) -------------- */
.card-kind {
    font-family: var(--f-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--card-accent);
    margin-top: -0.3rem;
}

/* ---------- 18. New: compact "tool table" --------------------------- */
.tool-table {
    border: var(--border);
    background: var(--paper);
    box-shadow: var(--shadow-hard);
}
.tool-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.25rem 1rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px dashed var(--ink);
    transition: background 0.15s ease, transform 0.15s ease;
    position: relative;
}
.tool-row:last-child { border-bottom: 0; }
.tool-row--head {
    background: var(--ink);
    color: var(--paper);
    font-family: var(--f-sans);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.7rem;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}
.tool-row--head .tool-col-name { font-family: var(--f-sans); }

.tool-col-name {
    font-family: var(--f-mono);
    font-weight: 500;
    font-size: 0.92rem;
}
.tool-col-lang { display: flex; align-items: center; }
.lang-chip {
    display: inline-block;
    font-family: var(--f-mono);
    font-size: 0.68rem;
    padding: 0.15rem 0.5rem;
    background: var(--card-accent, var(--ink));
    color: var(--paper);
    letter-spacing: 0.05em;
}
.tool-row--head .lang-chip { background: transparent; color: var(--paper); padding: 0; }

.tool-col-desc { font-size: 0.92rem; line-height: 1.5; }

.tool-row:not(.tool-row--head):hover {
    background: var(--canvas);
}
.tool-row:not(.tool-row--head):hover .tool-col-name {
    color: var(--card-accent);
}

@media (min-width: 720px) {
    .tool-row {
        grid-template-columns: 220px 120px 1fr;
        align-items: baseline;
        gap: 1.25rem;
    }
}

/* ---------- 19. New: book / reading cards --------------------------- */
.reading-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
@media (min-width: 600px)  { .reading-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px)  { .reading-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .reading-grid { grid-template-columns: repeat(5, 1fr); } }

.book-card .book-author {
    font-size: 0.72rem;
    color: var(--ink-soft);
    letter-spacing: 0.04em;
    margin-top: -0.2rem;
    border-bottom: 1px dashed var(--ink);
    padding-bottom: 0.5rem;
    margin-bottom: 0.2rem;
}

/* ---------- 20. New: certification cards (CV) ----------------------- */
.cert-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 600px) { .cert-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px){ .cert-grid { grid-template-columns: repeat(4, 1fr); } }

.cert-card {
    background: var(--paper);
    border: var(--border);
    box-shadow: var(--shadow-hard);
    padding: 1.1rem 1.1rem 1rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cert-card:hover {
    transform: translate(-4px, -4px);
    box-shadow: 8px 8px 0 0 var(--card-accent);
}
.cert-card .eyebrow {
    color: var(--card-accent);
    margin-bottom: 0.4rem;
    display: block;
}
.cert-card p {
    font-family: var(--f-serif);
    font-size: 1.05rem;
    line-height: 1.3;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
    html.js-ready .card,
    html.js-ready .cv-card {
        opacity: 1;
        transform: none;
    }
}

/* =====================================================================
   FOTOS & REISEN — multi-column photo carousel
   Append to /css/style.css. Builds on existing tokens only.
   ===================================================================== */

/* ---------- Compact hero variant for sub-pages ---------------------- */
.hero--compact {
    padding: 2.5rem 0 3.5rem;
}
.hero--compact .hero-title {
    font-size: clamp(2.6rem, 8vw, 6.5rem);
}
.hero--compact .hero-lede {
    margin-top: 1.5rem;
    max-width: 56ch;
}

/* ---------- Gallery shell ------------------------------------------- */
.gallery {
    --photo-h: 240px;
    position: relative;
    margin-top: 0.5rem;
}

@media (min-width: 720px)  { .gallery { --photo-h: 340px; } }
@media (min-width: 1080px) { .gallery { --photo-h: 440px; } }
@media (min-width: 1480px) { .gallery { --photo-h: 500px; } }

/* ---------- Top control row ----------------------------------------- */
.gallery-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
    padding-bottom: 0.9rem;
    border-bottom: var(--border);
}

.gallery-counter {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    font-size: clamp(1.4rem, 3.5vw, 2.2rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1;
}
.gallery-counter [data-gallery-current] {
    font-family: var(--f-serif);
    font-weight: 900;
    font-style: italic;
    color: var(--accent-burgundy);
    font-size: clamp(2rem, 5vw, 3.2rem);
    min-width: 1.6em;
    display: inline-block;
}
.gallery-counter-sep {
    color: var(--ink-soft);
    padding: 0 0.15em;
}

.gallery-buttons {
    display: flex;
    gap: 0.55rem;
}

.gallery-btn {
    width: 2.6rem;
    height: 2.6rem;
    padding: 0;
    background: var(--paper);
    border: var(--border);
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.gallery-btn svg { width: 60%; height: 60%; display: block; }
.gallery-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 2px 2px 0 0 var(--ink);
}
.gallery-btn:focus-visible {
    outline: 2px solid var(--accent-coral);
    outline-offset: 2px;
}
@media (min-width: 720px) {
    .gallery-btn { width: 3rem; height: 3rem; }
}

/* ---------- The scrolling track ------------------------------------- */
.gallery-track {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;       /* Firefox */
    -ms-overflow-style: none;    /* IE / old Edge */
    padding: 0.5rem 0;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track.is-dragging { cursor: grabbing; }
.gallery-track:focus-visible {
    outline: 2px solid var(--accent-coral);
    outline-offset: 4px;
}

@media (min-width: 720px) {
    .gallery-track { gap: 1.4rem; }
}

/* ---------- A single photo card ------------------------------------- */
/* Width comes from the photo's own aspect ratio (set inline by PHP).
   --aspect defaults to 3/2 so the row still looks right if it's ever
   missing. */
.gallery-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    cursor: zoom-in;
    width: calc(var(--photo-h) * var(--aspect, 1.5));
}

.gallery-frame {
    position: relative;
    width: 100%;
    height: var(--photo-h);
    background: var(--paper);
    border: var(--border);
    box-shadow: var(--shadow-hard);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.gallery-frame img {
    width: 100%;
    height: 100%;
    max-width: none;            /* override the global img { max-width:100% } */
    object-fit: cover;          /* aspect ratios match exactly, so no crop in practice */
    display: block;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.gallery-frame img[src] { opacity: 1; }

.gallery-item:hover .gallery-frame {
    transform: translate(-3px, -3px);
    box-shadow: 7px 7px 0 0 var(--card-accent);
}
.gallery-track.is-dragging .gallery-item:hover .gallery-frame {
    transform: none;
    box-shadow: var(--shadow-hard);
}

/* "Nr. 03" overlay — small editorial chip in the corner of every photo. */
.gallery-num {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--ink);
    padding: 0.15rem 0.45rem;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ---------- Caption -------------------------------------------------- */
.gallery-caption {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    max-width: 32ch;
    padding-right: 0.5rem;
}
.gallery-caption-title {
    font-family: var(--f-serif);
    font-style: italic;
    font-weight: 600;
    font-size: 0.98rem;
    line-height: 1.2;
    color: var(--ink);
}
.gallery-caption-meta {
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

/* ---------- Position bar -------------------------------------------- */
.gallery-progress {
    margin-top: 1.1rem;
    height: 4px;
    background: var(--paper);
    border: var(--border);
    position: relative;
    overflow: hidden;
}
.gallery-progress-bar {
    display: block;
    height: 100%;
    width: 0%;
    background: repeating-linear-gradient(
            45deg,
            var(--ink) 0 6px,
            var(--accent-mustard) 6px 12px
    );
    transition: width 0.18s linear;
}

/* ---------- Helper hint --------------------------------------------- */
.gallery-hint {
    margin-top: 0.6rem;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

/* ---------- Lightbox ------------------------------------------------- */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(26, 24, 20, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.22s ease;
}
.gallery-lightbox.is-open { opacity: 1; }
.gallery-lightbox[hidden] { display: none; }

.gallery-lightbox-figure {
    max-width: min(1100px, 92vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.gallery-lightbox-figure img {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    background: var(--paper);
    border: var(--border);
    box-shadow: 10px 10px 0 0 var(--accent-coral);
    object-fit: contain;
}
.gallery-lightbox-figure figcaption {
    color: var(--paper);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
}

.gallery-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.6rem;
    height: 2.6rem;
    background: var(--paper);
    color: var(--ink);
    border: var(--border);
    font-family: var(--f-serif);
    font-size: 1.6rem;
    line-height: 1;
    font-weight: 700;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.gallery-lightbox-close:hover {
    transform: translate(-2px, -2px);
    box-shadow: 2px 2px 0 0 var(--accent-coral);
}

/* ---------- Reduced motion ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .gallery-track { scroll-behavior: auto; }
    .gallery-frame, .gallery-btn, .gallery-lightbox-close,
    .gallery-lightbox, .gallery-progress-bar {
        transition: none !important;
    }
}

/* ---------- Hero Slideshow ------------------------------------------- */
.hero-portrait--slideshow .slideshow-track {
    width: 100%;
    height: 100%;
    position: relative;
    background: var(--paper);
}
.hero-portrait--slideshow .slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    display: block;
    max-width: none;
}
.hero-portrait--slideshow .slide.active {
    opacity: 1;
    z-index: 1;
}

.hero-portrait-caption {
    z-index: 10;
}

/* ---------- Slideshow Progress Bar ---------------------------------- */
.slideshow-progress {
    position: absolute;
    top: -1.5px; /* Sitzt exakt auf der oberen Trennlinie */
    left: 0;
    height: 2px;
    background: var(--ink); /* Alternativ: var(--accent-coral) für etwas mehr Farbe */
    width: 0%;
    z-index: 11;
}

@keyframes fillProgress {
    0%   { width: 0%; }
    100% { width: 100%; }
}