/* biobuv.de — "Cladogram" design */

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

:root {
  --forest: #16362a;     /* hero, header, footer */
  --forest-2: #20493a;   /* raised surfaces on dark */
  --lichen: #c6d86f;     /* branches, nodes, accents on dark */
  --paper: #f1f4ef;      /* page background: cool sage-white */
  --paper-2: #e4eae2;    /* alternate sections */
  --ink: #15211c;        /* text */
  --muted: #4c5c54;      /* secondary text */
  --rule: #c9d4c9;       /* hairlines */
  --link: #24613a;       /* links on light */
  --on-dark: #e9efe6;
  --on-dark-muted: #b4c4b8;

  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.7rem;
  --step-3: clamp(2.1rem, 1.6rem + 2vw, 2.9rem);
  --step-4: clamp(2.6rem, 1.8rem + 3.6vw, 4.4rem);
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.15; font-weight: 650; letter-spacing: -0.015em; margin: 0 0 0.6em; }
h1 { font-size: var(--step-4); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); letter-spacing: -0.005em; }
p { margin: 0 0 1em; }
em, i, .sci { font-style: italic; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--lichen); outline-offset: 3px; border-radius: 2px; }
main :focus-visible { outline-color: var(--link); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 0; background: var(--lichen); color: var(--forest); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- header ---------- */
.site-header { background: var(--forest); color: var(--on-dark); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding-top: 1.1rem; padding-bottom: 1.1rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--on-dark); text-decoration: none; font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; }
.brand-mark { width: 1.75rem; height: 1.75rem; color: var(--lichen); fill: var(--lichen); }
.site-nav { display: flex; gap: .25rem 1.6rem; flex-wrap: wrap; }
.site-nav a { color: var(--on-dark-muted); text-decoration: none; padding: .35rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--on-dark); }
.site-nav a[aria-current="page"] { color: var(--on-dark); border-bottom-color: var(--lichen); }

/* ---------- dark bands ---------- */
.band { background: var(--forest); color: var(--on-dark); }
.band a:not(.button) { color: var(--lichen); }

.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 6rem); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 2rem 4rem; align-items: center; }
.hero h1 { max-width: 12ch; }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--on-dark-muted); max-width: 34rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.button {
  display: inline-block; padding: .75rem 1.3rem; border-radius: 999px;
  background: var(--lichen); color: var(--forest); font-weight: 650; text-decoration: none;
  border: 2px solid var(--lichen);
}
.button:hover { background: #d6e48a; border-color: #d6e48a; }
.button-quiet { background: transparent; color: var(--on-dark); border-color: rgba(198, 216, 111, .55); }
.button-quiet:hover { background: var(--forest-2); border-color: var(--lichen); }

/* the cladogram */
.hero-tree { margin: 0; }
.hero-tree svg { width: 100%; height: auto; overflow: visible; }
.branches path { stroke: var(--lichen); stroke-width: 2.25; opacity: .85; }
.tips circle { fill: var(--lichen); }
.tips text { fill: var(--on-dark); font-family: var(--font); font-size: 19px; }

@media (prefers-reduced-motion: no-preference) {
  .branches path {
    stroke-dasharray: 1; stroke-dashoffset: 1;
    animation: grow .5s cubic-bezier(.3, .1, .3, 1) forwards;
    animation-delay: calc(var(--d) * 0.14s + .2s);
  }
  .tips g {
    opacity: 0;
    animation: appear .6s ease-out forwards;
    animation-delay: calc(var(--d) * 0.14s + .6s);
  }
}
@keyframes grow { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }

/* page title band on inner pages */
.page-head { padding: clamp(2.2rem, 5vw, 3.6rem) 0 clamp(2.4rem, 5vw, 3.8rem); }
.page-head h1 { font-size: var(--step-3); max-width: 22ch; margin-bottom: .4em; }
.page-head p { color: var(--on-dark-muted); font-size: var(--step-1); line-height: 1.5; max-width: 40rem; margin: 0; }

/* ---------- light sections ---------- */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section-alt { background: var(--paper-2); }
.section-title { font-size: var(--step-2); margin-bottom: 1.6rem; }

/* a branch: hairline with a node, the cladogram motif reused as a divider */
.section-title::before {
  content: ""; display: block; width: 3.2rem; height: 10px; margin-bottom: 1rem;
  background:
    radial-gradient(circle at calc(100% - 5px) 50%, var(--link) 4px, transparent 4.5px),
    linear-gradient(var(--link), var(--link)) left 50% / calc(100% - 8px) 2px no-repeat;
}

.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 3rem; }
.pillars h3 { margin-bottom: .4em; }
.pillars p { color: var(--muted); margin: 0; }

