﻿/* ===== BASE / TOKENS ===== */
@import url('https://fonts.googleapis.com/css2?family=Cabin+Condensed:wght@700&display=swap');

:root {
    --bg: #0b0f19;
    --bg2: #0f172a;
    --fg: #e5e7eb;
    --muted: #94a3b8;
    --card: #111827;
    --primary: #38bdf8;
    --accent: #a78bfa;
    --border: rgba(255,255,255,.07);
    --btn-icon: #6b7280;
    --container-max: 1200px;
    --container-pad: clamp(16px,3vw,24px);
    --nav-h: 64px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 10px);
}

/* =======================
   Unified dark scrollbars
   ======================= */

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(148,163,184,.38) #0e1628;
}

/* WebKit (Chrome/Edge/Safari) */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(180deg, var(--bg), var(--bg2));
    border-left: 1px solid rgba(255,255,255,.06);
}

::-webkit-scrollbar-thumb {
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: padding-box;
    background-image: linear-gradient(135deg, rgba(56,189,248,.18), rgba(167,139,250,.18)), linear-gradient(#64748b, #64748b);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.10), 0 2px 10px rgba(0,0,0,.25);
}

    ::-webkit-scrollbar-thumb:hover {
        background-image: linear-gradient(135deg, rgba(56,189,248,.28), rgba(167,139,250,.28)), linear-gradient(#748294, #748294);
        box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 0 0 4px rgba(56,189,248,.10);
    }

    ::-webkit-scrollbar-thumb:active {
        background-image: linear-gradient(135deg, rgba(56,189,248,.38), rgba(167,139,250,.38)), linear-gradient(#7f8ea1, #7f8ea1);
    }

::-webkit-scrollbar-corner {
    background: linear-gradient(180deg, var(--bg), var(--bg2));
}

/* Compact on small screens */
@media (max-width: 640px) {
    ::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }
}

html, body, #app {
    min-height: 100%;
    height: 100vh;
}

body {
    margin: 0;
    color: var(--fg);
    background: linear-gradient(180deg,var(--bg),var(--bg2));
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

/* ===== LAYOUT (global) ===== */
.container {
    width: min(var(--container-max), 100% - 2*var(--container-pad));
    margin-inline: auto;
}

.section {
    padding-block: clamp(64px, 8vw, 110px);
}

/* ===== TOP NAV (sticky) ===== */
.topnav {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--nav-h);
    background: rgba(10,12,22,.65);
    backdrop-filter: blur(8px) saturate(120%);
    border-bottom: 1px solid var(--border);
}

    .topnav .container {
        height: 100%;
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .topnav .brand {
        display: flex;
        align-items: center;
        gap: .6rem;
        text-decoration: none;
        color: var(--fg);
        font-weight: 800;
        letter-spacing: .2px;
        padding: .25rem .4rem;
        border-radius: 12px;
    }

.brand-mark {
    height: clamp(28px,5vw,64px);
    width: auto;
    transition: transform .25s;
}

.topnav .brand:hover .brand-mark {
    transform: scale(1.03);
}

.brand-wordmark {
    height: 40px;
    width: auto;
    overflow: visible;
}

    .brand-wordmark text {
        font-family: 'Cabin Condensed', Inter, ui-sans-serif, system-ui;
        font-weight: 700;
        letter-spacing: .2px;
    }

.topnav .links {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

    .topnav .links a {
        color: var(--muted);
        text-decoration: none;
        padding: .5rem .75rem;
        border-radius: 12px;
        transition: color .2s, background-color .2s;
    }

        .topnav .links a:hover, .topnav .links a.active {
            color: var(--fg);
            background: rgba(255,255,255,.06);
        }

.topnav .blebar {
    margin-left: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== TYPE & BUTTONS (global) ===== */
h1 {
    font-size: clamp(2.2rem,4vw + 1rem,4rem);
    line-height: 1.1;
    margin: 0 0 1rem;
}

h2 {
    font-size: clamp(1.6rem,2.2vw + 1rem,2.4rem);
    margin: 0 0 .75rem;
}

p.lead {
    font-size: 1.125rem;
    color: var(--muted);
    max-width: 60ch;
}

.btn {
    display: inline-block;
    font-weight: 700;
    text-decoration: none;
    padding: .9rem 1.2rem;
    border-radius: 14px;
    margin-top: 1rem;
    color: #0b0f19;
    background: linear-gradient(135deg,var(--primary),var(--accent));
    transition: transform .3s cubic-bezier(.22,.8,.25,1), box-shadow .3s cubic-bezier(.22,.8,.25,1), opacity .3s;
}

    .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 8px 20px rgba(56,189,248,.25);
    }

    .btn:active {
        transform: none;
        box-shadow: none;
    }
    /* unified disabled state for buttons */
    .btn[disabled], .btn:disabled {
        opacity: .5;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

/* ===== GRIDS & CARDS (global) ===== */
.grid-2 {
    display: grid;
    gap: 32px;
    grid-template-columns: repeat(2,minmax(0,1fr));
}

.grid-3 {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(3,minmax(0,1fr));
}

@media (max-width:900px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

.card {
    padding: 24px;
    border-radius: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    transition: transform .3s cubic-bezier(.22,.8,.25,1), box-shadow .3s cubic-bezier(.22,.8,.25,1), border-color .3s;
}

    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(0,0,0,.25);
        border-color: rgba(255,255,255,.12);
    }

/* ===== REVEAL (global) ===== */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity .95s, transform .95s cubic-bezier(.22,.8,.25,1);
}

.js .reveal {
    opacity: 0;
    transform: translateY(18px) scale(.98);
}

    .js .reveal.visible {
        opacity: 1;
        transform: none;
    }

/* ===== FOOTER (site-wide) ===== */
.site-footer-cta {
    position: relative;
    padding: 72px 0 48px;
    border-top: 1px solid var(--border);
    background: radial-gradient(90% 120% at 50% 0%, rgba(120,160,255,.14), transparent 70%), radial-gradient(80% 80% at 10% 60%, rgba(167,139,250,.10), transparent 70%), linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0) 40%), #0c1220;
    overflow: hidden;
}

    .site-footer-cta::before {
        content: "";
        position: absolute;
        inset: -20% -20% -60% -20%;
        background: radial-gradient(50% 60% at 70% 10%, rgba(70,130,255,.12), transparent 60%);
        filter: blur(32px);
        opacity: .6;
        pointer-events: none;
    }

.footer-grid.footer-3col {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    gap: clamp(24px,5vw,80px);
}

.footer-col.brand {
    grid-column: 2;
    justify-self: center;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-logo {
    display: block;
    margin-inline: auto;
    height: clamp(110px,12vw,170px);
    width: auto;
    filter: drop-shadow(0 8px 30px rgba(120,200,255,.15));
}

.footer-wordmark {
    margin-top: 4px;
    font-weight: 300;
    font-size: clamp(1.2rem,2.2vw,2rem);
    letter-spacing: .14rem;
    color: var(--fg);
}

.footer-col.spacer {
    min-height: 1px;
}

.footer-copy {
    margin-top: 36px;
    text-align: center;
    color: var(--muted);
    font-size: .95rem;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

@media (max-width:900px) {
    .footer-grid.footer-3col {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .site-footer-cta {
        padding: 56px 0 40px;
    }

    .footer-logo {
        height: clamp(90px,24vw,140px);
    }
}

/* ===== ROUTE TRANSITIONS (global) ===== */
.content-wrap {
    height: calc(100% - 64px);
    overflow-y: auto;
    overflow-x: hidden;
    /* smooth scroll for innholdet under navbaren */
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 10px);
}


.route-container {
    will-change: transform,opacity,filter;
    animation-duration: 380ms;
    animation-timing-function: cubic-bezier(.22,.8,.25,1);
    animation-fill-mode: both;
    transform-origin: 50% 50%;
}

.route-fade {
    animation-name: routeFade;
}

@keyframes routeFade {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.985);
        filter: blur(4px);
    }

    to {
        opacity: 1;
        transform: none;
        filter: blur(0);
    }
}

.route-slide-left {
    animation-name: routeSlideLeft;
}

@keyframes routeSlideLeft {
    from {
        opacity: 0;
        transform: translateX(48px) scale(.985);
        filter: blur(6px);
    }

    to {
        opacity: 1;
        transform: none;
        filter: blur(0);
    }
}

.route-slide-right {
    animation-name: routeSlideRight;
}

@keyframes routeSlideRight {
    from {
        opacity: 0;
        transform: translateX(-48px) scale(.985);
        filter: blur(6px);
    }

    to {
        opacity: 1;
        transform: none;
        filter: blur(0);
    }
}

@media (prefers-reduced-motion:reduce) {
    .route-container {
        animation: none !important;
    }
}

/* ===== Footer-kontaktliste ===== */
.footer-col.contact ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-col.contact li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
    font-weight: 300;
    font-size: clamp(1rem,1.4vw,1.2rem);
}

