/* Racehorse landing page.
   Archivo carries the page; Besley is kept for details (the evidence line,
   the closing call).
   Type: --t-hero, --t-xl 56, --t-l 26, --t-m 20, --t-body 17, --t-s 14.
   Space: 8 · 16 · 24 · 40 · 64 · 120. Nothing freelanced.
   Light: stone ground, deep green actions. Dark: charcoal ground, the lighter green. */

:root {
  --t-hero: clamp(48px, 6.4vw, 88px);
  --t-xl: clamp(38px, 4.4vw, 56px);
  --t-l: clamp(22px, 2vw, 26px);
  --t-m: clamp(18px, 1.5vw, 21px);
  --t-body: 17px;
  --t-s: 14px;

  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 40px; --s5: 64px; --s6: clamp(88px, 10vw, 120px);

  --bg: var(--paper);
  --fg: var(--ink);
  --fg-2: #57534C;
  --line: rgba(28, 28, 28, .14);
  --field: #FBF9F5;
  --action: var(--turf);
  --action-hover: #0D3021;
  --action-fg: var(--paper);

  --cream-2: rgba(242, 237, 228, .7);
  --hair: rgba(242, 237, 228, .18);
  --g: clamp(16px, 4vw, 40px);
  --col: min(1160px, 100% - 2 * var(--g));
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--ink);
    --fg: var(--paper);
    --fg-2: rgba(242, 237, 228, .64);
    --line: rgba(242, 237, 228, .14);
    --field: #252523;
    --action: var(--green);
    --action-hover: #3A8C64;
  }
}

body { background: var(--bg); color: var(--fg); font: 400 var(--t-body)/1.55 var(--sans); overflow-x: hidden; }
h1, h2 { font-family: var(--sans); font-weight: 500; letter-spacing: -.035em; line-height: 1.02; }

/* ---- buttons ---------------------------------------------------------- */
.btn {
  display: inline-block; text-decoration: none;
  background: var(--action); color: var(--action-fg);
  font: 600 16px/1 var(--sans); padding: 17px 26px; border-radius: 999px;
  transition: background .15s;
}
.btn:hover { background: var(--action-hover); }
.btn-small { font-size: var(--t-s); padding: 11px 16px; white-space: nowrap; }
.btn-line { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--fg); }
.btn-line:hover { background: var(--fg); color: var(--bg); }
a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---- top ------------------------------------------------------------------ */
.top {
  position: sticky; top: 0; z-index: 10;
  padding: var(--s2) max(var(--g), (100% - 1160px) / 2); display: flex; justify-content: space-between; align-items: center;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
}
.menu-open, .menu-close {
  font: 500 var(--t-s)/1 var(--sans); color: var(--fg-2); background: none; border: 0; padding: var(--s1) 0; cursor: pointer;
}
.menu-open:hover, .menu-close:hover { color: var(--fg); }

/* ---- menu: a small sheet of paper over the page ------------------------ */
.menu {
  --ease: cubic-bezier(.22, 1, .36, 1);
  position: fixed; inset: var(--s1) max(var(--s1), (100% - 1160px) / 2 - var(--s3)) auto auto; margin: 0;
  width: min(260px, 100% - 2 * var(--s1)); padding: var(--s2) var(--s3) var(--s3);
  border: 1px solid var(--line); border-radius: 20px;
  background: color-mix(in srgb, var(--bg) 96%, transparent); color: var(--fg); text-align: right;
  -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .22);
  opacity: 0; transform: translateY(-10px) scale(.96); transform-origin: calc(100% - 24px) 24px;
  transition: opacity .3s var(--ease), transform .45s var(--ease), overlay .45s allow-discrete, display .45s allow-discrete;
}
.menu:popover-open { opacity: 1; transform: none; }
@starting-style { .menu:popover-open { opacity: 0; transform: translateY(-10px) scale(.96); } }
.menu::backdrop { background: transparent; }
.menu-close { display: block; margin-left: auto; }
.menu ul { margin-top: var(--s2); }

/* Each place comes in a beat after the one above it. */
.menu li {
  opacity: 0; transform: translateY(8px);
  transition: opacity .35s var(--ease), transform .5s var(--ease);
  transition-delay: calc(var(--i, 0) * 35ms + 40ms);
}
.menu:popover-open li { opacity: 1; transform: none; }
.menu li:nth-child(2) { --i: 1; } .menu li:nth-child(3) { --i: 2; }
.menu li:nth-child(4) { --i: 3; } .menu li:nth-child(5) { --i: 4; }

