/* ============================================================================
   Golfkort — design system
   Product-register UI: earned familiarity, restrained palette, semantic states.
   Single stylesheet, no framework, no build. OKLCH throughout.
   Scene: an Icelandic golfer glancing at a phone in bright Nordic daylight —
   crisp cool-neutral surfaces, a deep evergreen identity, score-semantic colour.
   ============================================================================ */

:root {
    /* --- neutral ramp (cool, not cream) ------------------------------------ */
    --bg:            oklch(0.984 0.004 210);   /* app background — whisper-cool white */
    --surface:       oklch(1 0 0);             /* cards / panels */
    --surface-2:     oklch(0.972 0.005 210);   /* subtle inset / hover fill */
    --border:        oklch(0.912 0.008 210);   /* hairline */
    --border-strong: oklch(0.86 0.01 210);
    --ink:           oklch(0.26 0.014 220);    /* primary text */
    --ink-2:         oklch(0.44 0.013 220);    /* secondary text (>=4.5:1 on bg) */
    --ink-3:         oklch(0.56 0.012 220);    /* tertiary / meta (large text only) */

    /* --- brand: signal red + federation navy (golf.is family, elevated) ---- */
    --brand:         oklch(0.55 0.202 27);     /* signal red — links / active / accent */
    --brand-600:     oklch(0.515 0.214 27);    /* button fill — white text >=4.5:1 */
    --brand-700:     oklch(0.46 0.205 27);     /* hover / active */
    --brand-050:     oklch(0.966 0.028 30);    /* red tint fill */
    --brand-ink:     oklch(0.275 0.078 256);   /* federation navy — header/structure */
    --navy:          oklch(0.34 0.09 256);
    --navy-ink:      oklch(0.225 0.07 256);    /* darkest navy — hero overlay */
    --navy-050:      oklch(0.96 0.02 256);

    /* --- accent: warm gold, used only for emphasis moments ----------------- */
    --accent:        oklch(0.80 0.125 78);
    --accent-ink:    oklch(0.42 0.09 66);

    /* --- semantic (also the golf score ramp) ------------------------------- */
    --under:         oklch(0.55 0.14 152);     /* under par / birdie / success */
    --under-050:     oklch(0.955 0.03 155);
    --over:          oklch(0.55 0.17 27);      /* over par / danger / error */
    --over-050:      oklch(0.962 0.028 30);
    --warn:          oklch(0.76 0.13 75);
    --info:          oklch(0.58 0.11 240);
    --info-050:      oklch(0.96 0.025 240);

    /* --- focus ------------------------------------------------------------- */
    --focus:         oklch(0.62 0.14 232);

    /* --- space scale (4px base) -------------------------------------------- */
    --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem;
    --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4rem;

    /* --- radius (crisp/federation, not super-round) ------------------------ */
    --r-sm: 0.1875rem; --r: 0.3125rem; --r-lg: 0.4375rem; --r-xl: 0.5rem; --r-pill: 999px;

    /* --- elevation (soft, cool-tinted) ------------------------------------- */
    --sh-1: 0 1px 2px oklch(0.26 0.03 220 / 0.06), 0 1px 3px oklch(0.26 0.03 220 / 0.05);
    --sh-2: 0 2px 6px oklch(0.26 0.03 220 / 0.07), 0 8px 24px oklch(0.26 0.03 220 / 0.06);
    --sh-3: 0 12px 40px oklch(0.26 0.03 220 / 0.12);

    /* --- type: fixed rem scale (~1.2), one family -------------------------- */
    --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
    --t-xs: 0.78rem; --t-sm: 0.875rem; --t-base: 1rem;
    --t-lg: 1.15rem; --t-xl: 1.4rem; --t-2xl: 1.75rem; --t-3xl: 2.25rem;

    --measure: 68ch;
    --wrap: 64rem;
    --touch: 2.75rem;

    /* --- motion ------------------------------------------------------------ */
    --ease: cubic-bezier(0.22, 1, 0.36, 1);      /* ease-out-quart */
    --dur: 180ms;
    --dur-slow: 240ms;

    /* --- z-index scale ----------------------------------------------------- */
    --z-sticky: 100; --z-dropdown: 200; --z-modal: 400; --z-toast: 600;

    color-scheme: light;
}

