/* compass.serrato.us — shared styles.
   Design language inherited from serrato.us: paper + plum, Newsreader italic
   display, Spectral body, IBM Plex Mono for numbers. Quadrant tints are muted
   to sit on the paper; the plum marker is the loudest thing on the page. */

:root {
    --max-width: 720px;
    --padding: 3rem;

    --bg: #faf8fb;
    --bg-alt: #f1ebf1;
    --rule: rgba(58, 20, 48, 0.14);
    --text-dark: #1a1216;
    --text-muted: #5a4a52;
    --plum: #7d1d63;
    --plum-medium: #5c164e;
    --plum-deep: #3a1430;
    --accent-ink: #2a1820;

    /* Compass quadrants — recognizable but paper-muted */
    --q-authleft: #a8433f;
    --q-authright: #41589e;
    --q-libleft: #3f8a55;
    --q-libright: #a8862e;
    --q-authleft-fill: rgba(168, 67, 63, 0.10);
    --q-authright-fill: rgba(65, 88, 158, 0.10);
    --q-libleft-fill: rgba(63, 138, 85, 0.10);
    --q-libright-fill: rgba(168, 134, 46, 0.12);
    --grid-line: rgba(58, 20, 48, 0.10);
    --grid-axis: rgba(58, 20, 48, 0.38);

    /* Agreement scale */
    --agree-2: #2e6b3c;
    --agree-1: #5e9367;
    --neutral-0: #8a7f86;
    --disagree-1: #b0605a;
    --disagree-2: #8c2f28;

    --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
    --font-body: "Spectral", "Iowan Old Style", Georgia, serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

html[data-theme="dark"] {
    --bg: #0f0c11;
    --bg-alt: #161118;
    --rule: rgba(232, 184, 214, 0.16);
    --text-dark: #ede5eb;
    --text-muted: #a89ba4;
    --plum: #e070bc;
    --plum-medium: #c090b4;
    --plum-deep: #e8b8d6;
    --accent-ink: #ede5eb;

    --q-authleft: #d4736f;
    --q-authright: #7d93d6;
    --q-libleft: #6fbd85;
    --q-libright: #d0ab55;
    --q-authleft-fill: rgba(212, 115, 111, 0.10);
    --q-authright-fill: rgba(125, 147, 214, 0.10);
    --q-libleft-fill: rgba(111, 189, 133, 0.10);
    --q-libright-fill: rgba(208, 171, 85, 0.12);
    --grid-line: rgba(232, 184, 214, 0.10);
    --grid-axis: rgba(232, 184, 214, 0.40);

    --agree-2: #6fbd85;
    --agree-1: #93b998;
    --neutral-0: #8f858c;
    --disagree-1: #c98b85;
    --disagree-2: #d4736f;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

::selection { background: var(--plum); color: var(--bg); }

html { background: var(--bg); scroll-padding-top: 5rem; }

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.7;
    padding-top: 6rem;
    color: var(--text-dark);
    background: var(--bg);
    font-size: 19px;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
    min-height: 100vh;
}

/* Fine hatch, same as serrato.us */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image: repeating-linear-gradient(-45deg,
        transparent 0 11px,
        rgba(58, 20, 48, 0.012) 11px 12px);
}
html[data-theme="dark"] body::before {
    background-image: repeating-linear-gradient(-45deg,
        transparent 0 11px,
        rgba(232, 184, 214, 0.018) 11px 12px);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1000;
    background: var(--plum);
    color: var(--bg);
    padding: 0.6rem 1rem;
    font-family: var(--font-body);
    font-weight: 500;
    border-radius: 0 0 4px 0;
}
.skip-link:focus { left: 0; }

.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--padding);
    position: relative;
    z-index: 2;
}

/* ─── Nav ─── */

.site-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 500;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(140%) blur(8px);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
    border-bottom: 1px solid var(--rule);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.site-nav-inner {
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.site-nav-name {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--accent-ink);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}
.site-nav-name:hover { color: var(--plum); }
.site-nav-name .nav-dot { color: var(--plum); }