.menu li :is(a, button) {
  color: inherit; background: none; border: 0; cursor: pointer;
  display: inline-block; padding: 3px 0; text-decoration: none;
  font: 500 var(--t-l)/1.2 var(--sans); font-stretch: 104%; letter-spacing: -.035em;
  transition: opacity .25s var(--ease), transform .35s var(--ease);
}
/* The page you are on is set in the serif, as the hero sets its second line. */
.menu li a[aria-current] { font-family: var(--serif); font-style: italic; font-stretch: normal; letter-spacing: -.02em; }
.menu ul:hover :is(a, button) { opacity: .38; }
.menu ul:hover :is(a, button):hover { opacity: 1; transform: translateX(-4px); }
.menu-act a { color: var(--action); }

/* Contact: two lines; a tap copies and says so in place. */
.contact { width: min(320px, 100% - 2 * var(--s1)); display: flex; flex-direction: column; }
.contact:not(:popover-open) { display: none; }
/* Opened from the footer, it rises from the bottom with Close at the bottom. */
.contact.from-bottom { inset: auto max(var(--s1), (100% - 1160px) / 2 - var(--s3)) var(--s1) auto; padding: var(--s3) var(--s3) var(--s2); transform-origin: calc(100% - 24px) calc(100% - 24px); transform: translateY(10px) scale(.96); }
.contact.from-bottom:popover-open { transform: none; }
@starting-style { .contact.from-bottom:popover-open { transform: translateY(10px) scale(.96); } }
.contact.from-bottom .menu-close { order: 9; margin-top: var(--s2); }
.contact.from-bottom .contact-head { margin-top: 0; }
.contact-head { margin-top: var(--s1); font-size: var(--t-s); color: var(--fg-2); }
.contact li button { display: grid; justify-items: end; gap: 2px; width: 100%; padding: var(--s1) 0; text-align: right; }
.copy-label { font: 500 var(--t-s)/1.2 var(--sans); letter-spacing: 0; color: var(--fg-2); }
.copy-value { font: 500 var(--t-m)/1.25 var(--sans); letter-spacing: -.02em; }
.contact .copied .copy-label { color: var(--action); }
.menu-act { margin-top: var(--s1); padding-top: var(--s1); border-top: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); }
.brand .mark-logo { height: 18px; color: var(--action); }
.brand span { font: 600 18px/1 var(--sans); letter-spacing: -.02em; }

/* ---- hero: the window rests on the bend of the track ------------------- */
.hero { padding-top: clamp(56px, 8vw, 112px); }
.hero-text { width: var(--col); margin: 0 auto; text-align: center; }
.eyebrow { font: 500 var(--t-s)/1 var(--sans); letter-spacing: .02em; color: var(--fg-2); }
.hero h1 { margin-top: var(--s3); font-size: clamp(46px, 7.6vw, 112px); font-stretch: 104%; letter-spacing: -.05em; line-height: .96; }
.hero h1 em { display: block; font-family: var(--serif); font-weight: 500; font-stretch: normal; letter-spacing: -.035em; }
.lede { font-size: var(--t-m); color: var(--fg-2); max-width: 30em; margin: var(--s3) auto 0; }
.lede-end { display: block; color: var(--fg); }
.hero-act { display: flex; justify-content: center; margin-top: var(--s4); }

.hero-stage { position: relative; margin-top: var(--s5); display: grid; }
.hero-photo {
  grid-area: 1 / 1; align-self: end; width: 100%; height: 72%; object-fit: cover; object-position: 50% 78%;
  filter: grayscale(1) contrast(1.05);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 34%);
          mask-image: linear-gradient(180deg, transparent, #000 34%);
}
/* site.js grows the window as it comes up the page; the bottom margin keeps
   room for the extra height so it never runs into the next section. */
.hero-frame {
  --w: min(1160px, 100vw - var(--g));
  grid-area: 1 / 1; position: relative;
  width: var(--w); margin: 0 auto calc(var(--s5) + var(--w) * .14);
  transform: scale(var(--grow, 1)); transform-origin: 50% 0; will-change: transform;
}
.hero-shot {
  display: block; width: 100%; height: auto;
}

