/* =========================================================
   TJENESTER – NordPair
   Hovedeffekt: Horisontal kino-scroll + 3D tilt + lys-cursor
   ========================================================= */

:root {
    --bg-primary: #04060d;
    --bg-card: rgba(15, 19, 32, 0.5);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.65);
    --text-tertiary: rgba(255, 255, 255, 0.45);
    --accent: #5b8cff;
    --border: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { overflow-x: hidden; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

ul { list-style: none; }

.site-header__link--active {
    color: var(--text-primary) !important;
    position: relative;
}
.site-header__link--active::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 50%;
    transform: translateX(-50%);
    width: 100% !important; height: 1px;
    background: var(--accent);
}

/* Bakgrunn */
.bg-gradient {
    position: fixed; inset: 0; z-index: -3; pointer-events: none;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(91, 140, 255, 0.15), transparent),
        linear-gradient(180deg, #04060d 0%, #06091a 50%, #04060d 100%);
}
.bg-glow {
    position: fixed; border-radius: 50%; filter: blur(120px);
    z-index: -1; pointer-events: none; opacity: 0.4;
}
.bg-glow--1 { width: 600px; height: 600px; background: rgba(91,140,255,0.3); top: 10%; right: -10%; }
.bg-glow--2 { width: 500px; height: 500px; background: rgba(60,100,200,0.2); bottom: 20%; left: -10%; }

[data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s cubic-bezier(0.16,1,0.3,1), transform 0.9s cubic-bezier(0.16,1,0.3,1);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

/* =========================================================
   HERO – maskert linje-reveal
   ========================================================= */
.svc-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 48px 60px;
    max-width: 1280px;
    margin: 0 auto;
}

.svc-hero__inner { max-width: 880px; }

/* Maske-teknikk: tekst skjules bak overflow og glir opp.
   padding-bottom + negativ margin gir descenders (g,j,p,y)
   plass uten å endre layouten. */
.svc-hero__eyebrow,
.svc-hero__line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.18em;
    margin-bottom: -0.18em;
}

.svc-hero__eyebrow > span,
.svc-hero__line > span {
    display: inline-block;
    transform: translateY(110%);
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    padding-bottom: 0.05em;
}

.svc-hero.is-ready .svc-hero__eyebrow > span { transform: translateY(0); transition-delay: 0.1s; }
.svc-hero.is-ready .svc-hero__line:nth-child(1) > span { transform: translateY(0); transition-delay: 0.25s; }
.svc-hero.is-ready .svc-hero__line:nth-child(2) > span { transform: translateY(0); transition-delay: 0.38s; }

.svc-hero__eyebrow {
    margin-bottom: calc(28px - 0.18em);
}
.svc-hero__eyebrow > span {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    padding: 7px 16px;
    background: rgba(91, 140, 255, 0.06);
    border: 1px solid rgba(91, 140, 255, 0.25);
    border-radius: 999px;
}

.svc-hero__title {
    font-family: 'Manrope', sans-serif;
    font-size: clamp(40px, 6.5vw, 92px);
    font-weight: 600;
    line-height: 1.04;
    letter-spacing: -0.035em;
    color: var(--text-primary);
    margin-bottom: 32px;
}

.svc-hero__title em {
    font-style: normal;
    background: linear-gradient(135deg, #5b8cff 0%, #7ba2ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.svc-hero__text {
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-secondary);
    font-weight: 300;
    max-width: 560px;
    margin-bottom: 56px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.9s ease 0.6s, transform 0.9s cubic-bezier(0.16,1,0.3,1) 0.6s;
}
.svc-hero.is-ready .svc-hero__text { opacity: 1; transform: translateY(0); }

.svc-hero__hint {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.9s ease 0.9s;
}
.svc-hero.is-ready .svc-hero__hint { opacity: 1; }

