/* ==========================================================================
   Oche Dart League — public site
   Tokens mirror admin.ocheleague.com so the two properties read as one brand.
   Mobile-first: every rule is the phone rule until a min-width says otherwise.
   ========================================================================== */

:root {
    /* Carried over from the admin theme */
    --oche-coral: #ef5547;
    --oche-coral-dark: #c93d32;   /* AA-safe on white; use for text + fills */
    --oche-ink: #171a1f;
    --oche-bg: #f3f5f7;
    --oche-surface: #fff;
    --oche-text: #20242b;
    --oche-heading: #111318;
    --oche-muted: #667085;
    --oche-border: #dfe3e8;
    --oche-radius: 10px;
    --oche-shadow: 0 1px 3px rgb(16 24 40 / 8%), 0 1px 2px rgb(16 24 40 / 5%);
    --oche-shadow-lg: 0 12px 32px rgb(16 24 40 / 10%), 0 2px 6px rgb(16 24 40 / 6%);

    /* New here: the sisal of a real board, and the wire */
    --oche-sisal: #e8dcc4;
    --oche-wire: #b9c0c9;

    --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
    --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
            "Noto Sans", sans-serif;

    --gutter: 1.25rem;
    --measure: 68rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--oche-text);
    background: var(--oche-bg);
    -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--oche-coral-dark); }

h1, h2, h3 {
    font-family: var(--display);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    line-height: 0.94;
    color: var(--oche-heading);
    margin: 0;
    text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

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

/* Focus — one visible treatment everywhere, works on light and dark */
:where(a, button, [tabindex]):focus-visible {
    outline: 3px solid var(--oche-coral);
    outline-offset: 3px;
    border-radius: 4px;
}

.skip {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--oche-ink);
    color: #fff;
    padding: 0.75rem 1rem;
    z-index: 100;
}
.skip:focus { left: 0; }

.eyebrow {
    font-family: var(--display);
    font-weight: 700;
    font-size: 0.9375rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--oche-coral-dark);
    margin: 0 0 0.75rem;
}

/* --------------------------------------------------------------- buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 52px;              /* comfortable thumb target */
    padding: 0.875rem 1.5rem;
    font-family: var(--display);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--oche-radius);
    cursor: pointer;
    transition: transform 0.12s ease, background-color 0.12s ease,
                box-shadow 0.12s ease;
}

.btn-primary {
    background: var(--oche-coral-dark);
    color: #fff;
    box-shadow: var(--oche-shadow);
}
.btn-primary:hover { background: #b3352b; transform: translateY(-1px); }

.btn-ghost {
    background: transparent;
    color: var(--oche-heading);
    border-color: var(--oche-border);
}
.btn-ghost:hover { border-color: var(--oche-heading); background: #fff; }

.btn-on-dark {
    background: var(--oche-coral);
    color: var(--oche-ink);
}
.btn-on-dark:hover { background: #f56d61; transform: translateY(-1px); }

.btn-block { width: 100%; }

/* ---------------------------------------------------------------- header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgb(243 245 247 / 88%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--oche-border);
}

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 60px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    color: var(--oche-heading);
}

.brand-mark { width: 30px; height: 30px; flex: none; }

.brand-name {
    font-family: var(--display);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    line-height: 1;
}
.brand-name span { color: var(--oche-coral-dark); }

.header-link {
    font-family: var(--display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--oche-text);
    padding: 0.5rem 0.25rem;
}
.header-link:hover { color: var(--oche-coral-dark); }

/* ------------------------------------------------------------------ hero */

.hero { padding: 3rem 0 3.5rem; }

.hero h1 {
    font-size: clamp(2.75rem, 13vw, 6.5rem);
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
}
.hero h1 em {
    font-style: normal;
    color: var(--oche-coral-dark);
    display: block;
}

.hero-lede {
    font-size: 1.125rem;
    color: var(--oche-muted);
    max-width: 34rem;
    margin-bottom: 1.75rem;
}

.league-search {
    max-width: 40rem;
    padding: 1.125rem;
    background: var(--oche-surface);
    border: 1px solid var(--oche-border);
    border-radius: var(--oche-radius);
    box-shadow: var(--oche-shadow-lg);
}
.league-search label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--display);
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--oche-heading);
}
.league-search-row { display: grid; gap: 0.625rem; }
.league-search input {
    width: 100%;
    min-height: 52px;
    padding: 0.75rem 0.875rem;
    font: inherit;
    color: var(--oche-text);
    background: #fff;
    border: 2px solid var(--oche-border);
    border-radius: var(--oche-radius);
}
.league-search input:focus {
    outline: 3px solid rgb(239 85 71 / 25%);
    border-color: var(--oche-coral-dark);
}
.hero-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-top: 1rem;
    font-size: 0.9375rem;
}
.hero-secondary a { color: var(--oche-text); font-weight: 600; }

