/* ==========================================================
   Bug In The System — FTC Team 30307
   Theme from our 2025–26 portfolio: crimson reds, Bebas Neue
   headings, slanted geometric shards, and our gear-ladybug logo.
   ========================================================== */

:root {
  --maroon: #660000;
  --maroon-deep: #4a0000;
  --crimson: #990000;
  --red: #cc0000;
  --bright: #e32424;
  --blush: #fbeaea;
  --blush-2: #f5d6d6;
  --ink: #1f0a0a;
  --muted: #6b4f4f;
  --paper: #ffffff;
  --line: #efd9d9;
  --radius: 6px;
  --maxw: 1180px;
  --font-head: "Bebas Neue", "Oswald", Impact, "Arial Narrow", sans-serif;
  --font-body: "Quicksand", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--crimson); }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 400;
  line-height: 1;
  margin: 0 0 0.4em;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
h1 { font-size: clamp(3.2rem, 9vw, 6.5rem); }
h2 { font-size: clamp(2.4rem, 5vw, 3.6rem); color: var(--crimson); }
h3 { font-size: 1.75rem; color: var(--crimson); }
p { margin: 0 0 1em; }
strong { font-weight: 700; }

.container { width: min(var(--maxw), 100% - 32px); margin-inline: auto; }
.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--ink); color: #fff; padding: 8px 14px;
}
.skip-link:focus { left: 8px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--maroon-deep);
  box-shadow: 0 4px 0 var(--crimson), 0 8px 0 var(--red);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand img { width: 52px; height: 52px; }
.brand-text { font-family: var(--font-head); font-size: 1.7rem; line-height: 0.95; letter-spacing: 0.02em; }
.brand-text small { display: block; font-size: 1rem; color: #ff8a8a; letter-spacing: 0.08em; }
.nav-links { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 8px 14px;
  color: #fff; text-decoration: none;
  font-family: var(--font-head); font-size: 1.3rem; letter-spacing: 0.04em;
  transition: background 0.2s;
}
.nav-links a:hover { background: var(--crimson); color: #fff; }
.nav-links a[aria-current="page"] { background: var(--red); clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%); }
.nav-toggle {
  display: none; background: none; border: 2px solid #fff;
  width: 44px; height: 44px; cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 20px; height: 2px; background: #fff; margin: auto; position: relative; transition: transform 0.2s;
}
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px);
    flex-direction: column; padding: 8px 16px 16px; background: var(--maroon-deep);
    display: none; border-bottom: 6px solid var(--red);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 12px; }
  .nav-links a[aria-current="page"] { clip-path: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px 10px;
  font-family: var(--font-head); font-size: 1.4rem; letter-spacing: 0.05em;
  text-decoration: none; border: 0; cursor: pointer;
  clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%);
  transition: transform 0.15s, background 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--bright); color: #fff; }
