/* hugsa.fo page and component layout.

   css/brand.css holds the shared Hugsa public foundation: the palette, the
   type scale, the spacing rhythm, the content width, the focus treatment, the
   buttons and the form controls, and it is kept byte-identical with
   support.hugsa.fo. This file only adds the composition and the decorative
   atmosphere of the public company site. */

body {
    isolation: isolate;
    position: relative;
    background-image: var(--page-gradient);
}

body::before,
body::after {
    content: "";
    inset: 0;
    pointer-events: none;
    /* The atmosphere belongs to the page, not to the viewport. A fixed layer
       ends at the first viewport height, which leaves a hard horizontal edge
       partway through a full-page render; an absolute layer covers the whole
       document and the gradient stays continuous. */
    position: absolute;
}

body::before {
    background: var(--ambient-glow);
    opacity: 1;
    z-index: -2;
}

body::after {
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 4rem 4rem;
    mask-image: radial-gradient(ellipse at 50% 38%, black, transparent 72%);
    opacity: 0.55;
    z-index: -1;
}

#main-content {
    margin: 0 auto;
    max-width: var(--content-max-width);
    min-height: 60vh;
    padding: var(--space-5) var(--page-gutter);
    position: relative;
}

html.is-graph-dragging,
html.is-graph-dragging body {
    cursor: grabbing;
    overscroll-behavior: none;
    user-select: none;
}

/* ---------------------------------------------------------------- hero */

.hero {
    align-items: center;
    display: grid;
    gap: var(--space-3) var(--space-4);
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    min-height: clamp(24rem, 52vh, 36rem);
    position: relative;
}

.hero__content {
    max-width: 38rem;
    position: relative;
    z-index: 1;
}

.hero h1,
.hero__intro {
    user-select: none;
}

.hero h1 {
    color: var(--text);
    max-width: 18ch;
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
    .hero h1 {
        background-image: var(--heading-gradient);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }
}

.hero__intro {
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    max-width: 44ch;
}

.hero__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-3);
    margin-top: var(--space-3);
}

.hero__graphic {
    align-items: center;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 0;
}

.hero__graphic .knowledge-graph {
    max-width: 100%;
    opacity: 0.85;
    width: 100%;
}

/* ---------------------------------------------------------------- home sections */

.home-section {
    border-top: 1px solid var(--border-color);
    padding-top: var(--space-4);
}

.home-section + .home-section,
.home-section + .contact-band {
    margin-top: var(--space-5);
}

.home-section__head {
    max-width: 46rem;
}

.home-section__head h2 {
    max-width: 24ch;
}

.home-section__head p:last-child {
    margin-bottom: 0;
}

.service-list {
    display: grid;
    gap: var(--space-3) var(--space-4);
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    list-style: none;
    margin: var(--space-4) 0 0;
    padding: 0;
}

.service-item {
    border-top: 2px solid var(--accent-soft);
    padding-top: var(--space-2);
}

.service-item h3 {
    font-size: 1.15rem;
    margin-bottom: 0.35rem;
}

.service-item p {
    color: var(--muted-text);
    margin-bottom: 0;
}

.home-section__foot {
    margin: var(--space-4) 0 0;
}

.text-link {
    align-items: center;
    display: inline-flex;
    gap: 0.45rem;
    font-weight: 700;
    text-decoration-color: var(--accent-soft);
    text-decoration-thickness: 0.16em;
}

.home-section--split {
    display: grid;
    gap: var(--space-4);
    /* The label column clears the widest realistic rendering of the section
       labels so they stay on one line in every font in the stack. */
    grid-template-columns: minmax(10rem, 0.78fr) minmax(0, 1.22fr);
    max-width: 60rem;
}

.home-section--split h2 {
    margin-bottom: 0;
}

.work-card h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.6rem);
    margin-bottom: var(--space-1);
}

.work-card__meta {
    color: var(--accent);
    font-size: var(--font-size-small);
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: var(--space-2);
}

.work-card__status {
    align-items: center;
    color: var(--muted-text);
    display: flex;
    font-size: var(--font-size-small);
    gap: 0.45rem;
    margin-bottom: var(--space-2);
}

.status-dot {
    background: #4f9c83;
    border-radius: 50%;
    box-shadow: 0 0 0 0.25rem rgba(79, 156, 131, 0.13);
    display: inline-block;
    height: 0.45rem;
    width: 0.45rem;
}

