 /* ============================================================
   RUGGERO VALLI — Personal website
   Main stylesheet

   TABLE OF CONTENTS
   1.  Design tokens
   2.  Reset & base
   3.  Skip link (accessibility)
   4.  Header & navigation
   5.  Mobile hamburger
   6.  Buttons
   7.  Sections & backgrounds
   8.  Container
   9.  Utilities
   10. Hero section
   11. Research interests (home)
   12. Gallery & lightbox
   13. Image–text pairs (decorative)
   14. Project split (research page)
   15. Research page
   16. Decorative diary photos
   17. CV page
   18. Talks & outreach
   19. Gravity simulation
   20. Footer
   21. Scroll-reveal animation
   22. Responsive (≤960 px, ≤600 px)
   23. Accessibility: reduced motion
   ============================================================ */


/* ── 1. Design tokens ─────────────────────────────────────── */

@font-face {
  font-family: 'Figtree';
  src: url('../assets/fonts/figtree/Figtree-VariableFont_wght.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
}

@font-face {
  font-family: 'Figtree';
  src: url('../assets/fonts/figtree/Figtree-Italic-VariableFont_wght.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
}

:root {
  /* Backgrounds — black primary, dark blue secondary */
  --bg-black:   #000000;
  --bg-navy:    #060f1d;
  --bg-blue:    #0c1a2f;
  --bg-glow:    #0c3c8c;


  /* Text */
  --text:       #e8eeff;
  --text-muted: #99b1d4;

  /* Accent */
  --accent:     #ffffff;
  --accent2:    #cd8512;


  /* Borders */
  --border:       rgb(from var(--accent) r g b / 0.09);
  --border-hover: rgb(from var(--accent) r g b / 0.28);

  /* Font */

  --font: 'Figtree', system-ui, sans-serif;

  /* Type scale */
  --sz-xs:  0.75rem;
  --sz-sm:  0.875rem;
  --sz-md:  1rem;
  --sz-lg:  1.25rem;
  --sz-xl:  1.875rem;
  --sz-2xl: 2.75rem;
  --sz-3xl: 3.75rem;

  /* Spacing */
  --sp-xs: 0.5rem;
  --sp-sm: 1rem;
  --sp-md: 2rem;
  --sp-lg: 4rem;
  --sp-xl: 7rem;

  /* Border radii */
  --r-sm:   8px;
  --r-md:   16px;
  --r-lg:   24px;
  --r-full: 999px;

  /* Transitions */
  --ease: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --container: 1080px;
  --header-h:  62px;

  /* Binary orbit motif */
 --orbit-svg: url("../images/icons/interacting_binary.svg");
 }


/* ── 2. Reset & base ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg-black);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

ul, ol { list-style: none; }

a {
  color: inherit;
  text-decoration: none;
}

/* Visible keyboard focus ring */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--r-sm);
}


/* ── 3. Skip link ─────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1.25rem;
  background: var(--accent);
  color: var(--bg-black);
  font-weight: 700;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }


/* ── 4. Header & navigation ───────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  background: rgb(from var(--bg-black) r g b / 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background var(--ease), backdrop-filter var(--ease),
              -webkit-backdrop-filter var(--ease), border-color var(--ease);
}

/* Intensified once the user scrolls past the hero — toggled by nav.js */
.site-header--scrolled {

  border-bottom-color: var(--border-hover);
}

.header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-md);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__logo {
  font-size: var(--sz-lg);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.nav__list {
  display: flex;
  gap: var(--sp-md);
}

.nav__link {
  position: relative;
  font-size: var(--sz-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 4px;
  transition: color var(--ease);
}

/* Underline draws in from left on hover; stays full-width when active */
.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--ease);
}

.nav__link:hover               { color: var(--text); }
.nav__link:hover::after        { width: 100%; }
.nav__link--active             { color: var(--accent); }
.nav__link--active::after      { width: 100%; }


