/* Components. Only color, background, border, opacity and transform are transitioned. */

/* Header and navigation */
#site-header {
  display: contents; /* lets the sticky header use <body> as its scroll container */
}

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

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.brand__logo {
  height: 52px;
  width: auto;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0 var(--s-3);
  background: transparent;
  border: 1px solid var(--paper-line);
  border-radius: var(--r-control);
  cursor: pointer;
  font-weight: 600;
  transition: background-color var(--t-fast) var(--ease);
}

.menu-toggle:hover {
  background: var(--paper-200);
}

.menu-toggle .icon-close {
  display: none;
}

.menu-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

.menu-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.site-nav {
  position: absolute;
  inset: var(--header-h) 0 auto 0;
  background: #fff;
  border-bottom: 1px solid var(--paper-line);
  padding: var(--s-2) var(--gutter) var(--s-4);
}

.site-nav[hidden] {
  display: none;
}

.site-nav a {
  display: flex;
  align-items: center;
  min-height: 52px;
  border-bottom: 1px solid var(--paper-line);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--on-paper);
  transition: color var(--t-fast) var(--ease);
}

.site-nav ul:last-child li:last-child a {
  border-bottom: 0;
}

.site-nav a[aria-current] {
  text-decoration: underline 2px var(--red-600);
  text-underline-offset: 8px;
}

.site-nav__social a {
  gap: var(--s-3);
}

.site-nav a:hover {
  color: var(--red-600);
}

@media (min-width: 900px) {
  .menu-toggle {
    display: none;
  }
  .site-nav,
  .site-nav[hidden] {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    position: static;
    background: transparent;
    border: 0;
    padding: 0;
  }
  .site-nav ul {
    display: flex;
    gap: var(--s-2);
  }
  .site-nav__social {
    gap: 0;
    padding-left: var(--s-2);
    border-left: 1px solid var(--paper-line);
  }
  .site-nav__social a {
    justify-content: center;
    min-width: 44px;
    padding: 0;
  }
  .site-nav__social-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .site-nav a {
    min-height: 44px;
    padding: 0 var(--s-3);
    border: 0;
    border-radius: var(--r-control);
    font-size: 1rem;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: 0 var(--s-5);
  border: 1px solid transparent;
  border-radius: var(--r-control);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--red-500);
  color: #fff;
}

.btn--primary:hover {
  background: var(--red-700);
}

.btn--secondary,
.btn--ink {
  background: var(--surface-2);
  border-color: var(--line);
}

.btn--secondary:hover,
.btn--ink:hover {
  background: color-mix(in srgb, var(--surface-2), currentColor 10%);
}

.btn--ink {
  min-height: 56px;
  justify-content: flex-start;
  font-size: 1.125rem;
}

.btn--ink .icon-external {
  margin-left: auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

/* Tags (radio call signs, roles, meta) */
.tag {
  display: inline-block;
  padding: 2px var(--s-2);
  border-radius: var(--r-tag);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
  background: var(--surface-2);
  color: var(--text-2);
}

.tag--kicker {
  background: transparent !important;
  padding: 0;
  font-size: 0.875rem;
  color: var(--red-400) !important;
}

/* Icons */
.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Hero */
.hero__copy {
  container-type: inline-size;
}

.hero__title {
  margin-top: var(--s-3);
  /* Text is 13.45em wide (measured): column width / 13.7 keeps it on one line. */
  font-size: calc(100cqw / 13.7);
  white-space: nowrap;
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.hero__motto {
  margin-top: var(--s-5);
  max-width: 30rem;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--on-ink-2);
}

@media (min-width: 600px) {
  .hero__motto {
    font-size: 1.25rem;
  }
}

.hero .actions {
  margin-top: var(--s-8);
}

.emergency {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-3);
  margin-top: var(--s-8);
  min-height: 44px;
  color: var(--on-ink-2);
  font-size: 0.9375rem;
}

.emergency a {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--on-ink);
}

.hero__photo {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--r-card);
  background: var(--ink-850);
}

.hero__stripe {
  display: none;
}

@media (min-width: 1024px) {
  .hero__photo {
    height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
    object-position: 100% 50%;
    clip-path: polygon(calc(14% + 20px) 0, 100% 0, 100% 100%, 20px 100%);
  }
  .hero__stripe {
    display: block;
    position: absolute;
    inset: 0;
    background: var(--red-500);
    clip-path: polygon(14% 0, calc(14% + 8px) 0, 8px 100%, 0 100%);
  }
}

