/* ==========================================================================
   ARVENTO — SERVICE DETAIL PAGES
   (Økonomifunktion · Rapportering & Dashboards · Økonomisk Sparring)
   Award-grade elevation: layered depth, restrained motion, editorial type.
   Shares design tokens with style.css — no token redefinition here.
   ========================================================================== */

/* ── BASE CANVAS ────────────────────────────────────── */
.services-page-main {
    background-color: var(--color-cream);
    position: relative;
    isolation: isolate;
}

/* ── HERO ───────────────────────────────────────────── */
.services-hero {
    padding: 200px 0 128px;
    background-color: #0D1B2A;
    background-image:
        radial-gradient(60% 50% at 18% 0%, rgba(201, 168, 76, 0.10), transparent 60%),
        radial-gradient(80% 60% at 100% 10%, rgba(44, 94, 78, 0.35), transparent 55%),
        linear-gradient(170deg, #0D1B2A 0%, #16301F 55%, #1E4535 78%, var(--color-cream) 100%);
    position: relative;
    overflow: hidden;
}

/* fine grid texture */
.services-hero::before {
    content: '';
    position: absolute; inset: 0; z-index: 1;
    background-image:
        linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(70% 70% at 50% 20%, #000 30%, transparent 85%);
    mask-image: radial-gradient(70% 70% at 50% 20%, #000 30%, transparent 85%);
    pointer-events: none;
}

/* soft dot grain, matches original texture but refined */
.services-hero::after {
    content: '';
    position: absolute; inset: 0; z-index: 1;
    background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

/* floating ambient accents */
.services-hero-content { position: relative; z-index: 3; text-align: center; max-width: 720px; margin: 0 auto; }

.services-hero .container { position: relative; }

.services-hero .container::before,
.services-hero .container::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.55;
}
.services-hero .container::before {
    width: 260px; height: 260px;
    top: -60px; left: 2%;
    background: radial-gradient(circle, rgba(201,168,76,0.35), transparent 70%);
    animation: floatOrbA 14s ease-in-out infinite;
}
.services-hero .container::after {
    width: 320px; height: 320px;
    bottom: -120px; right: 4%;
    background: radial-gradient(circle, rgba(44,94,78,0.45), transparent 70%);
    animation: floatOrbB 18s ease-in-out infinite;
}

@keyframes floatOrbA {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(18px, 22px) scale(1.08); }
}
@keyframes floatOrbB {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-22px, -16px) scale(1.06); }
}

/* ── BADGE ──────────────────────────────────────────── */
.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-gold);
    padding: 9px 18px;
    border-radius: 50px;
    border: 1px solid rgba(201,168,76,0.35);
    background: rgba(201,168,76,0.08);
    backdrop-filter: blur(6px);
    margin-bottom: 28px;
    opacity: 0;
    animation: heroRise 0.8s var(--ease) forwards;
    animation-delay: 0.02s;
}
.premium-badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--color-gold);
    box-shadow: 0 0 10px rgba(201,168,76,0.8);
    flex-shrink: 0;
}

.display-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4.75rem);
    color: var(--color-white);
    line-height: 1.04;
    margin-bottom: 26px;
    letter-spacing: -0.03em;
    text-wrap: balance;
    opacity: 0;
    animation: heroRise 0.8s var(--ease) forwards;
    animation-delay: 0.12s;
}

.hero-lead {
    font-size: clamp(1.1rem, 1.6vw, 1.3rem);
    color: rgba(255,255,255,0.78);
    line-height: 1.75;
    max-width: 580px;
    margin: 0 auto;
    text-wrap: pretty;
    opacity: 0;
    animation: heroRise 0.8s var(--ease) forwards;
    animation-delay: 0.22s;
}

@keyframes heroRise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── STICKY SCROLL LAYOUT ───────────────────────────── */
.services-sticky-container {
    padding: 96px 0 40px;
    position: relative;
}

.service-scroll-group {
    display: flex;
    flex-direction: column;
    gap: 48px;
    margin-bottom: 0;
    padding-top: 64px;
    position: relative;
}

