/* public/assets/style.css — netspire.no's look on one screen: buttermilk background, navy text,
   Fraunces headings in indigo, Karla text, emerald links, orange hand-drawn underline and the
   site's hand-drawn button frame (src/scribble.js). Colours are netspire.no's tokens
   (org-netspire apps/netspire.no/src/styles/colors.css + theme.css). */

@font-face {
    font-family: "Karla";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("/assets/fonts/karla.woff2") format("woff2");
}

@font-face {
    font-family: "Fraunces";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/assets/fonts/fraunces.woff2") format("woff2");
}

:root {
    color-scheme: light;
    --background: #fffbf4; /* buttermilk-50 */
    --foreground: #151e4b; /* bright-blue-950 */
    --heading: #4853b3; /* purplish-700, the home page's h1 */
    --link: #006653; /* emerald-800 */
    --scribble: #fe511b; /* the orange underline */
    --focus: #4853b3;
    --frame-pad: 8px; /* FRAME_PAD in src/scribble.js */
    --container: 67rem;
    --gutter: clamp(1.5rem, 5vw, 2rem);
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr;
    background: var(--background);
    color: var(--foreground);
    font: 400 1.125rem/1.5 "Karla", ui-sans-serif, system-ui, sans-serif;
    overflow-x: hidden;
}

a {
    color: var(--link);
    font-weight: 600;
    text-decoration-color: var(--scribble);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.25em;
}

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

/* ---------- Header: the logo and a way to netspire.no ---------- */

.header {
    width: 100%;
    max-width: calc(var(--container) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 1.25rem var(--gutter) 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    display: block;
    line-height: 0;
}

.logo img {
    height: 2.25rem;
    width: auto;
}

.sitelink {
    font-size: 1.25rem;
    text-decoration: none;
}

.sitelink:hover {
    text-decoration: underline;
    text-decoration-color: var(--scribble);
}

/* ---------- The name ---------- */

.main {
    position: relative;
    width: 100%;
    max-width: calc(var(--container) + 2 * var(--gutter));
    margin: 0 auto;
    padding: clamp(2rem, 6vh, 4rem) var(--gutter);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.eyebrow {
    margin: 0 0 1rem;
    color: var(--link);
    font-size: 1.25rem;
    font-weight: 600;
}

.name {
    margin: 0 0 2.5rem;
    color: var(--heading);
    font-family: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
    font-weight: 500;
    line-height: 1.1;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.name--l {
    font-size: clamp(2.75rem, 9vw, 5.5rem);
}

.name--m {
    font-size: clamp(1.75rem, 8vw, 4.25rem);
}

.name--s {
    font-size: clamp(1.25rem, 6.4vw, 3rem);
}

.name__text {
    position: relative;
    display: inline-block;
}

/* The orange hand-drawn stroke, stretched to the name's width (preserveAspectRatio none). */
.name__underline {
    position: absolute;
    left: 0;
    bottom: -0.14em;
    width: 100%;
    /* The site's underline is 0.2em on 20 px nav text; on a 5 rem heading that would be a bar. */
    height: clamp(0.5rem, 0.14em, 0.75rem);
    overflow: visible;
    fill: var(--scribble);
    pointer-events: none;
}

.lead {
    margin: 0 0 2.5rem;
    max-width: 32rem;
    text-wrap: balance;
    font-size: clamp(1.125rem, 2.2vw, 1.375rem);
    line-height: 1.5;
}

/* ---------- The button: netspire.no's hand-drawn frame around the address ---------- */

.button {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 264px; /* BUTTON in scripts/scribble.ts */
    height: 56px;
    color: var(--foreground);
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
}

.button__frame {
    position: absolute;
    left: calc(-1 * var(--frame-pad));
    top: calc(-1 * var(--frame-pad));
    width: calc(100% + 2 * var(--frame-pad));
    height: calc(100% + 2 * var(--frame-pad));
    overflow: visible;
    z-index: -1;
    pointer-events: none;
}

.button__side {
    fill: currentColor;
}

.button__fill {
    fill: var(--foreground);
    opacity: 0;
}

.button__label {
    position: relative;
}

.button:hover,
.button:focus-visible {
    color: var(--background);
}

.button:hover .button__side,
.button:focus-visible .button__side {
    fill: var(--foreground);
}

.button:hover .button__fill,
.button:focus-visible .button__fill {
    opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
    .button,
    .button__fill {
        transition:
            color 160ms ease-out,
            opacity 160ms ease-out;
    }
}

/* ---------- Doodles, as on netspire.no's front page ---------- */

.doodle {
    position: absolute;
    pointer-events: none;
    user-select: none;
    height: auto;
}

.doodle--cheese {
    width: clamp(4.5rem, 9vw, 7.5rem);
    left: calc(var(--gutter) - 4rem);
    top: 18%;
    transform: rotate(-8deg);
}

.doodle--spark {
    width: clamp(2rem, 3.5vw, 3.25rem);
    right: calc(var(--gutter) + 2rem);
    top: 8%;
}

@media (max-width: 40rem) {
    .doodle--cheese {
        left: -2.25rem;
        top: 4%;
    }

    .doodle--spark {
        right: 1rem;
        top: 2%;
    }
}

/* Short screens (a phone held sideways): tighten so it all stays above the fold. */
@media (max-height: 34rem) {
    .main {
        padding-block: 1rem;
    }

    .eyebrow {
        margin-bottom: 0.5rem;
    }

    .name,
    .lead {
        margin-bottom: 1.25rem;
    }

    .name--l {
        font-size: clamp(2.25rem, 16vh, 4rem);
    }

    .name--m {
        font-size: clamp(2rem, 12vh, 3.25rem);
    }

    .name--s {
        font-size: clamp(1.5rem, 9vh, 2.5rem);
    }

    .header {
        padding-top: 0.75rem;
    }

    .doodle {
        display: none;
    }
}