.site-nav-sub {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.site-nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.site-nav-actions a {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s;
}
.site-nav-actions a:hover { color: var(--plum); }

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--plum-medium);
    padding: 0.2rem;
    line-height: 1;
    transition: color 0.2s ease;
}
.theme-toggle:hover { color: var(--plum); }
.theme-toggle svg { display: block; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ─── Typography ─── */

h1 {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    font-size: clamp(3rem, 8vw, 5.25rem);
    line-height: 0.95;
    letter-spacing: -0.025em;
    color: var(--accent-ink);
    margin-bottom: 1.75rem;
}
h1 .accent { color: var(--plum); }

h2 {
    font-family: var(--font-body);
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    margin-bottom: 1.75rem;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--accent-ink);
    position: relative;
    padding-bottom: 0.85rem;
}
h2::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 72px; height: 1px;
    background: var(--plum);
}

h3 {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 2.25rem;
    margin-bottom: 0.75rem;
    color: var(--accent-ink);
}

p { margin-bottom: 1.5rem; max-width: 62ch; }
p > em, p > i { font-family: var(--font-display); font-style: italic; }

a {
    color: var(--plum);
    text-decoration: none;
    font-weight: 500;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 1px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    padding-bottom: 1px;
    transition: background-size 0.35s cubic-bezier(0.2, 0, 0.1, 1), color 0.2s ease;
}
a:hover { color: var(--plum-deep); background-size: 100% 1px; }

a:focus-visible, button:focus-visible {
    outline: 2px solid var(--plum);
    outline-offset: 3px;
    border-radius: 2px;
}

strong { color: var(--accent-ink); font-weight: 600; }

ul { margin-bottom: 1.5rem; padding-left: 1.25rem; list-style: none; }
ul li { position: relative; margin-bottom: 0.85rem; padding-left: 0.25rem; }
ul li::before {
    content: '—';
    position: absolute;
    left: -1.25rem; top: 0;
    color: var(--plum);
    font-family: var(--font-mono);
    font-weight: 500;
}

section { padding: 4rem 0; }
main > section:nth-child(even) { background: var(--bg-alt); transition: background-color 0.3s ease; }

/* ─── Hero (landing) ─── */

.hero { padding-top: 2rem; padding-bottom: 4.5rem; }

.hero .section-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem;
    align-items: center;
}

.hero-rule {
    display: block;
    width: 56px; height: 1px;
    background: var(--accent-ink);
    opacity: 0.6;
    margin: 0 0 1.75rem;
}

.hero-tagline {
    font-size: 1.2rem;
    line-height: 1.55;
    max-width: 34ch;
    margin-bottom: 2rem;
}

.hero-compass { width: 240px; height: auto; }

.hero-meta {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.75rem;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    flex-wrap: wrap;
}

/* ─── Buttons ─── */

.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--bg);
    background: var(--plum);
    border: 1px solid var(--plum);
    padding: 0.8rem 2rem;
    cursor: pointer;
    text-decoration: none;
    background-image: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { background: var(--plum-medium); border-color: var(--plum-medium); color: var(--bg); }
html[data-theme="dark"] .btn { color: #0f0c11; }
html[data-theme="dark"] .btn:hover { color: #0f0c11; }

.btn-ghost {
    background: transparent;
    color: var(--plum);
    border: 1px solid var(--rule);
}
.btn-ghost:hover { background: transparent; border-color: var(--plum); color: var(--plum-deep); }
html[data-theme="dark"] .btn-ghost { color: var(--plum); }
html[data-theme="dark"] .btn-ghost:hover { color: var(--plum-deep); }

.btn-row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }

.start-option {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.start-option input { accent-color: var(--plum); width: 1rem; height: 1rem; }

/* ─── Axes cards (landing) ─── */

.axes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    margin-top: 2.5rem;
}
.axis-card { padding: 1.5rem; border-right: 1px solid var(--rule); }
.axis-card:first-child { padding-left: 0; }
.axis-card:last-child { border-right: none; padding-right: 0; }

.axis-poles {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-ink);
    display: block;
    margin-bottom: 0.5rem;
}
.axis-poles .axis-arrow { color: var(--plum); }
.axis-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 0; }

/* ─── Quiz ─── */

