/* ==========================================================================
   blancatena.com — single stylesheet for all pages
   Layer order keeps specificity flat and predictable.
   ========================================================================== */

@layer reset, tokens, base, layout, components, utilities;

/* --------------------------------------------------------------- @font-face */

@font-face {
  font-family: 'Newsreader';
  src: url('../fonts/newsreader-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Newsreader';
  src: url('../fonts/newsreader-latin-ext.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* -------------------------------------------------------------------- reset */

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

  html { -webkit-text-size-adjust: 100%; }

  body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol {
    margin: 0;
    padding: 0;
  }

  ul[class], ol[class] { list-style: none; }

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

  input, button, textarea, select { font: inherit; color: inherit; }

  :target { scroll-margin-block-start: 6rem; }
}

/* ------------------------------------------------------------------- tokens */

@layer tokens {
  :root {
    color-scheme: light dark;

    /* Palette. oklch keeps hue stable when lightness shifts between themes,
       which is why the dark green below still reads as the same green. */
    --ink:          oklch(24% 0.018 150);
    --ink-soft:     oklch(42% 0.016 150);
    --ink-faint:    oklch(56% 0.014 150);
    --surface:      oklch(98.5% 0.005 120);
    --surface-2:    oklch(96% 0.008 140);
    --surface-sunk: oklch(93.5% 0.010 140);
    --line:         oklch(89% 0.010 140);
    --line-strong:  oklch(80% 0.014 140);

    --accent:       oklch(38% 0.105 148);   /* the original #005700, tuned */
    --accent-hover: oklch(31% 0.100 148);
    --accent-ink:   oklch(98% 0.015 148);
    --accent-wash:  oklch(94% 0.030 148);

    --focus: oklch(55% 0.16 235);

    /* Type */
    --font-display: 'Newsreader', ui-serif, Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;

    --step--1: clamp(0.83rem, 0.81rem + 0.10vw, 0.90rem);
    --step-0:  clamp(1.00rem, 0.96rem + 0.20vw, 1.10rem);
    --step-1:  clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);
    --step-2:  clamp(1.45rem, 1.30rem + 0.75vw, 1.90rem);
    --step-3:  clamp(1.90rem, 1.55rem + 1.75vw, 2.80rem);
    /* Tuned so "Blanca Tena Estrada" fits on one line beside the portrait at
       every desktop width; it still wraps on phones, where it has to. */
    --step-4:  clamp(2.40rem, 1.55rem + 3.20vw, 4.30rem);

    /* Rhythm */
    --space-2xs: 0.375rem;
    --space-xs:  0.625rem;
    --space-s:   1rem;
    --space-m:   1.5rem;
    --space-l:   2.5rem;
    --space-xl:  4rem;
    /* Section padding — this is the space above a section heading and below the
       rule that separates it from the previous section. */
    --space-2xl: clamp(2rem, 1.5rem + 2.5vw, 3.25rem);

    /* --content-max is the page's outer width; --measure caps prose only, so a
       wide layout never turns paragraphs into unreadable 120-character lines. */
    --content-max: 68rem;
    --measure: 68ch;
    --gutter: clamp(1.25rem, 4vw, 3rem);
    --radius: 10px;
    --radius-s: 6px;

    --header-h: 4.25rem;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --ink:          oklch(93% 0.010 140);
      --ink-soft:     oklch(78% 0.012 140);
      --ink-faint:    oklch(64% 0.012 140);
      --surface:      oklch(17.5% 0.012 150);
      --surface-2:    oklch(21% 0.014 150);
      --surface-sunk: oklch(24% 0.016 150);
      --line:         oklch(29% 0.016 145);
      --line-strong:  oklch(38% 0.020 145);

      --accent:       oklch(76% 0.125 148);
      --accent-hover: oklch(84% 0.115 148);
      --accent-ink:   oklch(18% 0.030 148);
      --accent-wash:  oklch(27% 0.040 148);

      --focus: oklch(72% 0.14 225);
    }
  }

  @supports (interpolate-size: allow-keywords) {
    :root { interpolate-size: allow-keywords; }
  }
}

