*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --color-page: #f4efe6;
    --color-page-depth: #ebe4d6;
    --color-ink: #2a2620;
    --color-muted: #5a5448;
    --color-accent: #4a5d3e;
    --color-accent-hover: #3d4d33;
    --color-logo-bg: #423e2d;
    --header-pad: clamp(0.75rem, 4vw, 1.5rem);
    --content-pad: clamp(0.75rem, 4vw, 1.5rem);
    --contact-line: rgba(42, 38, 32, 0.1);
    --contact-w: 22rem; /* one readable column, centred with margin: auto, not flex tricks */
    /*
     * One font stack for every environment (file://, localhost, host).
     * Webfonts from Google can fail offline / file preview → different
     * metrics, “wrong” centre, looks unlike hosted tab in same browser.
     */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    --font-contact: var(--font-sans);
}

html {
    -webkit-text-size-adjust: 100%;
    height: 100%;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    color: var(--color-ink);
    background: var(--color-page);
    min-height: 100%;
    min-height: 100dvh;
    line-height: 1.55;
}

/* One screen: 50% logo, 50% contact—no page scroll; contact scrolls inside its half if needed. */
.page--split {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

@supports (height: 100dvh) {
    .page--split {
        height: 100dvh;
    }
}

/* Top: brand / logo (half viewport) */
.page__brand {
    --edge-top: max(0.35rem, env(safe-area-inset-top, 0px));
    --edge-x: max(var(--header-pad), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    max-height: 100%;
    padding: var(--edge-top) var(--edge-x) 0.4rem;
    background: var(--color-logo-bg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 0;
    overflow: hidden;
}

.page__brand .logo-wrap {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    width: 100%;
    min-width: 0;
}

.header-image {
    display: block;
    width: auto;
    max-width: min(92vw, 38rem, 100%);
    height: auto;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

/*
 * Lower half: CSS Grid (not flex) + inner “sheet” with max-width.
 * This pattern (grid justify-items: center, inner box margin: auto) is
 * the most cross-browser for horizontal centre, including mobile.
 */
main.content,
.content {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.content {
    /* Fills the lower 50% row; grid centres the block from top to bottom in that area */
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    display: grid;
    /* One full-height cell so the sheet can sit truly centred top–bottom in the 50% band */
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    justify-items: center;
    align-items: center;
    align-content: start;
    padding: max(0.65rem, env(safe-area-inset-top, 0px))
        max(
            var(--content-pad),
            env(safe-area-inset-left, 0px),
            env(safe-area-inset-right, 0px)
        )
        max(0.65rem, env(safe-area-inset-bottom, 0px));
    background-image: linear-gradient(
        180deg,
        var(--color-page) 0%,
        var(--color-page-depth) 100%
    );
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Section: full width of the grid track only (no max-width on this) */
section.contact,
.contact {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
}

/* Single content column: classic block + text-align, works everywhere */
.contact__sheet {
    display: block;
    width: 100%;
    max-width: var(--contact-w);
    margin-left: auto;
    margin-right: auto;
    padding: 0;
    font-family: var(--font-contact);
    text-align: center;
    direction: ltr;
    box-sizing: border-box;
}

.contact__headline {
    display: block;
    margin: 0 0 0.5rem;
    text-align: center;
}

/* Avoid letter-spacing + padding compensation on narrow screens (major cause of “off” look) */
.contact__headline-text {
    display: inline;
    max-width: 100%;
    font-size: clamp(0.7rem, calc(0.2rem + 1.6vw), 0.9rem);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    line-height: 1.35;
    color: var(--color-ink);
}

/* Two keywords, one line that wraps: flex only inside the sheet, sheet already full width of column */
.contact__keywords {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    column-gap: 0.7rem;
    row-gap: 0.4rem;
    margin: 0 0 0.9rem;
    text-align: center;
    font-size: clamp(0.58rem, calc(0.25rem + 1.2vw), 0.68rem);
    font-weight: 500;
    text-transform: uppercase;
    color: var(--color-muted);
}

@media (min-width: 30em) {
    .contact__headline-text {
        letter-spacing: 0.18em;
    }

    .contact__keywords {
        column-gap: 1.05rem;
    }
}

.contact__kw {
    display: inline-block;
    white-space: nowrap;
}

.contact__kw-sep {
    opacity: 0.4;
    font-weight: 300;
    user-select: none;
}

.contact__list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 0 0 auto;
}

.contact__item {
    display: flex;
    flex-direction: column;
    align-items: stretch; /* länk får full bredd → lång e-post centreras per rad */
    gap: 0.2rem;
    text-align: center;
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--contact-line);
}

.contact__item:first-child {
    border-top: 1px solid var(--contact-line);
    padding-top: 1.1rem;
}

.contact__item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.contact__label {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-muted);
}

.contact__link {
    display: block;
    font-size: clamp(0.9375rem, 2.8vw, 1.0625rem);
    font-weight: 500;
    font-style: normal;
    font-feature-settings: "lnum" 1;
    color: var(--color-ink);
    text-decoration: none;
    padding: 0.45rem 0.2rem;
    min-height: 44px;
    line-height: 1.4;
    text-align: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.16s ease, letter-spacing 0.16s ease;
    letter-spacing: 0.01em;
}

.contact__link:hover {
    color: var(--color-accent-hover);
}

.contact__link:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 2px;
}

.contact__address {
    display: block;
    margin: 1.1rem 0 0;
    padding: 1.1rem 0.5rem 0;
    width: 100%;
    text-align: center;
    font-style: normal;
    font-size: clamp(0.6875rem, 1.8vw, 0.75rem);
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.06em;
    color: var(--color-muted);
    border-top: 1px solid var(--contact-line);
}

.contact__address-sep {
    margin: 0 0.35em;
    opacity: 0.5;
    font-weight: 300;
}

