/* dennisfalk.de – ein Stylesheet für alle Seiten */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/fonts/schibsted-grotesk-latin-wght.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Nordisches Papier, blaue Tinte */
  --paper: #edf0f2;
  --ink: #12253b;
  --ink-2: #4b5b6b;
  --rule: #c3ccd3;
  --signal: #c8102e;

  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(1rem, 5vw, 4rem);
  --measure: 68ch;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1824;
    --ink: #e4eaee;
    --ink-2: #93a2b0;
    --rule: #2a3949;
    --signal: #ff6b78;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.125rem;
  line-height: 1.55;
  overflow-x: clip;
}

main { flex: 1 0 auto; }

.container {
  width: 100%;
  max-width: calc(76rem + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--rule);
  transition: text-decoration-color 150ms ease;
}
a:hover { text-decoration-color: var(--signal); }
a:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 2px;
}

ul { margin: 0; padding: 0; list-style: none; }

/* ---------- Name als Schriftmuster ---------- */

.name { display: block; width: 100%; height: auto; }
.name .glyphs { fill: var(--ink); }
.name .metrics line {
  stroke: var(--rule);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  shape-rendering: crispEdges;
}
.name--two, .name--three { display: none; }

@media (max-width: 64rem) {
  .name--wide { display: none; }
  .name--two { display: block; }
}
@media (max-width: 40rem) {
  .name--two { display: none; }
  .name--three { display: block; }
}

/* ---------- Startseite ---------- */

.hero {
  flex: 1 0 auto;
  min-height: 76svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(4rem, 12vh, 9rem) clamp(3rem, 8vh, 6rem);
}

.hero__name {
  margin: 0 0 clamp(1.75rem, 4vw, 3rem);
  font-size: 1rem;
  line-height: 1;
}

.hero__roles {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  color: var(--ink-2);
}
.hero__links a { color: var(--ink); }

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

.project + .project {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
}

.prose .project__name {
  margin: 0 0 0.5rem;
  font-size: clamp(1.375rem, 2.6vw, 1.875rem);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.prose .project__text {
  margin: 0;
  color: var(--ink-2);
}

@media (max-width: 40rem) {
  .hero { min-height: 68svh; }
}

/* ---------- Fußzeile ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem 2rem;
  padding-block: 1.75rem 2.25rem;
  /* Linie nur über der Inhaltsbreite, wie bei den Abschnitten */
  background: linear-gradient(var(--rule), var(--rule)) no-repeat center top / calc(100% - 2 * var(--gutter)) 1px;
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.site-footer ul { display: flex; gap: 1.5rem; }
.site-footer a { color: var(--ink); }

/* ---------- Rechtstexte ---------- */

.doc-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-block: 1.75rem;
}

.wordmark {
  font-weight: 760;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.doc-header .back { font-size: 0.9375rem; color: var(--ink-2); }

.prose {
  max-width: var(--measure);
  padding-block: clamp(2rem, 6vw, 4.5rem) clamp(4rem, 10vw, 7rem);
  overflow-wrap: break-word;
  hyphens: auto;
}

.prose h1 {
  margin: 0 0 2.5rem;
  font-size: clamp(2rem, 5.5vw, 3.5rem);
  font-weight: 760;
  text-wrap: balance;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.prose h2 {
  margin: 3.25rem 0 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.prose h1 + h2 { margin-top: 0; }

.prose h3 {
  margin: 2.25rem 0 0.5rem;
  font-size: 1.1875rem;
  font-weight: 650;
  line-height: 1.3;
}

.prose h4 {
  margin: 1.75rem 0 0.25rem;
  font-size: 1.0625rem;
  font-weight: 650;
}

.prose p, .prose ul, .prose ol { margin: 0.75rem 0; }
.prose ul { padding-left: 1.25rem; list-style: disc; }
.prose ol { padding-left: 1.5rem; }
.prose li { margin: 0.25rem 0; }
.prose li::marker { color: var(--ink-2); }
.prose .stand { color: var(--ink-2); margin-top: -1.5rem; margin-bottom: 2.5rem; }

/* ---------- Intro-Animation ---------- */

html.intro-replay .hero__name { cursor: pointer; }

html.intro:not(.intro-ready) body { visibility: hidden; }

html.intro .hero__roles,
html.intro .hero__links,
html.intro .site-footer {
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(.2, .7, .2, 1);
}
html.intro .hero__links { transition-delay: 120ms; }
html.intro .site-footer { transition-delay: 240ms; }

html.intro.intro-done .hero__roles,
html.intro.intro-done .hero__links,
html.intro.intro-done .site-footer {
  opacity: 1;
  transform: none;
}

.intro-stage {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--paper);
  cursor: pointer;
  transition: opacity 450ms ease;
}
.intro-stage.is-done { opacity: 0; pointer-events: none; }
.intro-stage svg { display: block; width: 100%; height: 100%; }
.intro-stage .glyphs { fill: var(--ink); }
.intro-stage .metrics line {
  stroke: var(--rule);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.intro-stage__scale {
  position: absolute;
  left: var(--gutter);
  bottom: calc(var(--gutter) * 0.75);
  margin: 0;
  padding: 0.25rem 0.5rem;
  background: var(--paper);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  transition: opacity 300ms ease;
}
.intro-stage.is-landing .intro-stage__scale { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  html.intro .hero__roles,
  html.intro .hero__links,
  html.intro .site-footer { transition: none; transform: none; }
}