.footer-col.contact a {
    color: var(--fg);
    text-decoration: none;
    position: relative;
    font-weight: 400;
}

    .footer-col.contact a:hover {
        color: var(--primary);
    }

    .footer-col.contact a::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: -2px;
        width: 0;
        height: 1px;
        background: linear-gradient(90deg, var(--primary), var(--accent));
        transition: width .18s ease-out;
    }

    .footer-col.contact a:hover::after {
        width: 100%;
    }

.footer-col.contact svg, .footer-col.contact img {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: block;
    object-fit: contain;
}

/* ===== HERO (base only; page layout lives in page CSS) ===== */
.hero {
    position: relative;
}

    .hero .container {
        position: relative;
    }

.float-pill-scene {
    pointer-events: none;
}

/* ===== BLE status pill in topnav ===== */
.ble-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,.45);
    background: rgba(15,23,42,.75);
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}

    .ble-pill::before {
        content: "";
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #4b5563;
        box-shadow: 0 0 0 0 rgba(56,189,248,0);
        transition: background .2s ease, box-shadow .25s ease;
    }

    .ble-pill.is-on {
        background: linear-gradient(135deg,var(--primary),var(--accent));
        color: #020617;
        border-color: transparent;
    }

        .ble-pill.is-on::before {
            background: #22c55e;
            box-shadow: 0 0 0 4px rgba(34,197,94,.35);
        }

