/* Scory landing page. A light, flat page: a cool grey desk, white panels with thin borders, 2px corners. The
   Scory red only marks "live" and the one primary button. Inter is served from this site (fonts/inter, SIL Open
   Font License) - no external requests. */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../fonts/inter/inter-latin-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url("../fonts/inter/inter-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --desk: #f1f2f4;
    --panel: #ffffff;
    --line: #dde1e7;
    --line-strong: #b9bfc9;
    --tint: #f7f8fa;
    --text: #15171c;
    --muted: #575d6a;
    --red: #d0282d;
    --red-dark: #b31f24;
    --new: #fbeeee;
    --radius: 2px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--desk);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: .2em; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.015em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.75rem); font-weight: 700; }
p { margin: 0 0 1em; }

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

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.sr-only {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 16px; top: -100px; z-index: 20; padding: 8px 12px; background: var(--panel); border: 1px solid var(--text); }
.skip:focus { top: 8px; }

/* Results banner: a thin dark bar above the header for visitors who came for results (the portal) */
.results-banner { margin: 0; padding: 9px 16px; background: var(--text); color: #fff; text-align: center; font-size: .9375rem; }
.results-banner a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; margin-left: .35em; }
.results-banner a:hover { color: #ffd2d3; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: .6em 1.1em;
    border: 1px solid var(--line-strong); border-radius: var(--radius);
    background: var(--panel); color: var(--text);
    font-weight: 600; text-decoration: none; line-height: 1.25;
    transition: background-color .15s ease, border-color .15s ease;
}
.btn:hover { border-color: var(--text); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-sm { min-height: 36px; padding: .4em .85em; font-size: .9375rem; }
.quiet { color: var(--muted); font-weight: 500; }
.quiet:hover { color: var(--text); }

/* Live marker */
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--red); font-weight: 600; font-size: .875rem; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: var(--panel); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; gap: 32px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.brand img { width: 40px; height: auto; }
.nav { display: flex; gap: 24px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: .9375rem; }
.nav a:hover { color: var(--text); text-decoration: underline; }
.lang { display: flex; gap: 2px; font-size: .875rem; font-weight: 600; }
.lang a { color: var(--muted); text-decoration: none; padding: .2em .45em; border-radius: 4px; }
.lang a:hover { color: var(--text); text-decoration: underline; }
.lang a[aria-current="true"] { color: var(--text); background: var(--line); }
/* Sign in: the Scory server (served by it, the link is its own /Login) */
.signin { color: var(--muted); text-decoration: none; font-weight: 500; font-size: .9375rem; white-space: nowrap; }
.signin:hover { color: var(--text); text-decoration: underline; }

/* Hero: the finish line */
.hero { padding: 40px 0 56px; }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.hero-copy { order: 2; }
.finish { order: 1; }
.hero h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.12; }
.lead { font-size: 1.0625rem; color: var(--muted); max-width: 32em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 24px 0 0; }

