/* ==========================================================================
   Mikkel Manniche — stylesheet
   Selvhostede fonte, ingen eksterne kald, ingen JavaScript.
   ========================================================================== */

/* --- Fonte (latin-subset, selvhostet: ingen Google-kald, GDPR-sikkert) --- */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 600;          /* variabel font: ét filkald dækker alle vægte */
    font-display: swap;
    src: url('fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122;
}

@font-face {
    font-family: 'Lora';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('fonts/lora-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122;
}

/* --- Designtokens --- */
:root {
    --bg: #0f0f0f;
    --surface: rgba(24, 24, 26, 0.72);
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.14);

    --text: #f4f4f4;
    --text-muted: #a8a8a8;
    --text-faint: #6f6f6f;

    /* Accent: klar blå. Baggrundsskæret er derimod neutralt grafit, så
       farven kun optræder ét sted ad gangen og bliver et kendetegn
       frem for et farvebad. */
    --accent-deep: #2f6fe0;
    --accent: #4d8dff;
    --accent-soft: rgba(77, 141, 255, 0.30);

    --radius: 18px;
    --radius-pill: 999px;
    --measure: 620px;

    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, figure, form { margin: 0; }
img, svg { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }

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

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-weight: 400;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Baggrund ---------------------------------------------------------------
   Tidligere: fire absolut placerede divs med filter: blur(40px). Det tvinger
   browseren til fire store blur-passes ved hver eneste repaint og scroll.
   Nu: ét fixed lag med radiale gradienter — samme neon-glød, men det koster
   reelt ingenting, og der er ingen ekstra DOM-noder på siderne.
   -------------------------------------------------------------------------- */
body::before {
    content: '';
    position: fixed;
    inset: -10vmax;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(38vmax 32vmax at 8% -4%,   rgba(150, 155, 170, 0.16), transparent 62%),
        radial-gradient(42vmax 38vmax at 104% 22%, rgba(120, 128, 146, 0.15), transparent 62%),
        radial-gradient(34vmax 34vmax at -6% 82%,  rgba(110, 118, 136, 0.13), transparent 62%),
        /* Ét diskret blåt skær, så accentfarven også findes i baggrunden */
        radial-gradient(44vmax 40vmax at 96% 108%, rgba(77, 141, 255, 0.17), transparent 62%);
}

/* Fin kornstruktur, så de store farveflader ikke banding'er på store skærme */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Tilgængelighed --- */
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* --- Navigation --- */
.site-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 32px 20px 8px;
}

.site-nav a {
    position: relative;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 1.05rem;
    padding: 6px 14px 8px;
    border-radius: var(--radius-pill);
    transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.site-nav a:hover { color: var(--text); background-color: rgba(255, 255, 255, 0.05); }

.site-nav a[aria-current='page'] { color: var(--text); }

.site-nav a[aria-current='page']::after {
    content: '';
    position: absolute;
    left: 14px; right: 14px; bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-soft);
}

.site-nav .divider { color: rgba(255, 255, 255, 0.12); user-select: none; }

/* --- Sprogskifter --- */
.lang {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 4px 20px 0;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.lang a {
    color: var(--text-faint);
    text-decoration: none;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.lang a:hover { color: var(--text-muted); background-color: rgba(255, 255, 255, 0.05); }

.lang [aria-current='true'] {
    color: var(--text);
    background-color: rgba(255, 255, 255, 0.07);
}

.lang .sep { color: rgba(255, 255, 255, 0.12); }

/* --- Layout --- */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4px;
    width: 100%;
    max-width: var(--measure);
    margin-inline: auto;
    padding: 40px 20px 72px;
}

/* --- Typografi --- */
h1, h2, h3 {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    font-weight: 400;
    line-height: 1.15;
    color: var(--text);
    text-wrap: balance;
}

h1 {
    font-size: clamp(2.75rem, 11vw, 4.5rem);
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

h2 {
    font-size: clamp(2rem, 7vw, 3rem);
    letter-spacing: -0.01em;
    margin-bottom: 16px;
}

.subtitle {
    font-size: clamp(1.05rem, 3.4vw, 1.25rem);
    color: var(--text-muted);
    font-weight: 300;
    max-width: 30ch;
    line-height: 1.65;
    text-wrap: balance;
}

/* --- Håndtegnet bølgestreg --- */
.wave {
    width: 220px;
    height: 20px;
    margin: 24px 0 32px;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
    fill: none;
    filter: drop-shadow(0 0 4px var(--accent-soft));
}

/* --- Kort / tekstflader --- */
.card {
    width: 100%;
    text-align: left;
    color: var(--text-muted);
    line-height: 1.75;
    font-size: 1.05rem;
    background: var(--surface);
    padding: clamp(22px, 5vw, 32px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.35);
}

.card > p + p { margin-top: 14px; }

.card a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-soft);
    transition: border-color 0.25s var(--ease);
}

