/* Webbfabriken Cloud — header-critical.css
   Speglar .com:s v4-designsystem för visuell kontinuitet, men med .cloud:s egna accenter. */

:root {
    color-scheme: light;

    /* Surfaces */
    --bg:           #f4f4f5;
    --bg-soft:      #eceef1;
    --surface:      #ffffff;
    --surface-muted:#f6f7f8;

    /* Text */
    --text:         #111111;
    --text-soft:    #303845;
    --text-muted:   #4f5968;

    /* Lines */
    --line:         rgba(18, 32, 52, 0.14);
    --line-strong:  rgba(18, 32, 52, 0.24);

    /* Accents — speglar .com (blå + guld) plus .cloud-distinkt sky */
    --accent:           #275e9c;
    --accent-light:     #2f77c8;
    --accent-dark:      #0d3c71;
    --accent-gold:      #e3c439;
    --accent-gold-dark: #b08f1f;
    --accent-sky:       #4ea7d9; /* .cloud distinkt — ljusare sky-blå för subtila accenter */

    /* Effects */
    --shadow-xs: 0 4px 10px rgba(8, 24, 44, 0.08);
    --shadow-sm: 0 8px 20px rgba(8, 24, 44, 0.08);
    --shadow-md: 0 16px 34px rgba(8, 24, 44, 0.12);
    --shadow-lg: 0 28px 60px rgba(8, 24, 44, 0.16);

    /* Geometry */
    --radius-sm:   10px;
    --radius-md:   14px;
    --radius-lg:   18px;
    --radius-pill: 999px;
    --container:   min(1240px, calc(100% - 2rem));
    --header-h:    82px;
    --ease:        180ms cubic-bezier(.2,.65,.3,1);

    /* Fonts */
    --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Trebuchet MS', sans-serif;
    --font-display: 'Inter', 'Segoe UI', sans-serif;
    --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg:           #121417;
    --bg-soft:      #1a1d22;
    --surface:      #1d2128;
    --surface-muted:#242a33;
    --text:         #edf2f8;
    --text-soft:    #d5deea;
    --text-muted:   #b6c2d0;
    --line:         rgba(198, 210, 223, 0.20);
    --line-strong:  rgba(198, 210, 223, 0.34);
    --accent:       #4d9fff;
    --accent-light: #6bb3ff;
    --accent-dark:  #3385e6;
    --accent-sky:   #7cc1ea;
    --shadow-xs: 0 6px 14px rgba(2, 6, 12, 0.30);
    --shadow-sm: 0 10px 24px rgba(2, 6, 12, 0.34);
    --shadow-md: 0 20px 36px rgba(2, 6, 12, 0.44);
    --shadow-lg: 0 32px 64px rgba(2, 6, 12, 0.56);
}

@media (max-width: 720px) { :root { --header-h: 74px; } }

/* ─── Reset ─── */
*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; tab-size: 4; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

html { font-family: var(--font-sans); }
body {
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    padding-top: var(--header-h); /* offset för fixed header */
}

.container {
    width: var(--container);
    margin-inline: auto;
}

.skip-link {
    position: absolute; top: -40px; left: 8px;
    background: var(--accent); color: #fff;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    z-index: 1000; font-weight: 600;
}
.skip-link:focus { top: 8px; }
.visually-hidden { position: absolute !important; clip: rect(0 0 0 0); width: 1px; height: 1px; overflow: hidden; }

/* ─── Topbar (.cloud distinkt — tunn blå/guld gradient högst upp) ─── */
.topbar {
    height: 3px;
    background: linear-gradient(90deg, var(--accent-dark), var(--accent), var(--accent-gold));
    position: fixed; top: 0; left: 0; right: 0; z-index: 1001;
}

/* ─── Site header ─── */
.site-header {
    position: fixed; top: 3px; left: 0; right: 0; z-index: 1000;
    height: var(--header-h);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    transition: box-shadow var(--ease), background var(--ease);
}
.site-header.is-scrolled {
    box-shadow: var(--shadow-sm);
    background: color-mix(in srgb, var(--surface) 96%, transparent);
}

.site-header__inner {
    height: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: clamp(.75rem, 2vw, 2rem);
}

.brand {
    display: inline-flex; align-items: center; gap: .7rem;
    font-weight: 700;
    color: var(--text);
}
.brand__mark { flex: 0 0 auto; }
.brand__text { display: inline-flex; flex-direction: column; line-height: 1.05; }
.brand__text strong { font-size: 1.05rem; letter-spacing: -.005em; }
.brand__text span {
    font-size: .68rem; color: var(--text-muted);
    letter-spacing: .22em; text-transform: uppercase; font-weight: 600;
}

.site-nav { justify-self: center; }
.site-nav__list { display: flex; gap: clamp(.25rem, 1.5vw, 1.5rem); align-items: center; }
.site-nav__list a {
    position: relative;
    display: inline-block;
    padding: .65rem 1rem;
    font-size: .94rem; font-weight: 500;
    color: var(--text-soft);
    border-radius: var(--radius-sm);
    transition: color var(--ease), background var(--ease);
}
.site-nav__list a:hover { color: var(--accent); background: var(--surface-muted); }
.site-nav__list a[aria-current="page"] {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.site-header__actions { display: inline-flex; align-items: center; gap: .4rem; }
.site-header__cta {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .65rem 1.15rem;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-pill);
    font-size: .9rem; font-weight: 600;
    transition: background var(--ease), transform var(--ease), box-shadow var(--ease);
}
.site-header__cta:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
@media (max-width: 720px) { .site-header__cta { display: none; } }

.lang-switch, .theme-toggle, .menu-toggle {
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-pill);
    color: var(--text-soft);
    transition: background var(--ease), color var(--ease);
    font-size: .8rem; font-weight: 700;
    letter-spacing: .04em;
}
.lang-switch:hover, .theme-toggle:hover, .menu-toggle:hover {
    background: var(--surface-muted); color: var(--text);
}

[data-theme="dark"]  .theme-toggle__icon--sun  { display: block; }
[data-theme="dark"]  .theme-toggle__icon--moon { display: none; }
[data-theme="light"] .theme-toggle__icon--sun  { display: none; }
[data-theme="light"] .theme-toggle__icon--moon { display: block; }
:root .theme-toggle__icon--moon { display: block; }
:root .theme-toggle__icon--sun  { display: none; }

.menu-toggle { display: none; flex-direction: column; gap: 4px; }
.menu-toggle span { width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform var(--ease), opacity var(--ease); }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-nav {
    position: fixed; inset: calc(var(--header-h) + 3px) 0 0 0;
    background: var(--surface);
    padding: 1.5rem;
    overflow-y: auto;
    z-index: 999;
    border-top: 1px solid var(--line);
}
.mobile-nav ul { display: flex; flex-direction: column; gap: .25rem; }
.mobile-nav a {
    display: block; padding: 1rem 1.25rem;
    font-size: 1.1rem; font-weight: 500;
    border-bottom: 1px solid var(--line);
    color: var(--text);
}

@media (max-width: 1020px) {
    .site-nav { display: none; }
    .menu-toggle { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
    *,*::before,*::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    html { scroll-behavior: auto !important; }
}