.finish-view {
    container-type: inline-size;
    background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
    font-variant-numeric: tabular-nums;
}
.finish-head {
    display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
    padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.race { font-weight: 700; }
.race-sub { margin-left: 8px; color: var(--muted); font-weight: 500; font-size: .875rem; }
.clock-wrap { padding: 16px 20px 18px; }
.clock-label { display: block; color: var(--muted); font-size: .875rem; font-weight: 500; }
.clock {
    display: block;
    font-size: clamp(3rem, 11vw, 6.75rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.045em;
    font-feature-settings: "tnum", "cv11";
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    margin-left: -.04em;
}
@supports (font-size: 1cqi) {
    .clock { font-size: min(17cqi, 7.5rem); }
}

.board { --row: 2.5rem; border-top: 1px solid var(--line); }
.board-cols, .row {
    display: grid;
    grid-template-columns: 3.25rem 3.25rem minmax(0, 1fr) 6rem 5.25rem;
    align-items: center;
    padding: 0 20px;
    gap: 0 8px;
}
.board-cols { height: 2.25rem; background: var(--tint); border-bottom: 1px solid var(--line); color: var(--muted); font-size: .8125rem; font-weight: 500; }
.board-cols .r { text-align: right; }
.board-rows { list-style: none; margin: 0; padding: 0; }
.row { height: var(--row); border-bottom: 1px solid var(--line); background: var(--panel); }
.row.is-last { border-bottom: 0; }
.row .rk { font-weight: 700; }
.row .bib { color: var(--muted); }
.row .nm { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .tm { text-align: right; font-weight: 600; }
.row .gap { text-align: right; color: var(--muted); }
.finish-foot { margin: 0; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.finish-foot b { color: var(--text); font-weight: 600; }

/* The running board (js/landing.js adds .is-live): rows sit in slots and slide when a finisher drops in above them */
.board-rows.is-live { position: relative; height: calc(var(--row) * 8); overflow: hidden; }
.board-rows.is-live .row {
    position: absolute; left: 0; right: 0; top: 0;
    transform: translate(var(--x, 0), calc(var(--i, 0) * 100%));
    transition: transform .6s cubic-bezier(.2, .7, .2, 1), opacity .45s ease, background-color 1.6s ease, box-shadow 1.6s ease;
}
.board-rows.is-live .row.is-entering { --x: -24px; opacity: 0; }
.board-rows.is-live .row.is-out { opacity: 0; }
.row.is-new { background: var(--new); box-shadow: inset 3px 0 0 var(--red); }

/* Sections */
.section { padding: 56px 0; }
.section-head { max-width: 46em; margin-bottom: 24px; }
.section-head p { color: var(--muted); font-size: 1.0625rem; margin: 0; }

/* What it does: headed paragraphs in two columns, separated by thin rules */
.facts { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.facts > div { padding: 22px 28px 24px; border-top: 1px solid var(--line); }
.facts > div:nth-child(-n+2) { border-top: 0; }
.facts > div:nth-child(even) { border-left: 1px solid var(--line); }
.facts dt { font-weight: 700; margin-bottom: 6px; }
.facts dd { margin: 0; color: var(--muted); }

/* Formats */
.formats { width: 100%; border-collapse: collapse; }
.formats th, .formats td { padding: 14px 20px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.formats thead th { border-top: 0; background: var(--tint); color: var(--muted); font-size: .875rem; font-weight: 500; padding-top: 10px; padding-bottom: 10px; }
.formats tbody th { font-weight: 700; white-space: nowrap; width: 11rem; }
.formats td:last-child { width: 15rem; color: var(--muted); }

/* MyScory */
.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 48px; align-items: center; padding: 40px; }
.split-text p { color: var(--muted); font-size: 1.0625rem; }
.plain { list-style: none; margin: 0 0 28px; padding: 0; border-top: 1px solid var(--line); }
.plain li { padding: 10px 0; border-bottom: 1px solid var(--line); }

.phone { justify-self: center; width: 280px; max-width: 100%; padding: 10px; border-radius: 36px; background: var(--text); }
.phone-screen { border-radius: 27px; overflow: hidden; background: var(--desk); min-height: 500px; font-variant-numeric: tabular-nums; }
.ph-top { display: flex; justify-content: space-between; align-items: center; padding: 20px 18px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.ph-brand { font-weight: 800; letter-spacing: -.02em; }
.ph-event { padding: 14px 18px; background: var(--panel); border-bottom: 1px solid var(--line); }
.ph-event b { display: block; }
.ph-event span { font-size: .8125rem; color: var(--muted); }
.ph-search { margin: 12px; padding: 8px 12px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.ph-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 16px; border-top: 1px solid var(--line); background: var(--panel); }
.ph-row .rk { font-weight: 700; }
.ph-row .nm { font-weight: 600; font-size: .9375rem; line-height: 1.3; }
.ph-row small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
.ph-row .tm { font-weight: 600; font-size: .9375rem; }
.ph-row.dim .nm, .ph-row.dim .tm { color: var(--muted); font-weight: 500; }

/* Contact */
.contact { padding-bottom: 72px; }
.contact-inner { padding: 36px 40px; }
.contact-inner p { color: var(--muted); font-size: 1.0625rem; max-width: 40em; margin-bottom: 20px; }

/* Footer */
.foot { background: var(--panel); border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; padding: 24px 0; }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.foot a:hover { color: var(--text); }

/* Narrower screens */
@media (max-width: 1000px) {
    .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .hero-copy { order: 0; }
    .hero h1 { max-width: 20em; }
    .split { grid-template-columns: minmax(0, 1fr); gap: 36px; }
}
@media (max-width: 760px) {
    .nav { display: none; }
    .top-inner { justify-content: space-between; }
    .facts { grid-template-columns: 1fr; }
    .facts > div:nth-child(2) { border-top: 1px solid var(--line); }
    .facts > div:nth-child(even) { border-left: 0; }

    /* The formats table becomes one block per format */
    .formats thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .formats, .formats tbody, .formats tr, .formats th, .formats td { display: block; width: auto; }
    .formats tr { padding: 16px 20px; border-top: 1px solid var(--line); }
    .formats tbody tr:first-child { border-top: 0; }
    .formats th, .formats td { padding: 0; border: 0; }
    .formats tbody th { width: auto; margin-bottom: 4px; white-space: normal; }
    .formats td:last-child { width: auto; margin-top: 6px; font-size: .9375rem; }
    .formats td:last-child::before { content: "Typical event: "; }
}
@media (max-width: 640px) {
    .wrap { padding: 0 16px; }
    .hero { padding: 28px 0 40px; }
    .section { padding: 40px 0; }
    .finish-head, .clock-wrap, .finish-foot { padding-left: 14px; padding-right: 14px; }
    .race-sub { display: block; margin-left: 0; }
    .board { --row: 2.375rem; }
    .board-cols, .row { grid-template-columns: 1.6rem 2.4rem minmax(0, 1fr) 5.1rem 3.9rem; padding: 0 14px; gap: 0 6px; font-size: .875rem; }
    .board-cols { font-size: .75rem; }
    .split, .contact-inner { padding: 24px 20px; }
    .facts > div { padding: 18px 20px 20px; }
    .btn { white-space: normal; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
