/* Any2Act — bright, paper-inspired academic project page */

:root {
  color-scheme: light;
  --paper: #ffffff;
  --paper-cool: #f6f7fc;
  --ink: #1c2436;
  --muted: #5b6475;
  --accent: #4659ae;
  --accent-dark: #35468f;
  --accent-soft: #e8ebf8;
  --line: #dfe4ee;
  --media-empty: #edf0f6;
  --focus: #354fb5;
  --content-width: 1120px;
}

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

html {
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

figure,
dl,
dd,
p,
h1,
h2,
h3 {
  margin: 0;
}

button,
summary {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

[hidden] {
  display: none !important;
}

[id] {
  scroll-margin-top: 24px;
}

::selection {
  background: #dfe4f7;
  color: #17203a;
}

:where(a, button, summary):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

video:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -5px;
}

.container {
  width: min(var(--content-width), calc(100% - 32px));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--paper);
  color: var(--accent-dark);
  font-weight: 600;
  transform: translateY(-180%);
}

.skip:focus {
  transform: none;
}

/* Hero */

.hero {
  padding: 35px 0 28px;
  text-align: center;
}

.hero-copy {
  max-width: 1040px;
  margin-inline: auto;
}

.project-logo {
  width: clamp(248px, 67vw, 372px);
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.hero h1 {
  max-width: 1020px;
  margin: 12px auto 0;
  color: #182136;
  font-size: clamp(1.35rem, 5.8vw, 2.3rem);
  font-weight: 650;
  line-height: 1.14;
  letter-spacing: -0.025em;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.desktop-break {
  display: none;
}

.authors,
.affiliations,
.resources {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0;
  list-style: none;
}

.authors {
  max-width: 780px;
  margin: 19px auto 0;
  gap: 4px clamp(12px, 2vw, 22px);
  font-weight: 550;
  line-height: 1.5;
}

.authors li,
.affiliations li,
.author-note span {
  white-space: nowrap;
}

.authors sup,
.affiliations sup,
.author-note sup {
  color: var(--accent-dark);
  font-size: .72em;
  font-weight: 600;
  line-height: 0;
}

.authors sup {
  margin-inline-start: 2px;
}

.affiliations sup,
.author-note sup {
  margin-inline-end: 3px;
}

.affiliations {
  max-width: 940px;
  margin: 11px auto 0;
  gap: 2px 16px;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.5;
}

.author-note {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.institution-logos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.85fr);
  align-items: center;
  width: min(100%, 480px);
  gap: clamp(10px, 3vw, 26px);
  margin: 19px auto 0;
  padding: 0;
  list-style: none;
}

.institution-logos img {
  display: block;
  width: 100%;
  height: clamp(38px, 10.75vw, 64px);
  object-fit: contain;
}

.resources {
  margin: 20px auto 0;
  gap: 8px;
}

.resource {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 8px;
  padding: 7px clamp(9px, 2vw, 16px);
  border: 1px solid #dce1ee;
  border-radius: 999px;
  background: #f7f8fc;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
}

a.resource {
  border-color: #cbd2e7;
  background: var(--paper-cool);
  color: var(--accent-dark);
  text-decoration: none;
}

a.resource:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.resources svg {
  grid-row: span 2;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--accent-dark);
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.resources strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.project-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 22px;
  margin-top: 13px;
}

.project-nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 6px 1px;
  border-bottom: 1px solid #cbd2e7;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 550;
  line-height: 1.3;
  text-decoration: none;
}

.hero-film {
  max-width: 1000px;
  margin: 23px auto 0;
}

/* Shared, functional video treatment */

.player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid #d8deea;
  border-radius: 8px;
  background: var(--media-empty);
  box-shadow: 0 1px 2px rgb(25 35 55 / 4%);
  isolation: isolate;
}

.player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--media-empty);
  object-fit: contain;
}

.play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: none;
  width: 58px;
  height: 58px;
  place-items: center;
  padding: 0;
  border: 1px solid rgb(70 89 174 / 24%);
  border-radius: 50%;
  background: rgb(255 255 255 / 96%);
  color: var(--accent);
  box-shadow: 0 2px 12px rgb(21 30 48 / 16%);
  transform: translate(-50%, -50%);
}

.js .player:not(.started) .play {
  display: grid;
}

.player-featured .play {
  width: 64px;
  height: 64px;
}

.play-icon {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid currentColor;
}

.player-featured .play-icon {
  border-top-width: 9px;
  border-bottom-width: 9px;
  border-left-width: 14px;
}

.time {
  display: none;
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 1;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgb(24 32 50 / 78%);
  color: #ffffff;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  pointer-events: none;
}

.js .player:not(.started) .time {
  display: block;
}

/* Research-scale facts */

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  max-width: 960px;
  margin: 26px auto 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats > div {
  padding: 16px 7px;
}

.stats > div + div {
  border-left: 1px solid var(--line);
}

