/* Peter Just – personlig hjemmeside
   Fortælling i kapitler. Aftenblå, papir og lampelys. */

@font-face { font-family: "Archivo"; src: url(../fonts/archivo-latin-wdth-normal.woff2) format("woff2-variations");
  font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Archivo"; src: url(../fonts/archivo-latin-ext-wdth-normal.woff2) format("woff2-variations");
  font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  unicode-range: U+0100-02AF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113, U+A720-A7FF; }
@font-face { font-family: "Newsreader"; src: url(../fonts/newsreader-latin-opsz-normal.woff2) format("woff2-variations");
  font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url(../fonts/newsreader-latin-opsz-italic.woff2) format("woff2-variations");
  font-weight: 200 800; font-style: italic; font-display: swap; }

:root {
  --night: #13222C;   /* aftenblå */
  --dusk:  #2B4352;
  --paper: #F5F7F6;
  --paper-2: #E8EDEC;
  --ink:   #1C2A33;
  --muted: #55646D;
  --line:  #D3DBDB;
  --lamp:  #F2A541;   /* lampelys / glød */
  --fjord: #2F6F69;   /* havnevand – links */

  --serif: "Newsreader", Georgia, serif;
  --sans: "Archivo", system-ui, sans-serif;
  --col: 38rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--fjord); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--lamp); outline-offset: 3px; border-radius: 3px; }
code { font-size: .9em; background: var(--paper-2); padding: .1em .35em; border-radius: 4px; }

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--lamp); color: var(--night); padding: .6rem 1rem; font-weight: 700; border-radius: 6px; }
.skip:focus { top: 1rem; }