/* ===== Blazor error bar ===== */
#blazor-error-ui {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    background: rgba(15,23,42,0.98);
    color: #e5e7eb;
    border-top: 1px solid rgba(148,163,184,0.6);
    font-size: 0.9rem;
    z-index: 1000;
    display: none;
}

    #blazor-error-ui .reload {
        margin-left: 0.75rem;
        text-decoration: underline;
    }

    #blazor-error-ui .dismiss {
        cursor: pointer;
        float: right;
    }

/* =========================================================
   SHARED PILL COMPONENT (used on home + bluetooth)
   ========================================================= */
.pill {
    position: relative;
    aspect-ratio: 1 / 2.6;
    /* Customizable props */
    --pill-intensity: 1;
    --pill-blink-ms: 1000ms;
    --pill-glow-top: -10%;
    --pill-glow-left: -14%;
    --pill-glow-right: -14%;
    --pill-glow-bottom: -6%;
}

    /* Parts */
    .pill .cap,
    .pill .body,
    .pill .ring,
    .pill .btn,
    .pill .glow {
        position: absolute;
        left: 0;
        right: 0;
        transition: opacity .6s, transform .85s cubic-bezier(.22,.8,.25,1), filter .6s, box-shadow .6s, background .6s;
    }

    /* Top glass */
    .pill .cap {
        top: 0;
        height: 56%;
        border-radius: 999px 999px 46px 46px;
        background: radial-gradient(160% 120% at 50% 78%, #bfe6ff 0%, #8fd1ff 45%, #64c0ff 90%), linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0) 55%);
        box-shadow: inset 0 12px 22px rgba(255,255,255,.55), inset 0 -16px 22px rgba(0,0,0,.08);
        opacity: calc(0.25 + 0.75 * var(--pill-intensity));
    }

        .pill .cap::before {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: inherit;
            background: radial-gradient(140% 90% at 50% 4%, rgba(255,255,255,.75) 0 10%, rgba(255,255,255,0) 34%), linear-gradient(to bottom, rgba(255,255,255,.10), rgba(255,255,255,0) 38%);
            mix-blend-mode: screen;
            opacity: .9;
        }

        .pill .cap::after {
            content: "";
            position: absolute;
            left: 22%;
            right: 22%;
            top: 12%;
            height: 10%;
            border-radius: 999px;
            background: linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,255,255,0));
            opacity: .55;
        }

    /* Bottom body */
    .pill .body {
        bottom: 0;
        height: 52%;
        border-radius: 46px 46px 999px 999px;
        background: linear-gradient(180deg, #e6e8ec 0%, #cdd1d8 48%, #b6bbc3 100%);
        box-shadow: inset 0 10px 16px rgba(255,255,255,.42), inset 0 -12px 16px rgba(0,0,0,.16);
    }

        .pill .body::before {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: inherit;
            background: radial-gradient(120% 90% at 50% 60%, rgba(0,0,0,.06), rgba(0,0,0,0) 60%);
            mix-blend-mode: multiply;
            opacity: .5;
        }

        .pill .body::after {
            content: "";
            position: absolute;
            left: 12%;
            right: 12%;
            top: 9%;
            height: 11%;
            border-radius: 999px;
            background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0));
            opacity: .5;
        }

    /* Ring */
    .pill .ring {
        top: 54.5%;
        height: 0;
        border-top: 1px solid rgba(0,0,0,.16);
        position: relative;
    }

        .pill .ring::after {
            content: "";
            position: absolute;
            left: -1.5%;
            right: -1.5%;
            top: -1px;
            height: 3px;
            border-radius: 999px;
            background: linear-gradient(180deg, rgba(0,0,0,.14), rgba(0,0,0,0));
            opacity: .8;
        }

    /* Button */
    .pill .btn {
        top: 59%;
        left: 50%;
        width: 20%;
        aspect-ratio: 1/1;
        border-radius: 50%;
        transform: translateX(-50%);
        background: #f3f4f6;
        border: 1px solid rgba(0,0,0,.18);
        box-shadow: inset 0 2px 3px rgba(255,255,255,.22), inset 0 -2px 4px rgba(0,0,0,.12);
    }

        .pill .btn::after {
            content: "";
            position: absolute;
            inset: 26%;
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2v6'/><path d='M6.35 5.65a8 8 0 1 0 11.3 0'/></svg>");
            background-repeat: no-repeat;
            background-position: center;
            background-size: 100% 100%;
            opacity: .95;
        }

    /* Glow */
    .pill .glow {
        position: absolute;
        z-index: -1;
        top: var(--pill-glow-top);
        left: var(--pill-glow-left);
        right: var(--pill-glow-right);
        bottom: var(--pill-glow-bottom);
        border-radius: 999px;
        mix-blend-mode: screen;
        background: radial-gradient(120% 100% at 50% 20%, rgba(160,220,255,.35), rgba(160,220,255,0) 70%), radial-gradient(140% 120% at 50% 80%, rgba(120,200,255,.22), rgba(120,200,255,0) 82%);
        filter: blur(14px) saturate(1.15);
        opacity: calc(0.10 + 0.60 * var(--pill-intensity));
        transition: opacity .7s, filter .7s, transform .7s;
    }

