/* Homepage photo and content; header, menu and shared colors live in shell.css. */
body.home-page {
    --home-background: var(--shell-background);
    --home-line: var(--shell-border);
    --home-accent: var(--shell-accent);
    --home-muted: var(--shell-muted);
    --home-hero-image: url("../images/home-hero-aurora.webp");
    --home-hero-position: 58% 64%;
    --home-scene-height: clamp(600px, 50vw, 840px);
    background: var(--home-background);
    color: #f1f5f7;
}

.home-shell {
    position: relative;
    isolation: isolate;
    min-height: 100svh;
    margin-left: 0;
    background: transparent;
}

.home-scene {
    position: absolute;
    z-index: -1;
    inset: 0 0 auto;
    height: var(--home-scene-height);
    max-height: 100%;
    overflow: hidden;
    pointer-events: none;
}

/* Clip the moving photo beneath a stationary overlay; neither affects layout. */
.home-scene::before,
.home-scene::after {
    position: absolute;
    inset: 0;
    content: "";
}

.home-scene::before {
    background-color: #0a1b25;
    background-image: var(--home-hero-image), linear-gradient(145deg, #071017 8%, #17383e 58%, #08131c 90%);
    background-position: var(--home-hero-position), center;
    background-size: cover;
    background-repeat: no-repeat;
}

.home-scene::after {
    background: linear-gradient(90deg, rgb(3 10 16 / 62%), rgb(3 10 16 / 24%) 48%, rgb(3 10 16 / 8%)),
        linear-gradient(0deg, #061017, rgb(6 16 23 / 28%) 24%, rgb(6 16 23 / 10%) 70%, rgb(6 16 23 / 18%));
}

.home-card-label svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.3;
}

.home-main {
    flex: 1;
    padding-top: 0;
}

.home-hero {
    display: grid;
    min-height: clamp(290px, 35vh, 390px);
    padding: clamp(2rem, 4vh, 3.5rem) 0 2.75rem;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 2rem;
}

.home-hero-copy {
    min-width: 0;
}

.home-eyebrow {
    display: flex;
    margin: 0 0 1.1rem;
    align-items: center;
    gap: .9rem;
    color: #becbd3;
    font-size: .62rem;
    letter-spacing: .23em;
    text-transform: uppercase;
}

.home-eyebrow::before {
    width: 32px;
    height: 1px;
    margin-right: .15rem;
    flex-shrink: 0;
    background: var(--home-accent);
    content: "";
}

.home-hero h1 {
    max-width: 25ch;
    margin: 0;
    font-size: clamp(2.5rem, 3.65vw, 3.8rem);
    font-weight: 600;
    letter-spacing: -.045em;
    line-height: 1.12;
    text-wrap: balance;
}

.home-study {
    margin: .75rem 0 0;
    color: #e2e9ef;
    font-size: clamp(1.1rem, 1.55vw, 1.55rem);
    line-height: 1.5;
}

.home-description {
    margin: .7rem 0 0;
    color: var(--home-muted);
    font-size: clamp(1rem, 1.2vw, 1.2rem);
    line-height: 1.65;
}

.home-actions {
    display: flex;
    margin-top: 1.8rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.home-button {
    display: inline-flex;
    min-height: 48px;
    padding: .75rem 1.7rem;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    border: 1px solid #64818a;
    border-radius: 7px;
    font-size: .95rem;
    font-weight: 550;
    text-decoration: none;
}

.home-button-primary {
    border-color: #9ce4e0;
    background: #83d5d2;
    color: #061c22;
}

.home-button-primary:hover {
    background: #adebe7;
}

.home-button-secondary {
    background: rgb(3 10 16 / 45%);
    color: #f1f5f7;
}

.home-button-secondary:hover {
    border-color: var(--home-accent);
    background: #132c33;
}

.home-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
}

.home-card {
    position: relative;
    isolation: isolate;
    display: flex;
    min-width: 0;
    min-height: 305px;
    padding: clamp(1.25rem, 1.7vw, 1.8rem);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--home-line);
    border-radius: 7px;
    background: rgb(8 20 28 / 68%);
}

.home-about-lines {
    position: absolute;
    z-index: -1;
    right: -.5rem;
    bottom: -.5rem;
    width: min(100%, 18rem);
    height: auto;
    fill: none;
    stroke: var(--home-accent);
    stroke-width: 1.2;
    opacity: .12;
    pointer-events: none;
}

.home-card-projects {
    background: rgb(9 29 39 / 72%);
}

