/* ==========================================================================
   Aviation Club - UW-Madison
   Dark / engineering / minimal, colored from the club logo (red + cream)
   ========================================================================== */

:root {
  --bg: #0f0e0d;           /* warm charcoal */
  --bg-2: #181615;
  --text: #e7e3e0;         /* logo cream */
  --muted: #9c948e;
  --border: #2f2a27;
  --brand: #b11617;        /* logo red: filled buttons, marks (too dark for text on --bg) */
  --brand-hover: #c41c1c;
  --accent: #e8645c;       /* lighter red: links, highlights, labels */
  --signal: #d6a84f;       /* amber: focus rings and live/active status only */

  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-pad: clamp(64px, 10vw, 128px);
  --radius: 2px;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
}

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

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

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-mono);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(2.5rem, 7vw, 5rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1em;
}

/* Author display rules (e.g. .tag) would otherwise override the hidden attribute. */
[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: var(--gutter);
  top: 12px;
  z-index: 100;
  background: var(--bg-2);
  padding: 8px 12px;
}

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-pad);
  border-top: 1px solid var(--border);
}

.section--alt {
  background: var(--bg-2);
}

.section-head {
  max-width: 720px;
  margin-bottom: 48px;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.split {
  display: grid;
  gap: 48px;
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

/* ---------- Technical labels ---------- */

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.eyebrow--accent {
  color: var(--accent);
}

.lead {
  font-size: clamp(1.125rem, 2vw, 1.3rem);
  color: var(--muted);
  max-width: 640px;
}

.mono {
  font-family: var(--font-mono);
}

.muted {
  color: var(--muted);
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  padding: 4px 10px;
  color: var(--muted);
}

.tag--live {
  color: var(--signal);
  border-color: var(--signal);
}

.tag-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.btn:hover {
  border-color: var(--accent);
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--text);
}

.btn-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 14, 13, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  color: var(--text);
  text-decoration: none;
  line-height: 1.2;
}

.brand-mark {
  width: auto;
  height: 40px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-sub {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
}

.site-nav ul a {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}

.site-nav ul a:hover,
.site-nav ul a[aria-current="page"] {
  color: var(--text);
}

/* Flagship project link: set apart from the regular nav items. */
.site-nav ul a.nav-flagship {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  padding-right: 24px;
  border-right: 1px solid var(--border);
}

.site-nav ul a.nav-flagship::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--brand);
}

.site-nav ul a.nav-flagship:hover,
.site-nav ul a.nav-flagship[aria-current="page"] {
  color: var(--accent);
}

.nav-toggle {
  display: none;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    padding: 24px var(--gutter) 32px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  .site-nav[data-open="true"] {
    display: flex;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 16px;
  }
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(80px, 14vw, 160px) var(--section-pad);
}

.hero h1 {
  margin-bottom: 24px;
}

.hero--page {
  padding-block: clamp(64px, 10vw, 112px) clamp(48px, 6vw, 72px);
}

.hero-note {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
}

/* ---------- Media placeholders ---------- */

/* Swap for real photography / CAD renders as they become available. */
.media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-2);
  border: 1px solid var(--border);
  overflow: hidden;
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media--placeholder {
  display: grid;
  place-items: center;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: -1px -1px;
}

.media--placeholder span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
  padding: 6px 10px;
  border: 1px solid var(--border);
}

/* ---------- Cards ---------- */

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-wrap: anywhere;
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 28px;
}

.section--alt .card {
  background: var(--bg-2);
}

.card h3 {
  margin-bottom: 12px;
}

.card p:last-child,
.card ul:last-child {
  margin-bottom: 0;
}

.card .card-link {
  margin-top: auto;
  padding-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card--feature {
  border-color: var(--accent);
}

.card-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.card ul:not(.tag-list) {
  padding-left: 1.1em;
  color: var(--muted);
}

/* ---------- Pillars (Learn / Build / Fly) ---------- */

.pillar-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.14em;
  margin-bottom: 24px;
}

/* ---------- Pipeline (Plans → Flight) ---------- */

.pipeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
  border: 1px solid var(--border);
  counter-reset: stage;
}

