/* Duelund Nordic Tech - the frame of the new site (header, menu, page head,
   footer) and the light look. Loaded after site.css on the new pages only;
   the under-construction front page uses site.css alone, so it cannot
   change by accident. Built by MAD_TECHIE. */

/* --- Light look (a per-page choice in the admin panel) ---------------------- */

.theme-light {
    color-scheme: light;
    --night-0: #f5f6f8;
    --night-1: #f1f3f6;
    --night-2: #eceff3;
    --ink: #151515;
    --ink-muted: #4b5563;
    /* The logo's blue for light backgrounds: 5.2:1 against white. */
    --accent: #2871a9;
    --focus: #1d5f91;
    --line: rgba(21, 21, 21, 0.12);
}

.theme-light .lang-switch {
    background: #ffffff;
    border-color: rgba(21, 21, 21, 0.18);
}

.theme-light .lang-switch__link[aria-current="page"] {
    color: #ffffff;
}

/* --- Skip link and preview bar -------------------------------------------- */

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 100;
    padding: 0.6rem 1rem;
    color: var(--night-0);
    background: var(--accent);
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 12px;
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.preview-bar {
    padding: 0.45rem var(--gutter);
    font: 600 0.75rem/1.4 var(--font-mono);
    color: var(--ink);
    background: repeating-linear-gradient(135deg, rgba(58, 143, 208, 0.18) 0 12px, rgba(58, 143, 208, 0.08) 12px 24px);
    border-bottom: 1px solid var(--accent);
}

/* --- Header ------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 2rem;
    /* The bar's contents line up with the page's content column on wide screens. */
    padding: 1rem max(var(--gutter), calc((100% - 1240px) / 2 + var(--gutter)));
    /* Frosted: the page shows faintly through the bar as it scrolls under it. */
    background: rgba(21, 21, 21, 0.82);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
    backdrop-filter: saturate(140%) blur(14px);
    border-bottom: 1px solid var(--line);
}

.theme-light .site-header {
    background: rgba(245, 246, 248, 0.85);
}

.site-header .brand__lockup {
    height: 32px;
}

.site-header .brand .brand__mark {
    height: 30px;
}

.site-nav {
    flex: 1 1 auto;
}

.site-nav__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav__link {
    position: relative;
    display: block;
    padding: 0.4rem 0;
    font-size: 0.93rem;
    font-weight: 500;
    color: var(--ink-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease;
}

.site-nav__link:hover {
    color: var(--ink);
}

.site-nav__link[aria-current="page"] {
    color: var(--ink);
    border-bottom-color: var(--accent);
}

.site-nav__link:focus-visible,
.site-search:focus-visible,
.site-header__menu:focus-visible,
.site-footer__link:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    border-radius: 4px;
}

.site-header__tools {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
}