.stats dt {
  color: #374b99;
  font-size: 24px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.stats dd {
  max-width: 30ch;
  margin: 6px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Paper and method */

.section {
  padding: 64px 0;
}

.section.abstract {
  padding-top: clamp(28px, 4vw, 48px);
}

.abstract h2 {
  margin-bottom: 18px;
  text-align: center;
}

.research {
  border-top: 1px solid #e5e8f1;
  border-bottom: 1px solid #e5e8f1;
  background: var(--paper-cool);
}

.abstract h2,
.section-header h2 {
  color: #1a2337;
  font-size: 30px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.prose {
  max-width: 72ch;
  margin-inline: auto;
  color: #303a4e;
  font-size: 17px;
  line-height: 1.75;
}

.prose p + p {
  margin-top: 18px;
}

.paper-figure {
  max-width: 1000px;
  margin: 25px auto 0;
  padding: clamp(12px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.paper-figure > a {
  display: block;
}

.paper-figure img {
  width: 100%;
  height: auto;
}

.paper-figure figcaption {
  margin-top: clamp(10px, 2vw, 18px);
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.paper-figure figcaption strong {
  color: var(--ink);
  font-weight: 650;
}

.method-components {
  display: grid;
  margin-block: 23px 21px;
}

.method-components > div {
  padding-block: 13px;
}

.method-components > div + div {
  border-top: 1px solid var(--line);
}

.method-components h3 {
  font-size: 16px;
  font-weight: 650;
  line-height: 1.35;
}

.method-components p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 15px;
}

.method {
  max-width: 1080px;
  margin: 0 auto;
  border-top: 1px solid #d8deea;
  border-bottom: 1px solid #d8deea;
}

.method > summary {
  min-height: 58px;
  padding: 18px 4px;
  color: #29354c;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  cursor: pointer;
}

.method > summary::marker {
  color: var(--accent);
}

.method .paper-figure {
  margin: 2px auto 18px;
}

/* Video galleries */

.gallery-section {
  background: var(--paper);
}

.gallery-section + .gallery-section {
  border-top: 1px solid var(--line);
}

.section-header > div {
  min-width: 0;
}

.section-header p {
  max-width: 56ch;
  margin-top: 13px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.clips {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 36px;
  margin-top: 32px;
}

.clip {
  min-width: 0;
}

.clip-copy {
  padding: 15px 2px 0;
}

.clip-source {
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 620;
  line-height: 1.45;
}

.clip h3 {
  color: #222c40;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -0.008em;
  overflow-wrap: break-word;
}

.clip-copy p {
  max-width: 44ch;
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* Footer */

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 24px;
  padding-bottom: 36px;
  border-top: 1px solid var(--line);
}

.footer a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.footer .wordmark {
  color: #202b43;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

@media (hover: hover) {
  .project-nav a:hover {
    border-bottom-color: var(--accent);
    color: var(--accent-dark);
  }

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

  .method > summary:hover,
  .footer a:hover {
    color: var(--accent-dark);
  }

  .footer .wordmark:hover {
    color: var(--accent-dark);
  }

  .paper-figure > a:hover {
    outline: 1px solid #c4cdea;
    outline-offset: 3px;
  }
}

@media (min-width: 620px) {
  .container {
    width: min(var(--content-width), calc(100% - 48px));
  }

  .hero {
    padding-top: 42px;
  }

  .project-nav {
    gap-inline: 28px;
  }

  .project-nav a {
    font-size: 15px;
  }

  .clips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px 22px;
  }
}

@media (min-width: 720px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 30px;
  }

  .stats > div {
    padding: 21px 22px 23px;
  }

  .stats > div + div {
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .stats dt {
    font-size: 27px;
  }

  .stats dd {
    max-width: 27ch;
    font-size: 13px;
  }
}

@media (min-width: 820px) {
  .section {
    padding: 84px 0;
  }

  .abstract h2,
  .section-header h2 {
    font-size: 32px;
  }

  .method-components {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-block: 28px 28px;
  }

  .method-components > div {
    padding: 0 20px;
  }

  .method-components > div:first-child {
    padding-left: 0;
  }

  .method-components > div + div {
    border-top: 0;
    border-left: 1px solid var(--line);
  }

  .method > summary {
    padding-block: 20px;
    font-size: 16px;
  }

  .section-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
    align-items: start;
    gap: 48px;
  }

  .section-header p {
    margin-top: 2px;
    font-size: 16px;
  }

  .clips {
    margin-top: 38px;
  }
}

@media (min-width: 900px) {
  .hero {
    padding: 44px 0 42px;
  }

  .hero h1 {
    font-size: clamp(2rem, 3vw, 2.3rem);
    line-height: 1.12;
  }

  .desktop-break {
    display: initial;
  }

  .hero-film {
    margin-top: 22px;
  }

  .player-featured .play {
    width: 70px;
    height: 70px;
  }

  .time {
    top: 12px;
    right: 12px;
  }
}

@media (min-width: 980px) {
  .clips {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 44px 24px;
  }

  .clip h3 {
    font-size: 18px;
  }
}

@media (max-width: 359px) {
  .project-nav {
    gap-inline: 16px;
  }

  .resource {
    column-gap: 5px;
    padding-inline: 7px;
  }

  .resources svg {
    width: 13px;
    height: 13px;
  }
}

@media (prefers-contrast: more) {
  :root {
    --muted: #424b5c;
    --line: #b8c0d0;
    --accent: #30469f;
    --accent-dark: #24377e;
  }

  .player,
  .paper-figure {
    border-color: #aeb8cb;
  }
}
@media (min-width: 980px) {
  .gallery-section .clips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px 24px;
  }
}

@media (max-width: 480px) {
  .project-nav {
    gap: 3px 15px;
  }

  .project-nav a {
    min-height: 31px;
    text-align: center;
  }

  .section {
    padding-block: 46px;
  }
}