.pipeline li {
  counter-increment: stage;
  padding: 16px;
  border-right: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.pipeline li:last-child {
  border-right: 0;
}

.pipeline li::before {
  content: counter(stage, decimal-leading-zero);
  display: block;
  font-size: 0.7rem;
  margin-bottom: 8px;
}

.pipeline li[data-status="active"] {
  color: var(--text);
  box-shadow: inset 0 2px 0 var(--signal);
}

.pipeline li[data-status="active"]::before {
  color: var(--signal);
}

.pipeline li[data-status="done"] {
  color: var(--text);
  box-shadow: inset 0 2px 0 var(--accent);
}

/* ---------- Spec table ---------- */

.spec {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.spec th,
.spec td {
  text-align: left;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.spec th {
  font-weight: 400;
  color: var(--muted);
  width: 45%;
}

/* ---------- Build log ---------- */

.log {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--border);
}

.log-entry {
  position: relative;
  padding: 0 0 40px 32px;
}

.log-entry::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 8px;
  width: 9px;
  height: 9px;
  background: var(--bg);
  border: 1px solid var(--accent);
}

.log-entry time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ---------- FAQ ---------- */

.faq details {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

.faq details:first-child {
  border-top: 1px solid var(--border);
}

.faq summary {
  font-family: var(--font-mono);
  cursor: pointer;
  list-style-position: outside;
}

.faq details p {
  margin: 12px 0 0;
  color: var(--muted);
}

/* ---------- Steps ---------- */

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  color: var(--accent);
}

/* ---------- CTA band ---------- */

.cta-band {
  text-align: left;
}

.cta-band h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 64px 32px;
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  margin-bottom: 48px;
}

.site-footer h4 {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li + li {
  margin-top: 8px;
}

.site-footer a {
  color: var(--text);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* Stacked containers inside one section (e.g. split + pipeline). */
.section .container + .container {
  margin-top: 48px;
}

.split--top {
  align-items: start;
}

.section--flush {
  border-top: 0;
}

.card .tag + h3 {
  margin-top: 16px;
}

.media--wide {
  aspect-ratio: 3 / 1;
}

.note {
  margin-top: 32px;
}

@media (max-width: 860px) {
  .site-nav ul a.nav-flagship {
    padding: 0 0 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    width: 100%;
  }
}

/* ---------- Role cards ---------- */

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 8px 0 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.9375rem;
}

.facts dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}

.facts dd {
  margin: 0;
}

.card .card-action {
  margin-top: auto;
  align-self: flex-start;
}

/* ---------- Photos ---------- */

figure.media {
  margin: 0;
}

.media--hero {
  aspect-ratio: 21 / 9;
}

.media--panorama {
  aspect-ratio: 12 / 5;
}

@media (max-width: 860px) {
  .media--hero,
  .media--panorama {
    aspect-ratio: 4 / 3;
  }
}

.media figcaption {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 6px 10px;
  background: rgba(15, 14, 13, 0.85);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.media.section-media {
  margin-top: 48px;
}

/* Image flush with the card's top edge. */
.card .card-media {
  aspect-ratio: 4 / 3;
  margin: -28px -28px 24px;
  border: 0;
  border-bottom: 1px solid var(--border);
}

.log-media {
  margin-top: 16px;
  max-width: 480px;
}

/* A card can also be a two-column split (e.g. flagship project card). */
.card.split {
  display: grid;
}

/* ---------- Carousel (open roles) ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.carousel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.search {
  flex: 1 1 280px;
  max-width: 420px;
}

.search input {
  width: 100%;
  font: inherit;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
}

.search input::placeholder {
  color: var(--muted);
}

.search input:focus {
  border-color: var(--accent);
  outline: none;
}

.carousel-status {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.carousel-nav {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.carousel-btn {
  padding: 10px 16px;
  font-size: 1rem;
}

.carousel-btn:disabled {
  opacity: 0.35;
  cursor: default;
  border-color: var(--border);
}

/* Three cards per view on desktop, two on tablet, one (with a peek) on phones. */
.carousel-track {
  --per-view: 3;
  list-style: none;
  margin: 0;
  padding: 0 0 12px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--per-view) - 1) * 24px) / var(--per-view));
  column-gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.carousel-slide {
  scroll-snap-align: start;
  display: flex;
}

.carousel-slide .card {
  width: 100%;
}

/* Empty/error message spans the full width instead of one column. */
.carousel-track:has(.carousel-empty) {
  display: block;
}

.carousel-empty {
  border: 1px dashed var(--border);
  padding: 28px;
}

@media (max-width: 1000px) {
  .carousel-track {
    --per-view: 2;
  }
}

@media (max-width: 640px) {
  .carousel-track {
    --per-view: 1.15;
  }
}

address {
  font-style: normal;
}

address.inline {
  display: inline;
}

address {
  font-style: normal;
}

address.inline {
  display: inline;
}

a.tag {
  text-decoration: none;
}

a.tag:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* ASM funding logo + disclaimer (white on transparent). */
.footer-asm {
  margin-bottom: 32px;
}

.footer-asm img {
  width: 100%;
  max-width: 400px;
  height: auto;
}

::selection {
  background: var(--brand);
  color: var(--text);
}

/* Footer logo mark */
.footer-mark {
  width: 120px;
  height: auto;
  margin-bottom: 16px;
}
