/* ==========================================================================
   Portfolio 2026 — dark, minimal, single page
   Type: Geist + Geist Mono (SIL OFL), self-hosted from ./fonts
   ========================================================================== */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/Geist-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/Geist-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/GeistMono-Regular.woff2") format("woff2");
}

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Color — dark only */
  --bg:        #0a0a0a;
  --surface:   #141414;
  --line:      #222222;
  --text:      #ededed;
  --muted:     #7d7d7d;
  --accent:    #ffffff;

  /* Type */
  --font-sans: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --fs-label:   0.8125rem;                              /* 13px */
  --fs-body:    clamp(1.0625rem, 0.98rem + 0.3vw, 1.25rem);
  --fs-title:   clamp(1.125rem, 1.05rem + 0.35vw, 1.375rem);
  --fs-display-sm: clamp(1.75rem, 1.3rem + 2vw, 3rem);
  --fs-display: clamp(2rem, 1.45rem + 2.4vw, 3.75rem);

  /* Space — 8pt scale */
  --s-1: 0.5rem;   /*  8 */
  --s-2: 1rem;     /* 16 */
  --s-3: 1.5rem;   /* 24 */
  --s-4: 2rem;     /* 32 */
  --s-6: 3rem;     /* 48 */
  --s-8: 4rem;     /* 64 */
  --s-12: 6rem;    /* 96 */
  --s-16: 8rem;    /* 128 */

  --gutter: clamp(1.25rem, 0.6rem + 3vw, 3rem);
  --max:    1440px;
  --section: clamp(var(--s-12), 8vw + 2rem, 11rem);

  --radius: 4px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  scroll-padding-top: var(--s-4);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, figure, dl, dd, ul { margin: 0; padding: 0; }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 1px solid var(--text); outline-offset: 4px; border-radius: 2px; }

::selection { background: var(--text); color: var(--bg); }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.muted { color: var(--muted); }

.label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.display {
  font-size: var(--fs-display);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.display--sm {
  font-size: var(--fs-display-sm);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  padding-top: clamp(var(--s-12), 11vw, 11rem);
  padding-bottom: var(--section);
}
.hero .display { max-width: 22ch; }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { padding-bottom: var(--section); }

/* Label column + content column, used by every section */
.split {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--s-3);
  row-gap: var(--s-4);
  padding-top: var(--s-2);
  border-top: 1px solid var(--line);
}
.split > .label { grid-column: 1 / span 4; }
.split__body   { grid-column: 5 / -1; }

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */
.prose {
  display: grid;
  gap: var(--s-3);
  max-width: 36ch;
  font-size: var(--fs-display-sm);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.prose a,
.mail {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--muted);
  transition: text-decoration-color 0.2s var(--ease);
}
.prose a:hover,
.mail:hover { text-decoration-color: var(--text); }

.facts {
  margin-top: var(--s-12);
  border-top: 1px solid var(--line);
}
.facts__row {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: var(--s-3);
  align-items: baseline;
  padding-block: var(--s-3);
  border-bottom: 1px solid var(--line);
}
.facts dd { font-size: var(--fs-body); }

/* --------------------------------------------------------------------------
   Talk
   -------------------------------------------------------------------------- */
.mail {
  display: inline-block;
  margin-top: var(--s-6);
  font-size: var(--fs-title);
  font-weight: 500;
}
.mail span {
  display: inline-block;
  text-decoration: none;
  transition: transform 0.3s var(--ease);
}
.mail:hover span { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
  padding-block: var(--s-4);
  border-top: 1px solid var(--line);
}
.footer__links { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); }
.footer__links a { color: var(--muted); transition: color 0.2s var(--ease); }
.footer__links a:hover { color: var(--text); }

/* --------------------------------------------------------------------------
   Brands ("Worked with")
   -------------------------------------------------------------------------- */