/* ── 5. Mobile hamburger ──────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--r-sm);
}

.hamburger__bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform-origin: center;
  transition: transform var(--ease), opacity var(--ease);
}

.hamburger[aria-expanded="true"] .hamburger__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger[aria-expanded="true"] .hamburger__bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger[aria-expanded="true"] .hamburger__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
  .hamburger { display: flex; }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-black);
    border-bottom: 1px solid var(--border);
    padding: var(--sp-md) var(--sp-md) var(--sp-lg);
    z-index: 199;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-0.4rem);
    transition:
      opacity      var(--ease),
      transform    var(--ease),
      visibility   0s linear var(--ease); /* hide only after fade finishes */
  }

  .site-nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition:
      opacity      var(--ease),
      transform    var(--ease),
      visibility   0s;          /* show immediately — no delay */
  }

  .nav__list        { flex-direction: column; gap: var(--sp-md); }
  .nav__link        { font-size: var(--sz-xl); }

  /* Pill handle at the bottom — hints that scrolling up (or tapping outside)
     closes the menu. Only visible while the menu is open. */
  .site-nav::after {
    content: '';
    display: block;
    width: 36px;
    height: 3px;
    border-radius: var(--r-full);
    background: rgba(255, 255, 255, 0.22);
    margin: var(--sp-md) auto 0;
    opacity: 0;
    transition: opacity var(--ease);
  }
  .site-nav.is-open::after { opacity: 1; }
}


/* ── 6. Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  border-radius: var(--r-full);
  font-family: var(--font);
  font-size: var(--sz-md);
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: background var(--ease), color var(--ease), border-color var(--ease),
              transform 0.15s ease, box-shadow var(--ease);
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.95) translateY(0) !important; }

.btn--outline {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}
.btn--outline:hover {
  background: var(--accent);
  color: var(--bg-black);
  transform: translateY(-2px);
  box-shadow:
    0 4px 16px rgb(from var(--accent) r g b / 0.14),
    0 1px  6px rgb(from var(--accent) r g b / 0.10);
}


/* ── 7. Sections & backgrounds ────────────────────────────── */
.section {
  padding: var(--sp-xl) 0;
}

/*
  --text-glow is a CSS custom property that cascades from the section down
  to .project-split__text and .flow inside it, where it is used as the
  centre colour of a radial gradient ::before that creates a soft glow
  directly behind prose content. Each section background gets a visually
  distinct glow colour:
    black  — deep blue pool, matching the hero halo
    navy   — saturated mid-blue, lighter and more vivid than the navy bg
    blue   — concentrated dark blue, adds depth against the blue bg
*/
.section--black {
  background:
    /*radial-gradient(ellipse 80% 55% at 50% 50%, var(--bg-blue) 0%, transparent 60%),*/
    var(--bg-black);
  --text-glow: var(--bg-blue);
}

.section--navy {
  background:
    /*radial-gradient(ellipse 80% 55% at 50% 50%, var(--bg-black) 0%, transparent 60%),*/
    var(--bg-navy);
  --text-glow: rgb(from var(--bg-glow) r g b / 0.3);
}
.section--blue {
  background:
    /*radial-gradient(ellipse 80% 55% at 50% 50%, rgb(from var(--accent2) r g b / 0.2) 0%, transparent 60%),*/
    var(--bg-blue);
  --text-glow: rgb(from var(--accent2) r g b / 0.2);
}

/* Parallax image section */
.section--parallax {
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  position: relative;
}
.section--parallax::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgb(from var(--bg-black) r g b / 0.20);
  pointer-events: none;
}
.section--parallax > * { position: relative; z-index: 1; }


/* Fixed image section */
.section--bkg-image {
  background-attachment: scroll;
  background-size: cover;
  background-position: center;
  position: relative;
}/*
.section--bkg-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgb(from var(--bg-black) r g b / 0.40);
  pointer-events: none;
}
.section--bkg-image > * { position: relative; z-index: 1; }*/

/* Section headings */
.section__title {
  font-size: var(--sz-2xl);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--sp-lg);
}

.section__subtitle {
  font-size: var(--sz-xl);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp-sm);
}


/* ── 8. Container ─────────────────────────────────────────── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-md);
}


/* ── 9. Utilities ────────────────────────────────────── */
/*
  Draw-in underline — uses background-image instead of text-decoration
  so the line grows from left to right on hover. Works correctly even
  on multi-line links because a background wraps with the text.
*/
.text-link {
  color: var(--text);
  text-decoration: none;
  background-image: linear-gradient(var(--border-hover), var(--border-hover));
  background-position: 0% 100%;
  background-repeat: no-repeat;
  background-size: 100% 1px;     /* full-width dim underline at rest */
  padding-bottom: 1px;
  transition: background-image var(--ease), color var(--ease);
}
.text-link:hover {
  background-image: linear-gradient(var(--accent), var(--accent));
}