/* About */
.about__text {
  display: grid;
  gap: var(--s-4);
  margin-top: var(--s-6);
  max-width: 38rem;
  font-size: 1.0625rem;
  color: var(--on-paper-2);
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-10);
  padding-top: var(--s-6);
  border-top: 1px solid var(--paper-line);
}

.fact__value {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.fact__label {
  display: block;
  margin-top: var(--s-2);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--on-paper-3);
}

.card,
.vehicle {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.timeline-card {
  padding: var(--s-6);
}

@media (min-width: 768px) {
  .timeline-card {
    padding: var(--s-8);
  }
}

.timeline-card h3,
.group h3 {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.timeline {
  position: relative;
  margin-top: var(--s-6);
  display: grid;
  gap: var(--s-6);
}

.timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--paper-line);
}

.timeline li {
  position: relative;
  padding-left: var(--s-8);
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red-500);
}

.timeline__year {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--red-600);
}

.timeline p {
  margin-top: var(--s-1);
}

/* Youth */
.youth__text {
  margin-top: var(--s-4);
  max-width: 34rem;
  font-size: 1.0625rem;
  color: var(--text-2);
}

.person-list {
  margin-top: var(--s-6);
  display: grid;
  gap: 0;
  max-width: 34rem;
}

.person-list li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--s-1) var(--s-3);
  min-height: 52px;
  padding-block: var(--s-2);
  border-top: 1px solid var(--line);
}

.person-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.person-list strong,
.roster strong {
  font-weight: 600;
}

.youth .btn {
  margin-top: var(--s-6);
}

.youth__figure img {
  width: 100%;
  aspect-ratio: 1080 / 400;
  object-fit: cover;
  border-radius: var(--r-card);
  background: var(--surface-2);
}

/* Leadership */
.group {
  padding: var(--s-6);
}

.group h3::before {
  content: "";
  display: block;
  width: 24px;
  height: 4px;
  margin-bottom: var(--s-3);
  background: var(--red-500);
}

.roster {
  margin-top: var(--s-4);
}

.roster li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--s-1) var(--s-3);
  min-height: 52px;
  padding-block: var(--s-2);
  border-top: 1px solid var(--line);
}

@media (min-width: 480px) {
  .person-list li,
  .roster li {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
}

/* Vehicles */
.vehicle {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-card);
  overflow: hidden;
}

.vehicle__figure {
  position: relative;
}

.vehicle__figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-2);
}

/* Placeholder when a vehicle has no image yet */
.vehicle__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  color: var(--text-2);
}

.vehicle__placeholder .icon {
  width: 3.5rem;
  height: 3.5rem;
}

.vehicle__call {
  position: absolute;
  left: var(--s-4);
  bottom: var(--s-4);
  padding: var(--s-1) var(--s-3);
  background: var(--ink-950);
  color: var(--on-ink);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.5;
  border-radius: var(--r-tag);
}

.vehicle__body {
  padding: var(--s-6);
}

.vehicle h3 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.vehicle__model {
  margin-top: var(--s-1);
  color: var(--text-2);
}

.specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4) var(--s-4);
  margin-top: var(--s-5);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}

.specs dt {
  font-size: 0.875rem;
  color: var(--text-3);
}

.specs dd {
  margin-top: var(--s-1);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

/* Social */
.social__title-wrap .section__lead {
  max-width: 28rem;
}

/* Contact */
.contact__list {
  display: grid;
  gap: var(--s-4);
  margin-top: var(--s-8);
}

.contact__row {
  display: flex;
  align-items: flex-start;
  gap: var(--s-4);
}

.contact__row .icon {
  margin-top: 2px;
  color: var(--accent);
}

.contact__row a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-block: -10px;
  font-weight: 600;
}

.contact__row address {
  font-style: normal;
}

.contact__label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-3);
}

.contact__photo {
  margin: 0;
  border-radius: var(--r-card);
  overflow: hidden;
}

.contact__photo img {
  display: block;
  width: 100%;
  height: auto;
}

/* Footer */
.footer__brand {
  display: inline-block;
}

.footer__brand img {
  display: block;
  height: 88px;
  width: auto;
}

