/* ==========================================================================
   Apex Arbitrage — #23 Pink Piggy Bank
   Brand rules live in /CLAUDE.md. Palette is the livery's four colours only.
   ========================================================================== */

:root {
  --hide: #F5B1AE;   /* livery pink: page background */
  --cut: #CA1D1B;    /* butcher red: dashed lines, display type, buttons */
  --ink: #000000;    /* body text, photo grounds */
  --paper: #FFFFFF;  /* number roundel, text on red */

  --serif: "Besley", "Clarendon", Georgia, serif;
  --ui: "Saira Semi Condensed", "Arial Narrow", system-ui, sans-serif;

  /* Type scale: classic 1.25 steps from an 18px base */
  --t-0: 1.125rem;
  --t-1: 1.4rem;
  --t-2: 1.75rem;
  --t-3: clamp(2.2rem, 4vw, 3.4rem);
  --t-4: clamp(3rem, 8.5vw, 7.5rem);

  --dash: 26 16;       /* the livery's dash rhythm */
  --line-w: 7;
  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--hide);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--t-0);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--cut); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a:hover { color: var(--cut); }
:focus-visible { outline: 3px dashed var(--cut); outline-offset: 4px; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.05; margin: 0 0 0.5em; }
h2 { font-size: var(--t-3); font-weight: 900; color: var(--cut); letter-spacing: -0.01em; }
h3 { font-size: var(--t-1); font-weight: 800; }
p { margin: 0 0 1em; max-width: 38em; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: .5em 1em; z-index: 10; }
.skip:focus { left: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--ui);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  padding: 0.7em 1.4em;
  border-radius: 999px;   /* pill = roundel; the only rounded thing besides the roundel itself */
  text-decoration: none;
  border: 2px solid var(--cut);
  cursor: pointer;
  line-height: 1.2;
}
.btn--solid { background: var(--cut); color: var(--paper); }
.btn--solid:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn--ghost { color: var(--paper); border-color: var(--paper); border-style: dashed; }
.btn--ghost:hover { background: var(--paper); color: var(--ink); }
.btn--disabled { opacity: .55; cursor: default; }
.btn--disabled:hover { background: var(--cut); border-color: var(--cut); }

/* ---------- The butcher line (used everywhere) ---------- */
.butcher-line {
  fill: none;
  stroke: var(--cut);
  stroke-width: var(--line-w);
  stroke-dasharray: var(--dash);
  stroke-linecap: butt;
}
.hide-fill { fill: var(--hide); }
.ink-fill { fill: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(100svh, 62rem);
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  isolation: isolate;
}
.hero__photo, .hero__photo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 55% 60%;
  z-index: -1;
}
.hero::after { /* keeps headline legible over the photo's lit floor */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.25) 45%, rgba(0,0,0,0) 70%);
}

.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem var(--gutter);
}
.nav__logo img { width: clamp(110px, 12vw, 170px); }
.nav__links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; list-style: none; margin: 0; padding: 0; font-family: var(--ui); font-weight: 500; font-size: 1.05rem; }
.nav__links a { text-decoration: none; color: var(--paper); }
.nav__links a:hover { color: var(--hide); text-decoration: underline; text-decoration-style: dashed; }