/* ---- tiles: what it does, in four lines ------------------------------------ */
.tiles { width: var(--col); margin: var(--s6) auto 0; }
.tiles h2 { font-size: var(--t-xl); }
.tiles h2 span { color: var(--fg-2); }
.tiles ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); margin-top: var(--s5); }
.tiles li { padding-top: var(--s3); border-top: 2px solid var(--fg); }
.tiles .ill { width: 52px; margin-bottom: var(--s3); --ill-w: 2px; }
.tiles h3 { font: 600 var(--t-m)/1.25 var(--sans); letter-spacing: -.015em; }
.tiles p { color: var(--fg-2); margin-top: var(--s1); }

/* ---- evidence ------------------------------------------------------------ */
.evidence { margin-top: var(--s6); background: var(--oxblood); color: var(--paper); }
.ev-inner {
  width: var(--col); margin: 0 auto; padding: var(--s6) 0;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s5); align-items: center;
}
.evidence h2 { font: 600 var(--t-xl)/1.05 var(--serif); letter-spacing: -.03em; }
.evidence li { font-size: var(--t-m); padding: var(--s2) 0; border-top: 1px solid var(--hair); }
.evidence li:first-child { border-top: 0; }
.evidence code { display: block; margin-top: 4px; font: 400 13px/1.4 var(--mono); color: rgba(242, 237, 228, .55); }

/* ---- start: the photo runs on from the green band ---------------------- */
.start {
  --reveal: 0; --drift: 1; --open: clamp(0, 1 - var(--reveal), 1);
  position: relative; overflow: hidden; background: var(--turf); color: var(--paper); text-align: center;
  clip-path: inset(calc(var(--open) * 10%) calc(var(--open) * 6vw) 0 round calc(var(--open) * 56px));
}
.start::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 60% 50% at 50% 42%, rgba(11,28,22,.62), transparent), linear-gradient(180deg, rgba(15,48,33,.2), rgba(11,28,22,.8)); z-index: 1; }
.start-photo {
  position: absolute; inset: -8% 0; width: 100%; height: 116%; object-fit: cover; object-position: 50% 55%;
  filter: grayscale(1) contrast(1.12); mix-blend-mode: luminosity; opacity: calc(.4 + (1 - var(--open)) * .45);
  transform: translateY(calc(var(--drift) * -6%)) scale(calc(1 + var(--open) * .1));
}
.start-inner { position: relative; z-index: 2; width: var(--col); margin: 0 auto; padding: calc(var(--s6) * 1.6) 0 calc(var(--s6) * 1.2); }
.start h2 { font: 600 var(--t-xl)/1.05 var(--serif); letter-spacing: -.03em; }
.start-line { margin-top: var(--s2); font-size: var(--t-m); color: rgba(242, 237, 228, .8); }
.start-act { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s1); margin-top: var(--s4); }
.btn-light { background: var(--paper); color: var(--ink); }
.btn-light:hover { background: #fff; }
.btn-line-light { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 1.5px rgba(242, 237, 228, .7); }
.btn-line-light:hover { background: rgba(242, 237, 228, .1); }
.foot { position: relative; z-index: 2; width: var(--col); margin: 0 auto; padding: var(--s3) 0 var(--s4); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-top: 1px solid rgba(242,237,228,.32); text-align: left; }
.foot .brand, .foot .brand .mark-logo { color: var(--paper); }
.foot-note { font: italic 400 var(--t-s)/1 var(--serif); color: rgba(242,237,228,.65); }
.foot nav { display: flex; gap: var(--s3); }
.foot nav { justify-self: end; }
.foot nav a { text-decoration: none; color: rgba(242,237,228,.72); font-size: var(--t-s); }


/* ---- privacy ------------------------------------------------------------ */
.privacy { width: var(--col); margin: 0 auto; padding: var(--s6) 0; text-align: center; }
.privacy h2 { font-size: var(--t-xl); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); margin: var(--s5) 0 var(--s4); text-align: left; }
.facts div { padding-top: var(--s2); border-top: 1px solid var(--line); }
.facts dt { font: 500 var(--t-s)/1.3 var(--sans); color: var(--fg-2); }
.facts dd { margin: var(--s1) 0 0; font-size: var(--t-m); line-height: 1.45; }
.more { display: inline-block; margin-top: var(--s3); font: italic 400 var(--t-m) var(--serif); color: var(--fg); text-underline-offset: 5px; text-decoration-color: var(--gold); }