.card a:hover { border-bottom-color: var(--accent); }

.card-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
    width: 100%;
}

/* --- Projektkort --- */
.project {
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
                box-shadow 0.3s var(--ease);
}

.project:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.45);
}

.project h3 {
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.project .tags {
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    margin-bottom: 14px;
}

/* --- Profilbillede --- */
.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 24px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

/* --- Knapper / sociale links --- */
.links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: rgba(30, 30, 32, 0.85);
    color: var(--text);
    text-decoration: none;
    padding: 12px 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.98rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s var(--ease), background-color 0.2s var(--ease),
                border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn:hover {
    transform: translateY(-2px);
    background-color: rgba(42, 42, 45, 0.9);
    border-color: var(--border-strong);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

.btn:active { transform: translateY(0); }

.btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    color: var(--accent-deep);
    flex: none;
}

.btn-primary {
    background: linear-gradient(45deg, var(--accent-deep), var(--accent));
    border-color: transparent;
    color: #fff;
    padding: 14px 24px;
    width: 100%;
}

.btn-primary:hover {
    /* Lysere udgave af accentfarven — bruger variablerne, så et farveskift
       kun skal laves ét sted. Tidligere stod disse to som hex-koder og blev
       derfor hængende i den gamle farve ved hover. */
    background: linear-gradient(45deg, var(--accent), #7aa9ff);
    box-shadow: 0 8px 24px var(--accent-soft);
}

/* --- Formular --- */
.form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 4px;
}

.form input,
.form textarea {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease);
}

.form textarea { resize: vertical; min-height: 130px; }

.form input::placeholder,
.form textarea::placeholder { color: var(--text-faint); }

.form input:focus,
.form textarea:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.07);
    outline: none;
}

.form input:user-invalid,
.form textarea:user-invalid { border-color: rgba(255, 90, 90, 0.65); }

/* Honeypot: usynlig for mennesker, udfyldes af spam-bots */
.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* --- Kvitteringer --- */
.notice {
    width: 100%;
    text-align: left;
    padding: 16px 18px;
    border-radius: 12px;
    font-size: 0.98rem;
    line-height: 1.6;
    margin-bottom: 18px;
    border: 1px solid;
}

.notice-ok {
    background: rgba(32, 200, 120, 0.09);
    border-color: rgba(32, 200, 120, 0.35);
    color: #b6f0d2;
}

.notice-error {
    background: rgba(255, 70, 70, 0.09);
    border-color: rgba(255, 70, 70, 0.35);
    color: #ffc9c9;
}

/* --- Kompetencegrupper --- */
.skill-group h3 {
    font-size: 1.25rem;
    margin-bottom: 4px;
    color: var(--text);
}

.skill-group .lead {
    color: var(--text-faint);
    font-size: 0.86rem;
    margin-bottom: 16px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tag-list li {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --- Løbende tekst (persondatapolitik o.l.) --- */
.prose { text-align: left; }

.prose h3 {
    font-size: 1.2rem;
    margin: 26px 0 8px;
    color: var(--text);
}

.prose h3:first-child { margin-top: 0; }

.prose ul { margin: 8px 0 0; padding-left: 20px; }
.prose li { margin-bottom: 6px; }

.prose .updated {
    display: block;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    color: var(--text-faint);
    font-size: 0.85rem;
}

/* --- Sociale profiler (ikonrække i footeren) --- */
.socials {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
}

.socials a {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: rgba(30, 30, 32, 0.8);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: transform 0.2s var(--ease), color 0.2s var(--ease),
                border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.socials a:hover {
    transform: translateY(-2px);
    color: var(--text);
    background-color: rgba(44, 44, 48, 0.9);
    border-color: var(--accent);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.socials svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

/* --- Footer --- */
.site-footer {
    text-align: center;
    padding: 0 20px 32px;
    color: var(--text-faint);
    font-size: 0.85rem;
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.site-footer a:hover { color: var(--text); border-bottom-color: var(--accent); }

.site-footer .fine {
    margin-top: 12px;
    font-size: 0.8rem;
}

.site-footer .fine a { border-bottom-color: rgba(255, 255, 255, 0.08); }

/* --- Mobil --- */
@media (max-width: 560px) {
    .site-nav { gap: 2px; padding-top: 22px; }
    .site-nav a { font-size: 0.98rem; padding: 6px 10px 8px; }
    .site-nav a[aria-current='page']::after { left: 10px; right: 10px; }
    .site-nav .divider { display: none; }
    .links { flex-direction: column; width: 100%; max-width: 280px; margin-inline: auto; }
    .wave { width: 180px; margin: 18px 0 26px; }
}

/* --- Respekter systemets bevægelsesindstilling --- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .project:hover, .btn:hover { transform: none; }
}