.brands__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: clamp(var(--s-6), 6vw, var(--s-12));
  row-gap: var(--s-6);
}
.brand {
  display: flex;
  align-items: center;
}
.brand img {
  height: clamp(1.5rem, 1.1rem + 0.8vw, 2rem);
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
/* Single-colour (black) logo files shown in white on the dark background */
.brand img.is-mono { filter: brightness(0) invert(1); }

/* --------------------------------------------------------------------------
   External link icon (any link that opens a new tab)
   -------------------------------------------------------------------------- */
a[target="_blank"]::after {
  content: "";
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-left: 0.22em;
  vertical-align: 0.02em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='square'%3E%3Cpath d='M3.5 2.5h6v6M9.25 2.75 2.5 9.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='square'%3E%3Cpath d='M3.5 2.5h6v6M9.25 2.75 2.5 9.5'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.25s var(--ease);
}
a[target="_blank"]:hover::after { transform: translate(1px, -1px); }

/* --------------------------------------------------------------------------
   Hover image ("workshop")
   -------------------------------------------------------------------------- */
.peek {
  position: relative;
  cursor: default;
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--muted);
  text-underline-offset: 0.18em;
  outline: none;
}
.peek__img {
  --dx: 0px;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.5em);
  z-index: 15;
  width: clamp(220px, 26vw, 400px);
  max-width: none;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transform: translate(calc(-50% + var(--dx)), 10px) rotate(-2deg);
  transition: opacity 0.3s var(--ease), transform 0.45s var(--ease);
}
.peek:hover .peek__img,
.peek:focus-visible .peek__img,
.peek.is-on .peek__img {
  opacity: 1;
  transform: translate(calc(-50% + var(--dx)), 0) rotate(-2deg);
}

/* --------------------------------------------------------------------------
   Teaching & speaking
   -------------------------------------------------------------------------- */
.entry {
  display: grid;
  grid-template-columns: 5rem 1fr auto;
  gap: var(--s-3);
  align-items: baseline;
  padding-block: var(--s-2);
  border-bottom: 1px solid var(--line);
}
.entry:first-child { padding-top: 0; }
.entry__title {
  font-size: var(--fs-title);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

@media (max-width: 720px) {
  .entry { grid-template-columns: 1fr auto; row-gap: 0.25rem; }
  .entry__title { grid-column: 1 / -1; grid-row: 2; }
}

/* --------------------------------------------------------------------------
   Projects — list with b/w previews; hover shows a stack of up to 4 images
   -------------------------------------------------------------------------- */
.index { margin: 0; padding: 0; list-style: none; }

/* Same sizes and rhythm as the Teaching & speaking list (.entry) */
.index__row {
  display: grid;
  grid-template-columns: 5rem 1fr auto;
  align-items: baseline;
  gap: var(--s-3);
  padding-block: var(--s-2);
  border-bottom: 1px solid var(--line);
  cursor: default;
  transition: color 0.3s var(--ease);
}
.index__row:first-child { padding-top: 0; }

.index__name {
  position: relative;
  justify-self: start;
  display: inline-flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: var(--fs-title);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
  outline: none;
}
/* Same treatment as the "workshop" hover link */
.index__text {
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--muted);
  text-underline-offset: 0.2em;
}
.index:hover .index__row:not(:hover),
.index:hover .index__row:not(:hover) .label { color: #3a3a3a; }
.index:hover .index__row:not(:hover) .index__text { text-decoration-color: #2a2a2a; }
a.index__text:hover { text-decoration-style: solid; text-decoration-color: var(--text); }

/* One small b/w preview per image — hover one to show it */
.index__thumbs { display: inline-flex; gap: 4px; transform: translateY(0.1em); }
.thumb {
  display: block;
  width: 30px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  outline: 1px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.25s var(--ease), opacity 0.3s var(--ease);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) brightness(0.45) contrast(1.1);
  transition: filter 0.3s var(--ease);
}
.index__row:hover .thumb img,
.index__row.is-open .thumb img { filter: grayscale(1) brightness(0.8) contrast(1.05); }
.thumb.is-on img,
.thumb:hover img { filter: grayscale(1) brightness(1.1) contrast(1.05) !important; }
.thumb.is-on,
.thumb:focus-visible { outline-color: var(--text); }
.index:hover .index__row:not(:hover) .thumb { opacity: 0.5; }

/* Hover stack — anchored above the name, like the workshop image */
.stack {
  --dx: 0px;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.35em);
  z-index: 15;
  width: clamp(340px, 38vw, 600px);
  aspect-ratio: 3 / 2;
  pointer-events: none;
  opacity: 0;
  transform: translate(calc(-50% + var(--dx)), 10px);
  transition: opacity 0.3s var(--ease), transform 0.45s var(--ease);
}
.index__row:hover .stack,
.index__name:focus-visible .stack {
  opacity: 1;
  transform: translate(calc(-50% + var(--dx)), 0);
}
.stack__card {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface) center / cover no-repeat;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  transition: transform 0.5s var(--ease);
}
.stack__card > img { width: 100%; height: 100%; object-fit: cover; }
.stack__card--1 { transform: rotate(-2deg); z-index: 3; }
.stack__card--2 { transform: translate(14px, -10px) rotate(2.5deg); z-index: 2; filter: brightness(0.55); }
.stack__card--3 { transform: translate(26px, -18px) rotate(6deg); z-index: 1; filter: brightness(0.35); }
.index__row:hover .stack__card--2 { transform: translate(18px, -12px) rotate(3.5deg); }
.index__row:hover .stack__card--3 { transform: translate(34px, -22px) rotate(8deg); }
/* Not enough room above: drop below the name */
.stack.is-below { bottom: auto; top: calc(100% + 0.6em); }
.stack.is-below .stack__card--2,
.index__row:hover .stack.is-below .stack__card--2 { transform: translate(16px, 10px) rotate(2.5deg); }
.stack.is-below .stack__card--3,
.index__row:hover .stack.is-below .stack__card--3 { transform: translate(30px, 18px) rotate(6deg); }