/* ============================================================================
   Reset & base
   ============================================================================ */

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

* { margin: 0; }

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

body {
    font-family: var(--font);
    font-size: var(--t-base);
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv05" 1, "ss01" 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

h1, h2, h3, h4 {
    line-height: 1.15;
    font-weight: 650;
    letter-spacing: -0.018em;
    color: var(--ink);
    text-wrap: balance;
}

h1 { font-size: var(--t-3xl); letter-spacing: -0.028em; }
h2 { font-size: var(--t-2xl); letter-spacing: -0.022em; }
h3 { font-size: var(--t-xl); }
h4 { font-size: var(--t-lg); }

p { text-wrap: pretty; }
p, li { max-width: var(--measure); }

a { color: var(--brand-700); text-decoration: none; font-weight: 500;
    text-underline-offset: 0.16em; transition: color var(--dur) var(--ease); }
a:hover { color: var(--brand); text-decoration: underline; }

strong, b { font-weight: 650; }
small { font-size: var(--t-sm); }

hr { border: 0; border-top: 1px solid var(--border); margin: var(--s5) 0; }

::selection { background: var(--brand-050); color: var(--brand-ink); }

:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

/* --- a11y utilities ------------------------------------------------------- */
.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
    position: fixed; left: var(--s3); top: -4rem; z-index: var(--z-toast);
    background: var(--brand-ink); color: #fff; padding: var(--s3) var(--s4);
    border-radius: var(--r-sm); box-shadow: var(--sh-2);
    transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--s3); }

.muted { color: var(--ink-2); }
.error { color: var(--over); font-weight: 550; }

/* ============================================================================
   Header — federation navy top bar
   ============================================================================ */