.footer address {
  margin-top: var(--s-4);
  font-style: normal;
  color: var(--on-ink-2);
}

.footer h2 {
  font-family: var(--font-text);
  font-size: 1rem;
  font-weight: 600;
  color: var(--on-ink);
}

.footer__links {
  margin-top: var(--s-2);
}

.footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--on-ink-2);
  transition: color var(--t-fast) var(--ease);
}

.footer__links a:hover {
  color: var(--on-ink);
}

.footer__bottom {
  padding-block: var(--s-6);
  border-top: 1px solid var(--ink-line);
  font-size: 0.875rem;
  color: var(--on-ink-3);
}

/* Legal pages */
.legal h1 {
  font-size: clamp(1.75rem, 1rem + 4vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.legal__intro {
  margin-top: var(--s-4);
  font-size: 1.125rem;
  color: var(--on-paper-2);
}

.legal section {
  margin-top: var(--s-10);
}

.legal h2 {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.legal h2::before {
  content: "";
  display: block;
  width: 24px;
  height: 4px;
  margin-bottom: var(--s-3);
  background: var(--red-500);
}

.legal p,
.legal ul {
  margin-top: var(--s-3);
  max-width: 44rem;
}

.legal li + li {
  margin-top: var(--s-1);
}

.legal a {
  color: var(--red-600);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.legal__back {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  margin-bottom: var(--s-6);
  color: var(--on-paper-2);
}

/* Loading placeholder (static HTML, replaced by the render) and fade-in of the finished content */
.ph-bar {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--paper-line);
}

.ph-block {
  min-height: calc(100vh - var(--header-h));
}

@keyframes content-in {
  from {
    opacity: 0;
  }
}

main.is-ready {
  animation: content-in 200ms var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  main.is-ready {
    animation: none;
  }
}

/* Error notices */
.notice {
  max-width: 40rem;
  margin: var(--s-16) auto;
  padding: var(--s-6);
  background: var(--paper-50);
  color: var(--on-paper);
  border: 1px solid var(--paper-line);
  border-left: 4px solid var(--red-500);
  border-radius: var(--r-card);
}

.notice h2 {
  font-size: 1.5rem;
}

.notice p {
  margin-top: var(--s-3);
  color: var(--on-paper-2);
}

.notice a {
  color: var(--red-600);
  font-weight: 600;
}

.page-shell {
  background: var(--paper-100);
  min-height: 60vh;
  padding-inline: var(--gutter);
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--t-enter) var(--ease), transform var(--t-enter) var(--ease);
  transition-delay: calc(var(--i, 0) * 50ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Header call to action: always in the bar, compact */
.header-cta {
  min-height: 44px;
  padding: 0 var(--s-3);
  margin-left: auto;
  margin-right: var(--s-2);
}

@media (min-width: 900px) {
  .header-cta {
    order: 1;
    margin: 0 0 0 var(--s-4);
  }
  .site-nav {
    margin-left: auto;
  }
}

.join__figure {
  margin-top: var(--s-8);
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--ink-800); /* panel and photo stand off the dark section */
}

.join__figure img {
  display: block;
  width: 100%;
  height: auto;
}

.join__panel {
  position: relative;
  padding: var(--s-6) var(--s-6) var(--s-6) var(--s-8);
  background: var(--ink-800);
  color: var(--on-ink);
}

/* Slanted red bar, same angle as the hero stripe */
.join__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--red-500);
  clip-path: polygon(16px 0, 24px 0, 8px 100%, 0 100%);
  width: 24px;
}

.join__panel h3 {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.join__panel p {
  margin-top: var(--s-2);
  color: var(--on-ink-2);
}

.join__paths {
  display: grid;
  gap: var(--s-6);
  margin-top: var(--s-6);
}

.join__path {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--s-6);
}

.join__path h3 {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.join__path p {
  margin: var(--s-3) 0 var(--s-6);
  color: var(--text-2);
}

.join__path .btn {
  margin-top: auto;
}

@media (min-width: 768px) {
  .join__figure {
    position: relative;
  }
  .join__panel {
    position: absolute;
    left: 0;
    bottom: 0;
    max-width: 24rem;
    padding-block: var(--s-5);
    border-top-right-radius: var(--r-card);
  }
  .join__paths {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: var(--s-8);
  }
  .join__path {
    padding: var(--s-8);
  }
}
