@font-face {
  font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("fonts/schibsted-grotesk.woff2") format("woff2");
}
:root {
  --bg: #eeece7;
  --card: #f7f6f2;
  --fg: #0e0f11;
  --muted: #5e6068;
  --line: #d6d3cb;
  --accent: #2b55f0;
  --accent-fg: #ffffff;
  --ink: #0e0f11;
  --ink-fg: #eeece7;
  --band: rgba(14, 15, 17, .035);
  --trace: #e0ddd5;
  --pad: clamp(16px, 4vw, 64px);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --radius: 14px;
  --banner: 22svh;
}
:root[data-theme="dark"] {
  --bg: #0e0f11;
  --card: #16171a;
  --fg: #eeece7;
  --muted: #a6a7ad;
  --line: #26272b;
  --accent: #6b8bff;
  --accent-fg: #0e0f11;
  --ink: #e7e5df;
  --ink-fg: #0e0f11;
  --band: rgba(238, 236, 231, .025);
  --trace: #1c1e23;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* Al tekst og afstand vokser med skærmen, så siden fylder store skærme og stadig passer på små */
html { overflow-x: clip; font-size: clamp(15px, min(1.15vw, 2svh), 22px); }
body {
  background: var(--bg); color: var(--fg);
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  font-size: 1rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .5s, color .5s;
}
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
img { display: block; max-width: 100%; }
ol, ul { list-style: none; }
::selection { background: var(--accent); color: var(--accent-fg); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 1rem; top: 1rem; z-index: 300; padding: .6rem 1rem; border-radius: 99px; background: var(--fg); color: var(--bg); transform: translateY(-200%); }
.skip:focus { transform: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.term:focus-within { box-shadow: 0 0 0 2px var(--accent), 0 20px 40px -24px rgba(0, 0, 0, .6); }
.arrow { width: 1em; height: 1em; flex: none; }

/* Printkort i baggrunden */
#circuit {
  position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 65% 60% at 50% 55%, rgba(0, 0, 0, .15), #000 85%);
  mask-image: radial-gradient(ellipse 65% 60% at 50% 55%, rgba(0, 0, 0, .15), #000 85%);
}

/* Fast header: tegningen (images/banner.svg, med sin egen animation) og menuen under den */
.top { position: sticky; top: 0; z-index: 50; }

/* Menu */
.nav {
  display: flex; justify-content: space-between; align-items: center; padding: .7rem var(--pad);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); border-block: 1px solid var(--line); transition: background .5s;
}
.logo { display: flex; align-items: center; gap: .65rem; font-weight: 700; letter-spacing: -.01em; }
.logo img { width: 1.75rem; height: 1.75rem; border-radius: 7px; }
.nav-links, .nav-sections { display: flex; gap: clamp(1rem, 2.4vw, 2.2rem); align-items: center; font-size: .95rem; }
.nav-sections { margin: 0 clamp(1rem, 2.4vw, 2.2rem) 0 auto; }
.nav-sections a { position: relative; padding-block: .4rem; color: var(--muted); transition: color .2s; }
.nav-sections a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transition: transform .3s var(--ease); }
.nav-sections a:hover, .nav-sections a[aria-current] { color: var(--fg); }
.nav-sections a[aria-current]::after { transform: none; }
.nav-cta { padding: .55rem 1.15rem; border-radius: 8px; background: var(--fg); color: var(--bg); font-weight: 600; transition: background .2s, color .2s; }
.nav-cta:hover { background: var(--accent); color: var(--accent-fg); }
.theme { width: 2.25rem; height: 2.25rem; border-radius: 8px; border: 1px solid var(--line); display: grid; place-items: center; transition: border-color .2s; }
.theme span { width: .875rem; height: .875rem; border-radius: 50%; border: 1.5px solid var(--fg); background: linear-gradient(90deg, var(--fg) 50%, transparent 50%); }
.theme:hover { border-color: var(--fg); }

.wrap { width: calc(100% - 2 * var(--pad)); margin-inline: auto; }
.tl-year, .service-num, .contact-link small, .number span, footer { font-size: .9rem; }

/* Menuen viser ét afsnit ad gangen, og det fylder skærmen under headeren, så der ikke skal scrolles.
   Et link til et afsnit lander altid øverst på siden lige under headeren. */
