/* matthiasschiller.de: calm space, large type, no boxes. Light and dark follow the system. */
:root { --screen: 100vh; --header: 68px; --page: #ffffff; --text: #0e1838; --muted: #56627f; --accent: #0a7d5c; --line: #e3e8f2; color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  :root { --page: #0c1430; --text: #eaf1fb; --muted: #97a8c8; --accent: #5fe6b8; --line: #1f2c55; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); font: 18px/1.55 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
a { color: inherit; text-underline-offset: 4px; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; }

/* One language at a time. Without JavaScript the page shows both, header and footer in German. */
html[data-lang="de"] [data-l="en"], html[data-lang="en"] [data-l="de"] { display: none; }
html:not(.js) span[data-l="en"] { display: none; }

/* The header stays at the top; its text keeps the width of the page. */
.top { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px;
  padding: 14px max(24px, calc((100% - 1312px) / 2)); background: color-mix(in srgb, var(--page) 90%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.top a { text-decoration: none; font-weight: 700; }
.top nav { display: flex; gap: 8px 24px; flex-wrap: wrap; }
/* The mark is the S of the surname: it stands on the baseline in "Matthias Schiller". */
.top .brand { font-size: 28px; line-height: 1.4; letter-spacing: -.02em; white-space: nowrap; }
.top .brand:hover { color: inherit; }
.mark { width: 1.14em; height: 1.14em; vertical-align: -.058em; margin: 0 -.095em 0 -.1em; }
.mark path { stroke-width: 7; }
/* Start page: the mark draws itself once while the page loads. */
@media (prefers-reduced-motion: no-preference) {
  .mark.draw path { stroke-dasharray: 1 2; animation: draw 1.6s .3s cubic-bezier(.55, .05, .3, 1) backwards; }
  .mark.draw circle { transform-box: fill-box; transform-origin: center; animation: arrive .5s 1.8s cubic-bezier(.2, 1.8, .4, 1) backwards; }
}
@keyframes draw { from { stroke-dashoffset: 1; opacity: 0; } 2% { opacity: 1; } to { stroke-dashoffset: 0; } }
@keyframes arrive { from { transform: scale(0); } }
.top .languages { display: flex; gap: 12px; }
/* On pages that open with a full-screen scene the header lies on top of it. */
.top.over { position: fixed; left: 0; right: 0; }
html:not(.js) .top.over { position: static; }
.top .languages a { color: var(--muted); }
html[data-lang="de"] .languages a[hreflang="de"], html[data-lang="en"] .languages a[hreflang="en"] { color: var(--text); text-decoration: underline; text-decoration-thickness: 2px; }

/* Heading and navigation stay on the left while the content scrolls. */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; max-width: 1360px; margin: 0 auto; padding: 140px 24px 40px; }
.split.page { padding-top: calc(var(--screen) * .09); }
.side { position: sticky; top: calc(var(--header) + 40px); align-self: start; }
.side h1, .side h2 { scroll-margin-top: calc(var(--header) + 40px); font-size: clamp(34px, 4vw, 52px); line-height: 1.05; letter-spacing: -.028em; margin: 0 0 16px; hyphens: auto; }
.side > p { color: var(--muted); max-width: 34ch; margin: 0 0 32px; }
.side nav a { display: flex; align-items: center; gap: 16px; padding: 9px 0; color: var(--muted); text-decoration: none; font-weight: 600; }
.side nav a::before { content: ""; width: 28px; height: 2px; background: currentColor; transition: width .2s; flex: none; }
.side nav a:hover, .side nav a:focus-visible, .side nav a.current { color: var(--text); }
.side nav a:hover::before, .side nav a.current::before { width: 64px; }
.side nav { margin-top: 24px; }

.block { scroll-margin-top: calc(var(--header) + 24px); margin-bottom: 80px; max-width: 68ch; }
.block h2, .block h3 { font-size: 26px; line-height: 1.25; letter-spacing: -.012em; margin: 0 0 16px; }
.block h3 ~ h3 { margin-top: 40px; }
.block p, .block ul, .block ol, .block dl { margin: 0 0 18px; }
.block ul, .block ol { padding-left: 22px; }
.block li { margin-bottom: 10px; }
.block dt { font-weight: 700; margin-top: 28px; }
.block dd { margin: 6px 0 0; color: var(--muted); }
.lead { font-size: 24px; line-height: 1.4; }

.rows > div { padding: 18px 0; transition: opacity .2s; }
.rows h3 { font-size: 18px; margin: 0 0 4px; }
.rows p { margin: 0; color: var(--muted); }
@media (hover: hover) { .rows:hover > div { opacity: .55; } .rows > div:hover { opacity: 1; } }

.more { font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

.foot { max-width: 1360px; margin: 0 auto; padding: 40px 24px 56px; color: var(--muted); font-size: 15px; display: flex; flex-wrap: wrap; gap: 8px 28px; }

/* Screenshots and their overlay (gallery.js). */
a.zoom { display: block; cursor: zoom-in; margin-bottom: 20px; }
.shot { display: block; width: 100%; height: auto; border-radius: 4px; }
.lightbox { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(6, 12, 28, .96); color: #fff; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: transparent; }
.lightbox img { max-width: calc(100vw - 128px); max-height: calc(100vh - 112px); max-height: calc(100dvh - 112px); cursor: pointer; }
.lightbox p { position: absolute; bottom: 12px; left: 0; right: 0; margin: 0; text-align: center; font-size: 15px; }
.lightbox button { position: absolute; width: 44px; height: 44px; padding: 0 0 4px; border: 0; background: none; color: #fff; font: 32px/1 -apple-system, sans-serif; cursor: pointer; opacity: .75; }
.lightbox button:hover { opacity: 1; }
.lightbox .previous { left: 10px; top: calc(50% - 22px); }
.lightbox .next { right: 10px; top: calc(50% - 22px); }
.lightbox .close { right: 10px; top: 10px; }
html:has(.lightbox[open]) { overflow: hidden; }

@media (max-width: 820px) {
  .split { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 72px; }
  .split.page { padding-top: 32px; }
  .side { position: static; }
  .side nav { display: none; }
  .block { margin-bottom: 56px; }
}
@media (max-width: 560px) {
  /* Name and languages in the first row, the links below. */
  :root { --header: 80px; }
  .top { justify-content: flex-start; gap: 2px 20px; padding: 8px 24px 10px; font-size: 16px; }
  .top .brand { font-size: 24px; }
  .top nav { display: contents; }
  .top .languages { margin-left: auto; }
  .top nav > a { order: 1; }
  .top::after { content: ""; flex-basis: 100%; height: 0; margin-top: -2px; }
  .lightbox img { max-width: calc(100vw - 16px); }
  .lightbox .previous, .lightbox .next { top: auto; bottom: 48px; }
  .lightbox .previous { left: calc(50% - 56px); }
  .lightbox .next { right: calc(50% - 56px); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
