/* ------------------------------------------------------------
   thmsmllr.xyz — shared styles
   The playing field: shapes from Ultimate and the newsroom.
   circle = disc (tinkering), triangle = cone (design),
   square = column (journalism).
   ------------------------------------------------------------ */

:root {
    --bg: #FBFAFF;
    --ink: #1C1633;
    --ink-fixed: #1C1633;   /* text on coloured surfaces, same in both themes */
    --ink-soft: #4E4866;
    --ink-faint: #8C87A3;
    --line: rgba(28, 22, 51, 0.12);

    --orange: #FF5B1F;
    --green: #14A867;
    --blue: #3048FF;
    --pink: #FF9FD2;
    --yellow: #FFCF3A;
    --lilac: #C9BCFF;
    --lilac-soft: #EEE9FF;
    --link: #3048FF;

    --f-display: "Unbounded", "Arial Black", sans-serif;
    --f-text: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;

    --gutter: clamp(16px, 4vw, 48px);
    --wrap: 1240px;
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    color-scheme: light;
}

/* Dark: night game under floodlights. Coloured surfaces stay as they are. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #16112A;
        --ink: #F3F0FF;
        --ink-soft: #C0B9DA;
        --ink-faint: #8E88AA;
        --line: rgba(243, 240, 255, 0.13);
        --lilac-soft: #261F42;
        --link: #9AA6FF;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #16112A;
    --ink: #F3F0FF;
    --ink-soft: #C0B9DA;
    --ink-faint: #8E88AA;
    --line: rgba(243, 240, 255, 0.13);
    --lilac-soft: #261F42;
    --link: #9AA6FF;
    color-scheme: dark;
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--f-text);
    font-size: 18px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

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

::selection { background: var(--yellow); color: var(--ink-fixed); }

:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 4px;
    border-radius: 6px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Shape primitives ---------- */

.sh { display: inline-block; flex-shrink: 0; width: 1em; height: 1em; }
.sh--circle { border-radius: 50%; background: var(--orange); }
.sh--tri { background: var(--yellow); clip-path: polygon(50% 4%, 100% 96%, 0 96%); }
.sh--square { background: var(--blue); border-radius: 0.12em; }
.sh--half { background: var(--pink); border-radius: 1em 1em 0 0; height: 0.5em; }

/* ---------- Links ---------- */

a { color: inherit; }

.text-link,
.prose a {
    color: var(--link);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.22em;
    transition: color 0.2s;
}

.text-link:hover,
.prose a:hover { color: var(--orange); }

/* ---------- Masthead ---------- */

.masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    flex-wrap: wrap;
    padding-top: 24px;
    padding-bottom: 24px;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--f-display);
    font-weight: 800;
    font-size: 19px;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.wordmark .marks { display: inline-flex; align-items: flex-end; gap: 3px; font-size: 14px; }

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 15px;
    font-weight: 600;
}

.nav a {
    padding: 7px 14px;
    border-radius: 999px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.nav a:hover { background: var(--lilac-soft); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }

/* ---------- Theme switch: sun disc slides over and turns into a moon ---------- */

.theme-toggle {
    position: relative;
    width: 60px;
    height: 32px;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--lilac-soft);
    box-shadow: inset 0 0 0 1.5px var(--line);
    cursor: pointer;
}

.theme-toggle::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 5px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--yellow);
    transition: transform 0.45s var(--spring), background-color 0.3s, box-shadow 0.3s;
}

.theme-toggle[aria-checked="true"]::before {
    transform: translateX(28px) rotate(-30deg);
    background: transparent;
    box-shadow: inset -6px -2px 0 0 var(--lilac);
}

.theme-toggle:hover::before { filter: brightness(1.06); }

.masthead .nav { margin-left: auto; }

@media (max-width: 560px) {
    .masthead { row-gap: 10px; }
    .masthead .nav { order: 3; flex-basis: 100%; margin-left: -9px; font-size: 14px; gap: 0; }
    .nav a { padding: 6px 9px; }
}

/* ---------- Sections ---------- */

.section { padding-top: clamp(72px, 10vw, 136px); }

.section-head {
    display: flex;
    align-items: center;
    gap: 0.3em;
    margin: 0 0 clamp(28px, 4vw, 44px);
    font-family: var(--f-display);
    font-weight: 800;
    font-size: clamp(28px, 5.4vw, 70px);
    line-height: 1;
    letter-spacing: -0.035em;
}

.section-head .sh { width: 0.7em; height: 0.7em; }

/* ---------- Chips ---------- */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--ink-fixed);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.chip--outline { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }

/* ---------- Page heads (lab, instructions, privacy) ---------- */

.page-head {
    position: relative;
    margin-top: 8px;
    padding: clamp(36px, 6vw, 80px) clamp(24px, 5vw, 64px);
    border-radius: clamp(28px, 4vw, 48px);
    background: var(--c, var(--lilac));
    color: var(--on-c, var(--ink-fixed));
    overflow: hidden;
    isolation: isolate;
}

.page-title {
    position: relative;
    margin: 0;
    max-width: 11ch;
    font-family: var(--f-display);
    font-weight: 800;
    font-size: clamp(42px, 8vw, 112px);
    line-height: 0.95;
    letter-spacing: -0.045em;
}

.page-head .lede {
    position: relative;
    max-width: 40ch;
    margin: 22px 0 0;
    font-size: clamp(18px, 1.8vw, 21px);
}

.page-head .deco {
    position: absolute;
    z-index: -1;
    pointer-events: none;
}

.back {
    position: relative;
    display: inline-flex;
    margin-bottom: 20px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    color: var(--ink-fixed);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
}

.back:hover { background: #fff; }

/* ---------- Prose ---------- */

.prose { max-width: 66ch; margin-top: clamp(40px, 6vw, 72px); }

.prose h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 52px 0 12px;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 23px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.prose h2:first-child { margin-top: 0; }

.prose h2::before {
    content: "";
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--orange);
}

.prose h2:nth-of-type(4n+2)::before { border-radius: 3px; background: var(--blue); }
.prose h2:nth-of-type(4n+3)::before { border-radius: 0; background: var(--yellow); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.prose h2:nth-of-type(4n+4)::before { border-radius: 14px 14px 0 0; height: 7px; background: var(--pink); }

.prose h3 { margin: 24px 0 6px; font-size: 18px; font-weight: 700; }
.prose p { margin: 0 0 14px; }
.prose ul { margin: 0 0 14px; padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: var(--orange); }
.prose strong { font-weight: 700; }

.nope { list-style: none; padding-left: 0 !important; display: flex; flex-wrap: wrap; gap: 8px; }
.nope li {
    margin: 0;
    padding: 6px 14px 6px 12px;
    border-radius: 999px;
    background: var(--lilac-soft);
    font-size: 16px;
    font-weight: 500;
}
.nope li::before { content: "✕"; margin-right: 8px; color: var(--orange); font-weight: 700; }

/* ---------- Footer ---------- */

.site-foot { margin-top: clamp(80px, 12vw, 160px); padding-bottom: 32px; }

.small-print {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 28px;
    padding-top: 22px;
    font-size: 14px;
    color: var(--ink-faint);
}

.small-print a { color: var(--ink-soft); font-weight: 600; text-decoration: none; }
.small-print a:hover { color: var(--blue); }

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