/* Sails: a dinghy regatta drawn on a nautical chart. Chart paper with a graticule, a header with depth contours and
   soundings over the chart's black-and-white latitude border, the race area as shallow water inside buff land,
   orange start buoys, dinghies from above with the coin as the sail insignia and a wake behind, the committee boat
   with blue finish flags, numeral pennants for 1st/2nd/3rd on a teak deck and an orange racing mark that holds the pot.
   Chart magenta is the action colour, signal-flag yellow/blue/red the accents. */
@font-face { font-family: 'Bodoni Moda'; src: url(/fonts/bodoni.woff2) format('woff2'); font-weight: 800 900; font-display: swap; }
@font-face { font-family: 'Bodoni Moda'; src: url(/fonts/bodoni-italic.woff2) format('woff2'); font-weight: 800 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Hanken Grotesk'; src: url(/fonts/hanken.woff2) format('woff2'); font-weight: 400 800; font-display: swap; }
@font-face { font-family: 'Azeret Mono'; src: url(/fonts/azeret.woff2) format('woff2'); font-weight: 500 700; font-display: swap; }

:root {
  --wall: #f2efe3;          /* chart paper */
  --wall-2: #e2dcc6;
  --cream: #fffdf7;
  --paper: #f8f5ea;
  --ink: #17202e;           /* chart black */
  --ink-2: #3f4858;
  --ink-3: #657084;
  --red: #b0186f;           /* primary: chart magenta */
  --red-dk: #8c1158;
  --bulb: #f6c418;          /* signal yellow */
  --amber: #f6c418;
  --cobalt: #1d4f9c;        /* signal blue */
  --flag-red: #d42a2a;
  --buoy: #f6772b;
  --turf: #cfe3ea;          /* shallow water */
  --turf-2: #dcebf0;
  --plank: #ecd592;         /* buff land */
  --plank-dk: #c8a956;
  --tin: #d8dde2;
  --up: #1c7a4a;
  --down: #c92f2f;
  --edge: 2.5px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
  --r: 12px;
  --display: 'Bodoni Moda', 'Didot', 'Bodoni 72', Georgia, serif;
  --text: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Azeret Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* chart paper with its graticule */
body {
  background-color: var(--wall);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cpath d='M0 239.5 H240 M239.5 0 V240' stroke='%236f8fa0' stroke-opacity='.22' stroke-width='1'/%3E%3Cpath d='M0 119.5 H240 M119.5 0 V240' stroke='%236f8fa0' stroke-opacity='.08' stroke-width='1'/%3E%3C/svg%3E"),
    radial-gradient(120% 80% at 50% 0%, #f7f4ea, #efebdd 70%);
}
h1, h2, h3 { font-weight: 900; letter-spacing: -.005em; line-height: 1.04; }
h1 { font-size: clamp(38px, 4.6vw, 64px); }
.hero h1 { font-size: clamp(40px, 4.3vw, 60px); line-height: 1.06; }
.hero h1 .h1b { color: var(--red); font-style: italic; text-shadow: 3px 3px 0 var(--bulb); margin-top: 2px; }
h2 { font-size: clamp(30px, 3.4vw, 42px); }
h3 { font-weight: 900; }
.lede { font-weight: 450; }

.btn { color: #fff; font-weight: 750; border-radius: 8px; }
.btn:hover { background: #c4237f; }
.btn-cream { color: var(--ink); }
.btn-cream:hover { background: #fff; }
.btn-ink { color: var(--cream); }
.btn-ink:hover { background: #263247; }
.step h3::before { color: var(--red); }
.ticket-head .fee-in { color: var(--red); font-weight: 900; }
.link { color: var(--ink); text-decoration-color: var(--red); }

/* the header: a strip of chart with depth contours and soundings, the chart's latitude border under it */
.top {
  color: var(--ink); border-bottom: 0;
  background-color: #fbf9f1;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='720' height='130'%3E%3Cg fill='none' stroke='%237aa2b4' stroke-width='1.3' stroke-opacity='.55'%3E%3Cpath d='M-10 34 C60 20 120 52 200 40 S330 8 420 30 S560 62 640 38 S710 24 730 30'/%3E%3Cpath d='M-10 82 C70 70 140 104 230 92 S380 58 470 80 S600 112 680 90 S715 84 730 86'/%3E%3C/g%3E%3Cg fill='%236d8796' fill-opacity='.38' font-family='Georgia, serif' font-style='italic' font-size='13'%3E%3Ctext x='92' y='64'%3E7%3C/text%3E%3Ctext x='262' y='22'%3E4%3C/text%3E%3Ctext x='318' y='70'%3E9%3C/text%3E%3Ctext x='508' y='54'%3E12%3C/text%3E%3Ctext x='600' y='112'%3E15%3C/text%3E%3Ctext x='170' y='116'%3E11%3C/text%3E%3Ctext x='690' y='66'%3E8%3C/text%3E%3Ctext x='30' y='112'%3E14%3C/text%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(180deg, #fdfbf5, #f5f1e4);
}
.top-in { min-height: 100px; padding-bottom: 16px; }
.brand { gap: 12px; color: var(--ink); }
.brand-horse { width: 64px; height: 60px; filter: none; --wave: #1d4f9c; --hull: #1d4f9c; }
.brand-word { font: italic 900 50px/1 var(--display); letter-spacing: -.01em; color: var(--ink); text-shadow: none; translate: 0 -2px; }
.nav a { color: var(--ink); font-weight: 700; }
.nav a:hover { border-color: rgba(23, 32, 46, .3); }
.nav a[aria-current='page'] { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 2px 2px 0 var(--red); }
.top .btn { background: var(--red); color: #fff; }
.top .btn:hover { background: #c4237f; }
.mode-note { color: var(--ink-2); }
.bulbs {
  bottom: 0; height: 14px;
  background:
    linear-gradient(var(--ink), var(--ink)) 0 0 / 100% 2.5px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 100% / 100% 2.5px no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 48px, #fbf9f1 48px 96px) 0 4.5px / 100% 5px no-repeat,
    #fbf9f1;
}
.nav-mobile { padding-bottom: 24px; }
.nav-mobile a { color: var(--ink); font-weight: 700; border-color: rgba(23, 32, 46, .28); background: #fbf9f1; }
.nav-mobile a[aria-current='page'] { background: var(--ink); color: #fff; }

/* the race area: buff land around a stretch of water */
.booth {
  border-radius: 12px; padding: 11px;
  background-color: var(--plank);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .36 0 0 0 0 .12 0 0 0 .5 -.12'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E"),
    linear-gradient(165deg, #f2deA0, #ead08a 60%, #e3c77c);
}
.booth-sign { border-radius: 6px; background: var(--cream); border-top: 7px solid var(--red); }
.booth-sign .clock { font-size: 28px; }
.booth-sign .t-name { font-weight: 900; }
.booth-sign .t-meta { color: var(--ink-3); }
.booth-more, .booth-more a { color: var(--ink); text-shadow: none; }

/* prizes: numeral pennants and the racing mark on a teak deck */
.shelf { padding-top: 12px; }
.shelf::after {
  height: 14px; border-radius: 3px;
  background: repeating-linear-gradient(90deg, transparent 0 58px, #3a2614 58px 60px), linear-gradient(180deg, #d79a5a, #b97a3e 55%, #94592a);
}
.prize { margin-bottom: 8px; }
.prize svg { width: clamp(60px, 7.2vw, 84px); height: clamp(55px, 6.6vw, 77px); }
.prize b { top: calc(clamp(55px, 6.6vw, 77px) * .408); right: 12%; translate: 0 -50%; font: italic 900 clamp(12px, 1.25vw, 15px)/1 var(--display); color: var(--ink); }
.prize span { margin-top: -2px; border-radius: 4px; }
.pot { margin-bottom: 6px; }
.pot svg { width: clamp(72px, 8.6vw, 100px); height: clamp(90px, 10.75vw, 125px); }
.pot .pot-sum { top: 59%; translate: -50% -50%; background: #fbfaf4; border: 1.5px solid var(--ink); border-radius: 3px; padding: 2px 4px; color: var(--ink); font: 700 clamp(10px, 1.02vw, 13px)/1 var(--mono); letter-spacing: -.04em; }
.pot .pot-label { color: #fff7e8; text-shadow: 1px 1px 0 #3a2614; position: relative; z-index: 2; }

/* the water: shallow tint, depth contours and soundings */
.track {
  --lane-h: 72px; --start: 40px; --fin: 50px;
  container-type: inline-size;
  margin-top: 11px; border-radius: 6px; border-width: 3px;
  background-color: var(--turf);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='216'%3E%3Cg fill='none' stroke='%235f8ea3' stroke-width='1.2' stroke-opacity='.42'%3E%3Cpath d='M-10 52 C50 36 110 70 190 58 S320 30 430 50'/%3E%3Cpath d='M-10 150 C80 136 150 172 250 158 S370 132 430 146'/%3E%3C/g%3E%3Cg fill='%23557d90' fill-opacity='.5' font-family='Georgia, serif' font-style='italic' font-size='12'%3E%3Ctext x='70' y='96'%3E6%3C/text%3E%3Ctext x='238' y='30'%3E5%3C/text%3E%3Ctext x='300' y='112'%3E8%3C/text%3E%3Ctext x='150' y='196'%3E9%3C/text%3E%3Ctext x='380' y='196'%3E7%3C/text%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(90deg, #d6e8ee, #cbe1e9 55%, #c3dce6);
}
.mini-booth .track { --lane-h: 50px; }
.lane { border-bottom: 0; }
.lane:nth-child(even) { background: none; }
.lane::after { display: none; }
.lane + .lane::before { content: ''; position: absolute; z-index: 1; left: 34px; right: 0; top: 0; border-top: 1.5px dashed rgba(29, 79, 156, .32); }
/* the start line: an orange pin buoy per lane, numbered */
.lane-no {
  width: 34px; border-right: 2.5px dashed var(--ink); color: #fff; font: italic 900 16px/1 var(--display);
  background: radial-gradient(circle at 50% 50%, #ff9a5a 0 3px, var(--buoy) 6px 11px, var(--ink) 11.5px 13px, transparent 13.5px), #fbf9f1;
}
.lane-empty { color: var(--ink-2); text-shadow: none; }
.zero { border-left: 2.5px dashed rgba(176, 24, 111, .6); }
.zero span { font: 700 12px/1 var(--mono); color: var(--red); top: 4px; }

/* the finish: the committee boat, a blue finish flag for every lane */
.finish {
  top: 4px; bottom: 4px; right: 4px; width: 42px;
  border: 2.5px solid var(--ink); border-radius: 21px / 34px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 42 72'%3E%3Cpath d='M13 20 V54' stroke='%2317202e' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M14 20 H33 V34 H14 Z' fill='%231d4f9c' stroke='%2317202e' stroke-width='2' stroke-linejoin='round'/%3E%3Ccircle cx='13' cy='55' r='3' fill='%23c9ced3' stroke='%2317202e' stroke-width='1.6'/%3E%3C/svg%3E") 50% 0 / 42px var(--lane-h, 72px) repeat-y,
    linear-gradient(90deg, #fffdf6 0 12%, #e9e4d6 12% 14%, #fffdf6 14% 86%, #e9e4d6 86% 88%, #fffdf6 88%);
  box-shadow: 2px 3px 0 rgba(23, 32, 46, .18);
}

/* the dinghies: 240 x 100 symbol, coin on the sail, wake behind */
.runner.boat {
  --hw: calc((var(--lane-h, 64px) - 12px) * 2.4);
  top: 6px; bottom: 6px;
  left: calc(var(--start) + (100% - var(--start) - var(--fin) - var(--hw)) * var(--x, 0));
}
.runner.boat .horse { inset: 0; height: 100%; transform-origin: 50% 50%; animation: bob 2.6s ease-in-out infinite; }
.lane:nth-child(2n) .runner.boat .horse { animation-delay: -.9s; }
.lane:nth-child(3n) .runner.boat .horse { animation-delay: -1.7s; }
@keyframes bob { 0%, 100% { transform: rotate(-1.2deg) translateY(0); } 50% { transform: rotate(1deg) translateY(1px); } }
@media (prefers-reduced-motion: reduce) { .runner.boat .horse { animation: none; } }
.runner.boat .disc { left: 30%; top: 10%; width: 13.3%; border-width: 2px; border-color: var(--ink); box-shadow: 0 0 0 1.5px var(--silk, #17202e); }
.runner.boat .rod {
  --x: inherit; left: auto; right: 82.5%; top: 50%; bottom: auto; translate: 0 -50%; z-index: -1;
  width: calc(var(--x, 0) * (100cqw - var(--start) - var(--fin) - var(--hw)) + 8px); max-width: none; min-width: 0; height: 66%;
  border: 0; border-radius: 0; background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .55) 70%, rgba(255, 255, 255, .95));
  clip-path: polygon(0 0, 100% 36%, 100% 64%, 0 100%, 0 86%, 100% 52%, 100% 48%, 0 14%);
}
.tag { border-radius: 4px; }
.tag em { font: 700 13px/1.1 var(--mono); }
.mono, .addr, .pick .w, .results .when { letter-spacing: -.02em; }
.runner.p1 .tag { background: #fff3c2; }
.runner.me .tag { background: var(--bulb); }

/* paper bits */
.panel { border-radius: 10px; }
.ticket { border-radius: 10px; }
.ticket.sprint { --tk: var(--red); }
.ticket.heat { --tk: var(--cobalt); }
.ticket.classic { --tk: var(--bulb); }
.ticket.dash { --tk: var(--buoy); }
.dlg { border-radius: 12px; }
.dlg-head { background: var(--cobalt); color: #fff; }
.dlg-head h2 { text-shadow: 2px 2px 0 var(--ink); font-style: italic; }
.seg button b { font-weight: 900; }
.seg button[aria-pressed='true'] { box-shadow: 3px 3px 0 var(--red); }
.count .big, .potline b, .standings .place { font-weight: 900; }
.test-note { background: #e6f0f3; border-color: #b9d2db; }
.toast { box-shadow: 4px 4px 0 var(--red); }
.foot {
  border-top: 0; color: #c9d0da;
  background: repeating-linear-gradient(90deg, #fbf9f1 0 48px, var(--ink) 48px 96px) 0 2.5px / 100% 5px no-repeat, linear-gradient(#fbf9f1, #fbf9f1) 0 0 / 100% 10px no-repeat, var(--ink);
  padding-top: 10px; border-top: 2.5px solid var(--ink);
}
.foot-links a { color: var(--cream); }
.hits button:hover, .hits button:focus-visible, .wallets button:hover, .standings tr.me td { background: #fdf2c6; }
.launch { background: var(--cobalt); }
.launch a { color: var(--bulb); }

@media (max-width: 640px) {
  .top-in { min-height: 80px; }
  .brand-horse { width: 48px; height: 45px; }
  .brand-word { font-size: 38px; }
  .track { --lane-h: 58px; --start: 26px; --fin: 32px; }
  .runner.boat { top: 5px; bottom: 5px; --hw: calc((var(--lane-h, 58px) - 10px) * 2.4); }
  .lane-no { width: 24px; font-size: 12px; border-right-width: 2px;
    background: radial-gradient(circle at 50% 50%, #ff9a5a 0 2px, var(--buoy) 4px 8.5px, var(--ink) 9px 10.5px, transparent 11px), #fbf9f1; }
  .lane + .lane::before { left: 24px; }
  .finish { width: 28px; right: 2px; top: 3px; bottom: 3px; background-size: 28px var(--lane-h, 58px), auto; }
  .booth { padding: 7px; border-radius: 10px; }
  .hero h1 { font-size: clamp(36px, 10vw, 46px); }
  .tag em { font-size: 11.5px; }
  .prize b { font-size: 11px; letter-spacing: -.02em; }
}