p { max-width: 72ch; }

.lead {
  font-size: var(--sz-lg);
  color: var(--text-muted);
}

.image-caption {
  color: var(--text-muted);
  font-size: var(--sz-sm);
  text-align: center;
  max-width: 65ch;
  margin: 0 auto;
}

/* ── 10. Hero section ─────────────────────────────────────── */
/*
   Signature element: a deep space radial glow — as if the void
   itself has depth behind the subject.
*/
.section--hero {
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  background: radial-gradient(ellipse 80% 55% at 60% 50%,
      var(--bg-blue) 0%,
      var(--bg-black) 70%);
}

.hero__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-xl);
}

.hero__photo-wrap {
  flex: 0 0 auto;
  position: relative;    /* anchor for the glow ::before */
}

.hero__photo-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
  box-shadow: 0 0 80px 24px rgb(from var(--bg-glow) r g b / 0.5);
  animation: glow-pulse 6s ease-in-out infinite;
  will-change: opacity;
  transform: translateZ(0);
  pointer-events: none;
}

.hero__photo {
  width: 340px;
  height: 340px;
  border-radius: var(--r-lg);
  object-fit: cover;
  object-position: center 40%;
  border: 1px solid var(--border);
  position: relative;    /* stay above the ::before glow */
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.45; }
  50%       { opacity: 1;    }
}

.hero__text { flex: 1; }

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-size: var(--sz-sm);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-xs);
}

/* Thin hairline before the eyebrow label */
.hero__eyebrow::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--text-muted);
  opacity: 0.5;
  flex-shrink: 0;
}

.hero__name {
  font-size: var(--sz-3xl);
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent);
  margin-bottom: var(--sp-sm);
}

.hero__role {
  font-size: var(--sz-lg);
  color: var(--text-muted);
  margin-bottom: var(--sp-md);
  max-width: 55ch;
}


/* ── 11. Research interests ───────────────────────────────── */
.interests__grid {
  display: flex;
  gap: var(--sp-xl);
  justify-content: center;
  margin-bottom: var(--sp-lg);
  flex-wrap: wrap;
}

.interest-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-sm);
  text-align: center;
}

.interest-card__icon {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgb(from var(--accent) r g b / 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.interest-card__icon img {
  width: 120px;
  height: 120px;
  object-fit: contain;
}
/*.interest-card:hover .interest-card__icon {
  border-color: var(--border-hover);
  box-shadow: 0 0 28px rgba(255, 225, 255, 0.06);
}*/

.interest-card__label {
  font-size: var(--sz-md);
  font-weight: 600;
  color: var(--text);
}

.interests__cta {
  text-align: center;
  margin-top: var(--sp-sm);
}


/* ── 12. Gallery & lightbox ───────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: 10px;
  margin-bottom: var(--sp-lg);
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-navy);
  cursor: pointer;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease;
}
.gallery-item:hover img { transform: scale(1.05); }

/* Spanning variants */
.gallery-item--wide { grid-column: span 2; }
.gallery-item--tall { grid-row:    span 2; }
.gallery-item--big  { grid-column: span 2; grid-row: span 2; }

/* Lightbox — visibility/opacity controlled by .is-open class (see gallery.js).
   The hidden attribute is removed in JS on init; CSS owns the closed state. */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-md);
  /* Closed state */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0s linear 0.28s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.28s ease, visibility 0s; /* no delay on open */
}

.lightbox__inner {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-sm);
  transition: transform 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.lightbox__img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--r-md);
  object-fit: contain;
}
.lightbox__caption {
  color: var(--text-muted);
  font-size: var(--sz-sm);
  text-align: center;
  max-width: 65ch;
}
.lightbox__close {
  position: fixed;
  top: var(--sp-md);
  right: var(--sp-md);
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ease);
}
.lightbox__close:hover { background: rgb(from var(--accent) r g b / 0.2); }

.gallery__credit {
  color: var(--text-muted);
  font-size: var(--sz-sm);
  text-align: center;
  max-width: 65ch;
  margin: 0 auto;
}


