/* FRC 4990 Gryphon Robotics — Crystal Springs Uplands School theme (blue + red, gold accent) */
:root {
  --navy: #043861;        /* CSUS blue, sampled from the gryphon logo */
  --navy-2: #0f5a8f;
  --red: #b4232c;         /* CSUS red */
  --red-2: #d8323c;
  --gold: #e8b84a;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --line: #e4e7ec;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --sans: 'Inter', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --display: 'Space Grotesk', 'Inter', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--navy-2); }
a:hover { color: var(--red); }

/* ---- top band ---- */
.band { background: linear-gradient(90deg, var(--navy) 0%, var(--navy-2) 70%, var(--red) 100%); color: #fff; }
.band .inner { display: flex; align-items: center; gap: 16px; padding: 14px 20px; max-width: 1280px; margin: 0 auto; }
.band .mark { width: 50px; height: 50px; flex: 0 0 50px; border-radius: 10px; background: #fff; padding: 4px; object-fit: contain; box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
.band .title { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: 0.5px; line-height: 1.1; }
.band .sub { font-size: 12px; opacity: 0.85; letter-spacing: 1.5px; text-transform: uppercase; }
.band .right { margin-left: auto; font-size: 12px; opacity: 0.85; text-align: right; }
.band a { color: #fff; text-decoration: none; }

/* ---- shell: left nav + content ---- */
.shell { display: grid; grid-template-columns: 240px 1fr; gap: 0; max-width: 1280px; width: 100%; margin: 0 auto; flex: 1; }
nav.side { border-right: 1px solid var(--line); background: var(--panel); padding: 22px 14px; }
nav.side .team { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: start; margin: 18px 10px 8px; padding-top: 14px; border-top: 2px solid var(--line); }
nav.side .team:first-child { border-top: 0; padding-top: 0; margin-top: 4px; }
nav.side .team .prog { grid-column: 1 / -1; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
nav.side .team .num { font-family: var(--display); font-size: 22px; font-weight: 800; color: var(--navy); line-height: 1; letter-spacing: -0.3px; }
nav.side .team .name { font-size: 19px; font-weight: 800; color: var(--red); text-transform: uppercase; letter-spacing: 0.4px; line-height: 1; }
nav.side .group { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 14px 10px 6px; }
nav.side a { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 15px; }
nav.side a:hover { background: var(--bg); color: var(--navy); }
nav.side a.active { background: var(--navy); color: #fff; }
nav.side a.sub { padding-left: 26px; font-weight: 500; font-size: 14px; }
nav.side .note { font-size: 12px; color: var(--muted); margin: 18px 12px 0; line-height: 1.5; }
main { padding: 26px 32px 60px; min-width: 0; }
h1 { font-family: var(--display); font-size: 30px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
h2 { font-family: var(--display); font-size: 20px; color: var(--navy); margin: 28px 0 10px; }
h3 { font-size: 15px; color: var(--ink-2); margin: 18px 0 6px; letter-spacing: 0.5px; text-transform: uppercase; }
p { line-height: 1.65; color: var(--ink-2); margin-bottom: 12px; max-width: 76ch; }
.lede { font-size: 17px; color: var(--muted); }
.muted { color: var(--muted); }
code { font-family: var(--mono); font-size: 0.92em; background: #eef1f6; padding: 1px 6px; border-radius: 4px; }

/* ---- hero with the 3D robot ---- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: stretch; }
.hero .stage { position: relative; height: 460px; border-radius: var(--radius); overflow: hidden; background: radial-gradient(ellipse at 50% 30%, #1273b8 0%, var(--navy) 55%, #021a30 100%); box-shadow: 0 14px 40px -18px rgba(20,40,94,0.6); }
.hero .stage canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.hero .stage canvas:active { cursor: grabbing; }
.hero .hint { position: absolute; left: 14px; bottom: 12px; font-size: 12px; color: rgba(255,255,255,0.8); background: rgba(0,0,0,0.25); padding: 5px 10px; border-radius: 999px; pointer-events: none; }
.hero .stage .loading { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-family: var(--mono); font-size: 13px; letter-spacing: 1px; }
.hero .copy { display: flex; flex-direction: column; justify-content: center; }
.hero .copy .kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 2px; color: var(--red); text-transform: uppercase; margin-bottom: 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: inherit; display: block; }
.card:hover { border-color: var(--navy-2); box-shadow: 0 8px 24px -16px rgba(20,40,94,0.5); }
.card .k { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; }
.card .v { font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--navy); margin-top: 4px; }
.card .n { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.45; }

/* ---- tables ---- */
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 14px; margin: 10px 0 18px; }
th { text-align: left; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); background: #f2f4f8; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.red { color: var(--red); font-weight: 600; }
.blue { color: var(--navy-2); font-weight: 600; }
.pill { display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; padding: 2px 8px; border-radius: 999px; border: 1px solid; }
.pill.win { color: #087443; border-color: #8fd3b1; background: #e7f7ee; }
.pill.loss { color: var(--red); border-color: #f0b3b7; background: #fdecee; }
.pill.red-a { color: var(--red); border-color: #f0b3b7; }
.pill.blue-a { color: var(--navy-2); border-color: #b9c6ee; }
.teams a { text-decoration: none; }
.teams .us { font-weight: 800; text-decoration: underline; }

/* ---- analysis blocks ---- */
.analysis { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 16px 18px; margin: 12px 0; }
.analysis h3 { margin-top: 0; }
.analysis .empty { color: var(--muted); font-style: italic; }
.score { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 14px 0 18px; }
.score .side { text-align: center; }
.score .side .lab { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }
.score .side .pts { font-family: var(--display); font-size: 44px; font-weight: 700; line-height: 1; margin: 6px 0; }
.score .vs { font-family: var(--mono); color: var(--muted); }
.score .side.won .pts { text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 8px; }

/* ---- champion banner + photos ---- */
.banner { background: linear-gradient(90deg, var(--navy) 0%, var(--navy-2) 60%, var(--red) 100%); color: #fff; border-radius: var(--radius); padding: 18px 22px; margin: 6px 0 18px; box-shadow: 0 14px 40px -22px rgba(4,56,97,0.8); }
.banner .k { font-family: var(--mono); font-size: 11px; letter-spacing: 2.5px; opacity: 0.85; }
.banner .v { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: 1px; margin: 4px 0 6px; color: var(--gold); }
.banner .n { font-size: 14px; line-height: 1.5; opacity: 0.95; }
.banner a { color: #fff; }
.story { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; margin: 22px 0 10px; }
.story h2 { margin-top: 0; }
.story p { max-width: 80ch; }
.story .score-line { font-family: var(--mono); font-size: 13px; color: var(--ink-2); background: var(--bg); border-radius: 8px; padding: 10px 14px; display: inline-block; margin: 6px 0 12px; }
.strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 16px 0 8px; }
.strip a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #000; aspect-ratio: 4 / 3; }
.strip img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.strip a:hover img { transform: scale(1.04); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 14px; }
.gallery figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery figure.tall { grid-row: span 2; }
.gallery img { width: 100%; height: auto; display: block; }
.gallery figcaption { padding: 10px 12px 12px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.gallery .when { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 4px; }
@media (max-width: 860px) { .strip { grid-template-columns: repeat(2, 1fr); } }

/* ---- rendered markdown (working record) ---- */
.doc { max-width: 86ch; }
.doc h1 { margin-bottom: 4px; }
.doc h1 + p { color: var(--muted); font-size: 13px; }
.doc h2 { margin-top: 30px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.doc h3 { text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--navy); }
.doc ul, .doc ol { margin: 0 0 14px 22px; line-height: 1.6; color: var(--ink-2); }
.doc li { margin-bottom: 4px; }
.doc table { font-size: 13.5px; }
.doc td, .doc th { white-space: normal; }
.doc code { white-space: nowrap; }
.doc pre { background: #0f1c2e; color: #e8edf5; padding: 12px 14px; border-radius: 8px; overflow-x: auto; font-family: var(--mono); font-size: 13px; margin: 10px 0 16px; }
.doc pre code { background: none; color: inherit; padding: 0; white-space: pre; }
.doc blockquote { border-left: 4px solid var(--gold); margin: 10px 0; padding: 4px 14px; color: var(--ink-2); background: #fffbf0; }
.doc strong { color: var(--ink); }
.doc hr { border: none; border-top: 1px solid var(--line); margin: 22px 0; }

/* ---- placeholders ---- */
.slot { border: 2px dashed #c9d2e3; border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); background: #fbfcfe; }
.slot b { color: var(--ink-2); }

footer { border-top: 1px solid var(--line); background: var(--panel); font-size: 12px; color: var(--muted); text-align: center; padding: 16px; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  nav.side { border-right: none; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px; padding: 10px; }
  nav.side .group, nav.side .team, nav.side .note { display: none; }
  nav.side a.sub { padding-left: 12px; }
  main { padding: 18px 16px 40px; }
  .hero { grid-template-columns: 1fr; }
  .hero .stage { height: 340px; }
}

/* ---- sportsmanship card inset on the home page ---- */
.card-note { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: center; margin: 10px 0 14px; }
.card-note .card-img { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: 0 10px 28px -16px rgba(4,56,97,0.5); transform: rotate(-1.5deg); }
.card-note .card-img img { width: 100%; height: auto; display: block; }
.card-note p { margin: 0; }
@media (max-width: 860px) { .card-note { grid-template-columns: 1fr; } .card-note .card-img { max-width: 220px; } }
nav.side .soon { display: block; padding: 8px 12px; font-size: 13px; color: var(--muted); font-style: italic; }

/* brand / icon downloads */
.icon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 18px; }
.icon-tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.icon-preview { padding: 18px; background: repeating-conic-gradient(#e9edf2 0 25%, #fff 0 50%) 0 0 / 24px 24px; }
.icon-preview img { display: block; width: 100%; height: auto; }
.icon-meta { padding: 12px 16px 16px; display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }
.icon-meta b { color: var(--navy); font-size: 16px; }
.icon-meta .dl { margin-top: 6px; font-weight: 600; }

/* team area: locked links carry a small padlock */
a.locked::after { content: "\1F512"; font-size: 10px; margin-left: 6px; opacity: 0.75; }
.lock-legend::before { content: "\1F512"; font-size: 10px; margin-right: 4px; }
nav.side a.locked::after { float: right; margin-top: 3px; }