.btn-dark { background: var(--maroon); color: #fff; }
.btn-dark:hover { background: var(--maroon-deep); color: #fff; }
.btn-white { background: #fff; color: var(--crimson); }
.btn-white:hover { background: var(--blush); color: var(--maroon); }

/* ---------- Home hero (styled after the portfolio cover) ---------- */
.hero { position: relative; overflow: hidden; background: #fff; padding: clamp(40px, 7vw, 90px) 0 clamp(56px, 8vw, 100px); }
.hero-shards { position: absolute; inset: 0; pointer-events: none; }
.hero-shards span { position: absolute; top: 0; bottom: 0; right: 0; }
.hero-shards .a { width: 58%; background: var(--maroon); clip-path: polygon(38% 0, 100% 0, 100% 100%, 8% 100%); }
.hero-shards .b { width: 52%; background: var(--crimson); clip-path: polygon(48% 0, 100% 0, 100% 100%, 22% 100%); }
.hero-shards .c { width: 30%; background: var(--red); clip-path: polygon(70% 0, 100% 0, 100% 100%, 30% 100%); }
.hero-grid { position: relative; display: grid; gap: 40px; align-items: center; grid-template-columns: 1.1fr 1fr; }
.hero h1 { color: var(--crimson); margin-bottom: 0.1em; }
.hero h1 .num { display: block; color: var(--bright); }
.hero .kicker { font-family: var(--font-head); font-size: 1.5rem; color: var(--maroon); letter-spacing: 0.05em; margin-bottom: 18px; }
.hero .lead { max-width: 32em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-visual { position: relative; justify-self: center; width: 100%; max-width: 480px; }
.hero-visual .logo { width: 62%; margin: 0 auto -18%; position: relative; z-index: 2; filter: drop-shadow(0 8px 16px rgba(0,0,0,0.35)); animation: bob 6s ease-in-out infinite; }
.hero-visual .photo-frame { position: relative; z-index: 1; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(3deg); } }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-shards .a { width: 100%; top: auto; height: 46%; clip-path: polygon(0 18%, 100% 0, 100% 100%, 0 100%); }
  .hero-shards .b { width: 100%; top: auto; height: 38%; clip-path: polygon(0 30%, 100% 8%, 100% 100%, 0 100%); }
  .hero-shards .c { width: 100%; top: auto; height: 20%; clip-path: polygon(0 40%, 100% 0, 100% 100%, 0 100%); }
}

/* ---------- Page banner (inner pages, like portfolio page headers) ---------- */
.banner { position: relative; overflow: hidden; background: var(--crimson); color: #fff; padding: 56px 0 64px; }
.banner::before, .banner::after { content: ""; position: absolute; top: 0; bottom: 0; }
.banner::before { right: 0; width: 45%; background: var(--red); clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%); }
.banner::after { right: 0; width: 22%; background: var(--bright); clip-path: polygon(50% 0, 100% 0, 100% 100%, 20% 100%); }
.banner .container { position: relative; z-index: 1; display: flex; align-items: center; gap: 32px; justify-content: space-between; }
.banner h1 { font-size: clamp(3rem, 8vw, 5.5rem); margin-bottom: 0.15em; }
.banner p { font-size: 1.15rem; max-width: 38em; margin: 0; }
.banner .tag { font-family: var(--font-head); font-size: 1.3rem; letter-spacing: 0.08em; color: #ffb3b3; }
.banner img.banner-logo { width: 140px; flex: none; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.3)); }
@media (max-width: 700px) { .banner img.banner-logo { display: none; } }

/* ---------- Sections ---------- */
section { padding: clamp(56px, 8vw, 96px) 0; }
.section-blush { background: var(--blush); }
.section-dark { background: var(--maroon); color: #fff; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark p { color: #f3d6d6; }

/* Ribbon label, like the red title bars in the portfolio */
.ribbon {
  display: inline-block; background: var(--red); color: #fff;
  font-family: var(--font-head); font-size: 1.25rem; letter-spacing: 0.08em;
  padding: 6px 22px 4px 16px; margin-bottom: 16px;
  clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%);
}
.section-dark .ribbon { background: var(--bright); }
.section-head { max-width: 760px; margin-bottom: 40px; }
.section-head.center { text-align: center; margin-inline: auto; }
.lead { font-size: 1.15rem; color: var(--muted); }
.section-dark .lead { color: #f3d6d6; }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.split { display: grid; gap: 52px; align-items: center; grid-template-columns: 1fr 1fr; }
.split.top { align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

/* ---------- Tiles (the table-of-contents blocks) ---------- */
.tile {
  position: relative; color: #fff; padding: 26px 26px 24px;
  background: var(--crimson);
  clip-path: polygon(0 0, 100% 0, 97% 100%, 0 100%);
}
.tile:nth-child(3n+1) { background: var(--maroon); }
.tile:nth-child(3n+2) { background: var(--crimson); }
.tile:nth-child(3n) { background: var(--red); }
.tile h3 { color: #fff; margin-bottom: 8px; }
.tile p { color: #fde7e7; margin: 0; }
.tile .num { font-family: var(--font-head); font-size: 3.2rem; line-height: 1; color: #ffb3b3; display: block; margin-bottom: 6px; }

/* ---------- Cards ---------- */
.card {
  position: relative; background: #fff; border: 1px solid var(--line);
  border-top: 6px solid var(--red); padding: 26px; border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 10px 24px -16px rgba(102, 0, 0, 0.45);
}
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.icon {
  width: 56px; height: 56px; margin-bottom: 14px;
  display: grid; place-items: center; background: var(--red); color: #fff;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.icon svg { width: 26px; height: 26px; }

/* ---------- Photos ---------- */
.photo-frame { position: relative; }
.photo-frame::before {
  content: ""; position: absolute; inset: 14px -14px -14px 14px; background: var(--red);
  clip-path: polygon(6% 0, 100% 0, 100% 100%, 0 100%);
}
.photo-frame img { position: relative; width: 100%; height: 100%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 12px 30px -12px rgba(0,0,0,0.4); }
.photo-frame.tall img { aspect-ratio: 3 / 4; }
.photo-frame.wide img { aspect-ratio: 4 / 3; }
figure { margin: 0; }
figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 22px; }
.gallery { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-bottom: 5px solid var(--red); }
.gallery figcaption { margin-top: 8px; font-size: 0.85rem; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; }
.stat { text-align: center; padding: 22px 12px; border-left: 2px solid rgba(255,255,255,0.18); }
.stat:first-child { border-left: 0; }
.stat strong { display: block; font-family: var(--font-head); font-weight: 400; font-size: clamp(3.2rem, 7vw, 4.6rem); line-height: 1; color: #fff; }
.stat span { font-family: var(--font-head); font-size: 1.25rem; letter-spacing: 0.06em; color: #ffb3b3; }
.stats.light .stat { border-color: var(--line); }
.stats.light .stat strong { color: var(--red); }
.stats.light .stat span { color: var(--maroon); }

/* ---------- Lists ---------- */
.spot-list { list-style: none; padding: 0; margin: 0 0 1em; }
.spot-list li { position: relative; padding-left: 28px; margin-bottom: 8px; }
.spot-list li::before {
  content: ""; position: absolute; left: 0; top: 0.42em; width: 14px; height: 14px; background: var(--red);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.section-dark .spot-list li::before, .tile .spot-list li::before { background: #ffb3b3; }

/* ---------- Team ---------- */
.member { text-align: left; }
.member .name { font-family: var(--font-head); font-size: 2.2rem; line-height: 1; color: var(--crimson); margin: 0; }
.member .captain {
  display: inline-block; background: var(--bright); color: #fff; font-family: var(--font-head);
  font-size: 1rem; letter-spacing: 0.08em; padding: 3px 10px 1px; margin-left: 6px; vertical-align: middle;
}
.member .role { font-weight: 700; color: var(--maroon); margin: 6px 0 10px; font-size: 0.95rem; }
.member .fav { font-size: 0.95rem; color: var(--muted); margin: 0; }
.member .fav b { color: var(--red); font-weight: 700; }
.member .badge {
  position: absolute; top: 18px; right: 18px; width: 44px; height: 50px;
  display: grid; place-items: center; background: var(--blush-2); color: var(--crimson);
  font-family: var(--font-head); font-size: 1.5rem;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

/* ---------- Steps / process ---------- */
.steps { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); counter-reset: step; }
.step {
  position: relative; color: #fff; padding: 22px 26px 20px 18px; background: var(--crimson);
  clip-path: polygon(0 0, 88% 0, 100% 50%, 88% 100%, 0 100%, 10% 50%);
  min-height: 130px; display: flex; flex-direction: column; justify-content: center;
}
.step:first-child { clip-path: polygon(0 0, 88% 0, 100% 50%, 88% 100%, 0 100%); }
.step:nth-child(odd) { background: var(--red); }
.step::before { counter-increment: step; content: counter(step, decimal-leading-zero); font-family: var(--font-head); font-size: 1.1rem; color: #ffc9c9; padding-left: 12px; }
.step strong { font-family: var(--font-head); font-weight: 400; font-size: 1.4rem; line-height: 1.05; padding-left: 12px; }
@media (max-width: 700px) {
  .step, .step:first-child { clip-path: polygon(0 0, 100% 0, 100% 86%, 50% 100%, 0 86%); padding: 16px 18px 26px; min-height: 0; }
}

/* ---------- Timeline ---------- */
.timeline { position: relative; list-style: none; margin: 0; padding: 0 0 0 36px; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 4px; background: var(--blush-2); }
.timeline li { position: relative; margin-bottom: 26px; }
.timeline li::before {
  content: ""; position: absolute; left: -36px; top: 2px; width: 26px; height: 28px; background: var(--red);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.timeline .when { font-family: var(--font-head); font-size: 1.35rem; color: var(--red); letter-spacing: 0.04em; line-height: 1.1; }
.timeline h3 { font-size: 1.5rem; margin: 2px 0 4px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 0.95rem; }
.data-table th, .data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.data-table thead th { background: var(--crimson); color: #fff; font-family: var(--font-head); font-weight: 400; font-size: 1.15rem; letter-spacing: 0.04em; }
.data-table td.rpn { font-weight: 700; }
.data-table tr.hot td.rpn { color: var(--red); }

/* ---------- Iterations ---------- */
.iterations { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.iter { background: #fff; border-left: 6px solid var(--red); padding: 18px 20px; box-shadow: 0 8px 20px -14px rgba(102,0,0,0.5); }
.iter .when { font-family: var(--font-head); font-size: 1.4rem; color: var(--crimson); line-height: 1; }
.iter ul { margin: 8px 0 0; padding-left: 18px; font-size: 0.95rem; }

/* ---------- Sponsors ---------- */
.logo-wall { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.logo-slot {
  aspect-ratio: 16 / 9; display: grid; place-items: center; padding: 16px; text-align: center;
  background: #fff; border: 2px dashed var(--blush-2); color: var(--muted); font-weight: 700; font-size: 0.9rem;
}
.logo-slot img { max-height: 70px; object-fit: contain; }

/* ---------- CTA ---------- */
.cta {
  position: relative; overflow: hidden; background: var(--maroon); color: #fff;
  padding: clamp(32px, 6vw, 60px); display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
}
.cta::before { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 40%; background: var(--crimson); clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%); }
.cta::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 18%; background: var(--red); clip-path: polygon(55% 0, 100% 0, 100% 100%, 20% 100%); }
.cta > * { position: relative; z-index: 1; }
.cta h2 { color: #fff; margin-bottom: 4px; }
.cta p { margin: 0; max-width: 36em; color: #f3d6d6; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 16px; }
.form label { font-weight: 700; font-size: 0.95rem; display: grid; gap: 6px; color: var(--maroon); }
.form input, .form select, .form textarea { font: inherit; padding: 12px 14px; border: 2px solid var(--blush-2); background: #fff; color: var(--ink); border-radius: var(--radius); }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--red); }
.form textarea { min-height: 140px; resize: vertical; }
.form-note { font-size: 0.85rem; color: var(--muted); margin: 0; }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-list .icon { flex: none; width: 46px; height: 46px; margin: 0; }
.contact-list .icon svg { width: 20px; height: 20px; }

/* ---------- Footer ---------- */
.site-footer { position: relative; background: var(--maroon-deep); color: #f0caca; padding: 60px 0 26px; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 10px; background: linear-gradient(90deg, var(--maroon) 0 33%, var(--crimson) 33% 66%, var(--red) 66%); }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-size: 1.5rem; letter-spacing: 0.04em; }
.site-footer a { color: #f0caca; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.footer-brand img { width: 76px; }
.footer-brand strong { color: #fff; font-family: var(--font-head); font-weight: 400; font-size: 2rem; line-height: 1; display: block; }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.15); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: 0.85rem; }

/* ---------- Utilities ---------- */
.center { text-align: center; }
.mt { margin-top: 40px; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s, transform 0.6s; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