/* ── 13. Image–text pairs ─────────────────────────────────── */
/*
   Decorative astrophysical images placed next to text blocks.
   Use .img-text--reversed to flip image to the right side.
*/
.img-text {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
  margin: var(--sp-lg) 0;
}
.img-text--reversed { flex-direction: row-reverse; }

.img-text__img {
  flex: 0 0 360px;
  width: 360px;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-lg);
  object-fit: cover;
  border: 1px solid var(--border);
}

.img-text__body { flex: 1; }

.img-text__body h3 {
  font-size: var(--sz-xl);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--sp-sm);
}
.img-text__body p {
  color: var(--text-muted);
  margin-bottom: var(--sp-sm);
}

/* ── 14. Project split (research page) ────────────────────── */

.project-split {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-lg);
}

.project-split--reversed {
  flex-direction: row-reverse;
}

/* Both columns take equal width; min-width:0 prevents overflow */
.project-split__text,
.project-split__images {
  flex: 1 1 0;
  min-width: 0;
}

/*
  Text halo — a radial glow behind the prose column only, not the whole section.
  isolation:isolate creates a stacking context so z-index:-1 on ::before sits
  above the section background but below all text content within this element.
  The --text-glow colour is set on each .section--* and cascades here.
  Negative inset lets the gradient bleed beyond the element's own box so
  it doesn't get clipped at the column edge.
*/
.project-split__text {
  position: relative;
  isolation: isolate;
}

.project-split__text::before {
  content: '';
  position: absolute;
  inset: -20% -100%;
  background: radial-gradient(
    ellipse 30% 50% at 50% 50%,
    var(--text-glow, transparent) 0%,
    transparent 100%
  );
  pointer-events: none;
  z-index: -1;
}

/*
  .flow is used as the prose wrapper in CV and Talks sections.
  Same glow treatment as .project-split__text.
*/
.flow {
  position: relative;
  isolation: isolate;
}

.flow::before {
  content: '';
  position: absolute;
  inset: -40% -30%;
  background: radial-gradient(
    ellipse 60% 50% at 50% 30%,
    var(--text-glow, transparent) 0%,
    transparent 100%
  );
  pointer-events: none;
  z-index: -1;
}

/* Clearfix — contains floated .deco-photo images */
.flow::after {
  content: '';
  display: table;
  clear: both;
}

/* Images stack vertically inside their column */
.project-split__images {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.project-split__images img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background-color: rgb(from var(--accent) r g b / 0.02);
}

/* ── 15. Research page ────────────────────────────────────── */
.research-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-md);
  flex-wrap: wrap;
  background: rgb(from var(--bg-black) r g b / 0.80);
  padding: 5%;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.research-intro .section__title { margin-bottom: var(--sp-sm); }

.project__title {
  font-size: var(--sz-xl);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: var(--sp-sm);
}

/* Standalone orbit mark — used in footers and as an optional section divider.
   Drop <span class="orbit-motif" aria-hidden="true"></span> where needed. */
.orbit-motif {
  display: block;
  width: 26px;
  height: 26px;
  margin: 0 auto var(--sp-sm);
  background: var(--orbit-svg) center / contain no-repeat;
  opacity: 0.35;
}

.project__body p {
  color: var(--text-muted);
  margin-bottom: var(--sp-sm);
}

/* ── 16. Decorative diary photos ──────────────────────────── */

.container {
  position: relative;
}

.deco-photo {
  position: absolute;
  z-index: 2;
  pointer-events: none;       /* never blocks clicks on content below */

  /* Physical photo print look */
  width: 300px;
  height: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background-color: rgb(from var(--accent) r g b / 0.02);
  left: 720px;
}

/* Narrow screens: drop back to in-flow centred image */
@media (max-width: 1080px) {
  .deco-photo {
    position: static;
    display: block;
    width: 300px;
    margin: 0 auto var(--sp-md);
    pointer-events: auto;
  }
}


/* ── 17. CV page ──────────────────────────────────────────── */
.cv-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-md);
  margin-bottom: var(--sp-xl);
  flex-wrap: wrap;
}

/* Sub-headings inside the CV body (Education, Positions, …) */
.cv-section-heading {
  font-size: var(--sz-lg);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: var(--sp-xs);
  margin-top: var(--sp-lg);
  margin-bottom: var(--sp-md);
  border-bottom: 1px solid var(--border);
  clear: both; /* don't let floats overlap section headings */
}

