/* ===== Combine Derby — shared design system ===== */

@font-face {
  font-family: "Racing Sans One";
  src: url("fonts/racing-sans-one.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --asphalt: #16181c;
  --asphalt-raised: #1f2228;
  --plate: #2a2e35;
  --line: #3a3f47;
  --off-white: #ededed;
  --dim: #9aa0a8;
  --stripe-red: #c8282a;
  --stripe-white: #f4f1ea;
  --flag-yellow: #f4c430;
  --iowa-green: #1f4d3d;
  --iowa-cream: #f4ecd8;

  --font-display: "Racing Sans One", "Arial Narrow", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Consolas, monospace;

  --radius: 4px;
  --max-width: 72rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--asphalt);
  color: var(--off-white);
  font-family: var(--font-body);
  line-height: 1.5;
}

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

a { color: var(--flag-yellow); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
  line-height: 1.15;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.1rem; }

p { color: var(--off-white); }
.dim { color: var(--dim); }

/* ---- layout shell ---- */

.site-header {
  border-bottom: 4px solid var(--stripe-red);
  background:
    repeating-linear-gradient(
      -45deg,
      var(--stripe-red) 0 14px,
      var(--stripe-white) 14px 28px
    );
  background-size: 100% 6px;
  background-repeat: no-repeat;
  background-position: bottom;
  background-color: var(--asphalt-raised);
}

.site-header nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-header .brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  text-transform: uppercase;
  color: var(--off-white);
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.site-header .brand:hover { text-decoration: none; }

.site-header .brand img {
  height: 1.4rem;
  width: auto;
  display: inline-block;
}

.site-header .links { display: flex; gap: 1.5rem; }

.site-header .links a {
  color: var(--off-white);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.site-header .links a:hover { color: var(--flag-yellow); text-decoration: none; }

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--dim);
  font-size: 0.85rem;
}

/* ---- checkered divider ---- */

.checker-rule {
  height: 12px;
  margin: 2.5rem 0;
  background-image:
    linear-gradient(45deg, var(--off-white) 25%, transparent 25%, transparent 75%, var(--off-white) 75%),
    linear-gradient(45deg, var(--off-white) 25%, transparent 25%, transparent 75%, var(--off-white) 75%);
  background-size: 12px 12px;
  background-position: 0 0, 6px 6px;
  background-color: var(--asphalt);
  opacity: 0.5;
}

/* ---- number-plate badge ---- */

.plate {
  display: inline-block;
  background: var(--plate);
  border: 2px solid var(--off-white);
  border-radius: var(--radius);
  padding: 0.15rem 0.6rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--off-white);
}

/* ---- home hero ---- */

.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}

.hero p.tagline {
  color: var(--dim);
  font-size: 1.1rem;
  max-width: 34rem;
  margin: 0.75rem auto 0;
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 1rem;
}

.btn-primary {
  background: var(--stripe-red);
  color: var(--stripe-white);
}
.btn-primary:hover { background: #e0302f; text-decoration: none; }

.btn-outline {
  border: 2px solid var(--off-white);
  color: var(--off-white);
}
.btn-outline:hover { border-color: var(--flag-yellow); color: var(--flag-yellow); text-decoration: none; }

/* ---- cards (used on home "latest" strip, engineering list) ---- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--asphalt-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card .thumb {
  aspect-ratio: 16 / 10;
  background: var(--plate);
  object-fit: cover;
  width: 100%;
}

.card .card-body { padding: 1rem; }

.card h3 { margin-bottom: 0.35rem; }

.card h3 a { color: var(--off-white); }
.card h3 a:hover { color: var(--flag-yellow); }

.card .meta {
  font-size: 0.8rem;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}

/* ---- gallery grid ---- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.75rem;
}

.gallery-grid a {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.gallery-grid img, .gallery-grid video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.gallery-grid a:hover img,
.gallery-grid a:hover video { transform: scale(1.05); }

/* ---- lightbox ---- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 13, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}

.lightbox.open { display: flex; }

.lightbox img, .lightbox video {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius);
}

.lightbox .close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--off-white);
  cursor: pointer;
  background: none;
  border: none;
}

/* ---- engineering article ---- */

.article-header { margin-bottom: 2rem; }

.decision-summary {
  background: var(--asphalt-raised);
  border-left: 4px solid var(--flag-yellow);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 2rem;
  font-size: 1.05rem;
}

.decision-summary .label {
  font-family: var(--font-display);
  text-transform: uppercase;
  color: var(--flag-yellow);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.35rem;
}

article.writeup { max-width: 42rem; }
article.writeup h2 { margin-top: 2rem; }
article.writeup p { margin: 1rem 0; }

/* ---- Iowa welcome sign ---- */

.iowa-sign-wrap {
  display: flex;
  justify-content: center;
  margin: 2.5rem 0;
}

.iowa-sign {
  position: relative;
  background: var(--iowa-green);
  border: 6px solid var(--iowa-cream);
  border-radius: 10px;
  padding: 1.5rem 2.5rem 2rem;
  text-align: center;
  max-width: 26rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.iowa-sign::before,
.iowa-sign::after {
  content: "";
  position: absolute;
  bottom: -2.5rem;
  width: 14px;
  height: 2.5rem;
  background: var(--plate);
  border: 2px solid var(--line);
  border-radius: 2px;
}

.iowa-sign::before { left: 2.5rem; }
.iowa-sign::after { right: 2.5rem; }

.iowa-sign .state-icon {
  height: 3.5rem;
  width: auto;
  margin: 0 auto 0.75rem;
  display: block;
}

.iowa-sign .welcome {
  color: var(--iowa-cream);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin: 0;
}

.iowa-sign h2 {
  font-family: var(--font-display);
  color: var(--flag-yellow);
  font-size: 2.4rem;
  margin: 0.15rem 0;
  letter-spacing: 0.04em;
}

.iowa-sign .tagline {
  color: var(--iowa-cream);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: 0.25rem 0 0;
}

/* small inline state watermark, e.g. footer */

.state-watermark {
  height: 1.5rem;
  width: auto;
  opacity: 0.6;
  vertical-align: middle;
  margin-right: 0.4rem;
}