.quiz-main { padding-top: 1rem; }

.quiz-progress {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.6rem;
    font-variant-numeric: tabular-nums;
}

.quiz-progress-track {
    height: 2px;
    background: var(--rule);
    margin-bottom: 3rem;
    position: relative;
}
.quiz-progress-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: var(--plum);
    width: 0%;
    transition: width 0.3s cubic-bezier(0.2, 0, 0.1, 1);
}

.statement {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 450;
    font-size: clamp(1.6rem, 4.5vw, 2.4rem);
    line-height: 1.25;
    letter-spacing: -0.015em;
    color: var(--accent-ink);
    min-height: 4.5em;
    margin-bottom: 2.5rem;
}

.answers { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 2rem; }

.answer-btn {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    text-align: left;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-dark);
    background: color-mix(in srgb, var(--bg) 60%, transparent);
    border: 1px solid var(--rule);
    padding: 0.85rem 1.1rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}
.answer-btn:hover {
    border-color: var(--chip);
    background: color-mix(in srgb, var(--chip) 7%, var(--bg));
}
.answer-btn:active { transform: scale(0.995); }

.answer-chip {
    width: 10px; height: 10px;
    background: var(--chip);
    flex-shrink: 0;
    transform: rotate(45deg);
}

.answer-key {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    border: 1px solid var(--rule);
    padding: 0.05rem 0.45rem;
    border-radius: 3px;
}

.quiz-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.back-btn {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0;
    transition: color 0.2s;
}
.back-btn:hover:not(:disabled) { color: var(--plum); }
.back-btn:disabled { opacity: 0.35; cursor: default; }

.kbd-hint { font-family: var(--font-mono); font-size: 0.75rem; }

/* ─── Results ─── */

.verdict-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.result-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3rem;
    align-items: start;
}

.compass-wrap { width: 340px; max-width: 100%; }
.compass-wrap svg { width: 100%; height: auto; display: block; }

.scores {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    border-top: 1px solid var(--rule);
    margin-top: 2rem;
}
.score-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--rule);
    gap: 1rem;
}
.score-label { font-size: 0.95rem; color: var(--text-muted); }
.score-value {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--accent-ink);
    white-space: nowrap;
}

.result-actions { margin-top: 2.5rem; display: flex; gap: 1rem; flex-wrap: wrap; }

.copy-feedback {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--plum);
    align-self: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.copy-feedback.show { opacity: 1; }

/* ─── Footer ─── */

.site-footer {
    border-top: 1px solid var(--rule);
    padding: 2.5rem 0 3rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.site-footer p { margin-bottom: 0.5rem; max-width: none; }

/* ─── Mobile ─── */

@media (max-width: 768px) {
    :root { --padding: 1.5rem; }
    body { font-size: 17px; padding-top: 5rem; }
    section { padding: 3rem 0; }

    .hero .section-inner { grid-template-columns: 1fr; gap: 2rem; }
    .hero-compass { width: 180px; order: -1; }

    .axes-grid { grid-template-columns: 1fr; }
    .axis-card { border-right: none; border-bottom: 1px solid var(--rule); padding-left: 0; padding-right: 0; }
    .axis-card:last-child { border-bottom: none; }

    .statement { font-size: 1.5rem; min-height: 5.5em; }
    .answer-key, .kbd-hint { display: none; }

    .result-layout { grid-template-columns: 1fr; }
    .compass-wrap { width: 100%; max-width: 400px; margin: 0 auto; }
}

/* Hero compass: the marker drifts slowly around the center, like a reading
   settling. Purely decorative — killed by prefers-reduced-motion below. */
.compass-marker-wander {
    animation: wander 26s ease-in-out infinite;
}
@keyframes wander {
    0%, 100% { transform: translate(0, 0); }
    20%      { transform: translate(52px, -38px); }
    45%      { transform: translate(-44px, -60px); }
    70%      { transform: translate(-58px, 46px); }
    88%      { transform: translate(38px, 30px); }
}

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

@media print {
    .site-nav, .site-footer, .result-actions, .skip-link { display: none; }
    body { padding-top: 0; background: #fff; color: #000; }
}
