/* SimPitch: United red on a mown pitch.
   Tokens first, then base, navbar, hero, ticker, strip, cards, band, footer, motion. */
:root {
  --red: #DB1D24;            /* manutd.com red */
  --red-dark: #B3141A;
  --pitch-dark: #1E6B32;     /* mown stripe, dark */
  --pitch-light: #2E8B43;    /* mown stripe, light */
  --deep: #0A2A17;           /* floodlit-night green for nav, footer, overlays */
  --chalk: #F5F7F2;
  --ink: #101A13;
  --line: #DCE3DA;
  --muted: #56635A;
  --white-line: rgba(255,255,255,.82);
  --head: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --page-max: 1180px;
  --ease: cubic-bezier(.2,.7,.2,1);
  --stripes: repeating-linear-gradient(90deg, var(--pitch-dark) 0 60px, var(--pitch-light) 60px 120px);
}

html, body { background: var(--chalk); color: var(--ink); }
body { font-family: var(--body); font-size: 1.04rem; line-height: 1.65; }

h1, h2, h3, h4, .quarto-title-block .title {
  font-family: var(--head); font-variation-settings: "SOFT" 0, "WONK" 0;
}
.navbar, .sp-tag, .sp-btn { font-family: var(--body); }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.015em; line-height: 1.1; color: var(--ink); }
h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); }
h2 { font-size: clamp(1.45rem, 2.5vw, 2rem); margin-top: 2.2rem; border-bottom: none; }
p, li { max-width: 72ch; }
a { color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--red-dark); }
::selection { background: var(--red); color: #fff; }

a:focus-visible, button:focus-visible, .sp-btn:focus-visible {
  outline: 3px solid var(--red); outline-offset: 2px;
}

/* ---------- Reading progress bar ---------- */
.sp-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 2000;
  background: var(--red); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none;
}

/* ---------- Navbar ---------- */
.navbar {
  background: var(--deep) !important;
  border-bottom: 3px solid var(--red);
  padding-top: .5rem; padding-bottom: .5rem;
}
.navbar .nav-link {
  position: relative; font-weight: 600; font-size: .95rem; color: #fff !important;
  padding: .5rem .85rem; letter-spacing: .01em;
}
.navbar .nav-link::after {
  content: ""; position: absolute; left: .85rem; right: .85rem; bottom: .2rem; height: 2px;
  background: var(--red); transform: scaleX(0); transform-origin: 0 50%; transition: transform .25s var(--ease);
}
.navbar .nav-link:hover::after, .navbar .nav-link.active::after { transform: scaleX(1); }
.navbar .navbar-nav.ms-auto > .nav-item:last-child .nav-link {
  background: var(--red); border-radius: 999px; margin-left: .5rem; padding: .5rem 1.1rem;
  transition: background .2s, transform .2s var(--ease);
}
.navbar .navbar-nav.ms-auto > .nav-item:last-child .nav-link::after { display: none; }
.navbar .navbar-nav.ms-auto > .nav-item:last-child .nav-link:hover { background: var(--red-dark); transform: translateY(-1px); }
.navbar .navbar-brand img { height: 32px; }
#quarto-search .aa-DetachedSearchButtonIcon, .navbar .bi { color: #fff !important; }
#quarto-content, .page-columns { max-width: var(--page-max); margin-left: auto; margin-right: auto; }

