:root {
  --motion-quick: 160ms;
  --motion-normal: 290ms;
  --motion-entry: 410ms;
  --motion-ease: cubic-bezier(.2, .72, .24, 1);
}

.site-header::after {
  content: "";
  position: absolute;
  inset: auto .95rem 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #956f35, #e6c879);
  transform: scaleX(var(--reading-progress, 0));
  transform-origin: left center;
  pointer-events: none;
}
.site-header.scrolled { box-shadow: 0 6px 24px #0005; }
.brand img { transition: filter var(--motion-normal), translate var(--motion-normal) var(--motion-ease); }
.brand:is(:hover, :focus-visible) img { filter: drop-shadow(0 0 .6rem #e2bd6459); translate: 0 -1px; }

.cover-title, .home-title, .roster-hero-inner { min-width: 0; max-width: 100%; }
.cover-title h1, .panel-hero h1, .panel-content > h2, .application-page-header h1 { overflow-wrap: anywhere; }
.home-title h1 { text-shadow: 0 2px 16px #000c; }
.home-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 67%, #0809094d, transparent 54%);
  pointer-events: none;
}

:is(.role-card, .album-cover, .news-card, .faq-item, .catalog-card, .person-card, .details-section details,
    .report-record, .panel-navigation button, .panel-button, .lightbox button, .record-toolbar button, .record-tablist button) {
  transition: border-color var(--motion-quick), background-color var(--motion-quick),
    box-shadow var(--motion-normal), color var(--motion-quick), transform var(--motion-normal) var(--motion-ease);
}
:is(.role-card, .album-cover, .person-card, .news-card):focus-within { border-color: var(--gold); }
:is(.role-card, .album-cover, .news-card):is(:hover, :focus-within) { box-shadow: 0 .55rem 1.6rem #0006; }
.catalog-card:hover, .catalog-card:focus-within { border-color: #8d7448; }
.news-card a:focus-visible { outline-offset: -3px; }
.faq-item summary:hover, .details-section summary:hover { color: #f0d594; }
:is(.role-card, .album-cover, .news-card):is(:hover, :focus-within) span { text-shadow: 0 2px 12px #0009; }
:is(.panel-button, .action, .film-toggle, .lightbox button, .record-toolbar button):active { transform: translateY(1px); }
:is(.panel-form, .mail-toolbar, .medal-filters) :is(input, textarea, select):focus-visible {
  outline-offset: 2px;
}
:is(.panel-form :is(input:not([type="radio"], [type="checkbox"]), textarea, select), .mail-toolbar input, .briefing-publish select) {
  min-width: 0;
  transition: background-color var(--motion-quick), border-color var(--motion-quick), box-shadow var(--motion-normal);
}
:is(.panel-form :is(input:not([type="radio"], [type="checkbox"]), textarea, select), .mail-toolbar input, .briefing-publish select):focus {
  border-color: #d8b974;
  box-shadow: 0 0 0 3px #d8b97422;
}
.panel-form input[type="file"] { max-width: 100%; }
.application-entry summary::after { transition: transform var(--motion-normal) var(--motion-ease); }
:is(.lightbox, .record-dialog, .panel-dialog, .briefing-dialog)::backdrop { backdrop-filter: blur(5px); }

.panel-result { min-width: 0; }
.panel-content[aria-busy="true"] > .panel-empty { display: flex; align-items: center; gap: .6rem; }
.panel-content[aria-busy="true"] > .panel-empty::before {
  content: "";
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--gold);
}
.panel-navigation { min-width: 0; }
@media (min-width: 761px) {
  .panel-navigation { max-height: calc(100dvh - 6.1rem); overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #66583d #111924; }
  .panel-navigation button:focus-visible { outline-offset: -2px; }
}
@media (max-width: 760px) {
  .panel-navigation button { min-height: 2.75rem; overflow-wrap: anywhere; }
}
.film-toggle, .lightbox button, .record-toolbar button { min-height: 2.75rem; }
.lightbox button { min-width: 2.75rem; }

@media (prefers-reduced-motion: no-preference) {
  @keyframes motion-rise {
    from { opacity: .06; translate: 0 14px; }
    to { opacity: 1; translate: 0 0; }
  }
  @keyframes motion-card-enter {
    from { opacity: .65; translate: 0 8px; }
    to { opacity: 1; translate: 0 0; }
  }
  @keyframes motion-emblem {
    from { opacity: 0; scale: .94; filter: drop-shadow(0 5px 18px #e2bc674d); }
    to { opacity: 1; scale: 1; }
  }
  @keyframes motion-dialog {
    from { opacity: 0; translate: 0 7px; scale: .988; }
    to { opacity: 1; translate: 0 0; scale: 1; }
  }
  @keyframes motion-fade {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  .motion-entered { animation: motion-card-enter var(--motion-entry) var(--motion-ease) var(--entry-delay, 0ms) backwards; }
  :is(.cover-title, .roster-hero-inner, .faq-header, .application-page-header > div, .panel-hero, .login-card) {
    animation: motion-rise 480ms var(--motion-ease) backwards;
  }
  .home-title .eyebrow { animation: motion-rise 480ms var(--motion-ease) backwards; }
  .hero-badge { animation: motion-emblem 680ms var(--motion-ease) 80ms backwards; }
  .home-title h1, .home-caption { animation: motion-rise 480ms var(--motion-ease) 150ms backwards; }
  .panel-result { animation: motion-card-enter var(--motion-normal) var(--motion-ease) backwards; }
  :is(.record-dialog, .panel-dialog, .briefing-dialog)[open] { animation: motion-dialog var(--motion-normal) var(--motion-ease) backwards; }
  .lightbox[open] { animation: motion-fade var(--motion-normal) var(--motion-ease) backwards; }
  :is(.lightbox, .record-dialog, .panel-dialog, .briefing-dialog)[open]::backdrop { animation: motion-fade 200ms ease-out backwards; }
  .faq-item[open] > p, .details-section details[open] > .detail-content,
  .report-record[open] > :not(summary), .record-dialog .record-pane:not([hidden]),
  .application-receipt:not([hidden]), .panel-alert:not([hidden]) { animation: motion-card-enter 230ms var(--motion-ease) backwards; }

  @media (hover: hover) and (pointer: fine) {
    :is(.role-card, .album-cover, .news-card):hover, .panel-button:hover:where(:not(:disabled, :active)) { transform: translateY(-2px); }
  }
  @media (max-width: 860px) {
    .site-nav.is-open { animation: motion-card-enter 220ms var(--motion-ease) backwards; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand:is(:hover, :focus-visible) img { translate: none; }
  :is(.person-card, .action, .film-toggle, .panel-button, .lightbox button, .record-toolbar button):is(:hover, :active, :focus-visible),
  :is(.role-card, .album-cover, .news-card):is(:hover, :focus-within) img { transform: none; }
  .person-card:is(:hover, :focus-visible) .card-photo { scale: 1; }
}