.service-scroll-group::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 64px; height: 1px;
    background: linear-gradient(90deg, var(--color-gold), transparent);
}

@media (min-width: 960px) {
    .service-scroll-group {
        flex-direction: row;
        align-items: flex-start;
        gap: 88px;
    }
}

/* ── STICKY SIDEBAR ─────────────────────────────────── */
.service-sticky-sidebar {
    flex: 0 0 36%;
    position: -webkit-sticky;
    position: sticky;
    top: 132px;
}

.sidebar-title {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 2.6vw, 2.5rem);
    color: var(--color-primary);
    margin-bottom: 22px;
    letter-spacing: -0.02em;
    line-height: 1.15;
    text-wrap: balance;
}

.sidebar-text {
    font-size: 1.08rem;
    color: var(--color-ink-mid);
    line-height: 1.75;
    max-width: 42ch;
}

/* ── SERVICE CARD ───────────────────────────────────── */
.service-scroll-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-width: 0;
}

.service-3d-card {
    --spot-x: 50%;
    --spot-y: 0%;
    position: relative;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: 28px;
    padding: 48px;
    box-shadow:
        0 0 0 1px rgba(13,27,42,0.05),
        0 8px 24px -8px rgba(10,25,47,0.08),
        0 32px 64px -20px rgba(10,25,47,0.10);
    transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
    transform: translateY(0) scale(1);
    will-change: transform;
    overflow: hidden;
    opacity: 0;
    translate: 0 24px;
}

.service-scroll-content.is-inview .service-3d-card {
    opacity: 1;
    translate: 0 0;
    transition: opacity 0.7s var(--ease), translate 0.7s var(--ease);
}

/* hairline gradient border */
.service-3d-card::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(155deg, rgba(255,255,255,0.85), rgba(201,168,76,0.25) 45%, rgba(30,69,53,0.12) 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* cursor spotlight — position set via inline custom properties from footer.php script;
   purely decorative, degrades to static gradient without JS */
.service-3d-card::after {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    background: radial-gradient(480px circle at var(--spot-x) var(--spot-y), rgba(44,94,78,0.09), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s var(--ease);
    pointer-events: none;
}
.service-3d-card:hover::after { opacity: 1; }

.service-3d-card:hover {
    transform: translateY(-8px);
    box-shadow:
        0 0 0 1px rgba(44,94,78,0.10),
        0 20px 40px -12px rgba(10,25,47,0.12),
        0 48px 96px -24px rgba(10,25,47,0.16);
}

.service-3d-card > * { position: relative; z-index: 1; }

.service-3d-card h3 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--color-primary);
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

.service-3d-card p {
    color: var(--color-ink-mid);
    font-size: 1.06rem;
    line-height: 1.7;
    margin-bottom: 28px;
    max-width: 58ch;
}

/* ── FEATURE LIST ───────────────────────────────────── */
.service-features {
    list-style: none; padding: 0; margin: 0;
}
.service-features li {
    display: flex; align-items: center; gap: 14px;
    font-size: 0.98rem; font-weight: 500;
    color: var(--color-primary);
    padding: 14px 4px;
    border-top: 1px solid rgba(13,27,42,0.06);
    transition: padding-left 0.35s var(--ease), color 0.35s var(--ease);
}
.service-features li:last-child { border-bottom: none; }

.service-features li:hover {
    padding-left: 8px;
    color: var(--color-secondary);
}

.dot {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--color-forest-pale);
    flex-shrink: 0;
    position: relative;
    transition: background 0.35s var(--ease), transform 0.35s var(--ease);
}
.dot::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--color-secondary);
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 0 rgba(44,94,78,0.35);
    transition: box-shadow 0.35s var(--ease);
}
.service-features li:hover .dot {
    transform: scale(1.12);
}
.service-features li:hover .dot::before {
    box-shadow: 0 0 0 6px rgba(44,94,78,0.14);
}

