/* ==========================================================================
   Bowen Yuan — Academic research portfolio
   Single light-theme design system. Modern minimalist academic.

   Contents
   01. Tokens
   02. Fonts
   03. Reset
   04. Typography
   05. Layout
   06. Header
   07. Hero
   08. Buttons & links
   09. Chips, tags & badges
   10. Sections
   11. Projects
   12. Video
   13. Publications
   14. CV
   15. Contact
   16. Footer
   17. Utilities
   18. Responsive
   19. Print
   ========================================================================== */


/* ==========================================================================
   01. Tokens
   ========================================================================== */

:root {
  color-scheme: light;

  /* Palette — client-mandated light academic. */
  --bg: #faf7f2;              /* page */
  --surface: #ffffff;         /* cards, header, footer */
  --text: #18262b;            /* primary text */
  --accent: #277a65;          /* brand green */
  --accent-strong: #1f6352;   /* hover / emphasis green */
  --accent-tint: #e8f2ee;     /* soft accent surface */
  --accent-border: #cfe3da;   /* soft accent border */
  --border: #e5e8e4;          /* hairline borders */
  --border-strong: #d3d9d5;   /* hover border */
  --muted: #5f6b68;           /* accessible secondary text (5.19:1 on --bg) */
  --decor-muted: #76817e;     /* NON-TEXT decoration only (fails AA as text) */
  --tag-bg: #f1eee7;          /* neutral chip surface */
  --tag-border: #e3dfd6;

  /* Typefaces */
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;

  /* Type scale */
  --text-body: 1.0625rem;   /* 17px */
  --text-lead: 1.0625rem;
  --text-small: 0.9375rem;  /* 15px */
  --text-meta: 0.8125rem;   /* 13px */
  --text-chip: 0.75rem;     /* 12px */
  --text-btn: 0.875rem;     /* 14px */
  --leading: 1.65;

  /* Spacing — 4px based scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Layout */
  --container: 1120px;
  --gutter: 24px;
  --section-y: clamp(3.5rem, 7vw, 5.5rem);
  --measure: 68ch;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 9px;
  --radius-lg: 12px;
  --radius-xl: 14px;

  /* Motion — restrained only */
  --ease: ease;
  --fast: 120ms var(--ease);

  /* Elevation — barely-there, light only */
  --shadow-sm: 0 1px 2px rgba(24, 38, 43, 0.05);
}


/* ==========================================================================
   02. Fonts (self-hosted, latin subset)
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-latin-var.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Source Serif 4';
  src: url('/fonts/source-serif-4-600-latin.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}


/* ==========================================================================
   03. Reset
   ========================================================================== */

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

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

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

ul,
ol {
  padding: 0;
}

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

img {
  height: auto;
}

button {
  font: inherit;
  color: inherit;
}

summary {
  cursor: pointer;
}

[hidden] {
  display: none;
}


/* ==========================================================================
   04. Typography
   ========================================================================== */

html {
  font-size: 100%;
}

body {
  font-family: var(--sans);
  font-size: var(--text-body);
  line-height: var(--leading);
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
  overflow-wrap: break-word;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--fast);
}

a:hover {
  color: var(--accent-strong);
}

strong,
b {
  font-weight: 600;
}

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


/* ==========================================================================
   05. Layout
   ========================================================================== */

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page__main {
  flex: 1 0 auto;
}

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

/* Nested containers never double their gutters. */
.container .container {
  padding-inline: 0;
  max-width: none;
}

/* Section anchors clear the sticky header. */
[id] {
  scroll-margin-top: 5.5rem;
}

@media (min-width: 768px) {
  :root {
    --gutter: 40px;
  }
}


/* ==========================================================================
   06. Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  min-height: 4rem;
  padding-block: 0.5rem;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.75rem, 3vw, 2rem);
  width: 100%;
  min-width: 0;
}

.nav__brand {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--fast);
}

.nav__brand:hover {
  color: var(--accent-strong);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(0.625rem, 2vw, 1.625rem);
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.nav__link {
  display: inline-block;
  font-family: var(--sans);
  font-size: var(--text-small);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  padding-block: 0.25rem;
  transition: color var(--fast);
}

.nav__link:hover {
  color: var(--accent);
}

.nav__link[aria-current] {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}


/* ==========================================================================
   07. Hero
   ========================================================================== */