/* ---------- Topbar ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem var(--gutter);
  color: var(--paper);
  transition: background-color .35s ease, color .35s ease, box-shadow .35s ease;
}
.bar a { color: inherit; text-decoration: none; }
.bar-name { font-family: var(--serif); font-size: 1.25rem; font-weight: 500; letter-spacing: -.01em; }
.bar nav { display: flex; gap: clamp(1rem, 3vw, 2rem); font-size: .95rem; }
.bar nav a { padding-block: .25rem; border-bottom: 1px solid transparent; }
.bar nav a:hover { border-color: currentColor; }
.bar.is-solid, body:not(.home) .bar {
  background: rgba(245, 247, 246, .88); color: var(--ink);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}

/* ---------- Knapper ---------- */
.btn {
  display: inline-block; padding: .8rem 1.3rem; border-radius: 999px;
  font-weight: 600; font-size: .98rem; text-decoration: none; line-height: 1.2;
  border: 1.5px solid transparent; transition: background-color .2s ease, color .2s ease;
}
.btn--light { background: var(--paper); color: var(--night); }
.btn--light:hover { background: #fff; }
.btn--ghost { color: var(--paper); border-color: rgba(245, 247, 246, .6); }
.btn--ghost:hover { background: rgba(245, 247, 246, .12); }
.btn--dark { background: var(--night); color: var(--paper); }
.btn--dark:hover { background: var(--dusk); }

/* ---------- Kapitelforsider ---------- */
.cover {
  position: relative; height: 100svh; min-height: 34rem;
  overflow: hidden; isolation: isolate; color: var(--paper);
  display: flex; align-items: flex-end;
}
.cover-bg { position: absolute; inset: -6% 0; z-index: -2; will-change: transform; }
.scene { width: 100%; height: 100%; display: block; object-fit: cover; }
.cover::after { /* mørk bund, så titlen kan læses */
  content: ""; position: absolute; inset: auto 0 0 0; height: 55%; z-index: -1;
  background: linear-gradient(to top, rgba(10, 18, 24, .72), rgba(10, 18, 24, 0));
}
.cover--light { color: var(--night); }
.cover--light::after { background: linear-gradient(to top, rgba(245, 247, 246, .55), rgba(245, 247, 246, 0)); }

.cover-text {
  width: 100%; max-width: 76rem; margin-inline: auto;
  padding: 0 var(--gutter) clamp(2.5rem, 8vh, 5.5rem);
}
.ch-no { margin: 0 0 .4rem; font-size: 1rem; font-weight: 500; opacity: .85; }
.ch-title {
  margin: 0; font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(3.5rem, 11vw, 9.5rem); line-height: .9; letter-spacing: -.025em;
  font-variation-settings: "opsz" 72;
}

/* Intro */
.cover--intro { align-items: center; }
.cover--intro::after { height: 100%; background: linear-gradient(to right, rgba(10, 18, 24, .55), rgba(10, 18, 24, 0) 70%); }
.cover--intro .cover-text { padding-top: 5.5rem; padding-bottom: 12vh; }
.intro-title {
  margin: 0; font-family: var(--serif); font-weight: 350;
  font-size: clamp(3.2rem, 9vw, 8rem); line-height: .95; letter-spacing: -.03em;
  font-variation-settings: "opsz" 72;
}
.intro-title .ln { display: block; }
.intro-title .ln:first-child { font-style: italic; color: var(--lamp); }
.intro-sub { max-width: 30rem; margin: 1.5rem 0 2rem; font-family: var(--serif); font-size: clamp(1.2rem, 1.9vw, 1.45rem); line-height: 1.45; opacity: .92; }
.intro-links { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 1.5rem; width: 2.75rem; height: 2.75rem; margin-left: -1.375rem;
  border-radius: 50%; border: 1.5px solid rgba(245, 247, 246, .5);
}
.scroll-cue::before {
  content: ""; position: absolute; left: 50%; top: 42%; width: .6rem; height: .6rem;
  border-right: 2px solid var(--paper); border-bottom: 2px solid var(--paper);
  transform: translate(-50%, -50%) rotate(45deg);
  animation: cue 2.4s ease-in-out infinite;
}
@keyframes cue { 0%, 100% { margin-top: 0; } 50% { margin-top: 5px; } }

/* Intro-indgang: én samlet bevægelse ved sideindlæsning */
.js .cover--intro .ln, .js .cover--intro .intro-sub, .js .cover--intro .intro-links {
  opacity: 0; transform: translateY(14px);
  animation: rise .9s cubic-bezier(.2, .7, .2, 1) forwards;
}
.js .cover--intro .ln:nth-child(2) { animation-delay: .25s; }
.js .cover--intro .intro-sub { animation-delay: .6s; }
.js .cover--intro .intro-links { animation-delay: .8s; }
@keyframes rise { to { opacity: 1; transform: none; } }

.sparks { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.steam { animation: steam 4s ease-in-out infinite; }
.steam.s2 { animation-delay: 1.4s; }
@keyframes steam { 0%, 100% { opacity: .15; transform: translateY(4px); } 50% { opacity: .6; transform: translateY(-6px); } }

@media (prefers-reduced-motion: reduce) {
  .scroll-cue::before, .steam { animation: none; }
  .js .cover--intro .ln, .js .cover--intro .intro-sub, .js .cover--intro .intro-links { animation: none; opacity: 1; transform: none; }
}

/* ---------- Fortællingen ---------- */
.story {
  max-width: calc(var(--col) + 2 * var(--gutter)); margin-inline: auto;
  padding: clamp(3.5rem, 9vw, 6.5rem) var(--gutter) clamp(4rem, 10vw, 7rem);
  font-family: var(--serif); font-size: 1.25rem; line-height: 1.7;
}
.story p { margin: 0 0 1.25em; }
.story-lede { font-size: clamp(1.5rem, 2.6vw, 1.9rem); line-height: 1.4; font-variation-settings: "opsz" 36; }
.story-lede::first-letter { font-size: 1em; }

.inset { margin: .3em 0 1.25em; }
.inset img { border-radius: 6px; width: 100%; height: auto; }
.inset figcaption { font-family: var(--sans); font-size: .85rem; color: var(--muted); margin-top: .5rem; }
@media (min-width: 1000px) {
  .inset { width: 13rem; }
  .inset-right { float: right; margin-right: -15rem; }
  .inset-left { float: left; margin-left: -15rem; }
}

.themes { margin: 2rem 0 2.5rem; }
.themes dt { font-style: italic; font-size: 1.55rem; line-height: 1.2; color: var(--fjord); margin-top: 1.75rem; }
.themes dd { margin: .4rem 0 0; }

.pull { margin: 3rem 0 0; padding-left: 1.5rem; border-left: 3px solid var(--lamp); }
.pull p { margin: 0; font-style: italic; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.25; font-variation-settings: "opsz" 48; }

/* ---------- Bloguddrag på forsiden ---------- */
.from-blog { background: var(--paper-2); padding-block: clamp(4rem, 9vw, 7rem); }
.from-blog-in { max-width: 52rem; margin-inline: auto; padding-inline: var(--gutter); }
.h-blog { margin: 0 0 2rem; font-family: var(--serif); font-weight: 400; font-style: italic; font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -.02em; }

.post-list { list-style: none; margin: 0 0 2.5rem; padding: 0; }
.post-list li { border-top: 1px solid var(--line); }
.post-list li:last-child { border-bottom: 1px solid var(--line); }
.post-list a { display: grid; gap: .35rem; padding: 1.5rem 0; color: inherit; text-decoration: none; }
.post-list time { font-size: .9rem; color: var(--muted); }
.pl-title { font-family: var(--serif); font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.2; font-weight: 450; transition: color .2s ease; }
.post-list a:hover .pl-title { color: var(--fjord); }
.pl-excerpt { color: var(--muted); max-width: 40rem; }
.post-list--full a { grid-template-columns: minmax(0, 1fr); }
.pl-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; margin-bottom: .75rem; }
.note { color: var(--muted); font-size: 1.05rem; }

/* ---------- Kapitelnavigation (desktop) ---------- */
.chapters {
  position: fixed; right: 1.25rem; top: 50%; transform: translateY(-50%); z-index: 30;
  display: flex; flex-direction: column; gap: .15rem; padding: .6rem;
  background: rgba(19, 34, 44, .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-radius: 14px; opacity: 0; pointer-events: none; transition: opacity .4s ease;
}
.chapters.show { opacity: 1; pointer-events: auto; }
.chapters a {
  display: flex; align-items: center; gap: .6rem; padding: .3rem .5rem;
  color: rgba(245, 247, 246, .7); text-decoration: none; font-size: .85rem; border-radius: 8px;
}
.chapters a::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .6; }
.chapters a:hover { color: var(--paper); }
.chapters a.active { color: var(--paper); }
.chapters a.active::before { background: var(--lamp); opacity: 1; }
@media (max-width: 1359px) { .chapters { display: none; } }

/* ---------- Blog-sider ---------- */
.blog, .post { max-width: 52rem; margin-inline: auto; padding: 7.5rem var(--gutter) 5rem; min-height: 70vh; }
.blog-head h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-style: italic; font-size: clamp(3rem, 8vw, 5.5rem); line-height: 1; letter-spacing: -.03em; }
.blog-head p { margin: .75rem 0 2.5rem; font-family: var(--serif); font-size: 1.3rem; color: var(--muted); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: var(--muted); font-size: .95rem; }