.cv-section-heading:first-of-type { margin-top: 0; }

/* Timeline spine */
.timeline {
  position: relative;
  padding-left: 2.25rem;
  margin-bottom: var(--sp-md);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: .5rem;
  bottom: .5rem;
  width: 1px;
  background: var(--border);
}

.timeline__entry {
  position: relative;
  margin-bottom: var(--sp-md);
}

/* Dot on the spine */
.timeline__entry::before {
  content: '';
  position: absolute;
  left: calc(-2.25rem - 4px + .5px);
  top: .45rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-black);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .35);
}

.timeline__year {
  font-size: var(--sz-sm);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.timeline__event {
  font-size: var(--sz-lg);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2px;
}

.timeline__detail {
  color: var(--text-muted);
  font-size: var(--sz-md);
  max-width: 60ch;
}

/* ── 18. Talks & outreach ─────────────────────────────────── */
.talks-columns {
  display: grid;
  grid-template-columns: repeat(1fr, 3);
  gap: var(--sp-md);
  align-items: start;
}

.talk-group__heading {
  font-size: var(--sz-lg);
  font-weight: 700;
  color: var(--accent);
  padding-bottom: var(--sp-xs);
  margin-bottom: var(--sp-sm);
  border-bottom: 1px solid var(--border);
}

.talk-list {
  display: flex;
  flex-direction: column;
}

.talk-entry {
  display: grid;
  grid-template-columns: repeat(2, 20% 80%);
  padding: var(--sp-xs) 0;
  border-bottom: 1px solid var(--border);
}

.talk-entry:last-child { border-bottom: none; }

.talk-entry__date {
  font-size: var(--sz-md);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 2px;
  padding: 0 var(--sp-sm);
}

.talk-entry__conference {
  font-size: var(--sz-md);
  color: var(--text);
}

/* ── 19. Gravity simulation ─────────────────────────────────── */

/* Wrapper stacks toolbar + canvas vertically */
.gravity__wrap {
  display: flex;
  flex-direction: column;
  height: 560px;
}

/* ── Toolbar ── */
/*
   Sits above the canvas in normal flow — no overlap.
   Rounded only at the top; the canvas connects flush below.
   Background matches the canvas colour (--bg-navy) so the two
   read as a single widget.
*/
.gravity__toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 0.55rem var(--sp-sm);
  background: var(--bg-navy);
  border: 1px solid var(--border);
  border-bottom: 1px solid rgba(255,255,255,.06); /* subtle inner divider */
  border-radius: var(--r-md) var(--r-md) 0 0;
  flex-shrink: 0;
}

/* ── Toolbar buttons (secondary — softer than CTA buttons) ── */
/*
   Less padding, dimmer border, no lift/glow on hover.
   Border-radius uses --r-sm (rectangular-ish) rather than the
   full-pill of .btn--outline, giving the toolbar a distinct
   "instrument panel" character vs the primary CTAs.
*/
.gravity__btn {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.8rem;
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: var(--sz-sm);
  font-weight: 400;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: color var(--ease), border-color var(--ease), background var(--ease);
  user-select: none;
  white-space: nowrap;
}

.gravity__btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: rgba(255,255,255,.05);
}

/* Active state — e.g. when simulation is paused */
.gravity__btn.is-active {
  color: var(--accent);
  border-color: rgba(255,255,255,.35);
}

/* ── Mass label + slider ── */
.gravity__mass-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: var(--sp-sm);
  border-left: 1px solid var(--border);
  font-size: var(--sz-xs);
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.gravity__mass-value {
  font-size: var(--sz-sm);
  font-variant-numeric: tabular-nums; /* fixed-width digits for the readout */
  min-width: 2.5ch;
  color: var(--text);
  text-align: right;
}

/* Custom range slider */
.gravity__slider {
  -webkit-appearance: none;
  appearance: none;
  width: 110px;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  outline: none;
  cursor: pointer;
}

.gravity__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text-muted);
  border: none;
  transition: background var(--ease), transform var(--ease);
}
.gravity__slider:hover::-webkit-slider-thumb {
  background: var(--accent);
  transform: scale(1.25);
}

.gravity__slider::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text-muted);
  border: none;
  cursor: pointer;
}
.gravity__slider:hover::-moz-range-thumb {
  background: var(--accent);
}

