/* RDR2 Bike Mod - site styles. Plain CSS, no build step. */

:root {
  --bg: #f5efe4;
  --bg-raised: #fbf8f2;
  --bg-sunken: #ece4d5;
  --text: #2a231c;
  --text-muted: #6b5f52;
  --border: #d9cdb9;
  --accent: #a3341f;
  --accent-text: #fffaf3;
  --accent-soft: #f3dcd3;
  --link: #8c2a17;
  --code-bg: #ece4d5;
  --ok: #3f6b2f;
  --warn: #8a5a00;
  --warn-soft: #f6e7c8;
  --shadow: 0 1px 2px rgba(60, 40, 20, 0.06), 0 4px 16px rgba(60, 40, 20, 0.06);
  --radius: 10px;
  --max: 1080px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17130f;
    --bg-raised: #211b16;
    --bg-sunken: #120f0c;
    --text: #ece3d6;
    --text-muted: #b2a594;
    --border: #3a3029;
    --accent: #d4553b;
    --accent-text: #1a0f0b;
    --accent-soft: #3a1e17;
    --link: #f08a6f;
    --code-bg: #2a221c;
    --ok: #8fc27a;
    --warn: #e7b04a;
    --warn-soft: #3a2c12;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

h1,
h2,
h3 {
  font-family: var(--serif);
  line-height: 1.2;
  font-weight: 700;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 3.3rem);
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 2.2em 0 0.6em;
}

h3 {
  font-size: 1.2rem;
  margin: 1.8em 0 0.5em;
}

p,
ul,
ol {
  margin: 0 0 1em;
}

li + li {
  margin-top: 0.3em;
}

code,
kbd {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--code-bg);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  overflow-wrap: anywhere;
}

kbd {
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  font-weight: 600;
  /* A key name never breaks across lines ("Insert", "Page Up"). */
  white-space: nowrap;
  overflow-wrap: normal;
}

pre {
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.5;
  background: var(--code-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 1.2em;
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--accent);
  color: var(--accent-text);
  padding: 8px 14px;
  border-radius: 6px;
  z-index: 10;
}

.skip:focus {
  left: 8px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}

.brand svg {
  width: 34px;
  height: 34px;
  flex: none;
}

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

.nav li + li {
  margin-top: 0;
}

.nav a {
  display: block;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav a:hover {
  background: var(--bg-sunken);
}

.nav a[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-text);
}

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

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px 64px;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding-top: 40px;
}

.page.tight {
  padding-top: 0;
}

.page > h1 + .lead {
  margin-top: -0.2em;
}

.lead {
  font-size: 1.18rem;
  color: var(--text-muted);
  max-width: 62ch;
}

.toc {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin: 24px 0 8px;
}

.toc strong {
  display: block;
  font-family: var(--serif);
  margin-bottom: 4px;
}

.toc ol {
  margin: 0;
  padding-left: 1.3em;
}

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

.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 56px 0 24px;
}

.hero p.lead {
  margin-bottom: 1.4em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--warn);
  background: var(--warn-soft);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 18px;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--accent);
}

.button.primary {
  background: var(--accent);
  color: var(--accent-text);
}

.button.secondary {
  color: var(--link);
}

.button:hover {
  filter: brightness(1.06);
}

.hero-art {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.hero-art svg {
  display: block;
  width: 100%;
}

/* Grid items may shrink below their content's width (the SVG, long code), so nothing overflows
   a phone screen. */
.hero > *,
.flow > *,
.cards > * {
  min-width: 0;
}

.svg-ink {
  stroke: var(--text);
}

.svg-accent {
  stroke: var(--accent);
}

.svg-fill-accent {
  fill: var(--accent);
}

.svg-text {
  fill: var(--text-muted);
  font: 600 13px var(--sans);
}

.svg-ground {
  stroke: var(--border);
}

/* --- Sections and cards ------------------------------------------------------------------- */

.section-title {
  text-align: center;
  margin-top: 64px;
}

.section-intro {
  text-align: center;
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0 auto 28px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin-top: 0;
}

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

.card .num {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--link);
  font-weight: 700;
  margin-bottom: 10px;
}

a.card {
  color: inherit;
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

a.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

a.card .more {
  color: var(--link);
  font-weight: 600;
}

.flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 10px;
}

.flow .arrow {
  align-self: center;
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 700;
}

.flow .back {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  border-top: 2px dashed var(--border);
  padding-top: 10px;
  margin-top: 6px;
}

/* --- Tables and callouts -------------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.4em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}

thead th {
  background: var(--bg-sunken);
  font-weight: 600;
}

tbody tr:last-child td {
  border-bottom: none;
}

td.nowrap,
th.nowrap {
  white-space: nowrap;
}

.callout {
  border-left: 4px solid var(--accent);
  background: var(--bg-raised);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 18px;
  margin: 0 0 1.4em;
}

.callout.warn {
  border-color: var(--warn);
  background: var(--warn-soft);
}

.callout p:last-child {
  margin-bottom: 0;
}

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

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 46px;
  margin-bottom: 1.2em;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--link);
  font-weight: 700;
}

details {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 10px;
}

details summary {
  cursor: pointer;
  font-weight: 600;
}

details[open] summary {
  margin-bottom: 8px;
}

details p:last-child {
  margin-bottom: 0;
}

.status-list {
  list-style: none;
  padding: 0;
}

.status-list li {
  padding-left: 28px;
  position: relative;
}

.status-list li::before {
  position: absolute;
  left: 0;
  font-weight: 700;
}

.status-list .done::before {
  content: "✓";
  color: var(--ok);
}

.status-list .todo::before {
  content: "○";
  color: var(--warn);
}

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

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 16px 36px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 32px;
}

.footer-inner p {
  margin: 0;
}

.footer-inner nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-inner nav li + li {
  margin-top: 0;
}

/* --- Small screens ------------------------------------------------------------------------ */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 36px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .flow {
    grid-template-columns: 1fr;
  }

  .flow .arrow {
    justify-self: center;
    transform: rotate(90deg);
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .header-inner {
    gap: 8px;
  }

  .nav a {
    padding: 5px 10px;
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  a.card {
    transition: none;
  }
}