.post { max-width: calc(var(--col) + 2 * var(--gutter)); }
.post-meta { margin: 0 0 1rem; font-size: .95rem; color: var(--muted); }
.post-meta a { color: inherit; }
.post-title { margin: 0; font-family: var(--serif); font-weight: 450; font-size: clamp(2.3rem, 6vw, 3.6rem); line-height: 1.05; letter-spacing: -.02em; text-wrap: balance; }
.post-lede { margin: 1.25rem 0 0; font-family: var(--serif); font-size: 1.4rem; line-height: 1.45; color: var(--muted); }
.post-cover { margin: 2.5rem 0 0; }
.post-cover img { border-radius: 8px; width: 100%; }
.post-body { margin-top: 2.5rem; font-family: var(--serif); font-size: 1.25rem; line-height: 1.7; }
.post-body p, .post-body ul { margin: 0 0 1.25em; }
.post-body h2 { font-weight: 500; font-size: 1.6rem; line-height: 1.25; margin: 2em 0 .6em; }
.post-body blockquote { margin: 2rem 0; padding-left: 1.25rem; border-left: 3px solid var(--lamp); font-style: italic; font-size: 1.45rem; line-height: 1.4; }
.post-body blockquote p { margin: 0; }
.post-body figure { margin: 2rem 0; }
.post-body figure img { border-radius: 6px; }
.post-body figcaption { font-family: var(--sans); font-size: .85rem; color: var(--muted); margin-top: .5rem; }
.post-sign { font-family: var(--serif); font-style: italic; font-size: 1.4rem; margin: 2rem 0 0; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.post-nav a { display: grid; gap: .25rem; color: inherit; text-decoration: none; font-family: var(--serif); font-size: 1.2rem; line-height: 1.3; }
.post-nav a span { font-family: var(--sans); font-size: .85rem; color: var(--muted); }
.post-nav .pn-newer { text-align: right; grid-column: 2; }
.post-nav a:hover { color: var(--fjord); }

/* ---------- Footer ---------- */
.foot { background: var(--night); color: rgba(245, 247, 246, .7); padding-block: 3rem; font-size: .95rem; }
.foot-in { max-width: 76rem; margin-inline: auto; padding-inline: var(--gutter); display: flex; flex-wrap: wrap; gap: .5rem 2.5rem; align-items: baseline; }
.foot p { margin: 0; }
.foot a { color: var(--paper); }
.foot-name { font-family: var(--serif); font-size: 1.4rem; color: var(--paper); }
.foot-links { margin-left: auto !important; display: flex; gap: 1.25rem; }
@media (max-width: 640px) { .foot-links { margin-left: 0 !important; } }

@media (max-width: 700px) {
  .chapter .cover { height: 78svh; min-height: 28rem; }
}

/* ---------- Profilbillede ---------- */
.avatar { border-radius: 50%; object-fit: cover; display: block; }
.avatar--intro {
  width: clamp(7.5rem, 13vw, 11rem); height: auto; aspect-ratio: 1;
  margin-bottom: 1.75rem;
  border: 3px solid var(--lamp);
  box-shadow: 0 0 0 6px rgba(242, 165, 65, .18), 0 18px 40px rgba(0, 0, 0, .35);
}
.js .cover--intro .avatar--intro { opacity: 0; transform: scale(.92); animation: pop .8s cubic-bezier(.2, .7, .2, 1) .1s forwards; }
@keyframes pop { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .js .cover--intro .avatar--intro { animation: none; opacity: 1; transform: none; } }

.post-sign { display: flex; align-items: center; gap: .9rem; }
.avatar--sm { width: 3.5rem; height: 3.5rem; }
.foot-name { display: flex; align-items: center; gap: .75rem; }
.avatar--xs { width: 2.5rem; height: 2.5rem; }
@media (max-width: 700px) { .avatar--intro { margin-bottom: 1.25rem; } }

/* ---------- Når jeg holder fri ---------- */
.free { padding-block: clamp(4rem, 9vw, 7rem); }
.free-in { max-width: 76rem; margin-inline: auto; padding-inline: var(--gutter); }
.h-free { margin: 0; font-family: var(--serif); font-weight: 400; font-style: italic; font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -.02em; }
.free-intro { margin: .75rem 0 2.5rem; font-family: var(--serif); font-size: 1.3rem; color: var(--muted); }
.free-grid { columns: 3 18rem; column-gap: 1rem; }
.free-grid figure { margin: 0 0 1rem; break-inside: avoid; cursor: zoom-in; }
.free-grid img { width: 100%; height: auto; border-radius: 6px; transition: filter .2s ease; }
.free-grid figure:hover img { filter: brightness(1.05); }
.free-grid figcaption { font-size: .9rem; color: var(--muted); margin-top: .45rem; }
@media (max-width: 640px) { .free-grid { columns: 2; column-gap: .6rem; } .free-grid figure { margin-bottom: .6rem; } }

/* Lysboks */
.lb { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 92vh; }
.lb::backdrop { background: rgba(10, 18, 24, .88); }
.lb img { max-width: 94vw; max-height: 84vh; width: auto; height: auto; border-radius: 6px; margin-inline: auto; }
.lb p { color: var(--paper); text-align: center; font-family: var(--serif); font-size: 1.15rem; margin: .75rem 0 0; }
.lb button { position: fixed; top: 1rem; right: 1rem; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 0; background: var(--paper); color: var(--night); font-size: 1.5rem; line-height: 1; cursor: pointer; }

/* ---------- Kongelig kundgørelse ---------- */
.royal { background: var(--night); color: var(--paper); padding-block: clamp(4rem, 9vw, 7rem); position: relative; overflow: hidden; }
.royal::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 70% at 75% 40%, rgba(242, 165, 65, .14), transparent 70%); pointer-events: none; }
.royal-in { position: relative; max-width: 64rem; margin-inline: auto; padding-inline: var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.royal-photo { margin: 0; transform: rotate(-2.5deg); background: #fff; padding: .7rem .7rem 2.6rem; border-radius: 3px; box-shadow: 0 24px 50px rgba(0, 0, 0, .45); max-width: 26rem; justify-self: center; }
.royal-photo img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; }
.royal-seal { width: 3.6rem; height: 3.6rem; border-radius: 50%; background: var(--lamp); display: grid; place-items: center; margin-bottom: 1.25rem; box-shadow: 0 0 0 6px rgba(242, 165, 65, .18); }
.royal-seal svg { width: 2.1rem; height: 2.1rem; fill: var(--night); }
.royal-h { margin: 0 0 1.25rem; font-family: var(--serif); font-weight: 400; font-style: italic; font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -.02em; color: var(--lamp); }
.royal-text p { font-family: var(--serif); font-size: 1.25rem; line-height: 1.6; margin: 0 0 1em; max-width: 32rem; color: rgba(245, 247, 246, .9); }
.royal-text em { color: var(--paper); }
.royal-sign { font-style: italic; color: rgba(245, 247, 246, .65) !important; font-size: 1.1rem !important; }
@media (max-width: 760px) { .royal-in { grid-template-columns: 1fr; } .royal-photo { max-width: 18rem; } }