.site-search {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    font: 500 0.78rem/1.2 var(--font-mono);
    color: var(--ink-muted);
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.site-search:hover,
.site-search[aria-current="page"] {
    color: var(--ink);
    border-color: var(--accent);
}

/* A magnifier drawn with borders, so no icon font and no extra request. */
.site-search__icon {
    position: relative;
    width: 11px;
    height: 11px;
    border: 1.6px solid currentColor;
    border-radius: 50%;
}

.site-search__icon::after {
    content: "";
    position: absolute;
    right: -4px;
    bottom: -3px;
    width: 5px;
    height: 1.6px;
    background: currentColor;
    transform: rotate(45deg);
}

.site-header__menu {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    font: 500 0.78rem/1.2 var(--font-mono);
    color: var(--ink);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
}

.site-header__menu-icon,
.site-header__menu-icon::before,
.site-header__menu-icon::after {
    display: block;
    width: 14px;
    height: 1.6px;
    background: currentColor;
}

.site-header__menu-icon {
    position: relative;
}

.site-header__menu-icon::before,
.site-header__menu-icon::after {
    content: "";
    position: absolute;
    left: 0;
}

.site-header__menu-icon::before {
    top: -4.5px;
}

.site-header__menu-icon::after {
    top: 4.5px;
}

/* Narrow screens with JavaScript: the menu folds behind the Menu button.
   Without JavaScript the list simply wraps and stays usable. */
@media (max-width: 1023px) {
    .js-nav .site-header__menu:not([hidden]) {
        display: inline-flex;
        order: 2;
    }

    .js-nav .site-header__tools {
        order: 1;
    }

    .js-nav .site-nav {
        display: none;
        order: 3;
        flex-basis: 100%;
    }

    .js-nav .site-header.is-open .site-nav {
        display: block;
    }

    .js-nav .site-nav__list {
        flex-direction: column;
        gap: 0;
        padding: 0.5rem 0 0.25rem;
    }

    .js-nav .site-nav__link {
        padding: 0.6rem 0;
        font-size: 1rem;
        border-bottom: 1px solid var(--line);
    }

    .js-nav .site-nav__link[aria-current="page"] {
        border-bottom-color: var(--accent);
    }
}

@media (max-width: 480px) {
    .site-search__label {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .site-header__tools {
        gap: 0.4rem;
    }
}

/* --- Page head ---------------------------------------------------------------- */

.hero--page {
    min-height: clamp(320px, 52vh, 560px);
    align-items: flex-end;
    padding: 5rem 0 3.5rem;
    border-bottom: 1px solid var(--line);
}

.hero--page .hero__content {
    max-width: 1240px;
    margin: 0 auto;
}

.hero__motion--page {
    position: absolute;
    z-index: 2;
    right: var(--gutter);
    bottom: 1rem;
}

.page-head {
    padding: 4rem var(--gutter) 2.5rem;
    border-bottom: 1px solid var(--line);
    background: var(--night-0);
}

.page-title {
    margin: 0;
    max-width: 64rem;
    font-size: clamp(2.2rem, 5.8vw, 4.2rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.032em;
    text-wrap: balance;
}

.page-body {
    padding: 2.5rem var(--gutter) 4rem;
    max-width: 72rem;
}

.planned {
    margin: 0;
    font: 0.85rem/1.5 var(--font-mono);
    color: var(--ink-muted);
}

main:focus {
    outline: none;
}

/* --- Footer --------------------------------------------------------------------- */

.site-footer--full {
    display: block;
    padding: clamp(3.5rem, 7vw, 5.5rem) 0 1.5rem;
    font: 0.88rem/1.6 var(--font-sans);
    background: #111213;
    border-top: 1px solid var(--line);
}

.theme-light .site-footer--full {
    background: #eceff3;
}

.site-footer__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 2.75rem;
    padding: 0 0 2.75rem;
    border-bottom: 1px solid var(--line);
}

.site-footer__brand img {
    display: block;
    height: 44px;
}

.site-footer__brand:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 6px;
}

.site-footer__cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem 2rem;
    padding-bottom: 2rem;
}

.site-footer__heading {
    margin: 0 0 0.6rem;
    font: 600 0.72rem/1.4 var(--font-mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink);
}

.site-footer__text {
    margin: 0 0 0.6rem;
    font-style: normal;
}

.site-footer__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer__list li {
    margin: 0 0 0.3rem;
}

.site-footer__link {
    color: var(--ink-muted);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.site-footer__link:hover {
    color: var(--ink);
    text-decoration: underline;
}

.site-footer__base {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    padding-top: 1rem;
    font: 0.75rem/1.4 var(--font-mono);
    border-top: 1px solid var(--line);
}

/* --- The offer of English (stage 5) ------------------------------------------------ */

.lang-offer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.25rem;
    padding: 0.6rem var(--gutter);
    font-size: 0.92rem;
    color: var(--ink);
    background: var(--night-2);
    border-bottom: 1px solid var(--accent);
}

.lang-offer[hidden] {
    display: none;
}

.lang-offer__text,
.lang-offer__actions {
    margin: 0;
}