/* --------------------------------------------------------------------- base */

@layer base {
  html { scroll-behavior: smooth; }

  body {
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.65;
    color: var(--ink);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-synthesis-weight: none;
  }

  h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-weight: 500;
    line-height: 1.15;
    text-wrap: balance;
    color: var(--ink);
  }

  h1 { font-size: var(--step-4); letter-spacing: -0.02em; }
  h2 { font-size: var(--step-3); letter-spacing: -0.015em; }
  h3 { font-size: var(--step-1); letter-spacing: -0.005em; }

  p { text-wrap: pretty; }
  p + p { margin-block-start: var(--space-s); }

  a {
    color: var(--accent);
    text-decoration-color: color-mix(in oklab, var(--accent) 35%, transparent);
    text-underline-offset: 0.18em;
    text-decoration-thickness: 0.075em;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
  }
  a:hover {
    color: var(--accent-hover);
    text-decoration-color: currentColor;
  }

  :focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
    border-radius: 2px;
  }

  strong, b { font-weight: 600; }

  ::selection {
    background: var(--accent-wash);
    color: var(--ink);
  }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

/* ------------------------------------------------------------------- layout */

@layer layout {
  /* One grid drives every page. Children default to the content column;
     .bleed opts into the full viewport width. */
  .shell {
    display: grid;
    grid-template-columns:
      [full-start] minmax(var(--gutter), 1fr)
      [content-start] min(var(--content-max), 100% - (var(--gutter) * 2)) [content-end]
      minmax(var(--gutter), 1fr) [full-end];
  }
  .shell > * { grid-column: content; }
  .shell > .bleed { grid-column: full; }

  main { display: block; }

  .section {
    padding-block: var(--space-2xl);
    scroll-margin-block-start: calc(var(--header-h) + 1rem);
  }
  .section + .section { border-block-start: 1px solid var(--line); }

  /* A single centred column at every width — heading above its content, the
     whole block centred in the viewport by the .shell grid. The column is wide;
     prose inside it is capped at --measure so lines stay readable. */
  .section--labelled { display: grid; gap: var(--space-m); }
  .section__body { min-inline-size: 0; }

  .stack > * + * { margin-block-start: var(--space-s); }
  .stack-l > * + * { margin-block-start: var(--space-l); }

  .skip-link {
    position: absolute;
    inset-block-start: 0.5rem;
    inset-inline-start: 0.5rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    background: var(--accent);
    color: var(--accent-ink);
    border-radius: var(--radius-s);
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-200%);
    transition: transform 0.18s ease;
  }
  .skip-link:focus-visible {
    transform: translateY(0);
    color: var(--accent-ink);
  }
}

/* --------------------------------------------------------------- components */

