/* =========================================================
   christel.dk – forside, version 5 (eksperimentel, interaktiv)
   Bygger på folderne: hvid flade, cirkler der ikke overlapper,
   stiplede forbindelseslinjer, små prikker i dæmpede
   arkitektfarver, hypotrochoider – og navnet med små
   bogstaver som et 50'er-twist.
   ========================================================= */

:root {
    --black: #1b1b1b;
    --grey: #707070;
    --line: #1b1b1b;

    /* dæmpede, brækkede farver (samme som i kompositionen) */
    --oxide: #b0533f;
    --sage:  #8f9c80;
    --slate: #5d7385;
    --ochre: #c9a24a;
    --rose:  #d8b6a4;

    /* Archivo: grotesk i Helvetica-familien med breddeakse –
       ser ens ud på Mac, Windows og mobil */
    --display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --text: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --mono: "JetBrains Mono", Consolas, "Courier New", monospace;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: #fff;
    color: var(--black);
    font-family: var(--text);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

.c1 { background: var(--oxide); }
.c2 { background: var(--slate); }
.c3 { background: var(--sage); }


/* ---------- Layout ---------- */

.page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 56px 40px 40px;

    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    grid-template-areas:
        "name  art"
        "about art"
        "index art"
        "foot  art";
    grid-template-rows: auto auto auto 1fr;
    column-gap: 72px;
}

.name    { grid-area: name; }
.about   { grid-area: about; }
.index   { grid-area: index; }
.foot    { grid-area: foot; }
.art     { grid-area: art; }


/* ---------- Navn ---------- */

.name {
    padding-top: 36px;
    font-family: var(--display);
}

.name h1 {
    margin: 0;
    font-weight: 750;
    font-stretch: 118%;
    font-size: clamp(2.4rem, 5.6vw, 4.6rem);
    line-height: 1;
    letter-spacing: -0.035em;
}

.byline {
    margin: 18px 0 0;
    font-size: clamp(1.15rem, 1.8vw, 1.45rem);
    font-weight: 650;
    font-stretch: 115%;
    letter-spacing: -0.01em;
}

.titles {
    margin: 2px 0 0;
    font-size: 0.95rem;
    font-stretch: 112%;
    letter-spacing: 0.02em;
    color: var(--grey);
}


/* ---------- Tekst ---------- */

.about {
    margin-top: 40px;
    max-width: 40ch;
    color: var(--grey);
}

.about p {
    margin: 0 0 12px;
}


/* ---------- Index ---------- */

.index {
    margin-top: 32px;
}

.index ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.index li + li {
    margin-top: 2px;
}

.index a {
    display: flex;
    align-items: center;
    gap: 16px;

    min-height: 50px;
    padding: 6px 0;

    text-decoration: none;
    font-family: var(--display);
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 650;
    font-stretch: 115%;
    letter-spacing: -0.015em;
}

.dot {
    flex: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transition: transform 0.2s;
}

.index .dash {
    flex: none;
    width: 28px;
    border-top: 1.5px dashed var(--line);
    transition: width 0.2s;
}

.index a:hover .dot,
.index a:focus-visible .dot {
    transform: scale(1.5);
}