.tiplist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.tiplist li { display: grid; grid-template-columns: minmax(12rem, 18rem) 1fr; gap: .25rem 2rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.tiplist a { font-size: var(--step-1); text-decoration: none; color: var(--ink); }
.tiplist a strong { font-weight: 650; }
.tiplist a:hover strong { color: var(--link); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .18em; }
.tiplist span { color: var(--muted); }
.more { margin: 1.6rem 0 0; }

.cta { background: var(--forest-2); padding: clamp(3rem, 6vw, 4.5rem) 0; }
.cta h2 { font-size: var(--step-2); }
.cta p { color: var(--on-dark-muted); max-width: 36rem; }

/* ---------- prose pages ---------- */
.prose { max-width: 42rem; }
.wrap.prose { max-width: var(--wrap); }
.wrap.prose > * { max-width: 42rem; }
.prose h2 { font-size: var(--step-2); margin-top: 2.4rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.8rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }

/* services on the work page */
.services { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.service { display: grid; grid-template-columns: minmax(14rem, 22rem) 1fr; gap: .5rem 3rem; padding: 1.8rem 0; border-bottom: 1px solid var(--rule); }
.service h2 { font-size: var(--step-1); margin: 0; }
.service p { margin: 0; color: var(--muted); max-width: 40rem; }
.service p + p { margin-top: .6rem; }

/* projects */
.project { display: grid; grid-template-columns: minmax(14rem, 22rem) 1fr; gap: .5rem 3rem; padding: 2rem 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 1rem; }
.project:first-of-type { border-top: 1px solid var(--rule); }
.project h3 { font-size: var(--step-2); margin: 0 0 .3em; }
.project .role { color: var(--muted); font-size: var(--step--1); margin: 0; }
.project .body p { max-width: 40rem; }
.project .links { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; margin: 0; font-size: var(--step--1); }
.status { display: inline-block; font-size: var(--step--1); color: var(--muted); border: 1px solid var(--rule); border-radius: 999px; padding: .05rem .6rem; margin-top: .6rem; }

.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.4rem 3rem; }
.tools h3 { margin-bottom: .35em; }
.tools p { color: var(--muted); margin-bottom: .5rem; }
.tools .links { font-size: var(--step--1); margin: 0; }

/* about */
.about-grid { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 42rem); gap: 2rem 4rem; align-items: start; }
.portrait { margin: 0; }
.portrait img { border-radius: 14px; border: 3px solid var(--forest); aspect-ratio: 1; object-fit: cover; width: 100%; background: var(--paper-2); }
.portrait figcaption { font-size: var(--step--1); color: var(--muted); margin-top: .7rem; }
.prose .profiles { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .45rem; }
.profiles a { display: inline-flex; gap: .5rem; align-items: center; }
.profiles svg { width: 1.15rem; height: 1.15rem; flex: none; }
.pubs { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.pubs li { display: grid; grid-template-columns: 4rem 1fr; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--rule); }
.pubs .year { color: var(--muted); font-variant-numeric: tabular-nums; }
.pubs .venue { display: block; color: var(--muted); font-size: var(--step--1); }

/* contact */
.mail-big { font-size: var(--step-3); font-weight: 650; letter-spacing: -0.02em; text-decoration: none; overflow-wrap: anywhere; }
.mail-big:hover { text-decoration: underline; }
.places { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 3rem; margin-top: 3rem; }
.places address { font-style: normal; }
.places h3 { margin-bottom: .3em; }
.places .note { color: var(--muted); font-size: var(--step--1); }

/* legal (German) pages */
.legal dl { display: grid; grid-template-columns: 14rem 1fr; gap: .6rem 2rem; margin: 0; }
.legal dt { color: var(--muted); }
.legal dd { margin: 0; }

/* ---------- footer ---------- */
.site-footer { background: var(--forest); color: var(--on-dark-muted); font-size: var(--step--1); padding: 3rem 0 1.5rem; }
.site-footer a { color: var(--on-dark); }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1.5rem 3rem; }
.footer-inner p { margin: 0 0 .4rem; }
.footer-name { color: var(--on-dark); font-weight: 650; }
.footer-base { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid rgba(198, 216, 111, .2); }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-tree { max-width: 30rem; }
  .pillars, .tools, .places { grid-template-columns: 1fr; }
  .tiplist li, .service, .project { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 13rem; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-inner > :first-child { grid-column: 1 / -1; }
  .legal dl { grid-template-columns: 1fr; gap: .1rem; }
  .legal dd { margin-bottom: .8rem; }
}
@media (max-width: 420px) {
  .site-nav { gap: .25rem 1.1rem; }
}

/* ---------- photographs (Markus's own) ---------- */
.band { position: relative; isolation: isolate; }
.has-photo { overflow: hidden; }
.band-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.has-photo::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, rgba(22, 54, 42, .95) 0%, rgba(22, 54, 42, .86) 42%, rgba(22, 54, 42, .62) 100%);
}

/* page heads: one photo per page, set via the body class */
.page-work, .page-projects, .page-about, .page-contact { --head-photo: none; }
.page-work     { --head-photo: url("../img/photos/misty-canopy-800.jpg"); }
.page-projects { --head-photo: url("../img/photos/forest-floor-800.jpg"); }
.page-about    { --head-photo: url("../img/photos/green-woodland-800.jpg"); }
.page-contact  { --head-photo: url("../img/photos/pines-and-sand-800.jpg"); }
@media (min-width: 801px) {
  .page-work     { --head-photo: url("../img/photos/misty-canopy-1800.jpg"); }
  .page-projects { --head-photo: url("../img/photos/forest-floor-1800.jpg"); }
  .page-about    { --head-photo: url("../img/photos/green-woodland-1800.jpg"); }
  .page-contact  { --head-photo: url("../img/photos/pines-and-sand-1800.jpg"); }
}
.page-work .page-head, .page-projects .page-head, .page-about .page-head, .page-contact .page-head {
  background:
    linear-gradient(100deg, rgba(22, 54, 42, .95) 0%, rgba(22, 54, 42, .88) 45%, rgba(22, 54, 42, .7) 100%),
    var(--head-photo) center / cover no-repeat,
    var(--forest);
}