.site-header {
    position: sticky; top: 0; z-index: var(--z-sticky);
    display: flex; align-items: center; gap: var(--s3);
    padding: var(--s3) clamp(var(--s4), 4vw, var(--s5));
    background: var(--brand-ink); color: oklch(0.93 0.02 256);
    box-shadow: 0 1px 0 oklch(1 0 0 / 0.06), var(--sh-1);
}
.site-header .brand {
    display: inline-flex; align-items: center; gap: 0.55rem; margin-right: auto;
    color: #fff; font-weight: 700; font-size: var(--t-lg); letter-spacing: -0.02em; text-decoration: none;
}
.site-header .brand::before {
    content: ""; width: 1.5rem; height: 1.5rem; flex: none; border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, #fff 0 22%, transparent 23%),
        radial-gradient(circle at 50% 50%, var(--brand) 24% 41%, transparent 42%),
        var(--navy);
    box-shadow: inset 0 0 0 1.5px oklch(1 0 0 / 0.28);
}
.site-header .brand:hover { text-decoration: none; color: #fff; }

.nav-toggle {
    display: inline-flex; align-items: center; justify-content: center; order: -1;
    background: oklch(1 0 0 / 0.08); border: 1px solid oklch(1 0 0 / 0.16);
    color: #fff; min-height: var(--touch); min-width: var(--touch);
    font-size: 1.2rem; border-radius: var(--r-sm); cursor: pointer;
    transition: background var(--dur) var(--ease);
}
.nav-toggle:hover { background: oklch(1 0 0 / 0.16); }

.header-right { display: inline-flex; align-items: center; gap: var(--s2); }
.hdr-link { color: oklch(0.9 0.02 256); font-weight: 500; font-size: var(--t-sm); }
.hdr-link:hover { color: #fff; }
.header-right .button.small { box-shadow: none; }

.bell { position: relative; display: inline-flex; align-items: center; color: oklch(0.9 0.02 256); font-size: 1.1rem; padding: 0.3rem; }
.bell:hover { color: #fff; }
.bell .badge {
    position: absolute; top: -0.15rem; right: -0.25rem;
    background: var(--brand); color: #fff; font-weight: 700;
    border-radius: var(--r-pill); padding: 0.02rem 0.36rem; font-size: 0.65rem; line-height: 1.4;
}

.lang-toggle { display: inline-flex; gap: 0.25rem; background: none; border: none; padding: 0; align-items: center; }
.lang-toggle button {
    background: transparent; border: 1px solid oklch(1 0 0 / 0.22); color: oklch(0.92 0.02 256);
    border-radius: var(--r-sm); padding: 0.3rem 0.55rem; min-height: 2.1rem; min-width: auto;
    font-size: var(--t-xs); font-weight: 600; cursor: pointer; box-shadow: none;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.lang-toggle button:hover { background: oklch(1 0 0 / 0.1); color: #fff; }
.lang-toggle button[aria-current="true"] { background: #fff; color: var(--brand-ink); border-color: #fff; }

@keyframes nav-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ============================================================================
   Layout — 3-column on desktop (left nav rail · main · right rail)
   ============================================================================ */

.layout {
    width: 100%; max-width: none; margin-inline: auto; flex: 1 0 auto;
    display: flex; flex-direction: column;
}

.site-main {
    flex: 1 0 auto; min-width: 0;
    padding: var(--s5) clamp(var(--s4), 4vw, var(--s5));
    animation: page-in var(--dur-slow) var(--ease);
}
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
.site-main > h1:first-child, .site-main > h2:first-child { margin-bottom: var(--s4); }
.site-main > p { margin-bottom: var(--s4); }

/* left rail — a drawer on mobile (toggled), a sidebar on desktop */
.rail-left { display: none; }
.rail-left.open {
    display: block; background: var(--surface); border-bottom: 1px solid var(--border);
    padding: var(--s2) clamp(var(--s4), 4vw, var(--s5)) var(--s3);
    animation: nav-in var(--dur-slow) var(--ease);
}
.rail-nav { display: flex; flex-direction: column; gap: 0.1rem; }
.rail-nav a {
    display: flex; align-items: center; min-height: 2.6rem; padding: 0.5rem 0.75rem;
    border-radius: var(--r-sm); color: var(--ink-2); font-size: var(--t-sm); font-weight: 550; text-decoration: none;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.rail-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.rail-nav a[aria-current="page"] { background: var(--brand-050); color: var(--brand-700); font-weight: 650; }
.rail-sep { display: block; height: 1px; background: var(--border); margin: var(--s2) 0.75rem; }

/* left rail becomes a card on desktop (matches the right rail) */
@media (min-width: 60rem) {
    .rail-left {
        background: var(--surface); border: 1px solid var(--border);
        border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: var(--s2);
    }
}

/* right rail — contextual widgets; below main on mobile */
.rail-right { padding: 0 clamp(var(--s4), 4vw, var(--s5)) var(--s4); }
.rail-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    padding: var(--s4); box-shadow: var(--sh-1); margin-bottom: var(--s4);
}
.rail-card h3 { font-size: var(--t-base); font-weight: 650; letter-spacing: -0.01em; margin-bottom: var(--s3); }
.rail-list { list-style: none; display: grid; gap: var(--s3); padding: 0; }
.rail-list a { display: block; font-size: var(--t-sm); color: var(--ink); font-weight: 550; line-height: 1.35; }
.rail-list a:hover { color: var(--brand); }
.rail-date { display: inline-block; font-size: var(--t-xs); font-weight: 700; color: var(--brand-700); font-variant-numeric: tabular-nums; margin-right: 0.35rem; }
.rail-donate p { font-size: var(--t-sm); color: var(--ink-2); margin-bottom: var(--s3); }

/* between mobile and full 3-col: 2 columns (nav + main), right rail below */
@media (min-width: 60rem) and (max-width: 74.99rem) {
    .nav-toggle { display: none; }
    .layout { display: grid; align-items: start; gap: var(--s5); grid-template-columns: 12.5rem minmax(0, 1fr); grid-template-areas: "left msg" "left main" "left right"; padding: var(--s5) clamp(var(--s5), 3vw, var(--s7)) 0; }
    .rail-left { display: block; grid-area: left; position: sticky; top: 4.9rem; }
    .rail-left.open { animation: none; }
    .messages { grid-area: msg; padding: 0; }
    .site-main { grid-area: main; padding: 0; }
    .rail-right { grid-area: right; padding: var(--s4) 0 0; }
    .rail-right .rail-card { display: inline-block; vertical-align: top; width: calc(50% - var(--s2)); margin-right: var(--s3); }
}

/* full 3-column desktop */
@media (min-width: 75rem) {
    .nav-toggle { display: none; }
    .layout {
        display: grid; align-items: start; gap: var(--s5);
        grid-template-columns: 12.5rem minmax(0, 1fr) 16rem;
        grid-template-areas: "left msg right" "left main right";
        padding: var(--s5) clamp(var(--s5), 3vw, var(--s7)) 0;
    }
    .rail-left { display: block; grid-area: left; position: sticky; top: 4.9rem; }
    .rail-left.open { animation: none; }
    .messages { grid-area: msg; padding: 0; }
    .site-main { grid-area: main; padding: 0; }
    .rail-right { grid-area: right; position: sticky; top: 4.9rem; padding: 0; }
}

.site-footer {
    border-top: 1px solid var(--border); margin-top: var(--s8);
    padding: var(--s6) var(--s4); text-align: center;
    font-size: var(--t-sm); color: var(--ink-2);
    display: flex; flex-direction: column; gap: var(--s2);
}
.site-footer a { color: var(--ink-2); }
.site-footer a:hover { color: var(--brand); }

/* ============================================================================
   Flash messages — tinted panels (never side-stripes)
   ============================================================================ */

.messages { list-style: none; padding: var(--s3) clamp(var(--s4), 4vw, var(--s6)) 0; }
.messages .message {
    display: flex; align-items: center; gap: var(--s2);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r); padding: var(--s3) var(--s4); margin-bottom: var(--s2);
    box-shadow: var(--sh-1); font-size: var(--t-sm);
}
.messages .message::before { content: "•"; font-size: 1.2rem; line-height: 1; color: var(--brand); }
.messages .message.success { background: var(--under-050); border-color: color-mix(in oklch, var(--under), transparent 70%); }
.messages .message.success::before { content: "✓"; color: var(--under); font-size: 0.9rem; }
.messages .message.error { background: var(--over-050); border-color: color-mix(in oklch, var(--over), transparent 70%); }
.messages .message.error::before { content: "!"; color: var(--over); font-weight: 800; }
.messages .message.warning { background: oklch(0.97 0.03 80); border-color: color-mix(in oklch, var(--warn), transparent 65%); }
.messages .message.info { background: var(--info-050); border-color: color-mix(in oklch, var(--info), transparent 72%); }

/* ============================================================================
   Buttons — one shape, full state set
   ============================================================================ */

button, .button, input[type="submit"] {
    --btn-bg: var(--brand-600); --btn-fg: #fff; --btn-bd: transparent;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    font: inherit; font-size: var(--t-sm); font-weight: 600; letter-spacing: -0.005em;
    padding: 0.6rem 1.05rem; min-height: var(--touch); min-width: var(--touch);
    border-radius: var(--r); border: 1px solid var(--btn-bd);
    background: var(--btn-bg); color: var(--btn-fg); cursor: pointer;
    text-decoration: none; white-space: nowrap;
    box-shadow: var(--sh-1);
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
                box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
button:hover, .button:hover, input[type="submit"]:hover {
    --btn-bg: var(--brand-700); color: #fff; text-decoration: none; box-shadow: var(--sh-2);
}
button:active, .button:active { transform: translateY(1px); box-shadow: var(--sh-1); }
button:disabled, .button[aria-disabled="true"] {
    opacity: 0.5; cursor: not-allowed; box-shadow: none; transform: none;
}

/* secondary / ghost / danger variants (opt-in via class on the same element) */
.button.secondary, button.secondary {
    --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--border-strong); box-shadow: var(--sh-1);
}
.button.secondary:hover, button.secondary:hover { --btn-bg: var(--surface-2); --btn-fg: var(--ink); }
.button.ghost, button.ghost {
    --btn-bg: transparent; --btn-fg: var(--brand-700); --btn-bd: transparent; box-shadow: none;
}
.button.ghost:hover, button.ghost:hover { --btn-bg: var(--brand-050); --btn-fg: var(--brand-700); box-shadow: none; }
.button.danger, button.danger { --btn-bg: var(--over); --btn-fg: #fff; }
.button.danger:hover, button.danger:hover { --btn-bg: oklch(0.48 0.17 27); }
.button.small, button.small { padding: 0.35rem 0.7rem; min-height: 2.2rem; font-size: var(--t-xs); }
.button.block { width: 100%; }

/* ============================================================================
   Forms
   ============================================================================ */

form { display: flex; flex-direction: column; gap: var(--s3); max-width: 30rem; }
form.inline-form, form.lang-toggle { flex-direction: row; align-items: center; max-width: none; gap: var(--s2); }
form.compose-form { max-width: none; margin-bottom: var(--s5); }

.filter-form {
    flex-direction: row; flex-wrap: wrap; align-items: end; gap: var(--s3); max-width: none;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    padding: var(--s4); box-shadow: var(--sh-1); margin-bottom: var(--s5);
}

label { font-weight: 600; font-size: var(--t-sm); color: var(--ink); display: block; margin-bottom: 0.3rem; }

input[type="text"], input[type="email"], input[type="search"], input[type="tel"],
input[type="date"], input[type="time"], input[type="number"], input[type="password"],
select, textarea {
    font: inherit; font-size: var(--t-base); width: 100%;
    padding: 0.6rem 0.75rem; min-height: var(--touch);
    color: var(--ink); background: var(--surface);
    border: 1px solid var(--border-strong); border-radius: var(--r);
    box-shadow: inset 0 1px 2px oklch(0.26 0.03 220 / 0.04);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--brand), transparent 82%);
}
textarea { min-height: 5rem; resize: vertical; line-height: 1.5; }

fieldset {
    border: 1px solid var(--border); border-radius: var(--r-lg);
    padding: var(--s4); background: var(--surface); box-shadow: var(--sh-1);
}
legend { font-weight: 650; padding-inline: var(--s2); }

/* ============================================================================
   Cards & lists — subtle elevation, NO side-stripes
   ============================================================================ */

.card-list, .feed-list {
    list-style: none; padding: 0; margin: 0;
    display: grid; gap: var(--s3);
}

.card, .feed-item {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: var(--s4) var(--s5);
    box-shadow: var(--sh-1);
    transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card h2, .card h3 { margin-top: 0; }
.card h2:first-child, .card h3:first-child { margin-bottom: var(--s2); }

/* clickable cards lift on hover */
a.card:hover, .card.interactive:hover {
    border-color: var(--border-strong); box-shadow: var(--sh-2); transform: translateY(-2px);
}

/* unread / attention: tinted fill + leading dot, not a border-left */
.card.unread, .feed-item.unread { background: var(--brand-050); border-color: color-mix(in oklch, var(--brand), transparent 78%); }
.card.unread::before {
    content: ""; display: inline-block; width: 0.5rem; height: 0.5rem;
    border-radius: 50%; background: var(--brand); margin-right: 0.5rem; vertical-align: middle;
}

.badge-inline, .badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: var(--brand-050); color: var(--brand-ink);
    font-size: var(--t-xs); font-weight: 650; letter-spacing: 0.01em;
    padding: 0.2rem 0.6rem; border-radius: var(--r-pill);
    border: 1px solid color-mix(in oklch, var(--brand), transparent 82%);
}
.badge-inline.accent { background: oklch(0.96 0.04 80); color: var(--accent-ink); border-color: color-mix(in oklch, var(--accent), transparent 70%); }
.badge-inline.live { background: var(--over-050); color: var(--over); border-color: color-mix(in oklch, var(--over), transparent 70%); }
.badge-inline.live::before { content: ""; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--over); animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.feature-list { padding-left: 1.2rem; display: grid; gap: 0.3rem; }
.feature-list li { padding-left: 0.2rem; }

/* ============================================================================
   Tables — clean, dense-friendly, scores colour-coded
   ============================================================================ */

.table-scroll { overflow-x: auto; margin: var(--s4) 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); }

table { border-collapse: collapse; width: 100%; min-width: 22rem; font-size: var(--t-sm); }
thead th {
    text-align: left; font-size: var(--t-xs); font-weight: 650; letter-spacing: 0.03em;
    text-transform: uppercase; color: var(--ink-2);
    padding: 0.7rem 0.85rem; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
tbody td { padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--dur) var(--ease); }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* leaderboard emphasis */
.pos { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-2); }
tbody tr:first-child .pos { color: var(--accent-ink); }
.to-par-under { color: var(--under); font-weight: 700; font-variant-numeric: tabular-nums; }
.to-par-over  { color: var(--over);  font-weight: 650; font-variant-numeric: tabular-nums; }
.to-par-even  { color: var(--ink-2); font-weight: 650; font-variant-numeric: tabular-nums; }

/* ============================================================================
   Landing — federation-editorial (golf.is family, elevated)
   ============================================================================ */

/* plain hero fallback (no image) */
.hero { padding: var(--s6) 0 var(--s7); display: grid; gap: var(--s4); justify-items: start; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); letter-spacing: -0.03em; max-width: 16ch; }
.hero-lede { max-width: 46ch; font-size: var(--t-lg); color: var(--ink-2); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-top: var(--s2); }

/* image-backed featured hero (navy overlay, editorial) */
.hero-featured {
    position: relative; isolation: isolate; overflow: hidden;
    border-radius: var(--r-xl); background: var(--navy-ink); color: #fff;
    padding: clamp(var(--s6), 7vw, var(--s8)) clamp(var(--s5), 5vw, var(--s7));
    margin: 0 0 var(--s6); box-shadow: var(--sh-2);
}
.hero-featured::before {
    content: ""; position: absolute; inset: 0; z-index: -2;
    background-image: var(--hero-img, none); background-size: cover; background-position: center; opacity: 0.55;
}
.hero-featured::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(102deg, var(--navy-ink) 6%, oklch(0.275 0.078 256 / 0.74) 52%, oklch(0.275 0.078 256 / 0.34) 100%);
}
.hero-featured h1 { color: #fff; font-size: clamp(2.2rem, 5.4vw, 3.6rem); letter-spacing: -0.032em; max-width: 18ch; margin-bottom: var(--s3); }
.hero-featured .hero-lede { color: oklch(0.93 0.015 256); max-width: 48ch; }
.hero-featured .hero-ctas { margin-top: var(--s5); }
.hero-featured .button.secondary { --btn-bg: oklch(1 0 0 / 0.1); --btn-fg: #fff; --btn-bd: oklch(1 0 0 / 0.32); }
.hero-featured .button.secondary:hover { --btn-bg: oklch(1 0 0 / 0.2); --btn-fg: #fff; }

/* federation stat strip */
.stat-row { display: flex; flex-wrap: wrap; gap: var(--s5) var(--s7); margin-top: var(--s6); padding-top: var(--s5); border-top: 1px solid oklch(1 0 0 / 0.16); }
.stat { display: grid; gap: 0.1rem; }
.stat-num { font-size: var(--t-2xl); font-weight: 700; letter-spacing: -0.02em; color: #fff; font-variant-numeric: tabular-nums; line-height: 1; }
.stat-label { font-size: var(--t-sm); color: oklch(0.87 0.018 256); }

/* section header — heading + optional see-all + a small red rule (deliberate, not an eyebrow) */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin: var(--s7) 0 var(--s4); }
.section-head h2 { margin: 0; }
.section-head h2::after { content: ""; display: block; width: 2.5rem; height: 3px; margin-top: 0.5rem; background: var(--brand); border-radius: 2px; }
.section-head > a { font-size: var(--t-sm); font-weight: 600; color: var(--brand); white-space: nowrap; }
.section-head > a:hover { color: var(--brand-700); }

/* image-forward media cards (courses, features) */
.media-grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); list-style: none; padding: 0; margin: 0; }
.media-card { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); text-decoration: none; color: var(--ink); transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.media-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--border-strong); text-decoration: none; color: var(--ink); }
.media-thumb {
    aspect-ratio: 16 / 10; position: relative;
    background-color: var(--navy);
    background-image: linear-gradient(135deg, oklch(0.36 0.09 256), oklch(0.24 0.07 256));
    background-size: cover; background-position: center; background-repeat: no-repeat;
}
.media-thumb::after {  /* faint mark, shown only when no photo covers it */
    content: "⛳"; position: absolute; inset: 0; display: grid; place-items: center;
    font-size: 2.2rem; color: oklch(1 0 0 / 0.22); z-index: -1;
}
.media-thumb.has-photo::after { content: none; }
.media-thumb .badge-inline { position: absolute; left: var(--s2); top: var(--s2); box-shadow: var(--sh-1); }
.media-body { padding: var(--s3) var(--s4) var(--s4); display: grid; gap: 0.15rem; }
.media-title { font-weight: 650; letter-spacing: -0.01em; }
.media-meta { font-size: var(--t-sm); color: var(--ink-2); }