@layer components {

  /* ---- Site header ---- */

  .site-header {
    position: sticky;
    inset-block-start: 0;
    z-index: 50;
    background: color-mix(in oklab, var(--surface) 82%, transparent);
    border-block-end: 1px solid var(--line);
    backdrop-filter: saturate(150%) blur(12px);
    -webkit-backdrop-filter: saturate(150%) blur(12px);
  }
  /* Browsers without backdrop-filter get a solid bar rather than a smeared one. */
  @supports not (backdrop-filter: blur(1px)) {
    .site-header { background: var(--surface); }
  }

  .site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xs) var(--space-m);
    width: min(var(--content-max), 100% - (var(--gutter) * 2));
    margin-inline: auto;
    min-block-size: var(--header-h);
    padding-block: 0.75rem;
  }

  .site-header__name {
    font-family: var(--font-display);
    font-size: var(--step-1);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
  }
  .site-header__name:hover { color: var(--accent); }

  .site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin-inline-start: auto;
  }
  .site-nav a {
    display: inline-block;
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius-s);
    font-size: var(--step--1);
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--ink-soft);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
  }
  .site-nav a:hover {
    color: var(--ink);
    background: var(--surface-2);
  }
  .site-nav a[aria-current='page'] {
    color: var(--accent);
    background: var(--accent-wash);
  }
  .site-nav a.is-cta {
    color: var(--accent);
    border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
    margin-inline-start: 0.35rem;
  }
  .site-nav a.is-cta:hover {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
  }

  /* ---- Mobile navigation ---- */

  /* The hamburger and the inline links swap at 48rem, but only once the `js`
     class confirms the panel can actually be opened. Without JavaScript the
     inline nav simply stays and wraps, so the site is never left unnavigable. */
  .nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    inline-size: 2.75rem;
    block-size: 2.75rem;
    margin-inline: auto -0.5rem;
    border: 0;
    border-radius: var(--radius-s);
    background: none;
    color: var(--ink);
    cursor: pointer;
  }
  .nav-toggle:hover { background: var(--surface-2); }
  .nav-toggle svg { inline-size: 1.5rem; block-size: 1.5rem; }

  @media (max-width: 48rem) {
    .js .site-nav { display: none; }
    .js .nav-toggle { display: flex; }
  }

  .nav-panel {
    margin: 0 0 0 auto;          /* pin to the inline-end edge, full height */
    inline-size: min(20rem, 84vw);
    max-inline-size: none;
    block-size: 100dvh;
    max-block-size: none;
    padding: var(--space-s) var(--space-m) var(--space-l);
    border: 0;
    border-start-start-radius: var(--radius);
    border-end-start-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    box-shadow: -12px 0 40px -16px oklch(0% 0 0 / 0.45);
    transform: translateX(100%);
    transition:
      transform 0.26s ease,
      overlay 0.26s allow-discrete,
      display 0.26s allow-discrete;
  }
  .nav-panel[open] { transform: translateX(0); }

  .nav-panel::backdrop {
    background: oklch(12% 0.01 150 / 0.45);
    opacity: 0;
    transition:
      opacity 0.26s ease,
      overlay 0.26s allow-discrete,
      display 0.26s allow-discrete;
  }
  .nav-panel[open]::backdrop { opacity: 1; }

  /* Entry animation: without these the panel would jump straight to its open
     state on first paint instead of sliding in. */
  @starting-style {
    .nav-panel[open] { transform: translateX(100%); }
    .nav-panel[open]::backdrop { opacity: 0; }
  }

  .nav-panel__head {
    display: flex;
    justify-content: flex-end;
    margin-block-end: var(--space-s);
  }
  .nav-panel__close {
    display: grid;
    place-items: center;
    inline-size: 2.75rem;
    block-size: 2.75rem;
    margin-inline-end: -0.5rem;
    border: 0;
    border-radius: var(--radius-s);
    background: none;
    color: var(--ink-soft);
    cursor: pointer;
  }
  .nav-panel__close:hover { background: var(--surface-2); color: var(--ink); }
  .nav-panel__close svg { inline-size: 1.25rem; block-size: 1.25rem; }

  .nav-panel__links { display: flex; flex-direction: column; gap: 0.15rem; }
  .nav-panel__links a {
    display: block;
    padding: 0.75rem;
    border-radius: var(--radius-s);
    font-size: var(--step-0);
    font-weight: 500;
    color: var(--ink);
    text-decoration: none;
  }
  .nav-panel__links a:hover { background: var(--surface-2); }
  .nav-panel__links a[aria-current='page'] {
    color: var(--accent);
    background: var(--accent-wash);
  }
  .nav-panel__links a.is-cta {
    margin-block-start: var(--space-s);
    border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
    color: var(--accent);
    text-align: center;
  }

  /* ---- Hero ---- */

  .hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: clamp(var(--space-m), 5vw, 4.5rem);
    padding-block: var(--space-2xl) var(--space-xl);
  }
  .hero > picture { flex: none; }
  .hero__portrait {
    inline-size: clamp(9rem, 26vw, 22rem);
    /* block-size must be stated explicitly: the height="" attribute is a
       presentational hint, and a used height of 400px would otherwise beat
       aspect-ratio and render the portrait as an oval. */
    block-size: auto;
    aspect-ratio: 1;
    border-radius: 50%;
    object-fit: cover;
    justify-self: center;
    box-shadow: 0 0 0 1px var(--line), 0 12px 32px -12px oklch(0% 0 0 / 0.28);
  }
  /* No cap here: the h1 needs the full remaining width to sit on one line.
     The measure is applied to the prose below it instead. */
  .hero__body { flex: 1 1 26rem; }
  .hero__eyebrow {
    font-size: var(--step--1);
    font-weight: 500;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-block-end: var(--space-2xs);
  }
  .hero h1 { margin-block-end: var(--space-s); }
  .hero__lede {
    font-size: var(--step-1);
    line-height: 1.55;
    color: var(--ink-soft);
    max-inline-size: 46ch;
  }

  /* ---- Contact row ---- */

  .contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
    margin-block-start: var(--space-m);
  }
  .contact-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: var(--step--1);
    font-weight: 500;
    color: var(--ink-soft);
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
  }
  .contact-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-wash);
  }
  .contact-links svg {
    inline-size: 1.05em;
    block-size: 1.05em;
    flex: none;
  }

  /* ---- Section headings ---- */

  .section__title {
    margin-block-end: var(--space-l);
  }
  /* Inside a labelled section the grid gap already provides the separation —
     this override must live in the components layer, or the .section__title rule
     above (a later layer than `layout`) would win and the two would stack. */
  .section--labelled > .section__title { margin-block-end: 0; }
  .section__kicker {
    display: block;
    font-family: var(--font-body);
    font-size: var(--step--1);
    font-weight: 500;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--accent);
    margin-block-end: var(--space-2xs);
  }
  .subhead {
    font-family: var(--font-body);
    font-size: var(--step--1);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-block: var(--space-l) var(--space-m);
    padding-block-end: var(--space-2xs);
    border-block-end: 1px solid var(--line);
  }
  /* Only kill the leading margin when the subhead genuinely opens the section.
     :first-of-type would also match the "Education" subhead that follows the
     About prose, collapsing the space that separates them. */
  .section > .subhead:first-child,
  .section__body > .subhead:first-child { margin-block-start: 0; }

  /* ---- Publication entries ---- */

  .entry {
    padding-block: var(--space-m);
    border-block-end: 1px solid var(--line);
  }
  .entry:last-child { border-block-end: 0; }

  .entry__title {
    font-family: var(--font-display);
    font-size: var(--step-1);
    font-weight: 500;
    line-height: 1.3;
    margin-block-end: var(--space-2xs);
  }
  .entry__authors {
    font-size: var(--step--1);
    color: var(--ink-soft);
    margin-block-end: var(--space-xs);
  }
  .entry__authors .self { font-weight: 600; color: var(--ink); }

  /* Abstract toggle and PDF link share one row. When the abstract opens it takes
     a full row of its own, pushing the remaining links to the next line. */
  .entry__tools {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-2xs);
    margin-block-start: var(--space-xs);
  }
  .entry__tools > .abstract { margin-block-start: 0; }
  .entry__tools > .abstract[open] { flex-basis: 100%; }

  .tag {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--surface-sunk);
    color: var(--ink-soft);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    vertical-align: 0.15em;
  }

  .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-s);
    background: none;
    font-size: var(--step--1);
    font-weight: 500;
    color: var(--ink-soft);
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
  }
  .btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-wash);
  }
  .btn svg { inline-size: 1em; block-size: 1em; flex: none; }

  /* ---- Abstracts: native <details>, no JavaScript ---- */

  .abstract { margin-block-start: var(--space-xs); }

  .abstract > summary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-s);
    font-size: var(--step--1);
    font-weight: 500;
    color: var(--ink-soft);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
  }
  .abstract > summary::-webkit-details-marker { display: none; }
  .abstract > summary:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-wash);
  }
  .abstract > summary::before {
    content: '';
    inline-size: 0.55em;
    block-size: 0.55em;
    border-inline-end: 1.5px solid currentColor;
    border-block-end: 1.5px solid currentColor;
    transform: rotate(45deg) translate(-0.1em, -0.1em);
    transition: transform 0.2s ease;
  }
  .abstract[open] > summary::before {
    transform: rotate(-135deg) translate(-0.15em, -0.15em);
  }

  .abstract__body {
    padding: var(--space-m) 0 var(--space-2xs);
    font-size: var(--step--1);
    line-height: 1.7;
    color: var(--ink-soft);
  }
  /* The entry column is wide; the prose inside it must not be. */
  .abstract__body > p { max-inline-size: var(--measure); }
  .abstract__body > figure { max-inline-size: 46rem; }
  .abstract__body > p + p,
  .abstract__body > figure { margin-block-start: var(--space-m); }

  /* Animate open/close where supported; elsewhere the rule is simply ignored
     and <details> snaps open as it always has. */
  .abstract::details-content {
    block-size: 0;
    overflow: clip;
    transition:
      block-size 0.32s ease,
      content-visibility 0.32s allow-discrete;
  }
  .abstract[open]::details-content { block-size: auto; }

  /* ---- Figures ---- */

  figure { margin: 0; }
  figure img {
    inline-size: 100%;
    block-size: auto;
    border-radius: var(--radius);
    background: var(--surface-2);
  }
  figcaption {
    margin-block-start: var(--space-xs);
    font-size: var(--step--1);
    line-height: 1.5;
    color: var(--ink-faint);
  }

  /* ---- Teaching / education ---- */

  .institution {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-block: var(--space-l) var(--space-s);
    font-size: var(--step-1);
  }
  .section > .institution:first-child,
  .section__body > .institution:first-child { margin-block-start: 0; }
  /* Logos vary from 4.7:1 (Kassel) to 0.7:1 (Vigo). Pin the height and let the
     width follow — a tight max-inline-size would letterbox the wide ones down to
     a smear. inline-size:auto is required to beat the width="" attribute. */
  .institution img {
    block-size: 1.7em;
    inline-size: auto;
    max-inline-size: 11em;
    object-fit: contain;
    flex: none;
  }

  .course-list { display: grid; gap: 0; }
  .course {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem var(--space-s);
    padding-block: 0.7rem;
    border-block-end: 1px solid var(--line);
  }
  .course:last-child { border-block-end: 0; }
  .course__name { font-style: italic; }
  .course__meta {
    font-size: var(--step--1);
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
    /* Deliberately allowed to wrap. `white-space: nowrap` here forced a 317px
       minimum on the longest meta string, which a flex item will not shrink
       below — that pushed the whole page wider than a 320px screen. There is
       ample room on desktop, so it stays on one line there regardless. */
  }

  /* ---- About / education timeline ---- */

  .timeline { position: relative; }
  .timeline__item {
    position: relative;
    padding-inline-start: var(--space-m);
    padding-block-end: var(--space-l);
    border-inline-start: 1px solid var(--line);
  }
  .timeline__item:last-child { padding-block-end: 0; }
  .timeline__item::before {
    content: '';
    position: absolute;
    inset-block-start: 0.55em;
    inset-inline-start: -0.3rem;
    inline-size: 0.55rem;
    block-size: 0.55rem;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--surface);
  }
  .timeline__item h3 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: var(--step-1);
    margin-block-end: var(--space-2xs);
  }
  .timeline__item h3 img {
    block-size: 1.5em;
    inline-size: auto;
    max-inline-size: 9em;
    object-fit: contain;
    flex: none;
  }
  .timeline__meta {
    font-size: var(--step--1);
    color: var(--ink-faint);
    margin-block-end: var(--space-xs);
  }
  .timeline__item p { font-size: var(--step--1); line-height: 1.6; }
  .timeline__item p + p { margin-block-start: var(--space-2xs); }

  /* ---- Photography ---- */

  .gallery {
    columns: 3 20rem;
    column-gap: var(--space-s);
    margin-block-start: var(--space-l);
  }
  .gallery figure {
    break-inside: avoid;
    margin-block-end: var(--space-s);
  }
  .gallery button {
    display: block;
    inline-size: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
    border-radius: var(--radius);
    overflow: hidden;
  }
  .gallery img {
    inline-size: 100%;
    block-size: auto;
    background: var(--surface-2);
    transition: transform 0.4s cubic-bezier(0.2, 0, 0.2, 1), filter 0.3s ease;
  }
  .gallery button:hover img,
  .gallery button:focus-visible img {
    transform: scale(1.035);
    filter: brightness(1.04);
  }

  /* ---- Lightbox ---- */

  .lightbox {
    inline-size: min(94vw, 1800px);
    max-inline-size: none;
    max-block-size: 94dvh;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    overflow: visible;
  }
  .lightbox::backdrop {
    background: oklch(12% 0.01 150 / 0.88);
    backdrop-filter: blur(4px);
  }
  .lightbox img {
    inline-size: auto;
    max-inline-size: 100%;
    max-block-size: 88dvh;
    margin-inline: auto;
    border-radius: var(--radius);
  }
  .lightbox figcaption {
    margin-block-start: var(--space-xs);
    text-align: center;
    color: oklch(88% 0.01 140);
  }
  .lightbox__close {
    position: absolute;
    inset-block-start: -0.5rem;
    inset-inline-end: -0.5rem;
    inline-size: 2.5rem;
    block-size: 2.5rem;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 12px oklch(0% 0 0 / 0.35);
  }
  .lightbox__close:hover { background: var(--surface-2); }

  /* University logos are fixed-colour third-party PNGs — the Kassel wordmark is
     near-black and disappears on a dark background. Give them a white plate
     rather than filtering, which would destroy the brand colours. box-shadow
     spread is used instead of padding so the layout box is unaffected. */
  @media (prefers-color-scheme: dark) {
    .institution img,
    .timeline__item h3 img,
    .inline-logo {
      background: #fff;
      box-shadow: 0 0 0 0.3em #fff;
      border-radius: 2px;
    }
  }

  /* ---- Footer ---- */

  .site-footer {
    margin-block-start: var(--space-2xl);
    padding-block: var(--space-l);
    border-block-start: 1px solid var(--line);
    background: var(--surface-2);
  }
  .site-footer__inner {
    width: min(var(--content-max), 100% - (var(--gutter) * 2));
    margin-inline: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-s) var(--space-m);
    font-size: var(--step--1);
    color: var(--ink-faint);
  }
  .site-footer p { max-inline-size: 62ch; }
  .site-footer a { color: var(--ink-soft); }
  .site-footer a:hover { color: var(--accent); }
}

/* ---------------------------------------------------------------- utilities */

@layer utilities {
  .visually-hidden:not(:focus):not(:active) {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .measure { max-inline-size: var(--measure); }
  .push-s { margin-block-start: var(--space-s); }
  .inline-logo {
    display: inline-block;
    block-size: 1.3em;
    inline-size: auto;
    vertical-align: -0.25em;
    margin-inline-end: 0.35em;
  }
  .lede { font-size: var(--step-1); line-height: 1.55; color: var(--ink-soft); }
  .muted { color: var(--ink-faint); }
  .defer-render { content-visibility: auto; contain-intrinsic-size: auto 800px; }
}

/* Cross-document fade, Chromium only, ignored elsewhere. */
@view-transition { navigation: auto; }

@media print {
  .site-header, .site-footer, .btn, .gallery { display: none; }
  .abstract::details-content { block-size: auto; }
  body { background: #fff; color: #000; }
}