body:has(.panel) { min-height: 100svh; display: flex; flex-direction: column; }
body:has(.panel) main { flex: 1; display: flex; flex-direction: column; }
.panel { flex: 1; display: flex; flex-direction: column; justify-content: center; scroll-margin-top: 100vh; animation: show .4s var(--ease); }
/* Kun fade: en bevægelse ville gøre siden højere et øjeblik, så scrollbaren blinker */
@keyframes show { from { opacity: 0; } }

/* Forside */
.hero { padding: clamp(1.2rem, 3svh, 2.5rem) 0; }
.hero-grid { display: grid; grid-template-columns: 1fr auto; gap: clamp(2.5rem, 7vw, 7rem); align-items: center; }
.hello { color: var(--muted); }
.name { font-size: clamp(2.4rem, min(5.5vw, 8svh), 5rem); font-weight: 700; line-height: 1; letter-spacing: -.045em; margin: .3rem 0 clamp(.7rem, 2svh, 1.2rem); }
.intro { font-size: clamp(1.15rem, min(1.8vw, 3svh), 1.5rem); line-height: 1.3; letter-spacing: -.02em; font-weight: 500; max-width: 30ch; }
.sub { color: var(--muted); max-width: 56ch; margin-top: .7rem; }
.buttons { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: clamp(1rem, 3svh, 1.6rem); }
.aside { margin-top: 1.1rem; font-size: .95rem; color: var(--muted); font-style: italic; }

.hero-figure { justify-self: end; }
/* Portrættet tager højden efter skærmen, og bredden følger med */
.hero-photo { height: clamp(200px, calc(100svh - var(--banner) - 15rem), 40rem); aspect-ratio: 4 / 5; border-radius: var(--radius); border: 1px solid var(--line); }
.hero-photo img { object-position: center 25%; }
.hero-figure figcaption { display: grid; margin-top: .9rem; font-size: .9rem; color: var(--muted); line-height: 1.4; }
.hero-figure figcaption b { color: var(--fg); font-weight: 600; }