/* dated event rail (golf.is "Næstu viðburðir") */
.event-rail { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--sh-1); }
.event-row { display: flex; align-items: center; gap: var(--s4); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); text-decoration: none; color: var(--ink); transition: background var(--dur) var(--ease); }
.event-row:last-child { border-bottom: 0; }
.event-row:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.event-date { flex: none; width: 3.1rem; text-align: center; display: grid; padding: 0.35rem 0; border-radius: var(--r-sm); background: var(--brand-050); color: var(--brand-700); }
.event-date .d { font-size: var(--t-lg); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.event-date .m { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.05em; }
.event-body { flex: 1; min-width: 0; }
.event-title { font-weight: 600; }
.event-meta { font-size: var(--t-sm); color: var(--ink-2); }

/* feature row (avoids the identical-card-grid tell) */
.feature-cols { display: grid; gap: var(--s5) var(--s6); grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: var(--s5) 0; }
.feature-cols h3 { font-size: var(--t-lg); margin-bottom: 0.35rem; }
.feature-cols p { color: var(--ink-2); font-size: var(--t-sm); margin-bottom: 0.5rem; }
.feature-cols a { font-weight: 600; font-size: var(--t-sm); }

/* mission band */
.mission-band { background: var(--navy-050); border: 1px solid var(--border); border-radius: var(--r-xl); padding: clamp(var(--s5), 4vw, var(--s7)); margin: var(--s7) 0; display: grid; gap: var(--s3); justify-items: start; }
.mission-band h2 { max-width: 22ch; }
.mission-band p { color: var(--ink-2); max-width: 54ch; }

/* ============================================================================
   Skorkort — hole-by-hole entry (the signature flow: make it feel great)
   ============================================================================ */

.hole-progress { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s4) 0; }
.hole-dot {
    min-width: var(--touch); min-height: var(--touch);
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--r); border: 1px solid var(--border-strong);
    background: var(--surface); text-decoration: none; color: var(--ink);
    font-weight: 600; font-variant-numeric: tabular-nums;
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.hole-dot:hover { transform: translateY(-1px); box-shadow: var(--sh-1); text-decoration: none; }
.hole-dot.current { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in oklch, var(--brand), transparent 82%); color: var(--brand-700); }
.hole-dot.done { background: var(--brand-600); color: #fff; border-color: transparent; }

.hole-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-xl); padding: var(--s6); box-shadow: var(--sh-2); text-align: center;
}
.hole-card h1, .hole-card h2 { margin-bottom: var(--s2); }