.svc-hero__hint-track {
    width: 42px;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
}
.svc-hero__hint-dot {
    position: absolute;
    top: -1px; left: 0;
    width: 14px; height: 3px;
    border-radius: 2px;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: hint-slide 2s cubic-bezier(0.6,0,0.4,1) infinite;
}
@keyframes hint-slide {
    0% { left: -14px; }
    60%, 100% { left: 42px; }
}

/* =========================================================
   HORISONTAL KINO-SCROLL
   ========================================================= */
.svc-rail {
    position: relative;
}

.svc-rail__sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
}

/* Progress-indikator */
.svc-progress {
    position: absolute;
    top: 50%;
    left: 48px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    z-index: 10;
}

.svc-progress__count {
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.1em;
}

.svc-progress__total {
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 0.1em;
}

.svc-progress__bar {
    width: 2px;
    height: 160px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.svc-progress__fill {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, var(--accent), #7ba2ff);
    border-radius: 2px;
    transform-origin: top center;
    transform: scaleY(0);
    box-shadow: 0 0 10px rgba(91, 140, 255, 0.6);
}

/* Sporet med panelene */
.svc-track {
    display: flex;
    gap: 40px;
    padding: 0 max(140px, 12vw) 0 max(140px, 12vw);
    will-change: transform;
    /* Isolerer rendering for jevnere scroll */
    backface-visibility: hidden;
}

/* ENKELT PANEL */
.svc-panel {
    position: relative;
    flex: 0 0 min(680px, 78vw);
    /* Fleksibel høyde – vokser med innholdet, klipper aldri tekst.
       min-height holder dem visuelt like store, men de utvider seg
       om teksten trenger mer plass (f.eks. ved zoom). */
    min-height: 60vh;
    max-height: none;
    background: linear-gradient(135deg,
        rgba(22, 28, 48, 0.9) 0%,
        rgba(13, 17, 30, 0.95) 100%);
    border: 1px solid var(--border-strong);
    border-radius: 28px;
    overflow: hidden;
    transform: perspective(1200px) rotateX(0) rotateY(0);
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.4s ease;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    /* Browseren slipper å re-paint utenfor panelet */
    contain: layout paint style;
}

.svc-panel:hover {
    border-color: rgba(91, 140, 255, 0.4);
}

/* Lys som følger musepeker */
.svc-panel__glow {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 3;
}

/* Stort bakgrunns-tall (parallakse) */
.svc-panel__bg {
    position: absolute;
    bottom: -8%;
    right: -2%;
    font-family: 'Manrope', sans-serif;
    font-size: clamp(220px, 32vw, 420px);
    font-weight: 800;
    line-height: 1;
    color: rgba(91, 140, 255, 0.06);
    pointer-events: none;
    z-index: 1;
    user-select: none;
}

/* Topp-skinn */
.svc-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 14%; right: 14%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(91, 140, 255, 0.8), transparent);
    z-index: 2;
}

.svc-panel__content {
    position: relative;
    z-index: 2;
    height: 100%;
    padding: clamp(32px, 5vh, 56px) clamp(32px, 4vw, 60px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 560px;
}

.svc-panel__icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: rgba(91, 140, 255, 0.08);
    border: 1px solid rgba(91, 140, 255, 0.25);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    transition: transform 0.5s cubic-bezier(0.16,1,0.3,1), background 0.4s ease;
}

.svc-panel:hover .svc-panel__icon {
    transform: scale(1.08) rotate(-5deg) translateZ(40px);
    background: rgba(91, 140, 255, 0.15);
}