/* Inline image — touch devices: tap a row to open, tap the image for the next one */
.index__peek {
  position: relative;
  grid-column: 1 / -1;
  display: none;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius);
  background: var(--surface);
}
.index__peek > img { width: 100%; height: 100%; object-fit: cover; }

@media (hover: none), (max-width: 720px) {
  .stack { display: none; }
  /* Mirrors .entry on mobile: number + category on top, name below */
  .index__row { grid-template-columns: 1fr auto; row-gap: 0.35rem; }
  .index__row:has(.index__peek) { cursor: pointer; }
  .index__row > .label:first-child { grid-column: 1; grid-row: 1; }
  .index__cat { grid-column: 2; grid-row: 1; }
  .index__name { display: block; grid-column: 1 / -1; grid-row: 2; }
  .index__thumbs { display: flex; margin: 0.6rem 0 0.15rem; transform: none; }
  .thumb { width: 33px; height: 22px; }
  .index__peek { display: block; max-height: 0; opacity: 0; transition: max-height 0.5s var(--ease), opacity 0.4s var(--ease), margin 0.5s var(--ease); }
  .index__row.is-open .index__peek { max-height: 80vw; opacity: 1; margin-top: var(--s-2); }
  .index:hover .index__row:not(:hover),
  .index:hover .index__row:not(:hover) .label { color: inherit; }
  .index:hover .index__row:not(:hover) .index__text { text-decoration-color: var(--muted); }
  .index:hover .index__row:not(:hover) .thumb { opacity: 1; }
}

/* --------------------------------------------------------------------------
   "Talk" link — the only navigation, pinned top-right
   -------------------------------------------------------------------------- */
.toplink {
  position: fixed;
  top: var(--s-3);
  right: var(--gutter);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text);
  transition: border-color 0.25s var(--ease);
}
.toplink:hover { border-color: var(--muted); }
.toplink span { display: inline-block; transition: transform 0.25s var(--ease); }
.toplink:hover span { transform: translateY(2px); }


/* --------------------------------------------------------------------------
   Legal page (Impressum & Datenschutz)
   -------------------------------------------------------------------------- */
.legal { max-width: 62ch; font-size: var(--fs-body); line-height: 1.6; }
.legal h3 {
  margin: var(--s-6) 0 var(--s-1);
  font-size: var(--fs-title);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.legal h3:first-child { margin-top: 0; }
.legal p, .legal ul { margin: 0 0 var(--s-2); color: #c9c9c9; }
.legal ul { padding-left: 1.1em; list-style: disc; }
.legal li { margin-bottom: 0.35em; }
.legal a { text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 0.18em; }
.legal a:hover { text-decoration-color: var(--text); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .split > .label,
  .split__body { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .facts { margin-top: var(--s-8); }
  .facts__row { grid-template-columns: 1fr; gap: var(--s-1); }
  .footer { flex-direction: column-reverse; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