/* Terminal på forsiden */
.term {
  margin-top: clamp(1rem, 3svh, 1.6rem); max-width: 30rem; padding: .7rem 1rem .8rem; border-radius: 10px; background: #0e0f11; color: #d7d9de; cursor: text;
  font: .82rem/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
[data-theme="dark"] .term { background: #1a1b1f; border: 1px solid var(--line); }
.term-bar { display: flex; align-items: center; gap: 6px; margin-bottom: .4rem; }
.term-bar i { width: 9px; height: 9px; border-radius: 50%; background: #3a3c42; }
.term-bar i:first-child { background: #ff5f57; }
.term-bar small { margin-left: .5rem; color: #8a8d95; font-size: .9em; }
.term-log { height: 4.65em; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; }
.term-log::-webkit-scrollbar { display: none; }
.term-log p:first-child { margin-top: auto; }
.term-log .out { color: #4ade80; }
.term-log .hint { color: #6b8bff; }
.term-line { display: flex; gap: .6ch; }
.term b { color: #6b8bff; font-weight: 600; }
.term-input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: #d7d9de; font: inherit; caret-color: #4ade80; padding: 0; }

.btn { display: inline-flex; align-items: center; gap: .6rem; padding: .75rem 1.3rem; border-radius: 8px; font-weight: 600; transition: background .2s, color .2s, border-color .2s; }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translate(2px, -2px); }
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: var(--accent-fg); }
.btn-ghost { border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--fg); }

/* Sektioner */
#arbejde, #erfaring { background: var(--band); }
.section { padding: clamp(1.2rem, 3.5svh, 2.5rem) 0; }
.head { max-width: 45rem; }
.label { color: var(--accent); font-weight: 600; font-size: .9rem; letter-spacing: .02em; margin-bottom: .4rem; }
h2 { font-size: clamp(1.7rem, min(3.2vw, 5.5svh), 2.7rem); font-weight: 700; line-height: 1.08; letter-spacing: -.035em; }
.lead { color: var(--muted); font-size: clamp(1rem, 1.2vw, 1.15rem); max-width: 60ch; margin-top: .6rem; }

/* Om mig */
.about-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
.statement { margin-top: clamp(.8rem, 2.5svh, 1.4rem); max-width: 62ch; }
.statement p { color: var(--muted); margin-top: .8rem; }
.statement p:first-child { font-size: clamp(1.08rem, min(1.4vw, 2.6svh), 1.3rem); line-height: 1.5; color: var(--fg); margin: 0; }
.numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.number { background: var(--card); padding: clamp(.9rem, 3svh, 1.8rem) clamp(1rem, 2vw, 1.8rem); display: grid; gap: .4rem; align-content: start; }
.number b { font-size: clamp(1.7rem, min(3vw, 5svh), 2.6rem); font-weight: 600; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.number span { color: var(--muted); }

.media { position: relative; overflow: hidden; background: var(--card); }
.media img { width: 100%; height: 100%; object-fit: cover; }

/* Arbejde */
.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-top: clamp(.9rem, 3svh, 1.8rem); }
.service { padding: clamp(.9rem, 2.4svh, 1.5rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); transition: border-color .2s; }
.service:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
/* Nummer og titel på samme linje, teksten under */
.service, .guide li { display: grid; grid-template-columns: auto 1fr; gap: 0 .65rem; align-items: baseline; align-content: start; }
.service p, .guide li p { grid-column: 1 / -1; }
.service-num { color: var(--accent); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.service h3 { font-size: clamp(1.05rem, 1.3vw, 1.25rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.service p { color: var(--muted); margin-top: .4rem; font-size: .95rem; line-height: 1.5; }

/* Supportguide */
.guide { margin-top: .8rem; padding: clamp(.9rem, 2.4svh, 1.5rem); border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--card)); }
.guide-title { font-size: clamp(1.05rem, 1.3vw, 1.25rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.guide-title span { margin-left: .5rem; font-size: .9rem; font-weight: 500; color: var(--accent); }
.guide ol { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; margin-top: clamp(.6rem, 2svh, 1.1rem); }
.guide b { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--accent); color: var(--accent-fg); font-size: .85rem; }
.guide h3 { font-size: 1rem; align-self: center; letter-spacing: -.01em; }
.guide li p { margin-top: .3rem; }
.guide p { color: var(--muted); font-size: .95rem; }

/* Erfaring */
.journey { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
.timeline { position: relative; margin-top: clamp(1rem, 3svh, 1.8rem); }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 clamp(.9rem, 3svh, 1.8rem) 2.4rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: 0; top: 5px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--muted); }
.tl-item:first-of-type::before { background: var(--accent); border-color: var(--accent); }
.tl-year { color: var(--accent); }
.tl-item h3 { font-size: clamp(1.15rem, 1.5vw, 1.4rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin-top: .25rem; }
.tl-item p { color: var(--muted); margin-top: .2rem; max-width: 56ch; }
.skills-box { padding: clamp(1.4rem, 2.4vw, 2rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.skills-box h3 { font-size: 1.15rem; letter-spacing: -.01em; }
.skills { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.1rem; }
.skills li { padding: .35rem .8rem; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); font-size: .9rem; }

/* Kontakt */
.contact { text-align: center; padding: clamp(1.4rem, 5svh, 3.5rem) clamp(1.2rem, 4vw, 3rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.contact h2 { font-size: clamp(2rem, min(4.4vw, 7svh), 3.4rem); }
.contact .lead { margin-inline: auto; }
.contact-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: clamp(1rem, 3.5svh, 2rem); }
.contact-link { display: inline-flex; align-items: center; gap: .8rem; padding: .9rem 1.2rem .9rem 1.4rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); transition: border-color .2s, background .2s, color .2s; }
.contact-link small { color: var(--muted); transition: color .2s; }
.contact-link span { font-size: clamp(1rem, 1.5vw, 1.2rem); font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.contact-link:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.contact-link:hover small { color: inherit; }
.copy { margin-top: clamp(.6rem, 2svh, 1rem); padding: .6rem 1.1rem; min-height: 44px; border-radius: 8px; border: 1px dashed var(--line); color: var(--muted); font-size: .9rem; transition: color .2s, border-color .2s; }
.copy:hover { color: var(--fg); border-color: var(--fg); }
.copy.done { color: var(--accent); border-color: var(--accent); border-style: solid; }
.contact .aside { margin-top: clamp(.6rem, 2svh, 1.2rem); }

footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--line); color: var(--muted); }
footer a { padding-block: .7rem; margin-block: -.7rem; }
footer a:hover { color: var(--fg); }
/* På forsiden står bundlinjen under kontaktkortet, så den ikke tager plads i de andre afsnit */
#kontakt footer { border: 0; padding-bottom: 0; }

/* Privatliv */
.privacy { max-width: 760px; padding: 4rem 0; }
.privacy h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); line-height: 1.08; letter-spacing: -.035em; }
.privacy section { margin-top: 2.6rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.privacy h2 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); letter-spacing: -.025em; }
.privacy section p, .privacy li { color: var(--muted); margin-top: .8rem; }
.privacy b { color: var(--fg); }
.privacy a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.privacy code { font-size: .9em; padding: .1em .35em; border-radius: 6px; background: var(--card); border: 1px solid var(--line); }
.privacy ul { display: grid; gap: .2rem; }

/* Tablet */
@media (max-width: 900px) {
  .services { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 800px) {
  /* Menupunkterne får deres egen række, der kan scrolles vandret */
  .nav { flex-wrap: wrap; row-gap: .3rem; }
  .nav-sections { order: 2; width: 100%; margin: 0; gap: 1.4rem; overflow-x: auto; scrollbar-width: none; font-size: .9rem; }
  .nav-sections::-webkit-scrollbar { display: none; }
  .nav-sections a { flex: none; }
}
/* Telefon */
@media (max-width: 700px) {
  :root { --banner: 18svh; }
  html { font-size: 16px; }
  .about-grid, .journey { grid-template-columns: 1fr; gap: 1.2rem; }
  .section, .hero { padding: 1.2rem 0; }
  /* Portrættet står ved siden af navnet på telefoner */
  .hero-text { display: contents; }
  .hero-grid {
    grid-template-columns: 1fr 34%; gap: 0 1rem; align-items: end;
    grid-template-areas: "hello photo" "name photo" "intro intro" "sub sub" "buttons buttons";
  }
  .hello { grid-area: hello; }
  .name { grid-area: name; margin-bottom: 0; font-size: min(2.8rem, 12vw); }
  .intro { grid-area: intro; margin-top: 1.4rem; }
  .sub { grid-area: sub; }
  .buttons { grid-area: buttons; margin-top: 1.5rem; }
  /* Terminalen er til tastatur og fylder for meget på en telefon */
  .term { display: none; }
  .theme { width: 44px; height: 44px; }
  .hero-figure { grid-area: photo; }
  .hero-photo { height: auto; }
  .hero-figure figcaption { display: none; }
  .buttons .btn { flex: 1; justify-content: center; padding-inline: 1rem; }
  .services { gap: .5rem; }
  .service { padding: .8rem; }
  .service p, .tl-item p, .statement p { font-size: .875rem; }
  .statement p:first-child { font-size: 1rem; }
  /* Supportguiden er skjult på telefoner, så Arbejde kan være på skærmen */
  .guide { display: none; }
  .contact { padding: 1.4rem 1rem; }
  .contact .lead { margin-top: .4rem; }
  /* Telefoner har selv et mailprogram, så kopiér-knappen er til computere */
  .copy { display: none; }
  .skills li { font-size: .8125rem; padding: .25rem .6rem; }
  .contact-links { flex-direction: column; }
  .contact-links { gap: .5rem; }
  .contact-link { width: 100%; display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 0 .8rem; padding: .6rem 1rem; }
  .contact-link small { grid-column: 1; }
  .contact-link span { grid-column: 1; font-size: 1rem; white-space: nowrap; overflow-wrap: normal; }
  .contact-link .arrow { grid-column: 2; grid-row: 1 / 3; }
  footer { flex-direction: column; align-items: center; text-align: center; gap: .5rem; }
  #kontakt footer { padding-top: .6rem; flex-direction: row; justify-content: center; gap: .2rem 1rem; font-size: .8125rem; }
}

@media (max-width: 380px) {
  .buttons { flex-direction: column; }
}

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

/* Udskrift: alle afsnit vises */
@media print {
  #circuit, .top, .term { display: none !important; }
  .panel[hidden] { display: block !important; }
}