/* ---------------------------------------------------------- discovery */

.discovery { padding: 3.5rem 0; background: #fff; border-top: 1px solid var(--oche-border); }
.discovery h2 { font-size: clamp(2.25rem, 9vw, 3.25rem); margin-bottom: 1.5rem; }
.discovery-grid { display: grid; gap: 0.875rem; }
.discovery-card, .empty-result, .search-message {
    padding: 1.25rem;
    background: var(--oche-bg);
    border: 1px solid var(--oche-border);
    border-radius: var(--oche-radius);
}
.discovery-card.accepting { border-left: 4px solid var(--oche-coral); }
.discovery-card h3, .empty-result h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.discovery-card p { color: var(--oche-muted); }
.discovery-card a { display: inline-block; margin-top: 0.75rem; font-weight: 700; }
.result-type {
    margin-bottom: 0.375rem;
    font-family: var(--display);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--oche-coral-dark) !important;
}
.empty-result p { margin: 0.5rem 0 1rem; color: var(--oche-muted); }

/* The "are you a player?" nudge — the one line that has to convert */
.stat-nudge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.75rem;
    padding: 0.875rem 1rem;
    background: var(--oche-surface);
    border: 1px solid var(--oche-border);
    border-left: 4px solid var(--oche-coral);
    border-radius: var(--oche-radius);
    text-decoration: none;
    color: var(--oche-text);
    box-shadow: var(--oche-shadow);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.stat-nudge:hover {
    transform: translateY(-2px);
    box-shadow: var(--oche-shadow-lg);
}
.stat-nudge p { font-size: 0.9375rem; }
.stat-nudge strong { color: var(--oche-heading); }
.stat-nudge .arrow {
    margin-left: auto;
    font-size: 1.25rem;
    color: var(--oche-coral-dark);
    flex: none;
}

/* ---------------------------------------------- signature: the nine darts */

.leg {
    background: var(--oche-ink);
    color: #fff;
    padding: 3.5rem 0;
    position: relative;
    overflow: hidden;
}

/* the oche itself: the throw line */
.leg::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 4px;
    background: repeating-linear-gradient(90deg,
        var(--oche-coral) 0 28px, transparent 28px 46px);
    opacity: 0.85;
}

.leg h2 {
    color: #fff;
    font-size: clamp(2.25rem, 9vw, 3.5rem);
    margin-bottom: 0.75rem;
}
.leg .eyebrow { color: var(--oche-coral); }

.leg-lede {
    color: #aeb4bd;
    max-width: 34rem;
    margin-bottom: 2.5rem;
}

.darts { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }

.dart {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 1.125rem;
    padding: 1.375rem 1.25rem;
    background: #1e222a;
    border: 1px solid #2b3038;
    border-radius: var(--oche-radius);
}

.dart-score {
    font-family: var(--display);
    font-size: 3rem;
    font-weight: 800;
    line-height: 0.8;
    letter-spacing: -0.03em;
    color: var(--oche-coral);
    font-variant-numeric: tabular-nums;
    min-width: 3.25rem;
}

.dart h3 {
    color: #fff;
    font-size: 1.5rem;
    letter-spacing: 0;
    margin-bottom: 0.375rem;
}

