/* Atyps startside
   Ett stilark, ingen build. Fargene ligger som variabler øverst — bytt dem der
   når designskissene er på plass. */

:root {
    --bg: #f6f5f3;
    --surface: #ffffff;
    --surface-hover: #fbfaf8;
    --border: #e3e0da;
    --text: #17161a;
    --text-muted: #6b6862;
    --accent: #1f4ed8;
    --accent-soft: #eaeefc;
    --shadow: 0 1px 2px rgba(23, 22, 26, .05), 0 8px 24px rgba(23, 22, 26, .05);
    --radius: 14px;
    --wrap: 1180px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121214;
        --surface: #1b1b1f;
        --surface-hover: #232327;
        --border: #2e2e34;
        --text: #f3f2f0;
        --text-muted: #9c9a95;
        --accent: #8ea8ff;
        --accent-soft: #23283c;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: 20px;
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--surface);
    padding: 12px 18px;
    border-radius: 0 0 var(--radius) 0;
    z-index: 10;
}
.skip:focus { left: 0; }

/* --- Topbar --------------------------------------------------------------- */

.topbar {
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: saturate(1.4) blur(8px);
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 62px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: -.01em;
}

.brand__mark {
    width: 26px; height: 26px;
    border-radius: 8px;
    background: var(--text);
    display: inline-block;
    flex: none;
}
.brand__mark--lg { width: 40px; height: 40px; border-radius: 12px; margin-bottom: 18px; }

.account {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    min-width: 0;
}

.account__name {
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avatar {
    width: 30px; height: 30px;
    flex: none;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
}

.account__logout {
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 12px;
    white-space: nowrap;
}
.account__logout:hover { color: var(--text); background: var(--surface); }

/* --- Hero og søk ---------------------------------------------------------- */

.hero { padding: 56px 0 8px; }

.hero__greeting {
    margin: 0 0 24px;
    font-size: clamp(28px, 5vw, 42px);
    letter-spacing: -.025em;
    font-weight: 600;
}

.search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 6px 6px 18px;
    box-shadow: var(--shadow);
    max-width: 640px;
}
.search:focus-within { border-color: var(--accent); }

.search .icon { color: var(--text-muted); flex: none; }

.search input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    padding: 10px 0;
    outline: none;
}
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.search button {
    flex: none;
    border: 0;
    border-radius: 999px;
    background: var(--text);
    color: var(--bg);
    font: inherit;
    font-weight: 500;
    padding: 10px 20px;
    cursor: pointer;
}
.search button:hover { opacity: .88; }

/* --- Seksjonsnavigasjon --------------------------------------------------- */

.jump {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 32px 0 4px;
}

.jump a {
    text-decoration: none;
    font-size: 14px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px;
}
.jump a:hover { color: var(--text); background: var(--surface); }

/* --- Seksjoner og kort ---------------------------------------------------- */

.section { padding: 36px 0 4px; scroll-margin-top: 78px; }

.section__head { margin-bottom: 18px; }

.section__head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
}

.section__intro {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 14px;
    max-width: 62ch;
}

.cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}

.card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    height: 100%;
    text-align: left;
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    color: inherit;
    font: inherit;
    cursor: pointer;
    position: relative;
    transition: border-color .12s ease, transform .12s ease, background .12s ease;
}
.card:hover { background: var(--surface-hover); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-1px); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card__icon {
    flex: none;
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
}

.card__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.card__title { font-weight: 600; letter-spacing: -.01em; }

.card__desc { color: var(--text-muted); font-size: 14px; }

.card__command {
    margin-top: 6px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 12.5px;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 7px;
    align-self: flex-start;
}

.card__hint {
    position: absolute;
    top: 14px; right: 14px;
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity .12s ease;
}
.card--command:hover .card__hint,
.card--command:focus-visible .card__hint { opacity: 1; }

.card--unset { opacity: .55; cursor: not-allowed; }
.card--unset:hover { transform: none; border-color: var(--border); }
.card--unset .card__hint { opacity: 1; }

.icon { width: 20px; height: 20px; }

/* --- Logg inn ------------------------------------------------------------- */

.login {
    min-height: calc(100dvh - 62px);
    display: grid;
    place-items: center;
    padding: 48px 0;
}

.login__card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.login__card h1 {
    margin: 0 0 8px;
    font-size: 24px;
    letter-spacing: -.02em;
}

.login__lead { margin: 0 0 24px; color: var(--text-muted); }

.login__note { margin: 20px 0 0; font-size: 13px; color: var(--text-muted); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: inherit;
    font: inherit;
    font-weight: 500;
    padding: 13px 20px;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: var(--surface-hover); }

.btn--primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn--primary:hover { background: var(--text); opacity: .9; }

.alert {
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    text-align: left;
    margin: 0 0 20px;
}

/* --- Toast og footer ------------------------------------------------------ */

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 12px);
    background: var(--text);
    color: var(--bg);
    padding: 11px 20px;
    border-radius: 999px;
    font-size: 14px;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: opacity .18s ease, transform .18s ease;
    pointer-events: none;
    z-index: 20;
}
.toast[data-visible="true"] { opacity: 1; transform: translate(-50%, 0); }

.footer {
    padding: 56px 20px 40px;
    color: var(--text-muted);
    font-size: 13px;
}
.footer code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px;
}

@media (max-width: 560px) {
    .hero { padding-top: 34px; }
    .account__name { display: none; }
    .search { padding-left: 14px; }
    .search button { padding-inline: 16px; }
    .login__card { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