.stroke-stepper { display: flex; align-items: center; justify-content: center; gap: var(--s4); margin: var(--s5) 0; }
.stroke-stepper input {
    text-align: center; font-size: 2.5rem; font-weight: 700; max-width: 5.5rem;
    padding: 0.3rem; min-height: auto; font-variant-numeric: tabular-nums;
    border-width: 2px;
}
.stroke-stepper button {
    font-size: 1.75rem; font-weight: 400; min-width: 3.5rem; min-height: 3.5rem;
    border-radius: 50%; padding: 0; --btn-bg: var(--surface); --btn-fg: var(--brand-700);
    --btn-bd: var(--border-strong); box-shadow: var(--sh-1);
}
.stroke-stepper button:hover { --btn-bg: var(--brand-050); --btn-fg: var(--brand-700); }

.hole-nav-buttons { display: flex; gap: var(--s3); flex-wrap: wrap; justify-content: space-between; }
.finish-form { margin-top: var(--s5); border-top: 1px solid var(--border); padding-top: var(--s4); }

.result-stats {
    display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s5);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    padding: var(--s4) var(--s5); box-shadow: var(--sh-1);
}
.result-stats dt { font-weight: 600; color: var(--ink-2); }
.result-stats dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ============================================================================
   Feed / wall / social
   ============================================================================ */