/* ── CTA SECTION ────────────────────────────────────── */
.services-cta {
    padding: 128px 0 140px;
    background: var(--color-white);
    border-top: 1px solid rgba(13,27,42,0.05);
    position: relative;
    overflow: hidden;
}
.services-cta::before {
    content: '';
    position: absolute;
    top: -30%; left: 50%;
    width: 900px; height: 500px;
    transform: translateX(-50%);
    background: radial-gradient(closest-side, rgba(44,94,78,0.08), transparent 75%);
    pointer-events: none;
}

.services-cta .container { position: relative; z-index: 1; }

.cta-title {
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 4.2vw, 3.4rem);
    color: var(--color-primary);
    margin-bottom: 20px;
    letter-spacing: -0.03em;
    line-height: 1.12;
    text-wrap: balance;
}
.cta-text {
    font-size: 1.15rem;
    color: var(--color-ink-mid);
    margin-bottom: 44px;
    line-height: 1.7;
}

/* Elevate the shared .btn-submit specifically when used as the CTA anchor here */
.services-cta .btn-submit {
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
}
.services-cta .btn-submit::before {
    content: '';
    position: absolute;
    top: 0; left: -60%;
    width: 40%; height: 100%;
    background: linear-gradient(115deg, transparent, rgba(255,255,255,0.25), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s var(--ease);
}
.services-cta .btn-submit:hover::before {
    left: 130%;
}
.services-cta .btn-submit::after {
    content: '→';
    display: inline-block;
    margin-left: 6px;
    transition: transform 0.35s var(--ease);
}
.services-cta .btn-submit:hover::after {
    transform: translateX(5px);
}

/* ── SCROLL REVEAL — GENERIC HOOKS ──────────────────── */
.services-cta.is-inview .cta-title,
.services-cta.is-inview .cta-text,
.services-cta.is-inview .btn-submit {
    animation: fadeUpDetail 0.7s var(--ease) forwards;
}
.services-cta .cta-title, .services-cta .cta-text, .services-cta .btn-submit { opacity: 0; }
.services-cta.is-inview .cta-text { animation-delay: 0.1s; }
.services-cta.is-inview .btn-submit { animation-delay: 0.2s; }

@keyframes fadeUpDetail {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Legacy hook kept for compatibility with inline .animate-fade-up usage */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-up {
    animation: fadeUp 0.8s var(--ease) forwards;
}

/* ── FOCUS & ACCESSIBILITY ──────────────────────────── */
.services-page-main a:focus-visible,
.services-page-main button:focus-visible {
    outline: 3px solid var(--color-forest);
    outline-offset: 4px;
    border-radius: 8px;
}

/* ── REDUCED MOTION ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .services-hero .container::before,
    .services-hero .container::after,
    .premium-badge, .display-title, .hero-lead,
    .service-3d-card, .cta-title, .cta-text, .btn-submit {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
        translate: 0 !important;
    }
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 1280px) {
    .service-sticky-sidebar { flex-basis: 40%; }
}

@media (max-width: 960px) {
    .services-hero { padding: 168px 0 80px; }
    .service-sticky-sidebar { position: static; flex-basis: auto; }
    .services-sticky-container { padding: 72px 0 24px; }
}

@media (max-width: 768px) {
    .services-hero { padding: 152px 0 64px; }
    .services-hero .container::before { width: 180px; height: 180px; }
    .services-hero .container::after { width: 220px; height: 220px; }
    .service-3d-card { padding: 30px 26px; border-radius: 22px; }
    .service-scroll-group { gap: 36px; padding-top: 48px; }
    .services-cta { padding: 88px 0 96px; }
    .sidebar-text { max-width: none; }
}

@media (max-width: 430px) {
    .services-hero { padding: 140px 0 56px; }
    .display-title { letter-spacing: -0.02em; }
    .premium-badge { font-size: 0.68rem; padding: 8px 14px; }
    .service-3d-card { padding: 26px 20px; }
    .service-3d-card h3 { font-size: 1.4rem; }
    .cta-title { font-size: clamp(1.75rem, 8vw, 2.4rem); }
}

@media (max-width: 375px) {
    .services-hero { padding: 132px 0 48px; }
    .services-page-main .container { padding: 0 16px; }
}

@media (min-width: 1440px) {
    .services-hero-content { max-width: 780px; }
    .service-3d-card { padding: 56px; }
}