/* v5: prikken skifter nuance – lidt, diskret – ved hover */
.dot {
    transition: transform 0.2s, background-color 0.35s;
}
a:hover .dot.c1, a:focus-visible .dot.c1 { background: #c4613a; }
a:hover .dot.c2, a:focus-visible .dot.c2 { background: #4f7899; }
a:hover .dot.c3, a:focus-visible .dot.c3 { background: #84a26e; }

.index a:hover .dash,
.index a:focus-visible .dash {
    width: 52px;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--black);
    outline-offset: 4px;
}


/* ---------- Fod ---------- */

.foot {
    align-self: end;
    margin-top: 56px;
    padding-top: 14px;
    border-top: 1.5px dashed var(--line);

    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;

    font-size: 0.85rem;
}

.foot a {
    text-decoration: none;
}

.foot a:hover,
.foot a:focus-visible {
    color: var(--oxide);
}


/* ---------- Komposition (mindre end før) ---------- */

.art {
    align-self: start;
    justify-self: center;
    width: 100%;
    max-width: 430px;
}

.composition {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 120px);
    margin: 0 auto;
}

.composition .links line {
    stroke: var(--line);
    stroke-width: 1.4;
    stroke-dasharray: 6 6;
}

.composition .orbit {
    fill: none;
    stroke: var(--black);
    stroke-width: 0.7;
}

.composition .hypo {
    fill: none;
    stroke: var(--line);
    stroke-width: 0.9;
}

.composition .hypo-fine {
    stroke-width: 0.45;
}

.composition .code text {
    fill: #d9e6cf;
    font-family: var(--mono);
    font-size: 8px;
}

.composition .axes line {
    stroke: #9b9585;
    stroke-width: 0.6;
}

.composition .lake {
    fill-opacity: 0.35;
    stroke: var(--black);
    stroke-width: 1.1;
}

.composition .branch {
    fill: none;
    stroke: var(--black);
    stroke-width: 1.1;
}

.composition .ec-label {
    fill: var(--black);
    font-family: var(--text);
    font-size: 8px;
}

.composition .ec-general {
    opacity: 0;
    fill: var(--grey);
}


/* ---------- v5: interaktivitet ---------- */

/* usynlige "fangeflader" over hvert objekt */
.composition .hit {
    fill: transparent;
    pointer-events: all;
}

.composition .obj * {
    pointer-events: none;
}

.composition .obj .hit {
    pointer-events: all;
}

/* de små prikker og solen skifter farve blødt */
.composition .fill,
.composition .sun,
.composition .planet {
    transition: fill 0.45s, r 0.45s;
}

.composition .obj-sun.is-on .sun {
    fill: #ff6a00;
    r: 10px;
}

.composition .obj-sun.is-on .planet {
    fill: #1f6bff;
    r: 3.8px;
}

/* farveoverlay på billeder, kode og kurve */
.composition .tint {
    opacity: 0;
    mix-blend-mode: multiply;
    transition: opacity 0.6s, fill 0.6s;
}

.composition .obj.is-on .tint {
    opacity: 0.55;
}

.composition .obj-ec.is-on .tint {
    opacity: 0.35;
}

.composition .obj-code .tint {
    mix-blend-mode: screen;
}

.composition .obj-code.is-on .tint {
    opacity: 0.32;
}

/* stiplingen kører: data sendes af sted */
@keyframes dataflow {
    to { stroke-dashoffset: -12; }
}

@keyframes dataflow-rev {
    to { stroke-dashoffset: 12; }
}

.composition .links line {
    transition: stroke 0.3s;
}

.composition .links line.flow {
    animation: dataflow 0.45s linear infinite;
}

.composition .links line.flow-rev {
    animation: dataflow-rev 0.45s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .composition .links line.flow,
    .composition .links line.flow-rev {
        animation: none;
        stroke-dasharray: none;
    }
}


/* ---------- Burgermenu (kun smal skærm) ---------- */

.topbar,
.drawer {
    display: none;
}


/* =========================================================
   MOBIL / SMAL
   ========================================================= */

@media (max-width: 820px) {

    .topbar {
        position: sticky;
        top: 0;
        z-index: 20;

        display: flex;
        align-items: center;
        justify-content: space-between;

        padding: 10px 20px;
        background: rgba(255, 255, 255, 0.94);
        border-bottom: 1.5px dashed var(--line);

        font-family: var(--display);
    }

    .topbar-name {
        font-size: 1.1rem;
        font-weight: 750;
        font-stretch: 118%;
        letter-spacing: -0.02em;
    }

    .burger {
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 44px;
        padding: 0 4px;

        background: none;
        border: 0;
        color: var(--black);
        font: inherit;
        font-size: 1rem;
        cursor: pointer;
    }

    .burger-lines,
    .burger-lines::before,
    .burger-lines::after {
        display: block;
        width: 22px;
        height: 1.5px;
        background: var(--black);
        transition: transform 0.2s, background-color 0.2s;
    }

    .burger-lines {
        position: relative;
    }

    .burger-lines::before,
    .burger-lines::after {
        content: "";
        position: absolute;
        left: 0;
    }

    .burger-lines::before { top: -7px; }
    .burger-lines::after  { top: 7px; }

    .burger[aria-expanded="true"] .burger-lines {
        background: transparent;
    }

    .burger[aria-expanded="true"] .burger-lines::before {
        transform: translateY(7px) rotate(45deg);
    }

    .burger[aria-expanded="true"] .burger-lines::after {
        transform: translateY(-7px) rotate(-45deg);
    }

    .drawer:not([hidden]) {
        display: block;
        position: sticky;
        top: 66px;
        z-index: 19;

        padding: 6px 20px 18px;
        background: #fff;
        border-bottom: 1.5px dashed var(--line);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
    }

    .drawer ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .drawer a {
        display: flex;
        align-items: center;
        gap: 14px;
        min-height: 48px;

        font-family: var(--display);
        font-size: 1.2rem;
        font-weight: 650;
        font-stretch: 115%;
        text-decoration: none;
    }

    .drawer .dot {
        width: 12px;
        height: 12px;
    }

    .drawer .sep {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #e4e4e4;
    }

    .drawer .sep a,
    .drawer .sep ~ li a {
        font-size: 1rem;
        color: var(--grey);
        padding-left: 26px;
    }

    .page {
        padding: 28px 20px 32px;
        grid-template-columns: 1fr;
        grid-template-areas:
            "name"
            "art"
            "about"
            "index"
            "foot";
        grid-template-rows: none;
    }

    .name {
        padding-top: 0;
    }

    .art {
        margin-top: 28px;
        max-width: 340px;
    }

    .composition {
        max-height: none;
    }

    .about {
        margin-top: 32px;
        max-width: none;
    }

    .index {
        margin-top: 20px;
    }
}
