/*
  Hero: the top of the page, cream type on the dark board. The hero is
  transparent, so the board from backgrounds.css shows through. The top bar
  holds only the "More Research" menu, centred. The findings sit below
  (findings.css).
*/

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  padding: 0 24px 40px;
  background: none;
  color: var(--ink);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1120px;
  padding-top: clamp(14px, 2.6vh, 32px);
  text-align: center;
}

/* ---------- Title, subtitle, authors, venue ---------- */

/* Avant Garde Bold, cream on the board, set a little tight as on 1970s
   posters; the subtitle too, smaller; the authors and the affiliations in
   Avant Garde Book. */
.hero h1,
.title-echo span {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(2rem, 3.1vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
}

/* The title echo, after a "dimension" brochure cover: while the page
   scrolls, copies of the title trail behind it, each one step further out,
   further left and smaller, in one blue, light near the title and dark far
   away (one hue, not a spectrum). As
   on the cover, each copy is solid and covers the copies behind it: a flat
   colour with fine vertical lines in a darker shade of it, with no outline,
   so the copies merge into one striped body and the letters read through
   their counters. On the cover the edge of the stack is soft, about three
   times softer than the edge of the cream word, with a faint warm halo; a
   drop shadow of 0.05em in the colour of each copy gives the same soft
   edge, and the title itself stays sharp. Its blur grows with --glow (0 to
   1, from the step), so the halo opens and goes out with the stack.
   They trail below the title while the page scrolls down and above it while
   the page scrolls up. title.js makes the copies and sets --lift (the signed
   step between copies, in px), --drift, --shrink, --glow and --show from
   the smoothed speed of the scroll, and hides the stack when it rests
   inside the title. --show is the opacity of the whole stack, so the copies
   stay solid among themselves and the edge they leave around the title
   goes out as they sink into it. Hidden with reduced motion. */

/* Below the following text of the hero, so the copies that trail under the
   title pass behind the subtitle, the authors and the buttons. */
.title-wrap {
  position: relative;
  z-index: -1;
  isolation: isolate;
}

.hero .title-wrap h1 {
  position: relative;
  z-index: 1;
}

.title-echo {
  --lift: 0px;
  --drift: 0px;
  --shrink: 0;
  --glow: 0;
  --show: 0;
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: var(--show);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.title-echo.is-resting {
  visibility: hidden;
}

.title-echo span {
  position: absolute;
  inset: 0;
  --line: color-mix(in oklab, var(--c) 60%, #171513);
  color: transparent;
  background-color: var(--c);
  background-image: repeating-linear-gradient(to right, transparent 0 2.4px, var(--line) 2.4px 3.4px);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 calc(0.05em * var(--glow)) color-mix(in oklab, var(--c) 70%, transparent));
  transform-origin: 50% 50%;
  transform: translate3d(calc(var(--k) * var(--drift) * -0.45), calc(var(--k) * var(--lift)), 0) scale(calc(1 - var(--k) * var(--shrink)));
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .title-echo {
    display: none;
  }
}

/* The subtitle is the second half of the title of the paper, so it takes
   the font, the weight and the colour of the title, at a smaller size
   (Mirko, 2026-11-19; before, Avant Garde Book in grey). */
.hero .subtitle {
  margin: 10px 0 0;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(1.1rem, 1.8vw, 1.45rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

.hero .authors {
  margin: 16px 0 0;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--ink);
}

.hero .author {
  white-space: nowrap;
}

/* As on Nerfies: the names in the link colour, with no underline until
   hover. --link is the Pelican blue of the reference covers, sampled from
   "The Psychology of Perception" (4.9:1 on the board); vermilion was too
   close to the orange of the diffusion data. */
.hero .authors a {
  color: var(--link);
  text-decoration: none;
}

.hero .authors a:hover {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.hero .authors a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 0;
}

.hero .affiliations {
  margin: 4px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 22px;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 1rem;
  color: var(--muted);
}

.hero .affiliations span {
  white-space: nowrap;
}

/* The venue is the official EACL 2027 logo, traced by
   scripts/release_assets/trace_eacl.py without the place and the dates: in
   cream on the board, and on hover in its own blue (#145FAD, read from the
   official PNG), like the buttons, which take the colour of where they lead.
   The blue copy sits on the cream one and fades in. */
.hero .venue {
  margin: 10px 0 0;
  line-height: 0;
}

.hero .venue a {
  position: relative;
  display: inline-block;
  border: 0;
  text-decoration: none;
}

.hero .venue a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* The "EACL 2027" wordmark of the official logo without the temple
   (Cavallaro, 2026-11-19: the temple of Athens can read as a local, European
   paper). The two SVGs are the traced logo with the viewBox cut to the
   wordmark; 21px keeps the letters as tall as in the full logo at 30px. */
.hero .venue img {
  display: block;
  width: auto;
  height: 21px;
}

.hero .venue .venue-color {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

.hero .venue a:hover img {
  opacity: 0;
}

.hero .venue a:hover .venue-color {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .hero .venue img {
    transition: opacity 160ms ease;
  }
}

/* ---------- Top bar: the "More research" menu, centred ---------- */

/* Two grey words in Avant Garde Book, like the subtitle and the
   affiliations, and a thin chevron with the weight of their strokes and flat
   ends like theirs; they turn cream on hover and while the list is open, and
   the chevron turns up. A Helvetica Medium label with a heavy chevron looked
   like a web widget, and the words alone too empty. */
.hero .topnav {
  position: relative;
  z-index: 3;
  justify-content: center;
  gap: 20px;
  padding: 14px 0 0;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 1rem;
  color: var(--ink);
}

.hero .more summary {
  padding: 4px 2px;
  border-radius: 0;
  color: var(--muted);
}

.hero .more summary:hover,
.hero .more[open] summary {
  background: none;
  color: var(--ink);
  text-decoration: none;
}

.hero .more summary {
  gap: 7px;
}

/* The chevron is centred on the capitals of the words, not on the line
   box, which would set it on the lowercase letters and look low. */
.hero .more .chevron {
  position: relative;
  top: -0.1em;
  flex: none;
}

.hero .more[open] .chevron {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: no-preference) {
  .hero .more .chevron {
    transition: transform 160ms ease;
  }
}

.hero .more summary:focus-visible,
.hero .more-menu a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The open list is plain text centred under the words, with no border, on a
   piece of the board itself: site.js lines its tiles up with those of the
   page. A soft dark shadow under it lifts it off the board, so it reads as
   a sheet laid over the page title, which stays in view around it. */
.hero .more-menu {
  top: calc(100% + 6px);
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 6px 18px;
  background-color: var(--page);
  background-image:
    url("../images/bg/dust.webp"),
    url("../images/bg/board.webp");
  background-size: 1000px 1000px, 1200px 1200px;
  background-repeat: repeat, repeat;
  color: var(--ink);
  border: 0;
  border-radius: 0;
  box-shadow:
    0 2px 6px rgb(0 0 0 / 0.35),
    0 12px 32px rgb(0 0 0 / 0.5);
  font-family: var(--font-body);
  font-size: 0.9rem;
  text-align: center;
}

.hero .more-menu a {
  padding: 5px 0;
  color: var(--ink);
  border-radius: 0;
}

.hero .more-menu a:hover {
  background: none;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.hero .more-title {
  font-weight: 400;
}

/* On a phone the list spans the width of the page. */
@media (max-width: 600px) {
  .hero .more-menu {
    left: 0;
    width: 100%;
    max-width: none;
    transform: none;
  }
}

/* ---------- Buttons: solid cream blocks, square ---------- */

.hero .links {
  margin-top: 16px;
  gap: 10px;
}

.hero .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--page);
  box-shadow: none;
  font-family: var(--font-body);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

/* Hover: the block takes the colour of the site it leads to. BibTeX stays on
   this page, so it turns the accent blue of the page, with board-coloured
   text (4.9:1; cream would be 2.9:1). arXiv turns arXiv red
   with cream text (5.4:1); Code and Data lead to GitHub and turn the green of
   GitHub's Code button with white text, as on GitHub (4.5:1). */
.hero .btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--page);
}

.hero .btn-arxiv:hover {
  background: var(--arxiv);
  border-color: var(--arxiv);
  color: var(--ink);
}

.hero .btn-github:hover {
  background: var(--github);
  border-color: var(--github);
  color: #ffffff;
}

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

@media (prefers-reduced-motion: no-preference) {
  .hero .btn {
    transition: background-color 0.15s ease, color 0.15s ease;
  }
}

/* ---------- Phones ---------- */

@media (max-width: 600px) {
  .hero {
    padding: 0 20px 36px;
  }

  .hero h1,
  .title-echo span {
    font-size: 1.8rem;
  }
}