/* ---- inner pages: the hero's head, then a quiet two-column body ---------- */
.page { width: var(--col); margin: 0 auto; padding: clamp(56px, 8vw, 104px) 0 var(--s6); }
.page-head { text-align: center; max-width: 820px; margin: 0 auto; }
.page-head .ill { width: 64px; margin-bottom: var(--s3); --ill-w: 2px; }
.page-head h1 { margin-top: var(--s2); font-size: clamp(40px, 6vw, 80px); font-stretch: 104%; letter-spacing: -.05em; line-height: .98; }
.page-head h1 em { display: block; font-family: var(--serif); font-weight: 500; font-stretch: normal; letter-spacing: -.035em; }

.legal { max-width: 920px; margin: var(--s6) auto 0; }
.legal section {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--s2) var(--s5);
  padding: var(--s4) 0; border-top: 1px solid var(--line);
}
.legal h2 { font: 600 var(--t-m)/1.3 var(--sans); letter-spacing: -.015em; }
.legal section div > * + * { margin-top: var(--s2); }
.legal a { text-decoration-color: var(--gold); text-underline-offset: 4px; }
.points li { position: relative; padding-left: var(--s3); }
.points li + li { margin-top: var(--s1); }
.points li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.inline-link { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }

/* ---- request form ------------------------------------------------------- */
.request {
  max-width: 640px; margin: var(--s5) auto 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3) var(--s3);
}
.request label, .request legend { display: grid; gap: var(--s1); font: 500 var(--t-s)/1.3 var(--sans); }
.request .wide { grid-column: 1 / -1; }
.request input:not([type=radio]), .request select, .request textarea {
  font: 400 var(--t-body)/1.4 var(--sans); color: var(--fg);
  background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.request textarea { resize: vertical; }
.request select {
  -webkit-appearance: none; appearance: none; padding-right: 44px;
  background: var(--field) no-repeat right 16px center / 12px 8px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2357534C' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.request :is(input, select, textarea):focus { outline: none; border-color: var(--action); box-shadow: 0 0 0 3px color-mix(in srgb, var(--action) 18%, transparent); }
.request fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); }
.request legend { width: 100%; margin-bottom: var(--s1); }
.request .choice { display: inline-flex; align-items: center; gap: var(--s1); font-weight: 400; font-size: var(--t-body); }
.request .choice input { accent-color: var(--action); width: 18px; height: 18px; }
.optional { font-weight: 400; color: var(--fg-2); }
.request-act { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-top: var(--s1); }
.request-act .btn { border: 0; cursor: pointer; }
.request-note { font-size: var(--t-s); color: var(--fg-2); }

/* ---- plain footer, for the inner pages ---------------------------------- */
.foot-plain { border-top-color: var(--line); }
.foot-plain .brand { color: var(--fg); }
.foot-plain .brand .mark-logo { color: var(--action); }
.foot-plain .foot-note { color: var(--fg-2); }
.foot-plain nav a, .foot-plain nav button { color: var(--fg-2); }
.foot nav button { font: inherit; font-size: var(--t-s); background: none; border: 0; padding: 0; cursor: pointer; color: rgba(242,237,228,.72); }
.foot-plain nav button { color: var(--fg-2); }

/* ---- small screens -------------------------------------------------------- */
@media (max-width: 1000px) { .tiles ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .ev-inner { grid-template-columns: 1fr; gap: var(--s4); }
  /* Too narrow for the whole window: it runs off the right edge of the
     screen, showing the sidebar and the start of the Case. */
  .hero-frame {
    --w: calc(100vw - var(--g)); margin: 0 0 var(--s5) var(--g); overflow: hidden; transform: none;
  }
  .hero-shot { width: 167%; max-width: none; }
}
@media (max-width: 640px) {
  .tiles ul { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; gap: var(--s3); }
  .hero-photo { height: 60%; }
  .start-act .btn { flex: 1 1 100%; text-align: center; }
  .foot { grid-template-columns: 1fr auto; row-gap: var(--s3); }
  .foot-note { display: none; }
  .legal section { grid-template-columns: 1fr; }
  .request { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .btn, .menu, .menu li, .menu li a { transition: none; } .start { clip-path: none; } }
