/*
 * Sulfur style-guide presentation. Layout/chrome only — palette tokens live
 * in sulfur.css. Everything here styles with the semantic tokens so the page
 * re-skins itself when [data-palette] flips.
 */

/* ── Shell ───────────────────────────────────────────────────────────── */
.container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 28px;
}

nav.top {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
    padding: 22px 28px;
    border-bottom: 1px solid var(--rule);
    font-family: var(--font-body);
    font-size: 12px;
    letter-spacing: .16em;
    text-transform: uppercase;
}
nav.top a { color: var(--text-dim); text-decoration: none; transition: color .2s; }
nav.top a:hover { color: var(--accent); }
nav.top .spacer { flex: 1; }

/* ── Header / wordmark ───────────────────────────────────────────────── */
header.masthead {
    padding: 64px 0 8px;
    text-align: center;
}
.mark {
    width: 92px;
    height: 92px;
    margin: 0 auto 22px;
    display: block;
    color: var(--accent);
    filter: drop-shadow(var(--accent-glow));
}
.wordmark {
    font-family: var(--font-display);
    font-size: clamp(40px, 8vw, 72px);
    font-weight: 600;
    letter-spacing: .01em;
    line-height: 1;
}
.wordmark .ye { color: var(--accent); }
.wordmark .dot { color: var(--accent-2); }
.wordmark .vi { color: var(--heading); font-style: italic; font-weight: 400; }

.kicker {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 11px;
    letter-spacing: .4em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: .85;
}
.lede {
    max-width: 56ch;
    margin: 18px auto 0;
    font-size: clamp(15px, 2.2vw, 18px);
    color: var(--text);
    opacity: .9;
}

/* ── Sections ────────────────────────────────────────────────────────── */
section { padding: 40px 0; border-top: 1px solid var(--rule); }
section:first-of-type { border-top: 0; }
section > h2 {
    font-size: clamp(26px, 4vw, 40px);
    margin-bottom: .15em;
}
section > h2 + .note { margin-top: 0; }
.note { color: var(--text-dim); max-width: 60ch; font-size: 15px; }
h3.group {
    margin: 34px 0 14px;
    font-size: 13px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--accent);
    font-family: var(--font-body);
    font-weight: 500;
}

/* ── Palette toggle ──────────────────────────────────────────────────── */
.toggle {
    display: inline-flex;
    border: 1px solid var(--rule);
    border-radius: 999px;
    overflow: hidden;
    font-family: var(--font-body);
    font-size: 11px;
    letter-spacing: .18em;
    text-transform: uppercase;
}
.toggle button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-dim);
    padding: 9px 18px;
    cursor: pointer;
    transition: background-color .25s, color .25s;
}
.toggle button[aria-pressed="true"] {
    background: var(--accent);
    color: var(--bg);
}
@media (prefers-reduced-motion: reduce) {
    .toggle button { transition: none; }
}

/* ── Swatches ────────────────────────────────────────────────────────── */
.swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}
.swatch {
    border: 1px solid var(--rule);
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-raised);
}
.swatch .chip {
    height: 96px;
    border-bottom: 1px solid var(--rule);
}
.swatch .meta {
    padding: 11px 13px 13px;
}
.swatch .name {
    font-family: var(--font-display);
    font-size: 19px;
    color: var(--heading);
    line-height: 1.1;
}
.swatch .hex {
    margin-top: 3px;
    font-family: var(--font-body);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.swatch .role {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--text);
    opacity: .75;
}

/* ── Type specimens ──────────────────────────────────────────────────── */
.specimen { margin-top: 20px; }
.specimen .display {
    font-family: var(--font-display);
    font-size: clamp(34px, 6vw, 58px);
    color: var(--heading);
    line-height: 1.05;
    margin: 0;
}
.specimen .display em { font-style: italic; color: var(--accent); }
.specimen .body {
    margin-top: 14px;
    max-width: 64ch;
    font-size: 17px;
}
.scale span {
    display: inline-block;
    margin: 0 18px 8px 0;
    color: var(--text-dim);
    font-family: var(--font-display);
}

/* ── Code blocks ─────────────────────────────────────────────────────── */
pre.code {
    margin: 16px 0 0;
    padding: 18px 20px;
    background: var(--bg-sunken);
    border: 1px solid var(--rule);
    border-left: 2px solid var(--accent);
    border-radius: 3px;
    overflow-x: auto;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
}
code.inline {
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: .9em;
    background: var(--bg-sunken);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 1px 6px;
    color: var(--accent);
}

/* ── Component samples ───────────────────────────────────────────────── */
.samples { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.btn {
    font-family: var(--font-body);
    font-size: 13px;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 11px 20px;
    border-radius: 2px;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid var(--accent);
}
.btn.solid { background: var(--accent); color: var(--bg); border-color: var(--accent); box-shadow: var(--accent-glow); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.blood { background: var(--accent-2); color: var(--vellum, #E7DCC2); border-color: var(--accent-2); }
.card {
    flex: 1 1 240px;
    background: var(--bg-raised);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 22px;
    box-shadow: 0 30px 60px -40px rgba(0,0,0,.8);
}
.card h4 { margin: 0 0 8px; font-size: 22px; }
.card p { margin: 0; font-size: 14.5px; color: var(--text); opacity: .85; }

/* ── Footer ──────────────────────────────────────────────────────────── */
footer {
    border-top: 1px solid var(--rule);
    padding: 34px 0 60px;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-dim);
}
footer a { text-decoration: none; }
