/* ============================================================
   laget.no — Grafitt-tema, kode-editor-stil
   ============================================================ */

:root {
    --bg:        #0b0b0d;   /* sideflate            */
    --panel:     #141417;   /* faner, statuslinje   */
    --panel-2:   #0f0f12;   /* innfelte flater      */
    --border:    #26262b;   /* hairlines            */
    --muted:     #74747f;   /* dempet tekst         */
    --text:      #e5e9f0;   /* hovedtekst           */

    --orange:    #fea55f;   /* aksent / lenker      */
    --green:     #43d9ad;   /* aksent / strenger    */
    --indigo:    #4d5bce;   /* aksent / nøkkelord   */

    --tab-h:     42px;
    --status-h:  38px;
    --content-max: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Fira Code", ui-monospace, "Cascadia Code", Consolas, "SF Mono", monospace;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

::selection { background: rgba(254, 165, 95, 0.28); }

/* FocusOnNavigate flytter fokus til <h1> ved lasting/navigasjon (for
   skjermlesere). Behold fokuset, men skjul den synlige ringen på
   overskrifter — den skal ikke se ut som en markering av "laget.no". */
h1:focus, h1:focus-visible { outline: none; }

/* ---------- boot-skjerm (før Blazor er lastet) ---------- */
.app-boot {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: "Fira Code", ui-monospace, monospace;
    color: var(--muted);
    font-size: 18px;
    background: var(--bg);
}
.app-boot__prompt { color: var(--indigo); }
.app-boot__cursor {
    width: 9px; height: 20px;
    background: var(--orange);
    display: inline-block;
    animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   Vindus-skall: faner (topp) · innhold · statuslinje (bunn)
   ============================================================ */
.window {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---------- fane-linje ---------- */
.tabbar {
    display: flex;
    align-items: stretch;
    height: var(--tab-h);
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    position: sticky;
    top: 0;
    z-index: 20;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }

.tabbar__brand {
    display: flex;
    align-items: center;
    padding: 0 20px;
    color: var(--muted);
    border-right: 1px solid var(--border);
    white-space: nowrap;
    flex-shrink: 0;
}

.tab {
    display: flex;
    align-items: center;
    padding: 0 20px;
    color: var(--muted);
    border-right: 1px solid var(--border);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.15s ease, background 0.15s ease;
    cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.active {
    color: var(--text);
    border-bottom-color: var(--orange);
    background: var(--bg);
}
.tab--edge { border-left: 1px solid var(--border); }

/* språkvelger (nb / en) — skyves mot høyre i fane-linja */
.tabbar__lang {
    margin-left: auto;
    display: flex;
    align-items: stretch;
    border-left: 1px solid var(--border);
    flex-shrink: 0;
}
.lang {
    font-family: inherit;
    font-size: 12.5px;
    color: var(--muted);
    background: none;
    border: none;
    padding: 0 11px;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}
.lang:hover { color: var(--text); }
.lang--on { color: var(--orange); }

/* ---------- innholdsflate ---------- */
.content {
    position: relative;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
/* svake glød-flekker i bakgrunnen */
.content::before,
.content::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(10px);
}
.content::before {
    width: 46vw; height: 46vw;
    top: -18vw; right: 4vw;
    background: radial-gradient(circle, rgba(67, 217, 173, 0.10) 0%, rgba(67, 217, 173, 0) 68%);
}
.content::after {
    width: 42vw; height: 42vw;
    bottom: -20vw; left: 8vw;
    background: radial-gradient(circle, rgba(77, 91, 206, 0.14) 0%, rgba(77, 91, 206, 0) 68%);
}
.content__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: clamp(28px, 5vw, 64px) clamp(20px, 5vw, 56px);
    flex: 1;
}

/* ---------- statuslinje ---------- */
.statusbar {
    display: flex;
    align-items: stretch;
    height: var(--status-h);
    background: var(--panel);
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--muted);
    position: sticky;
    bottom: 0;
    z-index: 20;
    overflow-x: auto;
    scrollbar-width: none;
}
.statusbar::-webkit-scrollbar { display: none; }
.statusbar__label {
    display: flex;
    align-items: center;
    padding: 0 18px;
    border-right: 1px solid var(--border);
    white-space: nowrap;
    flex-shrink: 0;
}
.statusbar__link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 16px;
    border-right: 1px solid var(--border);
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.15s ease, background 0.15s ease;
}
.statusbar__link:hover { color: var(--text); background: var(--bg); }
.statusbar__spacer { flex: 1; min-width: 12px; }
.statusbar__end {
    display: flex;
    align-items: center;
    padding: 0 18px;
    border-left: 1px solid var(--border);
    white-space: nowrap;
    flex-shrink: 0;
}
.statusbar__end .dot { color: var(--green); margin-right: 7px; }
.statusbar__term {
    font-family: inherit;
    font-size: 12.5px;
    color: var(--muted);
    background: none;
    border: none;
    border-left: 1px solid var(--border);
    padding: 0 16px;
    cursor: pointer;
    align-self: stretch;
    transition: color 0.15s ease, background 0.15s ease;
}
.statusbar__term:hover { color: var(--orange); background: var(--bg); }

/* ============================================================
   Delte tekst-elementer
   ============================================================ */
.prompt { color: var(--indigo); }
.accent { color: var(--orange); }
.green  { color: var(--green); }
.comment { color: var(--muted); }

.eyebrow {
    color: var(--muted);
    font-size: 13px;
}

h1.hero {
    font-size: clamp(2.4rem, 6vw, 3.8rem);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.01em;
    margin: 6px 0 10px;
}
h1.hero .dot { color: var(--orange); }

.hero-sub {
    color: var(--indigo);
    font-size: clamp(1rem, 2.2vw, 1.15rem);
    margin-bottom: 8px;
}

/* generisk sideoverskrift for undersider */
.page-title {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 600;
    margin-bottom: 6px;
}
.page-title .prompt { margin-right: 10px; }
.page-lead {
    color: var(--muted);
    max-width: 62ch;
    margin-bottom: 34px;
}

/* ============================================================
   Forsiden (_hei)
   ============================================================ */
.hei {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: clamp(28px, 5vw, 60px);
    align-items: start;
}

/* kodeblokk som lister temaene */
.codeblock {
    margin-top: 30px;
    font-size: 14px;
    line-height: 1.9;
}
.codeblock .ln { display: block; white-space: pre-wrap; }
.codeblock .ln--indent { padding-left: 2ch; }
.codeblock a.tema-link {
    border-bottom: 1px dashed transparent;
    transition: border-color 0.15s ease;
}
.codeblock a.tema-link:hover { border-bottom-color: var(--orange); }
.codeblock .coming { color: var(--muted); }

.hint {
    margin-top: 26px;
    color: var(--muted);
    font-size: 13px;
}
.hint kbd {
    font-family: inherit;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 7px;
    color: var(--text);
    font-size: 12px;
}

/* ============================================================
   Tema-utforsker (_tema)
   ============================================================ */
.cat {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 34px 0 14px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.cat:first-of-type { margin-top: 8px; }
.cat__sub {
    font-size: 12.5px;
    font-weight: 400;
    color: var(--muted);
    transition: color 0.15s ease;
}
.cat__sub:hover { color: var(--orange); }

.tema-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}
.tema-grid + .cat { margin-top: 40px; }
.tema-card {
    display: block;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 22px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.tema-card:hover {
    transform: translateY(-3px);
    border-color: rgba(254, 165, 95, 0.45);
}
.tema-card__head {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12.5px;
    margin-bottom: 10px;
}
.tema-card__head .ico { color: var(--green); }
.tema-card__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.tema-card__desc { color: var(--muted); font-size: 13.5px; line-height: 1.65; }
.tema-card__go {
    margin-top: 14px;
    color: var(--orange);
    font-size: 13px;
}
.tema-card--coming {
    border-style: dashed;
    background: transparent;
    opacity: 0.7;
}
.tema-card--coming:hover { transform: none; border-color: var(--border); }

/* generisk "kort" for om/kontakt */
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: clamp(20px, 3vw, 30px);
    max-width: 70ch;
}
.panel p + p { margin-top: 14px; }
.panel a.inline { color: var(--orange); border-bottom: 1px dashed rgba(254,165,95,0.5); }
.panel a.inline:hover { border-bottom-style: solid; }

.kv { margin-top: 18px; display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd a { color: var(--orange); }
.kv dd a:hover { text-decoration: underline; }

/* ============================================================
   Blazor feil-UI
   ============================================================ */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 12px 20px;
    background: #2a1215;
    color: #ff9d92;
    border-top: 1px solid #5c2b2e;
    font-size: 13px;
}
#blazor-error-ui .reload { color: var(--orange); text-decoration: underline; margin: 0 8px; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* ============================================================
   Mobil-fallback (desktop først)
   ============================================================ */
@media (max-width: 900px) {
    .hei { grid-template-columns: 1fr; }
    .tabbar__brand { display: none; }
}
