/* Andreas Vetter: base styles. Mobile-first, system fonts, no external resources. */

:root {
  --bg: #ffffff;
  --text: #161616;
  --muted: #666666;
  --line: #e4e4e4;
  --placeholder: #e9e9e9;
  --accent: #e6007e;
  --accent-contrast: #ffffff;
  --hero-bg: #111111;
  --hero-text: #ffffff;
  --hero-veil: rgba(235, 235, 235, 0.35); /* light veil over the hero video, adjust strength here */
  --img-veil: rgba(235, 235, 235, 0.65); /* grey veil over all photos (tiles, cards, today, video previews) */

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-slab: "Rockwell", "Roboto Slab", "Museo Slab", "Zilla Slab", "Courier New", Georgia, serif;
  --measure: 68ch;
  --wide: 1100px;
  --gutter: 16px;
  --space: clamp(4rem, 9vw, 7rem);
  --tile-gap: clamp(5rem, 12vw, 9rem);
  --radius: 4px;
  --raised: #ffffff;
  --frame: rgba(230, 0, 126, 0.55);
  --frame-bg: #ffffff;
  --line-tl: rgba(230, 0, 126, 0.6);
  --head-bg: #f2f2f2;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --text: #ececec;
    --muted: #a0a0a0;
    --line: #2a2a2a;
    --placeholder: #242424;
    --accent: #ff3fa4;
    --accent-contrast: #111111;
    --hero-bg: #000000;
    --hero-veil: rgba(20, 20, 20, 0.30);
    --img-veil: rgba(20, 20, 20, 0.65);
    --raised: #1a1a1a;
    --frame: rgba(255, 63, 164, 0.55);
    --frame-bg: #000000;
    --line-tl: rgba(255, 63, 164, 0.6);
    --head-bg: #141414;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}
@media (min-width: 768px) {
  body { font-size: 1.0625rem; }
}

img, video, iframe { max-width: 100%; display: block; }

a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--font-slab);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.6em;
}
h2 { font-size: 1.375rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: var(--gutter); top: -3rem; z-index: 10;
  background: var(--accent); color: var(--accent-contrast);
  padding: 0.5rem 0.9rem; border-radius: var(--radius);
}
.skip-link:focus { top: var(--gutter); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--hero-bg);
  color: var(--hero-text);
  overflow: hidden;
}
.hero__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero__veil {
  position: absolute; inset: 0;
  background: var(--hero-veil);
}
.hero__hint {
  position: absolute;
  left: 50%; bottom: 1.5rem;
  width: 2.75rem; height: 2.75rem;
  margin-left: -1.375rem;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  opacity: 0.6;
}
.hero__hint:hover, .hero__hint:focus-visible { opacity: 1; }
.hero__hint span {
  width: 0.75rem; height: 0.75rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

/* ---------- Sections ---------- */
.section {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--space) var(--gutter) 0;
}
.section--wide { max-width: calc(var(--wide) + 2 * var(--gutter)); }

.intro { text-align: center; }
.intro p { margin: 0 auto; color: var(--muted); max-width: 92ch; text-wrap: balance; }
.intro p + p { margin-top: 0.75rem; }
.intro p br { display: none; }
@media (min-width: 46rem) { .intro p br { display: inline; } }
.intro__line {
  font-size: clamp(1.5rem, 4vw, 1.75rem);
  margin-bottom: 0.8em;
}
.intro__line::after {
  content: "";
  display: block;
  width: 2.5rem; height: 3px;
  margin: 0.6em auto 0;
  background: var(--accent);
}

/* ---------- Two-click embeds: thumbnail with play icon, consent text below; full width once loaded ---------- */
.embed { position: relative; }
.embed__media { position: relative; background: var(--placeholder); }
.embed__media::before { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--img-veil); pointer-events: none; }
.embed__thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.embed__play {
  position: absolute; z-index: 2; left: 50%; top: 50%;
  width: 56px; height: 56px; margin: -28px 0 0 -28px; padding: 10px;
  color: var(--accent); cursor: pointer;
}
.embed__consent {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 0.4rem; padding: 0.5rem 0 0;
}
.embed__title { margin: 0; font-weight: 600; font-size: 0.8125rem; line-height: 1.4; }
.embed__note { margin: 0; font-size: 0.75rem; line-height: 1.45; color: var(--muted); max-width: 40ch; }
.embed__button {
  font: inherit; font-size: 0.8125rem; font-weight: 600;
  padding: 0.4rem 0.8rem;
  border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-contrast);
  cursor: pointer;
}
.embed__button:hover { filter: brightness(1.08); }
.embed--loaded { float: none; clear: both; width: 100%; margin: 0.75rem 0 1rem; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; }
.embed iframe { display: block; width: 100%; height: 100%; border: 0; }