/* States */
.pill--off .cap {
    opacity: 0.22;
    animation: none !important;
}

.pill--off .glow {
    opacity: 0;
    animation: none !important;
}

.pill--blink .cap,
.pill--blink .glow {
    animation: pillBlink calc(var(--pill-blink-ms) * 2) ease-in-out infinite;
}

@keyframes pillBlink {
    0%, 100% {
        opacity: 0.18;
    }

    50% {
        opacity: 1;
    }
}
html:not(.js) .float-pill-scene,
html:not(.js) .bt-pill-scene {
    animation: pillFloat 16s ease-in-out infinite;
    transform-origin: 100% 100%;
    will-change: transform;
}

/* Pille: stabil plassering – ikke klippes */
.float-pill-scene {
    position: relative;
    z-index: 1;
    height: auto;
    pointer-events: none;
    width: 140px;
}

.pill {
    position: relative;
    width: clamp(84px, 10vw, 140px);
    aspect-ratio: 1 / 2.6;
    margin-left: auto;
    display: block;
}

@media (max-width:900px) {

    .pill {
        width: clamp(72px,14vw,110px);
    }
}


/* Container already flex; add a right cluster for BLE + burger */
.topnav .container {
    position: relative;
}

.nav-actions {
    margin-left: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Desktop links (row) */
.topnav .links {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto; /* push to the right */
}

/* Hamburger button */
.menu-btn {
    display: none; /* hidden on desktop */
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(15,23,42,.6);
    backdrop-filter: blur(6px);
    outline: none;
    align-items: center;
    justify-content: center;
}

    .menu-btn .bar,
    .menu-btn .bar::before,
    .menu-btn .bar::after {
        content: "";
        display: block;
        width: 22px;
        height: 2px;
        background: var(--fg);
        position: relative;
        transition: transform .2s ease, opacity .2s ease;
    }

        .menu-btn .bar::before {
            position: absolute;
            transform: translateY(-6px);
        }

        .menu-btn .bar::after {
            position: absolute;
            transform: translateY( 6px);
        }

    .menu-btn[aria-expanded="true"] .bar {
        opacity: 0;
    }

        .menu-btn[aria-expanded="true"] .bar::before {
            transform: rotate(45deg);
        }

        .menu-btn[aria-expanded="true"] .bar::after {
            transform: rotate(-45deg);
        }

/* ===== Mobile layout (<=1000px) ===== */
@media (max-width:991px) {
    /* Show burger, keep BLE pill visible */
    .menu-btn {
        display: inline-flex;
    }

    /* Turn links into a dropdown panel */
    .topnav .links {
        position: absolute;
        top: var(--nav-h);
        right: var(--container-pad);
        margin-left: 0;
        display: none; /* hidden until opened */
        flex-direction: column;
        gap: 4px;
        min-width: 220px;
        padding: 10px;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: rgba(12,18,32,.98);
        box-shadow: 0 12px 30px rgba(0,0,0,.35);
        z-index: 60;
    }

        .topnav .links.is-open {
            display: flex;
        }

        .topnav .links a, .topnav .links .active {
            display: block;
            padding: 10px 12px;
            border-radius: 10px;
        }

            .topnav .links a:hover {
                background: rgba(255,255,255,.06);
            }

    /* BLE pill remains in .nav-actions; don't hide it */
}