/* ── Usage hints — right-aligned ── */
.gravity__hints {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-left: var(--sp-sm);
  border-left: 1px solid var(--border);
  font-size: var(--sz-xs);
  color: var(--text-muted);
  opacity: 0.65;
  white-space: nowrap;
}

/* ── Canvas ── */
.gravity__canvas {
  display: block;
  flex: 1;            /* fill remaining height in .gravity__wrap */
  width: 100%;
  min-height: 0;      /* required for flex children to shrink correctly */
  border: 1px solid var(--border);
  border-top: none;   /* toolbar handles the top edge */
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* ── 20. Footer ───────────────────────────────────────────── */
.site-footer {
  background: var(--bg-black);
  border-top: 1px solid var(--border);
  padding: var(--sp-md);
  text-align: center;
  font-size: var(--sz-sm);
  color: var(--text-muted);
}
.site-footer a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border-hover);
  text-underline-offset: 2px;
  transition: text-decoration-color var(--ease);
}
.site-footer a:hover { text-decoration-color: var(--accent); }


/* ── 21. Scroll-reveal animation ──────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal-group > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal-group.is-visible > *:nth-child(1) { opacity:1; transform:none; transition-delay:0.00s; }
.reveal-group.is-visible > *:nth-child(2) { opacity:1; transform:none; transition-delay:0.10s; }
.reveal-group.is-visible > *:nth-child(3) { opacity:1; transform:none; transition-delay:0.20s; }
.reveal-group.is-visible > *:nth-child(4) { opacity:1; transform:none; transition-delay:0.30s; }
.reveal-group.is-visible > *:nth-child(n+5){ opacity:1; transform:none; transition-delay:0.35s; }


/* ── 22. Responsive ───────────────────────────────────────── */
@media (max-width: 960px) {
  :root {
    --sz-3xl: 3rem;
    --sz-2xl: 2rem;
    --sp-xl:  5rem;
  }

  /* Hero */
  .section--hero       { min-height: auto; padding: var(--sp-lg) 0; }
  .hero__inner         { flex-direction: column; text-align: center; gap: var(--sp-md); }
  .hero__photo         { width: 220px; height: 220px; }
  .hero__role          { max-width: 100%; margin-left: auto; margin-right: auto; }

  /* Image–text pairs collapse to stacked */
  .img-text,
  .img-text--reversed  { flex-direction: column; }
  .img-text__img       { flex: none; width: 100%; max-height: 300px; aspect-ratio: unset; }

  /* Research page */
  .research-intro      { flex-direction: column; }

  /* CV */
  .cv-deco             { grid-template-columns: 1fr; }
  .cv-deco__img        { display: none; }  /* hide decorative image on medium screens */

  /* Talks */
  .talks-columns       { grid-template-columns: 1fr; }

  /* Outreach */
  .outreach__inner     { flex-direction: column; }
  .outreach__img       { flex: none; width: 100%; }

  /* Gallery — keep 2-column, drop spanning */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 180px;
  }
  .gallery-item--wide,
  .gallery-item--tall,
  .gallery-item--big  { grid-column: span 1; grid-row: span 1; }

  /* Gravity simulator — hide entirely on small screens */
  .section--gravity { display: none; }
}

@media (max-width: 760px) {
  /* Project split: stack to single column */
  .project-split,
  .project-split--reversed {
    flex-direction: column;
  }

  /* Float images: cancel float on small screens */
  .float-right,
  .float-left {
    float: none;
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 0 var(--sp-md) 0;
  }

  /* Talks: single column */
  .talks-columns {
    grid-template-columns: 1fr;
    gap: var(--sp-md);
  }

  .cv-top {
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  :root {
    --sp-xl:  3.5rem;
    --sp-lg:  2.5rem;
    --sz-3xl: 2.25rem;
    --sz-2xl: 1.75rem;
  }

  .hero__photo        { width: 180px; height: 180px; }
  .section__title     { font-size: var(--sz-xl); }

  .gallery-grid       { grid-auto-rows: 140px; }

  .interests__grid    { gap: var(--sp-lg); }

  .cv-top             { flex-direction: column; align-items: flex-start; }
}


/* ── 23. Reduced motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .hero__photo-wrap::before { animation: none; }
  .gallery-item img { transition: none; }
  .section--parallax { background-attachment: scroll; }
}