/* ---------- Contact ---------- */
.contact { padding-top: var(--tile-gap); padding-bottom: var(--space); text-align: center; }
.contact .button { margin-bottom: 0.75rem; }
.button {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius);
  background: var(--accent); color: var(--accent-contrast);
  font-weight: 600;
  text-decoration: none;
}
.button:hover { filter: brightness(1.08); }
.contact__mail { overflow-wrap: anywhere; }

/* ---------- Header (legal pages) & footer ---------- */
.site-header {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
  border-bottom: 1px solid var(--line);
}
.site-header a { color: var(--text); font-family: var(--font-slab); font-weight: 700; text-decoration: none; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem var(--gutter);
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}
.site-footer p { margin: 0; }
.site-footer a { color: inherit; }

.legal { padding-bottom: var(--space); }
.legal h1 { font-size: clamp(1.75rem, 5vw, 2.25rem); }
.legal h2 { font-size: 1.125rem; margin-top: 2rem; }
.legal .subtitle { color: var(--muted); }

/* ---------- Reveal on scroll (enabled by JS only) ---------- */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js-reveal .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- CV: two symbols, two lines ---------- */
.cv {
  max-width: calc(1100px + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--space) var(--gutter) 0;
}
.cv__heads {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 520px; margin: 0 auto;
  padding: 1.75rem 0.5rem 1.5rem;
  background: var(--head-bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.cv__head { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; text-align: center; color: var(--accent); }
.cv__head svg { width: 72px; height: 72px; overflow: visible; }
.cv__head p { margin: 0; color: var(--text); font-family: var(--font-slab); font-weight: 700; font-size: 0.9375rem; line-height: 1.3; }
@media (min-width: 768px) {
  .cv__head svg { width: 96px; height: 96px; }
  .cv__head p { font-size: 1.125rem; }
}
.cv__fork, .cv__join { display: block; fill: none; stroke: var(--line-tl); stroke-width: 1; overflow: visible; }
.cv__join circle { fill: var(--accent); stroke: none; }
.cv__fork--wide { width: 320px; height: 72px; margin: 0 auto; }
.cv__join--wide { width: 56px; height: 72px; margin: 0 auto; }
.cv__fork--narrow { width: 100%; height: 64px; }
.cv__join--narrow { width: 100%; height: 72px; }
.cv__join--narrow path { stroke: var(--line-tl); }
@media (max-width: 767px) { .cv__fork--wide, .cv__join--wide { display: none; } }
@media (min-width: 768px) { .cv__fork--narrow, .cv__join--narrow { display: none; } }

/* ---------- Timeline ---------- */
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before, .tl::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-tl);
}
.st { position: relative; }
.st::before { /* dot */
  content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
}
.st__head {
  box-sizing: border-box;
  display: flex; gap: 1.25rem; align-items: flex-start;
}
.st__head:focus-visible, .pill:focus-visible, .today__head:focus-visible, .contact__about:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.st__text { display: block; min-width: 0; max-width: 340px; }
.st__text > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st__year { font-size: 12px; letter-spacing: 0.2em; line-height: 1.6; color: var(--muted); }
.st__field { font-family: var(--font-slab); font-weight: 700; font-size: 19px; line-height: 1.3; margin-top: 2px; }
.st__where { font-size: 15px; line-height: 1.45; }
.st__role { font-size: 14px; line-height: 1.45; color: var(--muted); }
.plus { color: var(--accent); }
.st__head:hover .st__field { color: var(--accent); }

.frame {
  display: block; position: relative; box-sizing: border-box;
  padding: 5px; background: var(--frame-bg); border: 1px solid var(--frame); border-radius: var(--radius);
  overflow: hidden;
}
.frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.frame::after { content: ""; position: absolute; inset: 5px; background: var(--img-veil); pointer-events: none; }
.st__thumb { flex: none; width: 132px; height: 88px; }
.st__thumb img { transition: transform 0.6s ease; }
.st__head:hover .st__thumb img { transform: scale(1.03); }