.hero {
  /* Portrait is sized against the bio: one knob drives both the image and the
     grid column that holds it. */
  --portrait-size: 9.5rem; /* 152px */

  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 5vw, 3.5rem);
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    'portrait'
    'content';
  row-gap: clamp(1.5rem, 4vw, 2rem);
  align-items: start;
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.hero__content {
  grid-area: content;
  min-width: 0;
}

.hero__portrait {
  grid-area: portrait;
  justify-self: start;
  min-width: 0;
}

.hero__avatar {
  width: var(--portrait-size);
  height: var(--portrait-size);
  object-fit: cover;
  object-position: center 20%;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background-color: var(--tag-bg);
}

.hero__eyebrow {
  font-family: var(--sans);
  font-size: var(--text-chip);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.875rem;
}

.hero__title {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 0.5rem;
  overflow-wrap: break-word;
}

.hero__positioning {
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 1.6vw, 1.375rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 1.25rem;
}

.hero__intro {
  max-width: 60ch;
  font-size: var(--text-lead);
  line-height: var(--leading);
  color: var(--muted);
  margin: 0;
}

.hero__tags {
  margin-top: 1.5rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

@media (min-width: 768px) {
  .hero {
    --portrait-size: 13rem; /* 208px */
  }

  .hero__inner {
    grid-template-columns: minmax(0, 1fr) var(--portrait-size);
    grid-template-areas: 'content portrait';
    column-gap: clamp(2rem, 4vw, 3.5rem);
    align-items: start;
  }

  .hero__portrait {
    justify-self: end;
    /* Drop the portrait so it is optically centred against the intro block
       (eyebrow -> bio) instead of hanging from the eyebrow line. */
    margin-top: calc(var(--portrait-size) * 0.15);
  }
}

@media (min-width: 1024px) {
  .hero {
    --portrait-size: 16rem; /* 256px */
  }
}


/* ==========================================================================
   08. Buttons & inline links
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6875rem 1.125rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--sans);
  font-size: var(--text-btn);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color var(--fast),
    background-color var(--fast),
    border-color var(--fast);
}

.btn--primary {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn--primary:hover {
  background-color: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff;
}

.btn--secondary {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn--secondary:hover {
  border-color: var(--accent-border);
  color: var(--accent-strong);
}

.btn .icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.btn__hint {
  font-size: var(--text-chip);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #ffffff;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--sans);
  font-size: var(--text-btn);
  font-weight: 600;
  line-height: 1.3;
  color: var(--accent);
  text-decoration: none;
  padding-bottom: 1px;
  border-bottom: 1px solid transparent;
  transition:
    color var(--fast),
    border-color var(--fast);
}

.link-arrow:hover {
  color: var(--accent-strong);
  border-bottom-color: var(--accent-strong);
}

.link-arrow .icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: currentColor;
  fill: currentColor;
  transition: transform var(--fast);
}

.link-arrow:hover .icon {
  transform: translateX(2px);
}

.icon {
  display: inline-block;
  flex-shrink: 0;
}


/* ==========================================================================
   09. Chips, tags & badges — one consolidated visual language
   ========================================================================== */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 8px;
  border: 1px solid var(--tag-border);
  border-radius: var(--radius-sm);
  background-color: var(--tag-bg);
  font-family: var(--sans);
  font-size: var(--text-chip);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.005em;
  color: var(--muted);
  overflow-wrap: break-word;
}

.venue-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  background-color: var(--accent-tint);
  font-family: var(--sans);
  font-size: var(--text-chip);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.005em;
  color: var(--accent-strong);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--sans);
  font-size: var(--text-chip);
  font-weight: 500;
  line-height: 1.35;
  color: var(--muted);
  white-space: nowrap;
}

.status__dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background-color: var(--decor-muted);
  border: 1px solid transparent;
}

.status--published {
  color: var(--accent-strong);
}

.status--published .status__dot {
  background-color: var(--accent);
  border-color: var(--accent);
}

.status--accepted {
  color: var(--accent-strong);
}

.status--accepted .status__dot {
  background-color: transparent;
  border-color: var(--accent);
}