.lang-offer__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
}

.lang-offer__switch {
    font-weight: 600;
    color: var(--accent);
}

.lang-offer__dismiss {
    padding: 0.3rem 0.75rem;
    font: inherit;
    color: var(--ink-muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
}

.lang-offer__dismiss:hover {
    color: var(--ink);
    border-color: var(--accent);
}

.lang-offer__switch:focus-visible,
.lang-offer__dismiss:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    border-radius: 4px;
}

/* --- The search layer (stage 5) ----------------------------------------------------- */

.search-layer {
    width: min(40rem, calc(100vw - 2rem));
    max-height: min(36rem, calc(100vh - 4rem));
    margin: 4.5rem auto auto;
    padding: 0;
    color: var(--ink);
    background: var(--night-0);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

/* Only while open: a display value on the closed dialog would show it. */
.search-layer[open] {
    display: flex;
    flex-direction: column;
}

.search-layer::backdrop {
    background: rgba(10, 10, 10, 0.6);
}

/* Only the results scroll; the field and the help line stay in place. */
.search-layer__panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.search-layer__form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--line);
}

.search-layer__icon {
    flex: 0 0 auto;
    color: var(--ink-muted);
}

.search-layer__input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.35rem 0;
    font: inherit;
    font-size: 1.05rem;
    color: var(--ink);
    background: transparent;
    border: 0;
}

.search-layer__input:focus-visible {
    outline: none;
}

.search-layer__form:focus-within {
    box-shadow: inset 0 -2px 0 var(--accent);
}

.search-layer__close {
    flex: 0 0 auto;
    padding: 0.3rem 0.7rem;
    font: 500 0.78rem/1.2 var(--font-mono);
    color: var(--ink-muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
}

.search-layer__close:hover {
    color: var(--ink);
    border-color: var(--accent);
}

.search-layer__status {
    margin: 0;
    padding: 0.6rem 1rem 0;
    font: 0.78rem/1.4 var(--font-mono);
    color: var(--ink-muted);
}

.search-layer__status:empty {
    display: none;
}

.search-layer__results {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0.25rem 0.5rem 0.75rem;
}

.search-layer__group-title {
    margin: 0.75rem 0.5rem 0.35rem;
    font: 600 0.72rem/1.4 var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.search-layer__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.search-layer__result {
    display: block;
    padding: 0.55rem 0.5rem;
    color: var(--ink);
    text-decoration: none;
    border-radius: 6px;
}

.search-layer__result:hover {
    background: var(--night-2);
}

.search-layer__result:focus-visible {
    background: var(--night-2);
    outline: 2px solid var(--focus);
    outline-offset: -2px;
}

.search-layer__result-title {
    display: block;
    font-weight: 600;
}

.search-layer__result-summary {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--ink-muted);
}

.search-layer__all {
    display: inline-block;
    margin: 0.75rem 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
}

.search-layer__all:focus-visible,
.search-layer__close:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    border-radius: 4px;
}

.search-layer__help {
    margin: 0;
    padding: 0.55rem 1rem;
    font: 0.72rem/1.4 var(--font-mono);
    color: var(--ink-muted);
    border-top: 1px solid var(--line);
}

/* Touch screens have no arrow keys to explain. */
@media (hover: none) {
    .search-layer__help {
        display: none;
    }
}

@media (max-width: 480px) {
    .search-layer {
        width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
        margin-top: 0.5rem;
    }
}

/* --- Moving between pages (redesign, part 2) ------------------------------------- */

/* Moving between pages: the header stays, the page fades across. Browsers
   without view transitions simply load the next page. */
@view-transition {
    navigation: auto;
}

.site-header {
    view-transition-name: site-header;
}

::view-transition-old(root) {
    animation: page-out 0.25s ease both;
}

::view-transition-new(root) {
    animation: page-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes page-out {
    to {
        opacity: 0;
    }
}

@keyframes page-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation: none;
    }
}