.pills { list-style: none; margin: 0.75rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.pill {
  font: inherit; font-size: 14px; line-height: 1.2; color: var(--text);
  padding: 0.45rem 0.75rem; background: none; cursor: pointer;
  border: 1px solid var(--frame); border-radius: 999px; white-space: nowrap;
}
.pill:hover { border-color: var(--accent); }

/* mobile: one line per screen edge */
@media (max-width: 767px) {
  .tl::before { left: 0; }
  .tl::after { right: 0; }
  .st { padding: 20px 0; }
  .st--e { padding-left: 24px; padding-right: 56px; }
  .st--d { padding-left: 56px; padding-right: 24px; }
  .st::before { top: 48px; }
  .st--e::before { left: -4px; }
  .st--d::before { right: -4px; }
  .st::after { content: ""; position: absolute; top: 52px; width: 16px; height: 1px; background: var(--accent); }
  .st--e::after { left: 0; }
  .st--d::after { right: 0; }
  .st__thumb { display: none; }
  .st__head { display: block; width: 100%; }
  .st__text { max-width: 100%; }
  .st--d .st__head, .st--d .st__text { text-align: right; }
  .st--e .pills { align-items: flex-start; }
  .st--d .pills { align-items: flex-end; }
}

/* desktop: zipper, both lines close together in the middle */
@media (min-width: 768px) {
  .tl::before { left: calc(50% - 14px); }
  .tl::after { left: calc(50% + 14px); }
  .st { display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); }
  .st > * { grid-row: 1; }
  .st--e > .st__head, .st--e > .pills { grid-column: 1; }
  .st--d > .st__head, .st--d > .pills { grid-column: 3; }
  .st__head { padding: 24px 0 0; }
  .st > .pills { grid-row: 2; margin-bottom: 0; }
  .st { padding-bottom: 24px; }
  .st--e .st__head { justify-content: flex-end; text-align: right; padding-right: 24px; }
  .st--d .st__head { padding-left: 24px; }
  .st--e .pills { align-items: flex-end; padding-right: 24px; }
  .st--d .pills { align-items: flex-start; padding-left: 24px; }
  .st::before { top: 53px; }
  .st--e::before { left: calc(50% - 18px); }
  .st--d::before { left: calc(50% + 10px); }
}

/* ---------- Today (navel) ---------- */
.today { text-align: center; padding-top: 1rem; }
.today__head {
  box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; width: 100%;
}
.today__head > span { display: block; }
.today__kicker { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.today__field { font-family: var(--font-slab); font-weight: 700; font-size: 1.375rem; margin: 0.25rem 0 0.1rem; }
.today__where { font-size: 15px; }
.today__role { font-size: 14px; color: var(--muted); }
.today__media { width: 520px; max-width: 100%; aspect-ratio: 2 / 1; margin: 1.25rem 0; }
.today__media img { object-position: center 35%; }
.today__media::after { background: rgba(20, 20, 20, 0.3); }
@media (prefers-color-scheme: light) { .today__media::after { background: rgba(235, 235, 235, 0.3); } }
.today > p { max-width: 62ch; margin: 0 auto 0.9rem; text-align: left; }
/* today__head is no longer clickable (no pop-up) */

/* ---------- Contact: About me link ---------- */
.contact__about {
  font: inherit; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
  background: none; border: 0; cursor: pointer; padding: 0.75rem 1rem; margin-top: 1.5rem;
}
.contact__about:hover { color: var(--text); }

/* ---------- Details: pop-up content (listed at the end when JS is off) ---------- */
.details { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter) var(--space); }
.js .details { display: none; }
.detail + .detail { margin-top: 3rem; border-top: 1px solid var(--line); padding-top: 2rem; }
.detail__kicker { margin: 0 0 0.4rem; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); }
.detail h3 { font-size: 1.375rem; margin: 0 0 0.4rem; padding-right: 2.5rem; }
.detail__meta { font-size: 0.875rem; color: var(--muted); }
.detail__media { margin: 1.25rem 0; }
.detail__media .frame { aspect-ratio: 16 / 9; }
.detail__media figcaption { margin-top: 0.4rem; font-size: 0.8125rem; color: var(--muted); overflow-wrap: anywhere; }
.detail__media.embed .embed__media { aspect-ratio: 16 / 9; }
.detail__quote { margin: 1rem 0 0; padding-left: 1rem; border-left: 2px solid var(--accent); font-style: italic; }
.detail__quote p { margin: 0 0 0.35rem; }
.detail__quote footer { font-size: 0.8125rem; font-style: normal; color: var(--muted); }

/* ---------- Modal ---------- */
.modal {
  width: calc(100% - 32px); max-width: 720px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--raised); color: var(--text); overflow: auto; cursor: pointer;
}
.modal::backdrop { background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal__body { padding: 1.25rem; }
@media (min-width: 768px) { .modal__body { padding: 2rem; } }
.modal .detail__media, .modal a, .modal iframe { cursor: auto; }
.modal__close {
  position: sticky; top: 0; float: right; z-index: 2;
  width: 44px; height: 44px; margin: 0.5rem 0.5rem 0 0;
  font: inherit; font-size: 28px; line-height: 1; color: var(--accent);
  background: none; border: 0; cursor: pointer;
}
html.has-modal { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .st__thumb img { transition: none; }
}

.about-portrait {
  display: block;
  width: 120px; height: 120px;
  margin: 1.75rem auto 0;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  padding: 4px;
  background: #000;
}

@media (max-width: 767px) {
  .modal__close {
    -webkit-appearance: none; appearance: none;
    width: 36px; height: 36px; margin: 0.25rem 0.25rem 0 0;
    padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
    font-size: 0; color: var(--accent); opacity: 0.8;
  }
  .modal__close::before {
    content: "+"; display: block;
    font-size: 22px; font-weight: 300; line-height: 36px;
    transform: rotate(45deg);
  }
}