.status--progress .status__dot {
  background-color: var(--decor-muted);
}


/* Legacy in-page anchor alias (#projects -> #research). The id only needs to
   exist as a scroll target; [id] above provides the sticky-header offset. */
.section__anchor {
  display: block;
  height: 0;
  overflow: hidden;
}

/* ==========================================================================
   10. Sections
   ========================================================================== */

.section {
  padding-block: var(--section-y);
}

.section__header {
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.section__eyebrow {
  font-family: var(--sans);
  font-size: var(--text-chip);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.section__title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0;
  max-width: 26ch;
}

.section__lede {
  max-width: 62ch;
  margin: 0.75rem 0 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
}


/* ==========================================================================
   11. Projects
   ========================================================================== */

.project-list {
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 3.5vw, 2.5rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.project {
  position: relative;
  min-width: 0;
  background-color: var(--surface);
  border: 1px solid var(--border);
}

/* Featured cards: mobile DOM order is the reading order; grid areas reorder
   to media-left / information-right from 900px. */
.project--featured {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    'meta'
    'title'
    'media'
    'summary'
    'result'
    'tags'
    'actions'
    'details';
  row-gap: 0.625rem;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border-radius: var(--radius-xl);
  transition: border-color var(--fast);
}

.project--featured > * {
  min-width: 0;
}

/* Media-less featured card: one column at every breakpoint. */
.project--wide {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    'meta'
    'title'
    'summary'
    'result'
    'tags'
    'actions'
    'details';
}

.project--compact {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  min-width: 0;
  padding: clamp(1.125rem, 2.4vw, 1.625rem);
  border-radius: var(--radius-lg);
}

.project__meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  margin: 0;
  font-family: var(--sans);
  font-size: var(--text-meta);
  line-height: 1.5;
  color: var(--muted);
}

.project__meta-item {
  display: inline-flex;
  align-items: center;
}

/* One publication record inside the card meta line. Keeping each record in its
   own flex row means a multi-publication project wraps between venues rather
   than splitting a badge or status from its venue. */
.project__meta-pub {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.project__title {
  grid-area: title;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0;
  overflow-wrap: break-word;
}

.project__title a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition:
    color var(--fast),
    border-color var(--fast);
}

.project__title a:hover {
  color: var(--accent-strong);
  border-bottom-color: var(--accent);
}

.project__media {
  grid-area: media;
  align-self: start;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.project__media > .video,
.project__media > img {
  width: 100%;
}

/* Compact cards are flex columns, where start-alignment would collapse the
   media to its intrinsic width — keep it full width instead. */
.project--compact .project__media {
  align-self: stretch;
}

.project__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 10px;
  background-color: var(--tag-bg);
}

.project__summary {
  grid-area: summary;
  max-width: var(--measure);
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
}

.project__result {
  grid-area: result;
  margin: 0;
  padding: 0.625rem 0.875rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background-color: var(--accent-tint);
  font-size: var(--text-small);
  line-height: 1.55;
  color: var(--text);
}

.project__result-label {
  display: block;
  margin-bottom: 0.125rem;
  font-family: var(--sans);
  font-size: var(--text-chip);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.project__tags {
  grid-area: tags;
  margin: 0;
}

.project__actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.125rem;
  margin: 0;
}

/* No external actions for a project: keep the stack rhythm intact. */
.project__actions:not(:has(a)) {
  display: none;
}

.project--compact .project__title {
  font-size: 1.125rem;
}

.project__details {
  grid-area: details;
  margin: 0;
  padding-top: 0.125rem;
  min-width: 0;
}

.project__details summary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  width: max-content;
  max-width: 100%;
  list-style: none;
  font-family: var(--sans);
  font-size: var(--text-btn);
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted);
  transition: color var(--fast);
}

.project__details summary::-webkit-details-marker {
  display: none;
}

.project__details summary::marker {
  content: '';
}

.project__details summary::after {
  content: '+';
  font-size: 1rem;
  line-height: 1;
  color: var(--accent);
}

.project__details[open] summary::after {
  content: '−';
}

.project__details summary:hover {
  color: var(--accent-strong);
}