.hero__copy {
  margin-top: auto;
  padding: 0 var(--gutter) clamp(7rem, 17vw, 16rem);
  max-width: 50rem;
}
.hero__roundel {
  width: 4.2rem; height: 4.2rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper); color: var(--ink);
  border: 4px solid var(--ink); box-shadow: 0 0 0 3px var(--paper);
  font-family: var(--serif); font-weight: 900; font-size: 2rem; line-height: 1;
  margin: 0 0 1.2rem;
}
.hero h1 {
  font-size: var(--t-4);
  font-weight: 900;
  color: var(--hide);
  letter-spacing: -0.025em;
  line-height: 0.92;
  margin-bottom: 0.3em;
}
.hero__lede { font-size: var(--t-1); line-height: 1.45; max-width: 30em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

.hero__cut {
  position: absolute; left: 0; right: 0; bottom: -1px;
  width: 100%; height: clamp(110px, 16vw, 280px);
}
.hero__cut .butcher-line { vector-effect: non-scaling-stroke; stroke-width: 6px; }
.draw-mask { fill: none; stroke: #fff; stroke-width: 40; stroke-dasharray: 1; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) {
  .draw-mask { animation: draw 1.6s cubic-bezier(.6,.05,.25,1) .3s both; }
}
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* ---------- Sections & cuts ---------- */
.section { padding-block: clamp(1.5rem, 4vw, 3.5rem); }
.section__head { margin-bottom: 2rem; }
.section__head p { font-size: var(--t-0); }

.cut svg { display: block; width: 100%; height: clamp(120px, 13.75vw, 240px); }
.cut__label {
  font-family: var(--serif);
  font-weight: 800;
  font-size: 46px;
  fill: var(--cut);
}

/* ---------- The car ---------- */
.car { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.car__photo { margin: 0; }
.car__photo img { width: 100%; aspect-ratio: 12 / 7; object-fit: cover; border-radius: 0 6rem 0 6rem; /* the cut corner */ }
.car__driver { font-family: var(--ui); font-size: 1.15rem; }

.chart { margin-top: clamp(3rem, 7vw, 6rem); display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
.chart__plan { margin: 0 auto; max-width: 60rem; }
.chart__plan figcaption { font-style: italic; margin-top: .5rem; text-align: center; }
.cuts { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); column-gap: 2.5rem; }
.cuts > div {
  display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem;
  padding: .55rem 0;
  border-bottom: 3px dashed var(--cut);
}
.cuts > div { border-top: 3px dashed var(--cut); border-bottom: 0; }
.cuts dt { font-weight: 800; color: var(--cut); }
.cuts dd { margin: 0; font-size: 1rem; line-height: 1.45; }
.cuts dd span { display: block; font-style: italic; }

/* ---------- Merch ---------- */
.merch { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 2rem 1.5rem; }
.product h3 { font-size: var(--t-1); margin: 1rem 0 .2rem; }
.product__price { font-family: var(--ui); margin-bottom: .9rem; }
.product__img {
  aspect-ratio: 1; background: var(--paper);
  border: 3px dashed var(--cut);
  border-radius: 0 3rem 0 3rem;
  display: grid; place-items: center; overflow: hidden; position: relative;
}
.product__img img { width: 72%; }
.product__img--poster img { width: 92%; transform: rotate(-90deg) scale(1.25); }
.product__img--roundel span {
  width: 60%; aspect-ratio: 1; border-radius: 50%; background: var(--paper); border: 10px solid var(--ink);
  display: grid; place-items: center; font-weight: 900; font-size: clamp(3.5rem, 7vw, 5rem); line-height: 1;
}
.product__img--roundel { background: var(--hide); }
.product__img--cap { background: var(--ink); }
.product__img--cap span { color: var(--hide); font-weight: 900; font-size: clamp(1.1rem, 4.5vw, 1.8rem); line-height: 1; text-align: center; padding: 1rem; }
.is-placeholder .product__img::after {
  content: "Placeholder"; position: absolute; top: .6rem; left: .6rem;
  font-family: var(--ui); font-size: .8rem; background: var(--cut); color: var(--paper); padding: .1rem .5rem; border-radius: 99px;
}
#shopify-collection:empty { display: none; }

/* ---------- Instagram grid ---------- */
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(.4rem, 1.2vw, 1rem); }
.grid a { display: block; overflow: hidden; }
.grid img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.grid li:nth-child(1) a { border-radius: 0 0 0 4rem; }
.grid li:nth-child(3) a { border-radius: 0 4rem 0 0; }
.grid li:nth-child(4) a { border-radius: 4rem 0 0 0; }
.grid li:nth-child(6) a { border-radius: 0 0 4rem 0; }
.grid a:focus-visible { outline-offset: -6px; outline-color: var(--paper); }

/* ---------- Sponsors ---------- */
.sponsors { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.5rem; }
.sponsor {
  height: 100%;
  display: flex; flex-direction: column; gap: .7rem;
  padding: 1.5rem;
  text-decoration: none;
  border: 3px dashed var(--cut);
  border-radius: 3rem 0 3rem 0;
  background: transparent;
}
.sponsor:hover { background: var(--paper); color: var(--ink); }
.sponsor__logo { min-height: 4.5rem; display: flex; align-items: center; }
.sponsor__logo img { max-height: 4.5rem; max-width: 100%; width: auto; }
.sponsor__logo img[src*="sp-motorsports"] { width: 100%; } /* very wide wordmark: let it fill the tile */
.sponsor__logo--text { font-weight: 900; font-size: 1.6rem; line-height: 1.05; }
.sponsor__line { font-size: 1rem; line-height: 1.45; }
.sponsor__visit { margin-top: auto; font-family: var(--ui); font-weight: 700; color: var(--cut); text-decoration: underline; text-decoration-style: dashed; }
.sponsors__pitch { margin-top: 2rem; font-size: var(--t-1); }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.form label { display: block; font-family: var(--ui); font-weight: 700; margin-bottom: .3rem; }
.form input, .form select, .form textarea {
  width: 100%; font: inherit; font-size: 1rem;
  padding: .75rem .9rem;
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 0;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 3px dashed var(--cut); outline-offset: 2px; }
.form p { max-width: none; }
.form__hp { position: absolute; left: -9999px; }

/* ---------- Footer ---------- */
.footer { color: var(--paper); margin-top: 2rem; }
.footer__cut { display: block; width: 100%; height: clamp(60px, 9vw, 140px); }
.footer__cut .butcher-line { vector-effect: non-scaling-stroke; stroke-width: 6px; }
.footer__inner { background: var(--ink); margin-top: -1px; padding-block: 1rem 3rem; max-width: none; padding-inline: var(--gutter); display: grid; gap: .5rem; }
.footer__inner img { width: 150px; margin-bottom: 1rem; }
.footer__inner a { color: var(--paper); }
.footer__inner a:hover { color: var(--hide); }
.footer__legal { font-size: .85rem; opacity: .75; margin-top: 1rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .car, .chart, .contact { grid-template-columns: 1fr; }
  .car__photo { order: -1; }
}
@media (max-width: 760px) {
  .nav { flex-direction: column; align-items: flex-start; }
  .nav__links { gap: .2rem 1.1rem; font-size: 1rem; }
  /* Mobile hero: photo on top, copy on black below it, so the headline never sits on the busy livery */
  .hero { min-height: 0; }
  .hero::after { content: none; }
  .nav { position: absolute; top: 0; left: 0; right: 0; z-index: 2; background: linear-gradient(rgba(0,0,0,.75), rgba(0,0,0,0)); padding-bottom: 2.5rem; }
  .hero__photo { position: relative; display: block; height: 62svh; min-height: 22rem; z-index: 0; }
  .hero__photo img { position: absolute; object-position: 50% 62%; z-index: 0; }
  .hero__copy { margin-top: 0; padding-top: 1.5rem; padding-bottom: clamp(5rem, 22vw, 8rem); }
  .hero__roundel { display: none; }
  .hero h1 { font-size: clamp(2.8rem, 13vw, 4rem); }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .merch { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; }
  .product h3 { font-size: 1.1rem; }
  .product .btn { font-size: .9rem; padding: .6em 1em; }
  .grid li a { border-radius: 0 !important; }
  .cuts > div { grid-template-columns: 7.5rem 1fr; }
  .cut__label { font-size: 54px; }
}
