/* Cenk Aydin: academic website
   ---------------------------------------------------------------
   Accessibility (WCAG 2.2, aiming for AAA where practical):
   - Text contrast at least 7:1 in light and dark themes; UI borders and focus rings at least 3:1.
   - Motion is opt-in: transitions only run under prefers-reduced-motion: no-preference.
   - Targets at least 44x44 px (Apple HIG default, WCAG 2.5.5); never below 24 px (2.5.8).
   - Focus is never hidden by the sticky header (scroll-padding, 2.4.11).
   - prefers-contrast: more and forced-colors (Windows High Contrast) supported.
   Typography follows Apple's Dynamic Type scale (17 pt body) with no light weights.
   Colours from the Figma draft: #244572 #2C558C #305D99 #3465A6 #4483D9 #719DD9 #EEF0F2 */

:root {
  color-scheme: light dark;

  /* ===== Colour: "ink & lamplight" =====
     Tonal palettes generated in OKLCH from the brand blue #244572 (hue 257), Material-3 style.
     Roles follow Apple's semantic colours: they name a PURPOSE, never a look.
       primary   = ink blue   -> brand + everything interactive (links, buttons, focus). Nothing else.
       secondary = teal       -> low-emphasis containers (tonal buttons, selected nav, chips).
       tertiary  = amber      -> "aydin" (Turkish: enlightened, bright). Small emphasis only:
                                 section labels, badges, "now" markers, the light beam.
       label 1-3              -> text hierarchy (headings -> body -> metadata), all >= 7:1. Near-neutral ink.
       surface -> container   -> background depth hierarchy (Apple: system/secondary/tertiary bg).
                                 Warm "paper" neutrals, so blue stays meaningful instead of everywhere.
     Every text pair is >= 7:1 (WCAG AAA), every outline >= 3:1, in light and dark. */
  --surface:            light-dark(#FAF7F3, #111821);  /* page */
  --surface-low:        light-dark(#E5F4F3, #0D201E);  /* alternate section */
  --surface-container:  light-dark(#EEEBE5, #19212C);  /* footer, hover fills */
  --surface-high:       light-dark(#E7E2DB, #1F2834);
  --card:               light-dark(#FFFFFF, #1B232F);  /* surface-container-lowest (light) / raised (dark) */

  --label:   light-dark(#0F1621, #EBEFF4);  /* headings, strongest text      ~17:1 */
  --label-2: light-dark(#313943, #CBD2DB);  /* body text                     ~10:1 */
  --label-3: light-dark(#3D444F, #B6BECB);  /* metadata, captions            ~8:1  */
  --separator: light-dark(#DCD7CF, #2A313B); /* decorative dividers only */
  --outline:   light-dark(#626A75, #7D8796); /* interactive outlines >= 3:1 */

  --primary:          light-dark(#244572, #B8D5FF);
  --on-primary:       light-dark(#FFFFFF, #001536);
  --primary-hover:    light-dark(#1B3A63, #D2E4FF);
  --primary-container:    light-dark(#DDEBFE, #012C61);
  --on-primary-container: light-dark(#00204B, #DDEBFE);
  --link:   light-dark(#1B4782, #A9CBFF);
  --focus:  light-dark(#1E5FC0, #A9CBFF);

  --secondary:              light-dark(#044F4B, #7ECFC9);  /* secondary text/icons (low emphasis) */
  --secondary-container:    light-dark(#BEEEEA, #043E3C);
  --on-secondary-container: light-dark(#012D2B, #CBEDEA);

  --tertiary:               light-dark(#663D00, #FBB45A);
  --tertiary-container:     light-dark(#FFE5CB, #442700);
  --on-tertiary-container:  light-dark(#331C01, #FFE5CB);
  --glow:                   light-dark(rgb(251 168 65 / .24), rgb(251 168 65 / .16)); /* lamplight, decorative */
  --glow-hover:             light-dark(rgb(251 168 65 / .5), rgb(251 168 65 / .18)); /* badge hover glow; text stays >= 7:1 */
  --glow-2:                 light-dark(rgb(53 151 146 / .14), rgb(88 183 177 / .12));  /* teal haze, decorative */

  --band:         light-dark(#244572, #06162C);  /* ink band: highest-emphasis surface */
  --on-band:      #FFFFFF;
  --on-band-2:    #C8DFFE;                      /* 7.1:1 on light band, 15:1 on dark */
  --on-band-accent: #FFDDB8;                    /* amber on band, 7.5:1 */
  --line:   light-dark(#359792, #58B7B1);       /* decorative strokes (teal) */
  --beam:   light-dark(#DA890F, #FBB45A);       /* decorative amber stroke ("the light") */
  --brand:    light-dark(#244572, #EBEFF4);
  --on-brand: light-dark(#FAF7F3, #244572);

  /* type: Apple Dynamic Type (Large size), 1pt = 1px */
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --fs-display: clamp(2.5rem, 1.6rem + 4vw, 4rem);      /* hero name */
  --fs-large:   clamp(2.125rem, 1.7rem + 1.8vw, 2.75rem); /* Large Title 34 */
  --fs-title1:  clamp(1.75rem, 1.5rem + 1vw, 2rem);       /* Title 1 28 */
  --fs-title2:  1.375rem;   /* Title 2 22 */
  --fs-title3:  1.25rem;    /* Title 3 20 */
  --fs-body:    1.0625rem;  /* Body 17 */
  --fs-callout: 1rem;       /* Callout 16 */
  --fs-subhead: .9375rem;   /* Subhead 15 */
  --fs-footnote:.8125rem;   /* Footnote 13 (smallest size used) */

  /* space: 4/8-pt grid */
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4rem; --s9: 6rem;
  --section: clamp(var(--s8), 8vw, var(--s9));
  --wrap: 70rem;
  --measure: 68ch;
  --radius: 10px;
  --target: 2.75rem;   /* 44 px */
  --header-h: 4.5rem;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--s4));   /* WCAG 2.4.11 */
}
body {
  margin: 0;
  background: var(--surface);
  color: var(--label-2);
  font: 400 var(--fs-body)/1.6 var(--font);
  overflow-wrap: break-word;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { color: var(--label); margin: 0 0 var(--s4); text-wrap: balance; }
h1 { font-size: var(--fs-large); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
h2 { font-size: var(--fs-title1); font-weight: 700; line-height: 1.2; letter-spacing: -.015em; }
h3 { font-size: var(--fs-title3); font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
p, ul, ol, dl { margin: 0 0 var(--s4); }
/* Line breaking: no orphans in body text, balanced short lines, no mid-word splits, keep names together */
p, li, dd, address { text-wrap: pretty; hyphens: manual; overflow-wrap: break-word; }
.role, .lead, .eyebrow, .card-meta, .cta-card p, .timeline .when, .timeline .inst { text-wrap: balance; }
.nobr { white-space: nowrap; }
@media (max-width: 20rem) { .nobr { white-space: normal; } }  /* never force sideways scrolling */

strong, b { font-weight: 650; }
::selection { background: var(--tertiary-container); color: var(--on-tertiary-container); }
@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
a { color: var(--link); text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .14em; }
code, pre { font-family: var(--mono); font-size: .9em; }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.band :focus-visible { outline-color: var(--on-band); }

.wrap { width: min(100% - 2 * var(--s5), var(--wrap)); margin-inline: auto; }
.prose { max-width: var(--measure); }
.visually-hidden:not(:focus):not(:active) {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* Skip link: first focusable element */
.skip {
  position: absolute; left: var(--s4); top: var(--s2); z-index: 20;
  padding: var(--s3) var(--s4); background: var(--primary); color: var(--on-primary);
  font-weight: 600; border-radius: var(--radius); transform: translateY(-200%);
}
.skip:focus { transform: none; }
main:focus { outline: none; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid var(--separator);
}
.header-inner { display: flex; align-items: center; gap: var(--s5); min-height: var(--header-h); }
.brand {
  display: flex; align-items: center; gap: var(--s3); min-height: var(--target);
  color: var(--label); text-decoration: none; margin-right: auto;
  font-size: var(--fs-title3); font-weight: 700; letter-spacing: -.02em;
}
.logo { width: 2.25rem; height: 2.25rem; flex: none; }
.logo-arc { stroke: var(--brand); }
.logo-node { fill: var(--brand); }
.logo-fixed { fill: var(--beam); }   /* the fold's fixed point: amber, the "emphasis" role */

.nav ul { display: flex; gap: var(--s1) var(--s2); list-style: none; margin: 0; padding: 0; }
.nav a {
  display: inline-flex; align-items: center; min-height: var(--target); padding: 0 var(--s3);
  color: var(--label-2); text-decoration: none; font-size: var(--fs-callout); font-weight: 500;
  border-radius: 8px; position: relative;
}
.nav a:hover { color: var(--label); background: var(--surface-container); }
.nav a[aria-current="page"] {
  color: light-dark(var(--on-secondary-container), var(--on-tertiary-container));
  background: light-dark(var(--secondary-container), var(--tertiary-container));
  font-weight: 650;
}
.nav a[aria-current="page"]::after {          /* not colour alone (WCAG 1.4.1) */
  content: ""; position: absolute; left: var(--s3); right: var(--s3); bottom: .45rem;
  height: 2px; background: currentColor; border-radius: 1px;
}

.theme-toggle {
  display: inline-grid; place-items: center; width: var(--target); height: var(--target); flex: none;
  padding: 0; border: 1px solid var(--outline); border-radius: 50%;
  background: transparent; color: var(--label); cursor: pointer;
}
.theme-toggle:hover { background: var(--surface-container); }
.theme-toggle svg { width: 1.25rem; height: 1.25rem; }
.theme-toggle .moon, :root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

/* Menu button: hidden on wide screens (and without JS, where the links simply wrap below) */
.nav-toggle {
  display: none; align-items: center; gap: var(--s2); min-height: var(--target); padding: 0 var(--s4) 0 var(--s3);
  border: 1px solid var(--outline); border-radius: 999px; background: transparent;
  color: var(--label); font: inherit; font-size: var(--fs-callout); font-weight: 600; cursor: pointer;
}
.nav-toggle:hover { background: var(--surface-container); }
.burger { width: 1.375rem; height: 1.375rem; }
.burger path { transform-box: view-box; }
.burger .b1 { transform-origin: 12px 7px; }   /* each bar rotates about its own centre, then moves to (12,12) */
.burger .b2 { transform-origin: 12px 12px; }
.burger .b3 { transform-origin: 12px 17px; }
.nav-toggle[aria-expanded="true"] .b1 { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .b2 { opacity: 0; }
.nav-toggle[aria-expanded="true"] .b3 { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 44rem) {
  /* No JS: links wrap onto a second row, all still 44 px targets */
  :root:not(.js) { --header-h: 7.25rem; }
  :root:not(.js) .header-inner { flex-wrap: wrap; gap: 0 var(--s4); padding-block: var(--s2); }
  :root:not(.js) .nav { order: 3; width: 100%; margin-inline: calc(-1 * var(--s3)); }
  :root:not(.js) .nav ul { justify-content: space-between; }

  /* With JS: one compact row (brand · theme · Menu) and a full-width drop-down panel */
  .js .header-inner { gap: var(--s2); }
  .js .theme-toggle { order: 2; }
  .js .nav { order: 3; }
  .js .nav-toggle:not([hidden]) { display: inline-flex; }
  .js .nav ul {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0; padding: var(--s2) var(--s5) var(--s5);
    background: var(--surface); border-bottom: 1px solid var(--separator);
    box-shadow: 0 16px 24px -16px rgb(0 0 0 / .25);
    max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
  }
  .js .nav-toggle[aria-expanded="true"] + ul { display: flex; }
  .js .nav li + li { border-top: 1px solid var(--separator); }
  .js .nav a { display: flex; min-height: 3.25rem; padding: 0 var(--s2); font-size: var(--fs-title3); border-radius: 6px; }
  .js .nav a[aria-current="page"]::after { left: auto; right: var(--s2); top: 50%; bottom: auto; width: .5rem; height: .5rem; border-radius: 50%; transform: translateY(-50%); }
}
/* Very small screens / 400% zoom (WCAG 1.4.10): don't let the sticky header eat the viewport */
@media (max-width: 22rem), (max-height: 30rem) {
  .site-header { position: static; }
  .js .site-header { position: relative; }
  html { scroll-padding-top: var(--s4); }
}

/* ---------- shared text styles ---------- */
.eyebrow {
  display: block; margin: 0 0 var(--s3);
  color: var(--tertiary); font-size: var(--fs-footnote); font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em; line-height: 1.4;
}
.lead { font-size: var(--fs-title3); line-height: 1.5; color: var(--label-2); max-width: 38rem; }
.role { font-size: var(--fs-title2); font-weight: 500; line-height: 1.35; color: var(--label); margin-bottom: var(--s5); }
.small { font-size: var(--fs-subhead); color: var(--label-3); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; padding: clamp(var(--s8), 10vh, 7.5rem) 0 var(--section);
  background: var(--surface);
}
/* Decorative light: masked so it fades to nothing before the hero ends, so the next section blends in */
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 40rem 26rem at 86% 48%, var(--glow), transparent 70%),
    radial-gradient(ellipse 50rem 30rem at 8% 0%, var(--glow-2), transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
}
.hero .wrap { position: relative; z-index: 1; }
.hero-text { max-width: 42rem; }
.hero h1 { font-size: var(--fs-display); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin-bottom: var(--s3); }
h1.eyebrow { font-size: var(--fs-footnote); font-weight: 700; letter-spacing: .12em; line-height: 1.4; margin: 0 0 var(--s3); color: var(--tertiary); }
.hero-motif { position: absolute; right: 0; top: 50%; transform: translateY(-45%); width: min(30vw, 24rem); color: var(--brand); pointer-events: none; }
.hero-motif .tail { stroke: var(--beam); }
.hero-motif .now { stroke: var(--beam); }
.hero-motif .mid { stroke: var(--line); }
@media (max-width: 60rem) { .hero-motif { display: none; } }

/* Home hero: text + portrait. The portrait is the motif's large "now" circle: amber ring, beam to the
   right edge, and the two smaller ink/teal circles above it (all decorative). */
.hero-grid { display: grid; gap: var(--s6) var(--s8); align-items: center; grid-template-columns: 1fr; }
.hero-grid .hero-text { order: 1; }
.portrait { order: 0; position: relative; margin: 0; width: clamp(9rem, 38vw, 12rem); justify-self: start; }
.portrait img {
  display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%;
  background: var(--surface-container);
  box-shadow: 0 0 0 5px var(--surface), 0 0 0 9px var(--beam), 0 0 48px 12px var(--glow);
}
.portrait .beam { position: absolute; top: 50%; left: calc(100% + 9px); width: 100vw; height: 4px; margin-top: -2px; background: var(--beam); border-radius: 2px; }
.portrait .dot { position: absolute; border-radius: 50%; border-style: solid; }
/* small ink + teal circles sit in the empty top-left corner of the portrait's box (never over text) */
.portrait .dot-1 { width: 8%; aspect-ratio: 1; border-width: 3px; border-color: #3764A1; left: -14%; top: -14%; }
.portrait .dot-2 { width: 12%; aspect-ratio: 1; border-width: 4px; border-color: var(--line); left: -2%; top: -2%; }
@media (min-width: 52rem) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) auto; }
  .hero-grid .hero-text { order: 0; }
  .portrait { order: 1; width: clamp(15rem, 26vw, 21rem); margin-right: clamp(var(--s6), 6vw, var(--s9)); }
}
@media (max-width: 51.99rem) { .portrait .dot { display: none; } }
@media (forced-colors: active) { .portrait img { border: 3px solid CanvasText; } .portrait .beam { background: CanvasText; } }

/* ---------- buttons & chips ---------- */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-top: var(--s6); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--target); padding: var(--s3) var(--s5);
  background: var(--primary); color: var(--on-primary); border: 2px solid var(--primary);
  font-size: var(--fs-body); font-weight: 600; line-height: 1.2; text-decoration: none;
  border-radius: var(--radius);
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { background: var(--secondary-container); color: var(--on-secondary-container); border-color: transparent; }
.btn-ghost:hover { background: var(--surface-high); border-color: var(--outline); }
.band .btn-ghost { background: transparent; color: var(--on-band); border-color: var(--on-band-2); }
.band .btn-ghost:hover { background: rgb(255 255 255 / .1); }

.ids { display: flex; flex-wrap: wrap; gap: var(--s2); list-style: none; padding: 0; margin: var(--s6) 0 0; }
.ids a {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--target); padding: 0 var(--s4);
  border: 1px solid var(--outline); border-radius: 999px;
  color: var(--label); text-decoration: none; font-size: var(--fs-subhead); font-weight: 500;
}
.ids a:hover, .ids a:focus-visible { background: var(--tertiary-container); color: var(--on-tertiary-container); border-color: var(--beam); }
.ids svg { width: 1.1rem; height: 1.1rem; fill: currentColor; flex: none; }

/* ---------- sections ---------- */
.section { padding: var(--section) 0; }
.section.alt {
  background: linear-gradient(180deg, transparent, var(--surface-low) var(--s9), var(--surface-low) calc(100% - var(--s9)), transparent);
}
/* The ink band floats on the paper as a large rounded panel: no hard full-width edges */
.band { margin-inline: clamp(var(--s2), 2.5vw, var(--s6)); border-radius: clamp(20px, 3vw, 36px); }
.band + .section, .section + .band { margin-top: var(--s5); }
main > .band:first-child { margin-top: var(--s5); }
main > .band:last-child { margin-bottom: var(--s8); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s2) var(--s6); margin-bottom: var(--s6); }
.section-head h2 { margin: 0; }
.section-head a { display: inline-flex; align-items: center; min-height: var(--target); font-weight: 600; }
.page-intro { margin-bottom: var(--s7); }
.page-intro h1 { margin-bottom: var(--s4); }

.grid-2.center { align-items: center; }
.grid-2 { display: grid; gap: var(--s6) var(--s8); grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.topics { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s5); }
.topics li { padding-left: var(--s6); position: relative; }
.topics li::before { content: ""; position: absolute; left: 0; top: .4em; width: .8rem; height: .8rem; border: 2px solid var(--secondary); border-radius: 50%; }
.topics strong { display: block; color: var(--label); font-size: var(--fs-body); font-weight: 600; }
.topics span { color: var(--label-3); font-size: var(--fs-subhead); }

/* Dark band with light cards (draft: Articles page) */
.band { background: var(--band); color: var(--on-band); --focus: var(--on-band); }
.band h1, .band h2, .band > .wrap > p, .band .section-head a { color: var(--on-band); }
.band .eyebrow { color: var(--on-band-accent); }
.band dl.facts dt { color: var(--on-band-2); }
.band .prose, .band p { color: var(--on-band); }
.band a:not(.btn) { color: var(--on-band); }

/* ---------- cards ---------- */
.cards { display: grid; gap: var(--s5); list-style: none; margin: 0; padding: 0; }
/* Reserve space while articles load so nothing below jumps (CLS) */
.cards[aria-busy="true"] { min-height: 100svh; }
.card {
  background: var(--card); color: var(--label-2); --focus: light-dark(#1E5FC0, #A9C9F3);
  padding: clamp(var(--s5), 4vw, var(--s7)); border-radius: var(--radius);
  display: grid; gap: var(--s4) var(--s7); grid-template-columns: 1fr;
}
.band .card p, .band .card a:not(.btn) { color: inherit; }
.band .card a:not(.btn) { color: var(--link); }
.band .card .authors, .band .card .card-meta { color: var(--label-3); }
@media (min-width: 52rem) { .card.has-meta { grid-template-columns: 9rem 1fr; } }
.card h2, .card h3 { font-size: var(--fs-title2); font-weight: 600; line-height: 1.3; letter-spacing: -.01em; margin-bottom: var(--s2); color: var(--label); }
.card :is(h2, h3) a { color: var(--label) !important; text-decoration: none; }
.card :is(h2, h3) a:hover { text-decoration: underline; }
.card p { margin-bottom: var(--s3); }
.card-meta { color: var(--label-3); font-size: var(--fs-subhead); line-height: 1.45; }
.card-meta .year { display: block; font-size: var(--fs-title1); font-weight: 700; color: var(--label); letter-spacing: -.02em; line-height: 1.1; margin-bottom: var(--s1); }
.authors { color: var(--label-3); font-size: var(--fs-subhead); }
.authors strong { color: var(--label-2); }
.venue { font-style: italic; }
.links { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s5); padding: 0; margin: var(--s2) 0 0; list-style: none; font-size: var(--fs-subhead); }
.links a { display: inline-flex; align-items: center; min-height: var(--target); font-weight: 500; }
.tag {
  display: inline-block; padding: .1rem .55rem; margin-left: var(--s1); border-radius: 999px;
  background: var(--secondary-container); color: var(--on-secondary-container); border: 1px solid transparent;
  font-size: var(--fs-footnote); font-weight: 600; letter-spacing: .04em; vertical-align: .2em;
}

.tag--paper    { background: var(--primary-container);  color: var(--on-primary-container); }
.tag--preprint { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.tag--talk, .tag--thesis { background: var(--surface-high); color: var(--label); }
.authors strong { color: var(--label); }

details.cite { margin-top: var(--s2); }
details.cite summary {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--target);
  cursor: pointer; color: var(--link); font-size: var(--fs-subhead); font-weight: 600;
}
details.cite pre { margin: var(--s2) 0 0; padding: var(--s4); overflow-x: auto; background: var(--surface); border: 1px solid var(--separator); border-radius: 8px; line-height: 1.5; color: var(--label-2); }
.status { color: var(--on-band); }

.cta-card {
  background: var(--card); color: var(--label-2); margin-top: var(--s5); padding: clamp(var(--s5), 4vw, var(--s7));
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s5); border-radius: var(--radius);
}
.cta-card > div:first-child { flex: 1 1 26rem; }
.cta-card h2 { color: var(--label) !important; margin-bottom: var(--s2); }
.cta-card p { margin: 0; color: var(--label-2) !important; max-width: 46ch; }
.cta-card .actions { margin: 0; }
.band .cta-card .btn-ghost { background: var(--secondary-container); color: var(--on-secondary-container); border-color: transparent; }

/* ---------- about ---------- */
/* Same journey as the timeline (ink #3764A1 -> teal #359792 -> amber #DA890F), sampled in 8 equal OKLCH steps */

/* Timeline: vertical by default (small screens), horizontal from 52rem */
/* Timeline: vertical by default (small screens), horizontal from 52rem.
   Each step draws the connector to the next one: solid for what happened, dashed towards what is planned. */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s6); position: relative; }
.timeline li { position: relative; display: grid; grid-template-columns: 3rem 1fr; column-gap: var(--s4); align-items: start; }
.timeline li > :not(.milestone) { grid-column: 2; }
.timeline .milestone { grid-row: 1 / span 4; width: 3rem; height: 3rem; margin: 0; font-size: .6875rem; z-index: 1; }
.timeline li:not(:last-child)::after {
  content: ""; position: absolute; left: calc(1.5rem - 2px); top: 1.5rem; width: 4px; height: calc(100% + var(--s6));
  background: linear-gradient(in oklch 180deg, #3764A1, #359792); border-radius: 2px;
}
.timeline li.current::after { background: repeating-linear-gradient(180deg, var(--beam) 0 8px, transparent 8px 16px); }
@media (min-width: 52rem) {
  .timeline { grid-template-columns: repeat(3, 1fr); }
  .timeline li { display: block; }
  .timeline .milestone { width: 4rem; height: 4rem; margin-bottom: var(--s4); font-size: var(--fs-footnote); }
  .timeline li:not(:last-child)::after { left: 2rem; top: calc(2rem - 2px); height: 4px; width: calc(100% + var(--s6)); background: linear-gradient(in oklch 90deg, #3764A1, #359792); }
  .timeline li.current::after { background: repeating-linear-gradient(90deg, var(--beam) 0 8px, transparent 8px 16px); }
}
.milestone { display: grid; place-items: center; width: 4rem; height: 4rem; border-radius: 50%; background: #3764A1; color: #fff; font-size: var(--fs-footnote); font-weight: 700; margin-bottom: var(--s4); position: relative; }
.timeline li.current .milestone { background: #055956; box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--beam), 0 0 24px 6px var(--glow); }
.timeline li.planned .milestone { background: var(--surface); color: var(--label); border: 3px dashed var(--beam); }
.timeline li.planned .when { color: var(--label-2); }
.timeline li.planned h3 { color: var(--label-2); font-weight: 600; }
.timeline .now, .timeline .badge-planned {
  display: inline-block; margin-left: var(--s2); padding: 0 .5rem; border-radius: 999px;
  font-size: var(--fs-footnote); font-weight: 700; vertical-align: .25em;
}
.timeline .now { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.timeline .badge-planned { color: var(--tertiary); border: 1.5px dashed var(--beam); }
.timeline h3 { margin-bottom: var(--s1); }
.timeline .when { display: block; font-size: var(--fs-title2); font-weight: 700; color: var(--label); letter-spacing: -.01em; }
.timeline .inst { font-weight: 600; font-size: var(--fs-subhead); color: var(--label); margin-bottom: var(--s2); }
.timeline p { color: var(--label-3); font-size: var(--fs-subhead); }

/* Dated entries (teaching, before university): date column + entry; stacks on small screens */
.list-title { margin: var(--s8) 0 var(--s4); font-size: var(--fs-title3); }
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s5); max-width: 52rem; }
.entries li { display: grid; gap: var(--s1) var(--s5); }
.entries .when { font-size: var(--fs-subhead); font-weight: 600; color: var(--label-2); font-variant-numeric: tabular-nums; }
.entries strong { display: block; color: var(--label); font-size: var(--fs-body); font-weight: 600; }
.entries div span { color: var(--label-3); font-size: var(--fs-subhead); }
@media (min-width: 40rem) { .entries li { grid-template-columns: 11rem 1fr; } .entries .when { padding-top: .1em; } }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--s3) var(--s5); margin: 0; }
dl.facts dt { font-size: var(--fs-subhead); font-weight: 600; }
dl.facts dd { margin: 0; }
dl.facts a { display: inline-flex; align-items: center; min-height: var(--target); margin-block: calc(-1 * var(--s3)); }
@media (max-width: 30rem) { dl.facts { grid-template-columns: 1fr; gap: 0; } dl.facts dd { margin-bottom: var(--s3); } }

/* ---------- footer ---------- */
.site-footer { background: var(--surface-container); padding: var(--s8) 0 var(--s6); font-size: var(--fs-subhead); border-top: 1px solid var(--separator); }
.footer-grid { display: grid; gap: var(--s6); grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); color: var(--label-3); }
.footer-brand .logo { width: 3rem; height: 3rem; }
.footer-brand strong { color: var(--label); font-size: var(--fs-title3); letter-spacing: -.02em; }
.site-footer h2 { font-size: var(--fs-body); font-weight: 600; margin-bottom: var(--s2); letter-spacing: 0; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul a { display: inline-flex; align-items: center; column-gap: .28em; min-height: var(--target); color: var(--label-2); text-decoration: none; } /* gap: flex drops the space before "(Datenschutz)" */
.site-footer a:hover { color: var(--label); text-decoration: underline; }
.site-footer address { font-style: normal; line-height: 1.6; color: var(--label-2); }
.site-footer address a { display: inline-flex; align-items: center; min-height: var(--target); }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s2) var(--s5);
  margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--separator); color: var(--label-3); font-size: var(--fs-footnote);
}
.footer-bottom a { color: var(--label-3); display: inline-flex; align-items: center; min-height: var(--target); }

/* ---------- motion: opt-in only ---------- */
@media (prefers-reduced-motion: no-preference) {
  .btn, .nav a, .ids a, .theme-toggle, a { transition: background-color .15s ease, border-color .15s ease, color .15s ease, text-decoration-thickness .15s ease; }
  .skip { transition: transform .15s ease; }
  .burger path { transition: transform .2s ease, opacity .2s ease; }
}

/* ---------- interaction details (driven by the end of js/site.js) ---------- */
/* Profile badges: an amber glow under the pointer. Peak alphas keep text contrast at least 7:1. */
.ids a { position: relative; overflow: hidden; isolation: isolate; }
.ids a::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; pointer-events: none;
  background: radial-gradient(circle 4.5rem at var(--mx, 50%) var(--my, 50%), var(--glow-hover), transparent 72%);
}
.ids a:hover::before { opacity: 1; }

/* Bullet points: the one in the reading zone fills its ring and lifts its text one step */
.topics li.reading::before { background: var(--secondary); }
.topics li.reading span { color: var(--label-2); }

/* Brand: overlay drawn by JS while the name turns into the logo (letters are faded/moved inline) */
.brand { position: relative; }
.bn span { position: relative; }
.bn .bn-five { position: absolute; font-size: .62em; line-height: 1; opacity: 0; pointer-events: none; }
.brand .morph { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; opacity: 0; }
.brand.morphing .morph { opacity: 1; }
.brand.morphed .morph { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .ids a::before { transition: opacity .25s ease; }
  .topics li::before, .topics li span { transition: background-color .35s ease, color .35s ease; }

  .brand:not(.morphing) .bn span, .brand:not(.morphing) .logo { transition: opacity .25s ease; }

  /* Timeline: nodes appear one after another while the line grows from B.Sc. towards the PhD;
     then the planned stretch (M.Sc. -> PhD) pulses amber three times (under 5 s, WCAG 2.2.2). */
  .timeline.will-in li::after { transform-origin: top; transition: transform .7s cubic-bezier(.3, .7, .2, 1) .35s; }
  .timeline.will-in li:nth-child(2)::after { transition-delay: 1.15s; }
  .timeline.will-in:not(.in) li::after { transform: scaleY(0); }
  .timeline.will-in .milestone { transition: opacity .4s ease, transform .55s cubic-bezier(.3, 1.4, .5, 1); }
  .timeline.will-in li:nth-child(2) .milestone { transition-delay: .9s; }
  .timeline.will-in li:nth-child(3) .milestone { transition-delay: 1.7s; }
  .timeline.will-in:not(.in) .milestone { opacity: 0; transform: scale(.6); }
  .timeline.in li.current::after { animation: amber-pulse 1.4s ease-in-out 2.1s 3; }
  @media (min-width: 52rem) {
    .timeline.will-in li::after { transform-origin: left; }
    .timeline.will-in:not(.in) li::after { transform: scaleX(0); }
  }
}
@keyframes amber-pulse { 50% { opacity: .3; } }

/* ---------- more contrast (Apple "Increase Contrast" / prefers-contrast) ---------- */
@media (prefers-contrast: more) {
  :root {
    --label: light-dark(#000000, #FFFFFF); --label-2: light-dark(#000000, #FFFFFF); --label-3: light-dark(#14181F, #F2F4F8);
    --link: light-dark(#002A66, #D2E4FF); --tertiary: light-dark(#4A2C00, #FFD4A7); --secondary: light-dark(#003532, #B5F0EB);
    --surface: light-dark(#FFFFFF, #000A18); --surface-low: light-dark(#FFFFFF, #000A18); --card: light-dark(#FFFFFF, #000A18);
    --surface-container: light-dark(#F0F2F5, #0B1A2E);
    --outline: light-dark(#000000, #FFFFFF); --separator: light-dark(#5A5A5A, #A0A0A0); --band: light-dark(#10264A, #000814);
    --glow: transparent;
  }
  .card, .cta-card { border: 2px solid var(--outline); }
  .nav a, .ids a, .section-head a { text-decoration: underline; }
}

/* ---------- Windows High Contrast / forced colours ---------- */
@media (forced-colors: active) {
  .logo-arc { stroke: CanvasText; }
  .logo-node, .logo-fixed { fill: CanvasText; }
  .hero-motif, .hero-motif .tail, .hero-motif .now, .hero-motif .mid { color: CanvasText; stroke: CanvasText; }
  .btn, .ids a, .theme-toggle, .card, .cta-card { border: 1px solid ButtonText; }
  .nav a[aria-current="page"]::after { background: Highlight; }
  .milestone { forced-color-adjust: none; }
  :focus-visible { outline-color: Highlight; }
}

/* ---------- print ---------- */
@media print {
  .site-header, .site-footer, .hero-motif, .theme-toggle, .skip, details.cite summary { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .band, .card, .cta-card { background: none !important; color: #000 !important; padding: 0; }
  a { color: #000; } a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
}

/* ---------- legal pages + footer legal links ---------- */
.legal h2 { margin-top: var(--s7); }
.legal h3 { margin-top: var(--s5); margin-bottom: var(--s2); font-size: var(--fs-body); font-weight: 650; }
.legal code { font-size: .875em; padding: .05em .3em; border-radius: 4px; background: var(--surface-container); }
.site-footer .legal-links { display: flex; flex-wrap: wrap; gap: 0 var(--s4); list-style: none; margin: 0; padding: 0; }
.site-footer .legal-links a { text-transform: none; letter-spacing: 0; font-size: var(--fs-footnote); color: var(--label-3); }