.feed-list { gap: var(--s3); }
.feed-meta { margin-bottom: 0.4rem; font-size: var(--t-sm); color: var(--ink-2); }
.feed-meta a { color: var(--ink); font-weight: 600; }
.profile-actions, .lobby-actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s2); }

/* ============================================================================
   Embeddable leaderboard
   ============================================================================ */

body.embed { background: var(--surface); }
body.embed .site-header, body.embed .site-footer, body.embed .rail { display: none; }
body.embed .layout { display: block; padding: 0; max-width: none; }
body.embed .site-main { grid-area: auto; padding: var(--s3); animation: none; }

/* ============================================================================
   Motion preferences
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important; scroll-behavior: auto !important;
    }
}

/* ============================================================================
   Avatars + styrktaraðilakóróna (supporter crown — decoration only, doctrine:
   contributions never buy features, only this mark)
   ============================================================================ */

.avatar-circle { position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--navy); color: #fff;
    vertical-align: middle; flex: 0 0 auto; overflow: visible; }
.avatar-circle img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar-circle .avatar-initial { font-weight: 700; font-size: 1rem; line-height: 1; }
.avatar-lg { width: 4rem; height: 4rem; }
.avatar-lg .avatar-initial { font-size: 1.75rem; }
.crown-badge { position: absolute; top: -0.55rem; right: -0.35rem; }
.crown-badge .crown-inline { width: 1.05rem; height: 0.7rem; }
.crown-inline { width: 0.85rem; height: 0.6rem; fill: #c9a227; vertical-align: baseline; margin-left: 0.15rem; }
.avatar-lg + .crown-note, .profile-head { display: inline-flex; align-items: center; gap: var(--s3); }