.project__details-body {
  max-width: var(--measure);
  margin-top: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--muted);
}

.project__details-body p + p {
  margin-top: 0.75rem;
}

.project-list--compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.25rem, 2.5vw, 1.75rem);
  align-items: start;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 900px) {
  .project--featured {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    grid-template-areas:
      'media meta'
      'media title'
      'media summary'
      'media result'
      'media tags'
      'media actions'
      'media details';
    column-gap: clamp(1.5rem, 3vw, 2.5rem);
    row-gap: 0.625rem;
  }

  .project--wide {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'meta'
      'title'
      'summary'
      'result'
      'tags'
      'actions'
      'details';
  }

  .project-list--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* ==========================================================================
   12. Video (click-to-load YouTube)
   ========================================================================== */

.video {
  margin: 0;
  min-width: 0;
  max-width: 100%;
}

.video__poster {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background-color: var(--tag-bg);
}

.video__thumb {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Decorative fallback plate: shows when the YouTube thumbnail cannot load
   (blocked CDN, offline). Quiet by design — it must never compete with a real
   thumbnail, and it is aria-hidden in the markup. */
.video__plate {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  /* Top-left slate: the centred play button would otherwise sit on top of
     centred fallback copy on 16:9 posters. */
  place-content: start start;
  justify-items: start;
  gap: 4px;
  padding: clamp(12px, 2.5vw, 20px);
  text-align: left;
  background-color: var(--tag-bg);
}

.video__plate-title {
  max-width: 90%;
  font-family: var(--serif);
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
  overflow-wrap: break-word;
}

.video__plate-meta {
  font-family: var(--sans);
  font-size: clamp(0.625rem, 1.8vw, 0.6875rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.video__play {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 3.5rem; /* 56px */
  height: 3.5rem;
  padding: 0;
  border: 1px solid var(--accent-border);
  border-radius: 50%;
  background-color: var(--surface);
  color: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(24, 38, 43, 0.18);
  transition:
    transform var(--fast),
    border-color var(--fast),
    color var(--fast);
}

.video__play:hover {
  transform: translate(-50%, -50%) scale(1.05);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.video__play:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.video__play-badge {
  display: grid;
  place-items: center;
  color: currentColor;
}

.video__play .icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  margin-left: 2px; /* optical centring of the play triangle */
}

.video__caption {
  margin-top: 0.5rem;
  font-size: var(--text-meta);
  line-height: 1.5;
  color: var(--muted);
}

.video__fallback {
  margin-top: 0.5rem;
  font-size: var(--text-meta);
  line-height: 1.5;
  color: var(--muted);
}

.video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background-color: var(--tag-bg);
}

.video__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}


/* ==========================================================================
   13. Publications
   ========================================================================== */

.publication-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.publication {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 0.375rem;
  border-top: 1px solid var(--border);
  padding-block: 1.375rem;
}

.publication__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0;
  font-family: var(--sans);
  font-size: var(--text-meta);
  line-height: 1.5;
  color: var(--muted);
}

.publication__type {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.publication__body {
  min-width: 0;
}

.publication__title {
  margin: 0 0 0.25rem;
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
  overflow-wrap: break-word;
}

.publication__title a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition:
    color var(--fast),
    border-color var(--fast);
}

.publication__title a:hover {
  color: var(--accent-strong);
  border-bottom-color: var(--accent);
}

.publication__authors {
  margin: 0;
  font-size: var(--text-small);
  line-height: 1.55;
  color: var(--muted);
}

/* Conference location / dates, shown only when the record carries them. */
.publication__event {
  margin: 0.25rem 0 0;
  font-size: var(--text-meta);
  line-height: 1.5;
  color: var(--muted);
}

.publication__author--self {
  font-weight: 600;
  color: var(--text);
}

.publication__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 0.5rem;
}

.publication__note {
  font-size: var(--text-meta);
  color: var(--muted);
}

@media (min-width: 768px) {
  .publication {
    grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
    column-gap: clamp(1.5rem, 3vw, 2rem);
    row-gap: 0.25rem;
    align-items: start;
    padding-block: 1.5rem;
  }

  .publication__meta {
    grid-column: 1;
    grid-row: 1;
  }

  .publication__body {
    grid-column: 2;
    grid-row: 1;
  }
}


