:root {
  --bg: #f5f1ea;
  --bg-2: #ece6dc;
  --ink: #1d1b18;
  --muted: #6e675d;
  --line: #d9d1c4;
  --accent: #a8502a;
  --accent-soft: #a8502a1a;
  --ok: #3f7d4e;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13120f;
    --bg-2: #1c1a16;
    --ink: #ede7dd;
    --muted: #9b9386;
    --line: #2e2b25;
    --accent: #e08b5f;
    --accent-soft: #e08b5f1f;
    --ok: #74c088;
  }
}
:root[data-theme="dark"] {
  --bg: #13120f; --bg-2: #1c1a16; --ink: #ede7dd; --muted: #9b9386;
  --line: #2e2b25; --accent: #e08b5f; --accent-soft: #e08b5f1f; --ok: #74c088;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* Diskret papir-korn */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.45 0 0 0 0 0.4 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, .topbar, .footer { position: relative; z-index: 1; }

a { color: inherit; }
::selection { background: var(--accent); color: var(--bg); }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 40px; } }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: var(--bg);
  font: 500 16px/1 var(--serif); font-style: italic;
}
.brand__name { font: 500 17px/1 var(--serif); letter-spacing: .01em; }
.nav { display: flex; align-items: center; gap: 4px; font-size: 14.5px; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 999px; color: var(--muted); transition: color .2s, background .2s; }
.nav a:hover { color: var(--ink); background: var(--bg-2); }
.nav__family {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 6px;
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); cursor: default;
}
.nav__family svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (max-width: 720px) { .nav a { display: none; } }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(56px, 11vw, 140px); padding-bottom: clamp(48px, 8vw, 104px); }
.eyebrow { margin: 0 0 28px; font-size: 14px; color: var(--muted); letter-spacing: .02em; }
.status { display: inline-flex; align-items: center; gap: 8px; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 70%,100% { box-shadow: 0 0 0 9px transparent; } }

.hero__name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 340;
  font-size: clamp(56px, 13vw, 168px);
  line-height: .92;
  letter-spacing: -.035em;
  font-variation-settings: "opsz" 144;
}
.hero__name em { font-style: italic; font-weight: 300; color: var(--accent); padding-left: .55em; }
@media (max-width: 560px) { .hero__name em { padding-left: 0; } }
.hero__lede {
  max-width: 34ch; margin: 36px 0 0;
  font: 300 clamp(20px, 2.4vw, 26px)/1.45 var(--serif);
  color: var(--muted);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px;
  font: 500 15px/1 var(--sans); text-decoration: none;
  transition: transform .2s ease, background .2s, color .2s, border-color .2s;
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { transform: translateY(-2px); }
.btn--solid { background: var(--ink); color: var(--bg); }
.btn--solid:hover { background: var(--accent); }
.btn--ghost { border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--ink); }

/* ---------- Grid ---------- */
.grid {
  display: grid; gap: 56px;
  padding-top: 56px; padding-bottom: 96px;
  border-top: 1px solid var(--line);
}
@media (min-width: 900px) {
  .grid { grid-template-columns: 260px 1fr; gap: 88px; padding-top: 80px; }
  .side { position: sticky; top: 104px; align-self: start; }
}

/* ---------- Sidebar ---------- */
.portrait {
  width: 100%; max-width: 260px; aspect-ratio: 4 / 5; border-radius: 6px; overflow: hidden;
  display: grid; place-items: center;
  background:
    radial-gradient(120% 90% at 20% 10%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 60%),
    linear-gradient(160deg, var(--bg-2), color-mix(in srgb, var(--bg-2) 60%, var(--line)));
  border: 1px solid var(--line);
}
@media (max-width: 899px) {
  .portrait { max-width: 132px; aspect-ratio: 1; border-radius: 50%; }
  .portrait span { font-size: 44px !important; }
}
.portrait span { font: italic 300 72px/1 var(--serif); color: color-mix(in srgb, var(--ink) 55%, transparent); }
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }

.side__block { margin-top: 40px; }
.side h3 {
  margin: 0 0 14px; font: 600 12px/1 var(--sans);
  text-transform: uppercase; letter-spacing: .14em; color: var(--muted);
}
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: 14px; padding: 6px 12px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.langs { margin: 0; display: grid; gap: 10px; font-size: 15px; }
.langs div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.langs dt { font-weight: 500; }
.langs dd { margin: 0; color: var(--muted); }

/* ---------- Sections ---------- */
.section + .section { margin-top: 96px; }
.section__title {
  display: flex; align-items: baseline; gap: 16px;
  margin: 0 0 32px;
  font: 400 clamp(30px, 4vw, 42px)/1.1 var(--serif); letter-spacing: -.02em;
}
.section__title span { font: 500 13px/1 var(--sans); color: var(--accent); letter-spacing: .08em; }
.prose p { margin: 0 0 1.1em; max-width: 62ch; color: var(--muted); }
.prose .prose__big { font: 300 clamp(21px, 2.2vw, 25px)/1.5 var(--serif); color: var(--ink); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.job {
  display: grid; gap: 6px 32px;
  padding: 28px 0; border-top: 1px solid var(--line);
  transition: background .25s;
}
.job:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 640px) { .job { grid-template-columns: 140px 1fr; } }
.job__when { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 4px; }
.job h3 { margin: 0; font: 500 22px/1.3 var(--serif); letter-spacing: -.01em; transition: color .2s; }
.job:hover h3 { color: var(--accent); }
.job__where { margin: 4px 0 10px; font-size: 15px; font-weight: 500; }
.job__body p:last-child { margin-bottom: 0; }
.job__body p:not(.job__where) { color: var(--muted); max-width: 60ch; }

.job--now .job__when { color: var(--accent); font-weight: 500; }
.job__where { color: var(--ink); }

/* ---------- Certificeringer ---------- */
.certs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 640px) { .certs { grid-template-columns: repeat(3, 1fr); } }
.certs li {
  padding: 20px; border: 1px solid var(--line); border-radius: 8px;
  background: color-mix(in srgb, var(--bg-2) 55%, transparent);
  transition: border-color .2s, transform .2s;
}
.certs li:hover { border-color: var(--accent); transform: translateY(-2px); }
.certs h3 { margin: 0 0 8px; font: 500 17px/1.35 var(--serif); }
.certs p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- Contact ---------- */
.contact {
  padding: clamp(32px, 5vw, 56px); border-radius: 8px;
  background: var(--ink); color: var(--bg);
}
.contact .section__title span { color: color-mix(in srgb, var(--accent) 70%, var(--bg)); }
.contact__lede { margin: 0 0 18px; opacity: .7; }
.contact__mail {
  font: 300 clamp(26px, 4.6vw, 48px)/1.15 var(--serif); letter-spacing: -.02em;
  text-decoration: none; word-break: break-word;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .4s ease;
}
.contact__mail:hover { background-size: 100% 1px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.footer__inner { display: flex; justify-content: space-between; padding-top: 28px; padding-bottom: 40px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s ease var(--d, 0ms), transform .8s cubic-bezier(.2,.7,.2,1) var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .status i { animation: none; }
}

/* ---------- Print = pænt CV på papir ---------- */
@media print {
  :root { --bg: #fff; --bg-2: #f3f3f3; --ink: #000; --muted: #444; --line: #ccc; }
  body::before, .topbar, .hero__actions, .footer, .eyebrow { display: none; }
  .reveal { opacity: 1; transform: none; }
  .hero { padding: 0 0 24px; }
  .hero__name { font-size: 54px; }
  .grid { padding-top: 24px; }
  .side { position: static; }
  .section + .section { margin-top: 32px; }
  .contact { background: none; color: #000; padding: 0; }
  .job { break-inside: avoid; }
}