.home-card-projects::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(90deg, #07141cf5 15%, #07141c96),
        url("../../projects/media-design/ullern-vgs-forside/assets/previews/preview.jpg") center 45% / cover;
    opacity: .7;
    content: "";
}

.home-card-education {
    background: rgb(12 25 35 / 68%);
}

.home-card-education::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(90deg, rgb(6 16 23 / 90%), rgb(6 16 23 / 40%)),
        linear-gradient(0deg, rgb(6 16 23 / 48%), transparent 60%),
        url("../images/home-education-gloshaugen.webp") center 58% / cover;
    content: "";
}

.home-card-apps {
    background: rgb(8 17 23 / 72%);
}

.home-card-label {
    display: flex;
    margin: 0 0 1.45rem;
    align-items: center;
    gap: 1rem;
    color: #c3cdd4;
    font-size: .6rem;
    letter-spacing: .21em;
    text-transform: uppercase;
}

.home-card-label svg {
    color: var(--home-accent);
}

.home-card h2 {
    margin: 0;
    font-size: clamp(1.1rem, 1.5vw, 1.45rem);
    font-weight: 550;
    letter-spacing: -.025em;
    line-height: 1.3;
    text-wrap: balance;
}

.home-card-description {
    max-width: 36ch;
    margin: 1rem 0 1.5rem;
    color: #bbc8d0;
    font-size: .86rem;
    line-height: 1.75;
}

.home-card-link {
    display: flex;
    width: fit-content;
    min-height: 44px;
    margin-top: auto;
    align-items: center;
    gap: .75rem;
    color: #b2efea;
    font-size: .85rem;
    text-decoration: none;
    text-underline-offset: .3em;
}

.home-card-link:hover {
    color: #f1f5f7;
    text-decoration: underline;
}

.home-flow-wordmark {
    position: absolute;
    z-index: -1;
    right: 1rem;
    bottom: 1.7rem;
    color: #1b373e;
    font-size: 3.8rem;
    font-weight: 600;
    letter-spacing: -.07em;
    line-height: 1;
}

.home-statement {
    display: flex;
    margin-top: 1rem;
    padding: 1.25rem 0;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    border-top: 1px solid var(--home-line);
}

.home-statement > p {
    margin: 0;
    padding-left: 1.75rem;
    border-left: 1px solid var(--home-line);
    color: var(--home-muted);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1rem;
    font-style: italic;
    line-height: 1.65;
}

.home-signature {
    display: grid;
    min-height: 40px;
    padding-left: 1.75rem;
    align-content: center;
    gap: .25rem;
    flex-shrink: 0;
    border-left: 1px solid var(--home-line);
    color: #b4c5cd;
    font-size: .55rem;
    letter-spacing: .19em;
    text-transform: uppercase;
}

@media (max-width: 1000px) {
    .home-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-card {
        min-height: 285px;
        padding: 1.6rem;
    }

    .home-card h2 {
        font-size: 1.45rem;
    }
}

@media (max-width: 820px) {
    body.home-page {
        --home-hero-position: 78% 50%;
        /* Keep the scene above the fold instead of stretching it over all cards. */
        --home-scene-height: 760px;
    }

    .home-hero {
        min-height: 350px;
        padding-block: 2rem 2.75rem;
        grid-template-columns: minmax(0, 1fr);
    }

    .home-hero h1 {
        max-width: 20ch;
        font-size: clamp(2.2rem, 6.1vw, 3.5rem);
    }

    .home-study {
        max-width: 44ch;
    }

    .home-description {
        max-width: 42ch;
    }

    .home-statement {
        padding: 1.25rem 0;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .home-statement > p {
        padding-left: 1rem;
    }

    .home-signature {
        min-height: 0;
        padding: 0 0 0 1.1rem;
        border: 0;
    }
}

@media (max-width: 540px) {
    .home-eyebrow {
        gap: .5rem;
        font-size: .5rem;
        letter-spacing: .16em;
    }

    .home-eyebrow::before {
        width: 20px;
    }

    .home-cards {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }

    .home-card {
        min-height: 280px;
    }

    .home-actions {
        gap: .75rem;
    }

    .home-button {
        flex: 1 1 9rem;
        padding-inline: 1rem;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .home-card-link,
    .home-button {
        transition: background-color .15s ease, border-color .15s ease, color .15s ease;
    }
}

@media (min-width: 821px) and (prefers-reduced-motion: no-preference) {
    .home-scene.is-parallax::before {
        transform: translate3d(0, var(--home-parallax-offset, 0px), 0);
        will-change: transform;
    }
}