.svc-panel__kicker {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.svc-panel__title {
    font-family: 'Manrope', sans-serif;
    font-size: clamp(32px, 4vw, 52px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.svc-panel__desc {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
    font-weight: 300;
    margin-bottom: 32px;
}

.svc-panel__list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.svc-panel__list li {
    position: relative;
    padding-left: 30px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-secondary);
    font-weight: 300;
}

.svc-panel__list li::before {
    content: '';
    position: absolute;
    left: 0; top: 2px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: rgba(91, 140, 255, 0.1);
    border: 1px solid rgba(91, 140, 255, 0.4);
}
.svc-panel__list li::after {
    content: '';
    position: absolute;
    left: 6px; top: 7px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

/* =========================================================
   CTA
   ========================================================= */
.svc-cta {
    position: relative;
    max-width: 1280px;
    margin: 80px auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 22px;
    backdrop-filter: blur(20px);
    padding: 44px 52px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 40px;
    overflow: hidden;
}

.svc-cta__rays {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 60%;
    background:
        radial-gradient(ellipse 50% 100% at 50% 100%, rgba(91,140,255,0.18), transparent 70%),
        radial-gradient(ellipse 20% 100% at 25% 100%, rgba(91,140,255,0.08), transparent 70%),
        radial-gradient(ellipse 20% 100% at 75% 100%, rgba(91,140,255,0.08), transparent 70%);
    pointer-events: none;
}

.svc-cta__content { position: relative; z-index: 1; }

.svc-cta__title {
    font-family: 'Manrope', sans-serif;
    font-size: clamp(24px, 2.6vw, 32px);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.svc-cta__text {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 300;
}

.svc-cta__btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, #5b8cff, #4170e8);
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), box-shadow 0.3s ease;
    box-shadow:
        0 0 0 1px rgba(91,140,255,0.5),
        0 10px 32px rgba(91,140,255,0.4),
        inset 0 1px 0 rgba(255,255,255,0.2);
}
.svc-cta__btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 0 0 1px rgba(91,140,255,0.6),
        0 14px 40px rgba(91,140,255,0.55),
        inset 0 1px 0 rgba(255,255,255,0.25);
}
.svc-cta__btn svg { transition: transform 0.3s ease; }
.svc-cta__btn:hover svg { transform: translateX(4px); }

/* Lave skjermer / zoom inn: krymp mellomrom så ALL tekst får plass
   uten å måtte scrolle inni panelet */
@media (min-width: 861px) and (max-height: 760px) {
    .svc-panel__icon {
        width: 56px;
        height: 56px;
        margin-bottom: 18px;
    }
    .svc-panel__title { margin-bottom: 14px; }
    .svc-panel__desc {
        margin-bottom: 22px;
        font-size: 15px;
    }
    .svc-panel__list { gap: 11px; }
    .svc-panel__kicker { margin-bottom: 10px; }
}

@media (min-width: 861px) and (max-height: 620px) {
    .svc-panel__icon {
        width: 48px;
        height: 48px;
        margin-bottom: 14px;
    }
    .svc-panel__desc {
        font-size: 14px;
        margin-bottom: 18px;
        line-height: 1.5;
    }
    .svc-panel__list { gap: 9px; }
    .svc-panel__list li { font-size: 14px; }
}

/* =========================================================
   RESPONSIV – under 860px: vanlig vertikal flyt
   ========================================================= */
@media (max-width: 860px) {
    .svc-hero {
        min-height: 90vh;
        padding: 110px 24px 60px;
    }

    .svc-rail {
        height: auto !important;
    }

    .svc-rail__sticky {
        position: relative;
        top: 0;
        height: auto;
        overflow: visible;
        display: block;
        padding: 20px 0 40px;
    }

    .svc-progress { display: none; }

    .svc-track {
        flex-direction: column;
        gap: 24px;
        padding: 0 24px;
        transform: none !important;
    }

    .svc-panel {
        flex: none;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        overflow: hidden;
        /* Mobil-animasjon: kommer inn fra siden med kraftig 3D-rotasjon */
        opacity: 0;
        transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
                    transform 0.95s cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* Annenhver kort kommer fra venstre / høyre for variasjon */
    .svc-panel:nth-child(odd) {
        transform: perspective(1000px) rotateY(22deg) translateX(-60px) scale(0.88);
    }
    .svc-panel:nth-child(even) {
        transform: perspective(1000px) rotateY(-22deg) translateX(60px) scale(0.88);
    }

    /* Når kortet kommer i view (styres av JS) */
    .svc-panel.is-in {
        opacity: 1;
        transform: perspective(1000px) rotateY(0) translateX(0) scale(1);
    }

    .svc-panel__content {
        padding: 36px 28px;
        max-width: 100%;
        height: auto;
    }

    .svc-panel__bg {
        font-size: 220px;
        bottom: -4%;
        opacity: 0.7;
        /* Parallakse settes via JS variabel - kraftigere på mobil */
        transform: translateY(var(--bg-shift, 0px)) scale(var(--bg-scale, 1));
        transition: transform 0.15s linear;
    }

    /* Ikonet spretter inn etter kortet */
    .svc-panel__icon {
        transition: transform 0.8s cubic-bezier(0.34, 1.7, 0.5, 1) 0.2s,
                    background 0.4s ease;
        transform: scale(0.4) rotate(-20deg);
    }
    .svc-panel.is-in .svc-panel__icon {
        transform: scale(1) rotate(0);
    }

    /* Tittel + beskrivelse glir opp */
    .svc-panel__kicker,
    .svc-panel__title,
    .svc-panel__desc {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16,1,0.3,1);
    }
    .svc-panel.is-in .svc-panel__kicker { opacity: 1; transform: translateY(0); transition-delay: 0.15s; }
    .svc-panel.is-in .svc-panel__title { opacity: 1; transform: translateY(0); transition-delay: 0.24s; }
    .svc-panel.is-in .svc-panel__desc { opacity: 1; transform: translateY(0); transition-delay: 0.33s; }

    /* Liste-elementene fader inn etter hverandre */
    .svc-panel__list li {
        opacity: 0;
        transform: translateX(-16px);
        transition: opacity 0.5s ease, transform 0.55s cubic-bezier(0.16,1,0.3,1);
    }
    .svc-panel.is-in .svc-panel__list li { opacity: 1; transform: translateX(0); }
    .svc-panel.is-in .svc-panel__list li:nth-child(1) { transition-delay: 0.42s; }
    .svc-panel.is-in .svc-panel__list li:nth-child(2) { transition-delay: 0.50s; }
    .svc-panel.is-in .svc-panel__list li:nth-child(3) { transition-delay: 0.58s; }
    .svc-panel.is-in .svc-panel__list li:nth-child(4) { transition-delay: 0.66s; }

    .svc-cta {
        margin: 40px 24px;
        grid-template-columns: 1fr;
        text-align: center;
        gap: 24px;
        padding: 36px 28px;
    }

    .svc-cta__btn { justify-self: center; }
}

@media (max-width: 600px) {
    .svc-hero { padding: 100px 20px 50px; }
    .svc-panel__content { padding: 30px 22px; }
    .svc-panel__icon { width: 60px; height: 60px; }
    .svc-track { padding: 0 20px; }
    .svc-cta { margin: 40px 20px; padding: 30px 22px; }
}

/* =========================================================
   TILGJENGELIGHET
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    [data-reveal] { opacity: 1; transform: none; }
    .svc-hero__eyebrow > span,
    .svc-hero__line > span,
    .svc-hero__text,
    .svc-hero__hint { transform: none !important; opacity: 1 !important; }

    .svc-rail { height: auto !important; }
    .svc-rail__sticky {
        position: relative;
        height: auto;
        overflow: visible;
        display: block;
        padding: 40px 0;
    }
    .svc-progress { display: none; }
    .svc-track {
        flex-direction: column;
        gap: 24px;
        padding: 0 48px;
        transform: none !important;
    }
    .svc-panel {
        flex: none;
        width: 100%;
        height: auto;
        max-height: none;
        transform: none !important;
    }
}