/* ==========================================================================
   14. CV
   ========================================================================== */

.cv-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.cv-card__body {
  min-width: 0;
}

.cv-card__title {
  margin: 0 0 0.25rem;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
}

.cv-card__text {
  max-width: 60ch;
  margin: 0;
  font-size: var(--text-small);
  line-height: 1.6;
  color: var(--muted);
}

.cv-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}


/* ==========================================================================
   15. Contact
   ========================================================================== */

.contact-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact {
  min-width: 0;
  padding: clamp(1.125rem, 2.2vw, 1.375rem);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--fast);
}

.contact:hover {
  border-color: var(--accent-border);
}

.contact__label {
  margin: 0 0 0.375rem;
  font-family: var(--sans);
  font-size: var(--text-chip);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact__value {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.contact__value a {
  color: inherit;
  text-decoration: none;
  transition: color var(--fast);
}

.contact__value a:hover {
  color: var(--accent-strong);
}

@media (min-width: 640px) {
  .contact-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* ==========================================================================
   16. Footer
   ========================================================================== */

.site-footer {
  margin-top: 4.5rem;
  padding-block: 2.5rem;
  border-top: 1px solid var(--border);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.site-footer__note {
  margin: 0;
  font-size: var(--text-meta);
  line-height: 1.5;
  color: var(--muted);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.125rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__links a {
  font-size: var(--text-meta);
  line-height: 1.5;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--fast);
}

.site-footer__links a:hover {
  color: var(--accent-strong);
}


/* ==========================================================================
   17. Utilities
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  color: var(--text);
  font-size: var(--text-btn);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--fast);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

/* Suppress the default outline only where :focus-visible already applies. */
:focus:not(:focus-visible) {
  outline: none;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@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;
  }
}


/* ==========================================================================
   18. Responsive
   ========================================================================== */

/* Small phones: the header must keep brand + 4 links on one row. */
@media (max-width: 600px) {
  .site-header__inner {
    min-height: 3.5rem;
    padding-block: 0.375rem;
  }

  .nav {
    gap: 0.75rem;
  }

  .nav__brand {
    font-size: 1rem;
  }

  .nav__links {
    gap: clamp(0.5rem, 2.5vw, 0.875rem);
  }

  .nav__link {
    font-size: var(--text-chip);
    letter-spacing: 0;
  }

  .hero__title {
    font-size: clamp(2.25rem, 9vw, 2.75rem);
  }

  .project--featured,
  .project--compact {
    padding-inline: clamp(1rem, 4vw, 1.25rem);
  }
}

@media (max-width: 360px) {
  .site-header__inner {
    padding-block: 0.25rem;
  }

  .nav {
    gap: 0.5rem;
  }

  .nav__brand {
    font-size: 0.9375rem;
  }

  .nav__links {
    gap: 0.375rem;
  }

  .nav__link {
    font-size: 0.6875rem;
    letter-spacing: -0.005em;
  }

  /* On very small 16:9 posters the plate meta would enter the play button. */
  .video__plate-meta {
    display: none;
  }
}

@media (max-width: 640px) {
  .cv-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Touch devices: keep tap targets comfortable without changing density. */
@media (hover: none) {
  .project__details summary,
  .nav__link {
    padding-block: 0.375rem;
  }
}


/* ==========================================================================
   19. Print
   ========================================================================== */

@media print {
  html {
    font-size: 11pt;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .site-header,
  .skip-link,
  .video__play,
  .project__actions,
  .publication__actions,
  .site-footer__links {
    display: none;
  }

  .page {
    display: block;
    min-height: 0;
  }

  .container,
  .hero__inner {
    max-width: none;
    padding-inline: 0;
    margin-inline: 0;
  }

  .section,
  .hero {
    padding-block: 1.25rem;
  }

  .project,
  .cv-card,
  .contact,
  .publication,
  .video__poster,
  .project__result {
    break-inside: avoid;
  }

  .project,
  .cv-card,
  .contact {
    box-shadow: none;
  }

  a {
    color: #000000;
    text-decoration: underline;
  }

  .site-footer {
    margin-top: 1.5rem;
    padding-block: 1rem;
  }
}