.work-card__link {
    align-items: center;
    display: inline-flex;
    gap: 0.5rem;
    margin-top: var(--space-1);
    text-decoration-color: var(--accent-soft);
    text-decoration-thickness: 0.16em;
}

.work-card__link span:last-child {
    font-size: 1.15em;
    line-height: 1;
    transition: transform 180ms ease;
}

.work-card__link:hover span:last-child,
.work-card__link:focus-visible span:last-child {
    transform: translate(0.15rem, -0.15rem);
}

.contact-details {
    display: grid;
    gap: 0.75rem var(--space-3);
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    margin: 0 0 var(--space-3);
}

.contact-details dt {
    color: var(--muted-text);
    font-size: var(--font-size-small);
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 0.15rem;
    text-transform: uppercase;
}

.contact-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

/* The address is longer than the other values, so it takes a full row instead of being squeezed
   into one narrow column on a wide screen. */
.contact-details__wide {
    grid-column: 1 / -1;
}

.contact-band {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    display: grid;
    gap: var(--space-3) var(--space-4);
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    padding: clamp(1.5rem, 4vw, 2.75rem);
}

.contact-band__text h2 {
    max-width: 18ch;
}

.contact-band__text p:last-child {
    margin-bottom: 0;
}

.contact-band__actions {
    align-content: start;
    display: grid;
    gap: var(--space-2);
    justify-items: stretch;
}

.contact-band__meta {
    color: var(--muted-text);
    font-size: var(--font-size-small);
    margin: var(--space-1) 0 0;
}

/* ---------------------------------------------------------------- inner pages */

.page-section {
    max-width: var(--text-measure);
    padding-top: var(--space-4);
}

.page-section h1 {
    max-width: 18ch;
    margin-bottom: var(--space-4);
}

.section-label {
    color: var(--accent);
    font-size: var(--font-size-small);
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-1);
    text-transform: uppercase;
}

.page-intro {
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    max-width: 46ch;
}

.page-section--intro {
    min-height: clamp(22rem, 44vh, 32rem);
}

.page-section--services,
.page-section--projects,
.page-section--privacy {
    padding-bottom: var(--space-5);
}

.text-sections {
    display: grid;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.text-section {
    border-top: 1px solid var(--border-color);
    padding-top: var(--space-4);
}

.text-sections h2 {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
    margin-bottom: var(--space-1);
}

.text-sections p {
    margin-bottom: 0;
}

.text-sections p + p {
    margin-top: var(--space-2);
}

.project-card h2 {
    margin-bottom: var(--space-1);
}

.project-card__meta {
    color: var(--accent);
    font-size: var(--font-size-small);
    font-weight: 700;
    margin-bottom: var(--space-2) !important;
}

.page-copy {
    display: grid;
    gap: var(--space-4);
}

.page-copy p {
    border-top: 1px solid var(--border-color);
    margin: 0;
    padding-top: var(--space-4);
}

.page-note {
    color: var(--muted-text);
    margin-top: var(--space-5);
}

/* ---------------------------------------------------------------- errors */

#blazor-error-ui {
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    display: none;
    padding: var(--space-2) var(--page-gutter);
    position: fixed;
    inset: auto 0 0;
    z-index: 1000;
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 64rem) {
    .home-section--split {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-section--split h2 {
        margin-bottom: var(--space-2);
    }
}

@media (max-width: 48rem) {
    .hero {
        display: block;
        min-height: 0;
    }

    /* Two different-width buttons side by side leave an uneven edge on a phone;
       stacked and full width they read as one deliberate pair of actions. */
    .hero__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .hero__graphic {
        /* The mark keeps its 800:520 aspect ratio, so its height follows the
           rendered width. */
        height: auto;
        margin-top: var(--space-4);
        opacity: 0.6;
    }

    .hero__graphic .knowledge-graph {
        max-width: none;
        transform: translateX(-4%);
        width: 108%;
    }

    .contact-band {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .work-card__link span:last-child {
        transition: none;
    }
}

@media (forced-colors: active) {
    .hero h1 {
        background: none;
        color: var(--text);
        -webkit-text-fill-color: currentColor;
    }

    body {
        background-image: none;
    }

    body::before,
    body::after {
        display: none;
    }

    .status-dot {
        background: CanvasText;
        box-shadow: none;
    }
}