.dart p { color: #aeb4bd; font-size: 0.9375rem; }

.leg-note {
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid #2b3038;
    color: #aeb4bd;
    font-size: 0.9375rem;
}
.leg-note strong { color: var(--oche-sisal); font-weight: 600; }

/* ------------------------------------------------------------ stat panel */

.stats { padding: 3.5rem 0; }
.stats h2 { font-size: clamp(2.25rem, 9vw, 3.25rem); margin-bottom: 0.75rem; }
.stats-lede { color: var(--oche-muted); max-width: 34rem; margin-bottom: 2rem; }

.stat-grid { display: grid; gap: 0.875rem; }

.stat-card {
    padding: 1.25rem;
    background: var(--oche-surface);
    border: 1px solid var(--oche-border);
    border-radius: var(--oche-radius);
    box-shadow: var(--oche-shadow);
}

.stat-value {
    font-family: var(--display);
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--oche-heading);
    font-variant-numeric: tabular-nums;
}
.stat-value small {
    font-size: 1.125rem;
    color: var(--oche-muted);
    margin-left: 0.125rem;
}

.stat-label {
    font-family: var(--display);
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--oche-coral-dark);
    margin: 0.5rem 0 0.25rem;
}

.stat-card p { font-size: 0.875rem; color: var(--oche-muted); }

/* --------------------------------------------------------- organiser bar */

.organisers { padding: 0 0 3.5rem; }

.organiser-card {
    padding: 1.75rem 1.5rem;
    background: var(--oche-surface);
    border: 1px solid var(--oche-border);
    border-radius: var(--oche-radius);
    box-shadow: var(--oche-shadow);
}
.organiser-card h2 { font-size: 1.75rem; margin-bottom: 0.625rem; }
.organiser-card p { color: var(--oche-muted); margin-bottom: 1.25rem; }

/* ---------------------------------------------------------- closing call */

.closer {
    background: var(--oche-ink);
    color: #fff;
    padding: 3.5rem 0;
    text-align: center;
}
.closer h2 {
    color: #fff;
    font-size: clamp(2.5rem, 11vw, 4rem);
    margin-bottom: 0.875rem;
}
.closer p { color: #aeb4bd; margin: 0 auto 1.75rem; max-width: 30rem; }

/* ---------------------------------------------------------------- footer */

.site-footer {
    background: var(--oche-ink);
    border-top: 1px solid #2b3038;
    padding: 2rem 0 2.5rem;
    color: #aeb4bd;
    font-size: 0.875rem;
}
.site-footer a { color: #d7dbe1; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    font-family: var(--display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* -------------------------------------------------------------- motion */

/* Content is visible by default. site.js adds .motion to <html> only when it
   is safe to animate, so a script failure can never leave the page blank. */
.motion .rise { opacity: 0; transform: translateY(16px); }
.motion .rise.landed {
    opacity: 1;
    transform: none;
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .motion .rise, .motion .rise.landed {
        opacity: 1; transform: none; transition: none;
    }
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------------------------------------------------------- wider screens */

@media (min-width: 40rem) {
    :root { --gutter: 2rem; }

    .hero { padding: 5rem 0 4.5rem; }
    .league-search-row { grid-template-columns: minmax(0, 1fr) auto; }
    .btn-block { width: auto; }

    .darts { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
    .dart { grid-template-columns: 1fr; gap: 1rem; }
    .dart-score { font-size: 3.75rem; }

    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .discovery-grid { grid-template-columns: repeat(2, 1fr); }

    .organiser-card {
        display: flex;
        align-items: center;
        gap: 2rem;
        padding: 2rem;
    }
    .organiser-card > div { flex: 1; }
    .organiser-card p { margin-bottom: 0; }
}

@media (min-width: 64rem) {
    .hero { padding: 6.5rem 0 5.5rem; }
    .hero-inner {
        display: grid;
        grid-template-columns: 1.15fr 0.85fr;
        gap: 4rem;
        align-items: center;
    }
    .hero h1 { font-size: 5.75rem; }
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
    .leg, .stats, .closer { padding: 5rem 0; }
}