/* ---------- Inner-page title banner: a strip of mown pitch ---------- */
.quarto-title-banner {
  background: var(--stripes) !important; color: #fff; position: relative; overflow: hidden;
  border-bottom: 4px solid var(--red); margin-bottom: 1.5rem !important;
}
.quarto-title-banner::after {
  content: ""; position: absolute; top: -40%; right: 6%; width: 260px; height: 260px;
  border: 3px solid var(--white-line); border-radius: 50%; opacity: .35; pointer-events: none;
}
.quarto-title-banner .title, .quarto-title-banner .subtitle, .quarto-title-banner .description { color: #fff !important; }
.quarto-title-banner .quarto-categories .quarto-category {
  background: var(--red); color: #fff; border: none; font-family: var(--body); font-weight: 700;
}
.quarto-title-meta-heading, .quarto-title-meta-contents { font-family: var(--body); }

/* ---------- Buttons and tags ---------- */
.sp-btn {
  display: inline-flex; align-items: center; gap: .5rem; background: var(--red); color: #fff !important;
  font-weight: 700; padding: .75rem 1.35rem; border-radius: 999px; text-decoration: none;
  transition: background .2s, transform .2s var(--ease), box-shadow .2s;
}
.sp-btn::after { content: "→"; transition: transform .2s var(--ease); }
.sp-btn:hover { background: var(--red-dark); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(219,29,36,.35); }
.sp-btn:hover::after { transform: translateX(4px); }
.sp-tag {
  display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  color: var(--pitch-dark); background: #E2EFE4; padding: .2rem .55rem; border-radius: 3px;
}
.sp-tag.free { background: var(--red); color: #fff; }
.sp-hero-text .sp-tag { background: var(--red); color: #fff; }

/* ---------- Home layout (escape Quarto's page grid) ---------- */
.sp-wrap, .sp-wrap.page-columns { display: block !important; grid-column: 1 / -1 !important; width: min(1124px, calc(100% - 2rem)); margin: 0 auto; }
.sp-wrap > * { grid-column: auto !important; }

/* ---------- Home: hero with a live pitch ---------- */
.sp-hero, .sp-hero.page-columns { display: flex !important; gap: 1.5rem; margin: 1.5rem 0 1rem; }
.sp-hero > * { grid-column: auto !important; }
.sp-hero-main { flex: 2 1 0; min-width: 0; }
.sp-latest { flex: 1 1 0; min-width: 0; }
.sp-hero-main {
  position: relative; color: #fff; border-radius: 10px; overflow: hidden;
  min-height: 470px; display: flex; align-items: flex-end;
  background: repeating-linear-gradient(90deg, var(--pitch-dark) 0 9.09%, var(--pitch-light) 9.09% 18.18%);
  box-shadow: 0 18px 40px rgba(10,42,23,.25);
}
.sp-pitch-svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .4s var(--ease); }
.sp-pitch-svg .mark { fill: none; stroke: var(--white-line); stroke-width: 3; }
.sp-pitch-svg .spot { fill: var(--white-line); }
.sp-pitch-svg .run { fill: none; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 8 10; opacity: .9; }
.sp-pitch-svg .run.red { stroke: var(--red); }
.sp-pitch-svg .run.white { stroke: #fff; }
.sp-pitch-svg .pass { fill: none; stroke: #fff; stroke-width: 2; stroke-dasharray: 2 8; stroke-linecap: round; opacity: .7; }
.sp-pitch-svg .player { fill: var(--red); stroke: #fff; stroke-width: 3; }
.sp-pitch-svg .player.opp { fill: #fff; stroke: var(--deep); }
.sp-pitch-svg .halo { fill: none; stroke: var(--red); stroke-width: 3; transform-box: fill-box; transform-origin: center; }
.sp-pitch-svg .ball { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.sp-hero-main::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, rgba(10,42,23,.94) 0%, rgba(10,42,23,.78) 40%, rgba(10,42,23,.05) 75%);
}
.sp-hero-text { position: relative; z-index: 1; padding: 2rem; max-width: 600px; }
.sp-hero-text h1 { color: #fff; margin: .6rem 0 .7rem; }
.sp-hero-text h1 em { font-style: normal; color: var(--red); background: #fff; padding: 0 .2em; border-radius: 4px; }
.sp-hero-text p { color: #E3EEE6; margin-bottom: 1.2rem; }

/* Latest: a numbered team-sheet */
.sp-latest { padding: .25rem 0 0 1.5rem; border-left: 1px solid var(--line); counter-reset: sheet; }
.sp-latest h2 {
  font-size: .8rem; margin: 0 0 .5rem; font-family: var(--body); text-transform: uppercase; letter-spacing: .12em; color: var(--red);
}
.sp-latest ul { list-style: none; padding: 0; margin: 0; }
.sp-latest li {
  counter-increment: sheet; display: grid; grid-template-columns: 2.4rem 1fr; align-items: start;
  padding: .85rem 0; border-bottom: 1px solid var(--line); font-weight: 700; line-height: 1.3;
}
.sp-latest li::before {
  content: counter(sheet); font-family: var(--head); font-size: 1.7rem; font-weight: 800; color: var(--red); line-height: 1;
}
.sp-latest li:last-child { border-bottom: none; }
.sp-latest small { display: block; font-weight: 400; color: var(--muted); margin-top: .15rem; }
.sp-latest a { color: var(--ink); text-decoration: none; background: linear-gradient(var(--red), var(--red)) 0 100% / 0 2px no-repeat; transition: background-size .3s var(--ease); }
.sp-latest a:hover { color: var(--ink); background-size: 100% 2px; }

/* ---------- Home: stadium advertising-board ticker ---------- */
.sp-ticker {
  overflow: hidden; background: var(--red); color: #fff; border-radius: 6px; margin: 1.25rem 0 1rem;
  font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: .85rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.sp-ticker-track { display: flex; width: max-content; }
.sp-ticker-track span { padding: .7rem 0; white-space: nowrap; }
.sp-ticker-track span::after { content: "●"; margin: 0 1.4rem; opacity: .6; font-size: .6rem; vertical-align: middle; }

/* ---------- Home: fixture strip ---------- */
.sp-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin: 0 0 2.5rem; }
.sp-strip > div {
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.15rem;
  border-bottom: 3px solid var(--pitch-light); transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.sp-strip > div:hover { transform: translateY(-3px); border-bottom-color: var(--red); box-shadow: 0 10px 22px rgba(16,26,19,.08); }
.sp-strip b { font-family: var(--head); display: block; font-size: 1.1rem; line-height: 1.25; margin-top: .2rem; }
.sp-strip span { color: var(--red); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Home: section headers ---------- */
.sp-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 2.75rem 0 1.1rem; }
.sp-section-head h2 { margin: 0; display: flex; align-items: center; gap: .65rem; }
.sp-section-head h2::before {
  /* corner flag */
  content: ""; width: 14px; height: 22px; flex: none; background: var(--red);
  clip-path: polygon(0 0, 100% 25%, 0 50%); box-shadow: inset 2px 0 0 var(--ink);
}
.sp-section-head a { font-weight: 700; white-space: nowrap; text-decoration: none; }
.sp-section-head a::after { content: " →"; display: inline-block; transition: transform .2s var(--ease); }
.sp-section-head a:hover::after { transform: translateX(4px); }

/* ---------- Cards (listings and manual grids) ---------- */
.quarto-listing-grid .card, .sp-card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: none;
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
.quarto-listing-grid .card::before, .sp-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; z-index: 2;
  background: var(--red); transform: scaleX(0); transform-origin: 0 50%; transition: transform .35s var(--ease);
}
.quarto-listing-grid .card:hover, .sp-card:hover { transform: translateY(-5px); box-shadow: 0 16px 32px rgba(10,42,23,.12); border-color: transparent; }
.quarto-listing-grid .card:hover::before, .sp-card:hover::before { transform: scaleX(1); }
.quarto-listing-grid .card-img-top { transition: transform .5s var(--ease); }
.quarto-listing-grid .card:hover .card-img-top { transform: scale(1.04); }
.quarto-listing-grid .card-title, .sp-card h3 { font-family: var(--head); font-weight: 800; line-height: 1.2; }
.quarto-listing-grid .listing-categories .listing-category {
  background: #E2EFE4; color: var(--pitch-dark); border: none; border-radius: 3px; font-weight: 800;
}
.quarto-listing .listing-title, .quarto-listing .card-title { font-family: var(--head); font-weight: 800; color: var(--ink); line-height: 1.2; }
.quarto-listing .listing-category { text-transform: uppercase; letter-spacing: .06em; font-weight: 800; font-size: .7rem; }
.quarto-listing .listing-date, .quarto-listing .card-footer { color: var(--muted); text-transform: none; }
.quarto-listing-category .category.active, .quarto-listing-category .category:hover { color: var(--red); }

.sp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.sp-grid.two { grid-template-columns: repeat(2, 1fr); }
.sp-card { padding: 1.3rem 1.3rem 1.4rem; }
.sp-card::after {
  /* a corner of pitch that grows on hover */
  content: ""; position: absolute; right: -36px; bottom: -36px; width: 90px; height: 90px; border-radius: 50%;
  background: repeating-linear-gradient(90deg, var(--pitch-dark) 0 12px, var(--pitch-light) 12px 24px);
  opacity: .14; transition: transform .45s var(--ease), opacity .3s;
}
.sp-card:hover::after { transform: scale(1.6); opacity: .22; }
.sp-card h3 { font-size: 1.22rem; margin: .65rem 0 .35rem; }
.sp-card p { color: var(--muted); font-size: .97rem; margin: 0; position: relative; }

/* ---------- Subscribe band: centre circle on a mown pitch ---------- */
.sp-band {
  position: relative; overflow: hidden; color: #fff; border-radius: 12px; padding: 2.4rem 2.2rem; margin: 3.25rem 0 1.5rem;
  background: var(--stripes);
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.sp-band::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 240px; height: 240px; margin: -120px 0 0 -120px;
  border: 3px solid var(--white-line); border-radius: 50%; opacity: .45;
}
.sp-band::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--white-line); opacity: .45; }
.sp-band > * { position: relative; z-index: 1; }
.sp-band h2 { color: #fff; margin: 0 0 .3rem; }
.sp-band p { margin: 0; color: #E3EEE6; }

/* ---------- Footer ---------- */
.nav-footer { border-top: 3px solid var(--red); background: var(--deep); color: #DCE8DF; font-size: .9rem; }
.nav-footer a { color: #fff; }

/* ---------- Article pages ---------- */
.quarto-title-block .title { font-weight: 800; }
figure img, .figure img { border-radius: 6px; }
div.sourceCode { border-radius: 6px; }
main h2 { position: relative; padding-left: .9rem; }
main h2::before { content: ""; position: absolute; left: 0; top: .15em; bottom: .15em; width: 4px; border-radius: 2px; background: var(--red); }
.sp-wrap h2::before { display: none; }
.sp-wrap h2 { padding-left: 0; }
.sp-wrap .sp-section-head h2::before { display: block; position: static; }
table { font-size: .95rem; }
thead th { border-bottom: 2px solid var(--red) !important; }

/* ---------- Small screens ---------- */
@media (max-width: 860px) {
  .sp-hero, .sp-hero.page-columns { flex-direction: column; }
  .sp-hero-main, .sp-latest { flex: 0 0 auto; }
  .sp-latest { border-left: none; padding-left: 0; }
  .sp-hero-main { min-height: 400px; }
  .sp-hero-main::after { background: linear-gradient(to top, rgba(10,42,23,.95) 0%, rgba(10,42,23,.75) 55%, rgba(10,42,23,.1) 100%); }
  .sp-strip { grid-template-columns: 1fr 1fr; }
  .sp-grid, .sp-grid.two { grid-template-columns: 1fr; }
  .sp-band::before, .sp-band::after { opacity: .25; }
}

/* ---------- Motion (only when the visitor allows it) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .sp-hero-text > * { animation: sp-rise .7s var(--ease) both; }
  .sp-hero-text > :nth-child(2) { animation-delay: .1s; }
  .sp-hero-text > :nth-child(3) { animation-delay: .2s; }
  .sp-hero-text > :nth-child(4) { animation-delay: .3s; }
  .sp-pitch-svg .mark { stroke-dasharray: 1; stroke-dashoffset: 1; animation: sp-draw 1.8s var(--ease) forwards; }
  .sp-pitch-svg .mark:nth-of-type(odd) { animation-delay: .25s; }
  .sp-pitch-svg .run { animation: sp-march 1.4s linear infinite; }
  .sp-pitch-svg .halo { animation: sp-pulse 2s ease-out infinite; }
  .sp-ticker-track { animation: sp-ticker 32s linear infinite; }
  .sp-ticker:hover .sp-ticker-track { animation-play-state: paused; }
  .sp-js .sp-reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
  .sp-js .sp-reveal.sp-in { opacity: 1; transform: none; }
  .sp-js .sp-reveal.sp-in:hover { transition-delay: 0s !important; }
  @keyframes sp-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  @keyframes sp-draw { to { stroke-dashoffset: 0; } }
  @keyframes sp-march { to { stroke-dashoffset: -36; } }
  @keyframes sp-pulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.2); opacity: 0; } }
  @keyframes sp-ticker { to { transform: translateX(-50%); } }
}
@media (prefers-reduced-motion: reduce) {
  .sp-ticker-track { flex-wrap: wrap; width: auto; justify-content: center; }
  .sp-ticker-track [aria-hidden="true"] { display: none; }
  .sp-pitch-svg .ball { display: none; }
}

/* ---------- Analysis posts: stat tiles and portrait ---------- */
.sp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin: 0 0 1.75rem; }
.sp-stats > div { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--red); border-radius: 8px; padding: .9rem 1rem; }
.sp-stats b { display: block; font-family: var(--head); font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.05; color: var(--ink); }
.sp-stats span { display: block; margin-top: .3rem; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sp-portrait { border-radius: 10px; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 8%; width: 100%; }
.figure-caption, figcaption { font-size: .88rem; color: var(--muted); }
.cell-output-display .plotly-graph-div { margin: .25rem 0; }
@media (max-width: 860px) { .sp-stats { grid-template-columns: 1fr 1fr; } }
a.sp-card { display: block; color: inherit; text-decoration: none; }
a.sp-card:hover { color: inherit; }
a.sp-card h3 { color: var(--ink); }

/* ---------- Hover language: colour shift + underline that draws in ---------- */
main p a:not([class]), main li > a:not([class]), main td a:not([class]), .nav-footer a {
  color: var(--red); text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: color .2s, background-size .25s var(--ease);
}
main p a:not([class]):hover, main li > a:not([class]):hover, main td a:not([class]):hover {
  color: var(--red-dark); background-size: 100% 2px;
}
.nav-footer a { color: #fff; background-size: 0 1px; }
.nav-footer a:hover { color: #fff; background-size: 100% 1px; }
.sp-card h3, .quarto-listing-grid .card-title { transition: color .2s; }
.sp-card:hover h3, .quarto-listing-grid .card:hover .card-title {
  color: var(--red); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.quarto-grid-link { color: inherit; }
.quarto-listing-category .category { transition: color .2s, padding-left .2s var(--ease); cursor: pointer; }
.quarto-listing-category .category:hover { padding-left: .3rem; text-decoration: underline; text-underline-offset: 3px; }
.listing-category, .quarto-category { transition: background .2s, color .2s; }
.listing-category:hover, .quarto-category:hover { background: var(--red) !important; color: #fff !important; }
.sp-strip > div:hover b { color: var(--red); }
details.code-fold > summary { transition: color .2s; }
details.code-fold > summary:hover { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.sp-btn.ghost:hover { background: var(--red); color: #fff !important; }

/* ---------- Coming-soon panel ---------- */
.sp-soon {
  position: relative; overflow: hidden; border-radius: 12px; padding: 1.6rem 1.6rem 1.7rem; color: #fff;
  background: var(--stripes);
}
.sp-soon::after {
  content: ""; position: absolute; right: -60px; top: 50%; width: 220px; height: 220px; margin-top: -110px;
  border: 3px solid var(--white-line); border-radius: 50%; opacity: .35; pointer-events: none;
}
.sp-soon > * { position: relative; z-index: 1; }
.sp-soon .sp-tag { background: var(--red); color: #fff; }
.sp-soon h2, .sp-soon h3 { color: #fff; margin: .7rem 0 .4rem; padding-left: 0; }
.sp-soon h2::before { display: none; }
.sp-soon p { color: #E3EEE6; margin: 0 0 1rem; max-width: 60ch; }
.sp-soon.big { padding: 2.6rem 2.4rem; margin: .5rem 0 2rem; }
.sp-soon.big::after { width: 320px; height: 320px; margin-top: -160px; right: -40px; }

/* ---------- News feed ---------- */
.sp-news { list-style: none; padding: 0; margin: .5rem 0 2rem; border-top: 1px solid var(--line); }
.sp-news-item { border-bottom: 1px solid var(--line); max-width: none; }
.sp-news-link {
  display: grid; grid-template-columns: 13.5rem 1fr auto; gap: 1.25rem; align-items: baseline;
  padding: 1.15rem .75rem; color: var(--ink); text-decoration: none; position: relative;
  transition: background .25s;
}
.sp-news-link::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--red);
  transform: scaleY(0); transition: transform .25s var(--ease);
}
.sp-news-link:hover { background: #fff; color: var(--ink); }
.sp-news-link:hover::before { transform: scaleY(1); }
.sp-news-time {
  font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--red);
  font-variant-numeric: tabular-nums;
}
.sp-news-title { display: block; font-family: var(--head); font-weight: 800; font-size: 1.3rem; line-height: 1.2; transition: color .2s; }
.sp-news-link:hover .sp-news-title { color: var(--red); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.sp-news-desc { display: block; color: var(--muted); margin-top: .25rem; }
.sp-news-arrow { font-size: 1.3rem; color: var(--muted); transition: transform .25s var(--ease), color .2s; }
.sp-news-link:hover .sp-news-arrow { transform: translateX(6px); color: var(--red); }

/* ---------- Job search ---------- */
.sp-jobs-meta { color: var(--muted); margin: 0 0 1.25rem; }
.sp-jobs { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: 1rem; }
.sp-job {
  max-width: none; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--pitch-light);
  border-radius: 10px; padding: 1.15rem 1.3rem; transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}
.sp-job:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(10,42,23,.1); border-left-color: var(--red); }
.sp-job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.sp-job-title { font-family: var(--head); font-weight: 800; font-size: 1.25rem; line-height: 1.2; color: var(--ink); text-decoration: none; }
.sp-job-title::after { content: " ↗"; font-family: var(--body); font-size: .9rem; color: var(--muted); }
.sp-job-title:hover { color: var(--red); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.sp-job-org { font-weight: 600; margin-top: .3rem; }
.sp-job-desc { color: var(--muted); margin: .5rem 0 .2rem; }
.sp-job-facts { display: flex; flex-wrap: wrap; gap: .4rem 1.75rem; margin: .7rem 0 0; }
.sp-job-facts div { display: flex; gap: .4rem; align-items: baseline; }
.sp-job-facts dt { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sp-job-facts dd { margin: 0; font-size: .95rem; }
.sp-badge { flex: none; display: inline-block; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: .2rem .55rem; border-radius: 999px; }
.sp-badge.open { background: #E2EFE4; color: var(--pitch-dark); }
.sp-badge.closed { background: #ECEDEA; color: var(--muted); }
.sp-job.is-closed { border-left-color: var(--line); }
.sp-job.is-closed .sp-job-title, .sp-job.is-closed .sp-job-org { color: var(--muted); }
.sp-jobs-empty { padding: 1.5rem; background: #fff; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); }

@media (max-width: 860px) {
  .sp-news-link { grid-template-columns: 1fr auto; gap: .35rem 1rem; }
  .sp-news-time { grid-column: 1 / -1; }
  .sp-soon.big { padding: 2rem 1.4rem; }
}
.sp-wrap .sp-latest li > a:not([class]) {
  color: var(--ink); background: linear-gradient(var(--red), var(--red)) 0 100% / 0 2px no-repeat;
}
.sp-wrap .sp-latest li > a:not([class]):hover { color: var(--red); background-size: 100% 2px; }

/* ---------- "Subscribe for the code" link under each chart ---------- */
main a.sp-code-cta {
  display: inline-flex; align-items: center; gap: .45rem; margin: -.25rem 0 1.5rem;
  padding: .45rem .9rem; border: 1.5px solid var(--red); border-radius: 999px;
  font-size: .85rem; font-weight: 700; color: var(--red); text-decoration: none; background: #fff;
  transition: background .2s, color .2s, transform .2s var(--ease);
}
main a.sp-code-cta::before { content: "</>"; font-family: ui-monospace, Menlo, monospace; font-size: .8rem; }
main a.sp-code-cta:hover { background: var(--red); color: #fff; transform: translateY(-1px); }

/* ---------- Chart heading above an interactive chart ---------- */
.sp-chart-head { margin: 1.25rem 0 .1rem; }
.sp-chart-head .sp-chart-title { font-family: var(--head); font-weight: 800; font-size: clamp(1.2rem, 2.4vw, 1.45rem); line-height: 1.2; color: var(--ink); margin: 0 0 .25rem; }
.sp-chart-head .sp-chart-sub { font-size: .95rem; color: var(--muted); margin: 0; }

/* ---------- Back-to-top football ---------- */
.sp-top {
  position: fixed; z-index: 1500;
  right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 4px; border: 0; background: none; cursor: pointer;
  opacity: 0; transform: translateY(24px) scale(.8); pointer-events: none;
  transition: opacity .3s, transform .35s var(--ease);
}
.sp-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.sp-top-arrow { width: 22px; height: 13px; color: var(--red); transition: transform .25s var(--ease); }
.sp-top-ball {
  width: 50px; height: 50px; border-radius: 50%;
  filter: drop-shadow(0 6px 10px rgba(10,42,23,.28)); transition: transform .3s var(--ease);
}
.sp-top:hover .sp-top-arrow { transform: translateY(-4px); }
.sp-top:hover .sp-top-ball { transform: translateY(-3px) rotate(-25deg); }
.sp-top:focus-visible { outline: none; }
.sp-top:focus-visible .sp-top-ball { outline: 3px solid var(--red); outline-offset: 3px; }
.sp-top.is-kicked .sp-top-ball { animation: sp-kick .6s cubic-bezier(.3,.7,.3,1) both; }
.sp-top.is-kicked .sp-top-arrow { animation: sp-arrow-up .5s .15s var(--ease) both; }
@keyframes sp-kick {
  0%   { transform: none; }
  22%  { transform: translateY(5px) scale(1.14, .8); }              /* squash as the boot hits it */
  60%  { transform: translateY(-26px) rotate(-220deg) scale(.95); } /* pop up and spin */
  100% { transform: translateY(-8px) rotate(-360deg); }
}
@keyframes sp-arrow-up { to { transform: translateY(-18px); opacity: 0; } }
@media (max-width: 860px) {
  .sp-top { right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .sp-top-ball { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-top, .sp-top-ball, .sp-top-arrow { transition: none; }
}
@media print { .sp-top { display: none; } }
