/* mortenzacho.dk — fælles stylesheet */

/* Outfit, self-hostet. Ikke hentet fra Google Fonts: et eksternt fontkald
   sender den besøgendes IP til Google, hvilket er problematisk under GDPR.
   Licens: SIL Open Font License 1.1 — se fonts/OFL.txt */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font-display: 'Outfit', ui-sans-serif, system-ui, -apple-system,
    'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-alt: #f4f1ec;
  --ink: #16202b;
  --ink-soft: #55606c;
  --ink-faint: #7d8894;
  --accent: #1d5c8f;
  --accent-soft: #eaf1f7;
  --line: #e6e2dc;
  --max: 46rem;
  --max-wide: 60rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151a;
    --surface: #171c23;
    --surface-alt: #1c222a;
    --ink: #e9edf1;
    --ink-soft: #a8b2bd;
    --ink-faint: #7c8792;
    --accent: #7fb6e2;
    --accent-soft: #1a2732;
    --line: #262d36;
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* så den sticky topbar ikke dækker overskriften ved anker-links */
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.wrap-wide { max-width: var(--max-wide); }

a { color: var(--accent); }

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

.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--ink);
  font-weight: 400;
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.nav a:hover { color: var(--ink); }

.nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ---------- Header ---------- */

.page-header { padding: clamp(2.5rem, 8vw, 4.5rem) 0 1.5rem; }

h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  font-weight: 600;
}

.lede {
  font-size: clamp(1.0625rem, 2.4vw, 1.1875rem);
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
}

.lede:last-child { margin-bottom: 0; }

/* ---------- Sektioner ---------- */

main { flex: 1; }

section { padding: 2.5rem 0; }

section + section { border-top: 1px solid var(--line); }

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  letter-spacing: -0.025em;
  margin: 0 0 1.5rem;
  font-weight: 600;
}

/* Kort-titler: skal læses som titler, ikke som afsnitsoverskrifter i brødtekst */
h3 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  line-height: 1.25;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  font-weight: 600;
}

h3::after {
  content: "";
  display: block;
  width: 2.25rem;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  margin-top: 0.6rem;
}

p { margin: 0 0 1rem; }

p:last-child { margin-bottom: 0; }

/* ---------- Billeder ---------- */

img { max-width: 100%; }

/* Forsidens hero: tekst til venstre, portræt til højre */
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: center;
}

@media (max-width: 44rem) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .hero-photo { max-width: 20rem; }
}

.hero-photo {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  border: 1px solid var(--line);
}

/* Bredt billedbånd øverst i en sektion */
.band {
  width: 100%;
  /* height:auto er nødvendig — ellers vinder height-attributten over aspect-ratio */
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
  margin-bottom: 1.5rem;
  object-fit: cover;
}

.band-wide { aspect-ratio: 3 / 1; }

.band-photo {
  aspect-ratio: 16 / 9;
  object-position: center 40%;
}

/* Website-screenshots — beskåret fra toppen, så headeren altid er synlig */
.shot {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-bottom: 1.25rem;
  background: #fff;
}

/* Grafer vises ubeskåret — beskæring ville fjerne data */
.chart {
  width: 100%;
  max-width: 34rem;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-bottom: 1.25rem;
  background: #fff;
}

figure { margin: 0; }

figcaption {
  font-size: 0.875rem;
  color: var(--ink-faint);
  margin-top: -0.75rem;
  margin-bottom: 1.5rem;
}

/* ---------- Kort ---------- */

.item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.item:last-child { margin-bottom: 0; }

/* Kort med billede: tekst til venstre, billede i fast kolonne til højre.
   Billederne har blandede formater (både portræt og landskab), så de
   beskæres ikke — hvert billede beholder sit eget forhold og begrænses
   af både kolonnebredden og en fælles maks-højde. Det giver ens visuel
   vægt uden at ødelægge fx bogforsiden. */
.item-media {
  display: grid;
  grid-template-columns: 1fr 13rem;
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 44rem) {
  .item-media {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .item-figure { justify-self: start; }
}

.item-figure img {
  max-width: 100%;
  max-height: 15rem;
  width: auto;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.item-figure figcaption {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ink-faint);
  margin: 0.625rem 0 0;
}

.note {
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px dashed var(--line);
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

/* ---------- Knapper ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  border: 1px solid var(--accent);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.btn:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-primary { background: var(--accent); color: var(--bg); }

.btn-secondary { background: transparent; color: var(--accent); }

/* ---------- CV ---------- */

.cv-group { margin-bottom: 2.5rem; }

.cv-group:last-child { margin-bottom: 0; }

.cv-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cv-list li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.25rem 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.cv-list li:last-child { border-bottom: none; }

.cv-year {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9375rem;
  white-space: nowrap;
}

@media (max-width: 34rem) {
  .cv-list li { grid-template-columns: 1fr; }
}

.bullets {
  margin: 0;
  padding-left: 1.15rem;
}

.bullets li { margin-bottom: 0.75rem; }

.bullets li:last-child { margin-bottom: 0; }

/* ---------- Publikationer ---------- */

.pubs {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: pub;
}

.pubs li {
  position: relative;
  padding: 0.75rem 0 0.75rem 2.25rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.pubs li:last-child { border-bottom: none; }

.pubs li::before {
  counter-increment: pub;
  content: counter(pub);
  position: absolute;
  left: 0;
  top: 0.85rem;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
  background: var(--surface-alt);
  border-radius: 4px;
  min-width: 1.5rem;
  text-align: center;
  padding: 0.1rem 0.25rem;
}

.pubs strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
  background: var(--surface);
}

footer p { margin: 0 0 0.5rem; }

.footer-meta {
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}
