@font-face {
    font-family: "Archivo";
    src: url("/fonts/Archivo-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Archivo Black";
    src: url("/fonts/ArchivoBlack-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --paper: #e6ddd0;
    --sheet: #fbf7f1;
    --ink: #1c1916;
    --muted: #6e665d;
    --line: #ddd3c4;
    --accent: #8d1d24;
    --accent-soft: #f8efe9;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --sans: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: var(--sans);
    background:
        radial-gradient(ellipse at top, #f4eee4 0%, var(--paper) 52%, #ddd2c3 100%);
}

.page {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 64px;
}

.masthead h1 {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(2.1rem, 4vw, 3.4rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 0.95;
}

.brand {
    margin: 0 0 8px;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}

.lede {
    max-width: 38rem;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.45;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.9fr);
    gap: 28px;
    margin-top: 28px;
    align-items: start;
}

.sheet,
.panel {
    background: var(--sheet);
    border: 1px solid rgba(28, 25, 22, 0.08);
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(70, 46, 22, 0.08);
}

.sheet {
    padding: 22px 22px 18px;
    position: sticky;
    top: 16px;
}

.eyebrow,
.progress {
    margin: 0;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.stamp {
    display: flex;
    justify-content: center;
    padding: 12px 0 4px;
    transition: opacity 0.15s ease;
}

.stamp.is-loading { opacity: 0.4; }

.stamp svg {
    width: min(100%, 520px);
    height: auto;
}

.banner,
.error {
    margin: 8px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8e4e2;
    color: #6d1218;
}

.downloads {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.hint,
.help,
.arc-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.4;
}

.panel { padding: 18px; }

.crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 18px;
    padding: 0;
    list-style: none;
}

.crumbs button {
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 0.92rem;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
}

.crumbs button.is-current {
    background: var(--ink);
    color: #f7f1e7;
}

.crumbs button:disabled {
    opacity: 0.35;
    cursor: default;
}

.step h2 {
    margin: 0 0 6px;
    font-family: var(--serif);
    font-size: 1.7rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

.inks,
.choices {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.inks {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
}

.choices { grid-template-columns: 1fr 1fr; }

.choice {
    position: relative;
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 72px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
}

.choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.choice:focus-within {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

.choice:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.choice strong { display: block; }
.choice small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    line-height: 1.3;
}

.swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.18);
    flex: none;
}

.swatch.libre {
    background:
        conic-gradient(from 20deg, #1a1a1a, #163a8a, #a61b1b, #0f6b3c, #5b2a86, #1a1a1a);
}

.shape-icon { flex: none; color: var(--ink); }

.fields {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

label.field { display: grid; gap: 6px; font-weight: 650; }

input[type="text"] {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    font-weight: 500;
}

input[type="text"]:focus,
input[type="color"]:focus {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

input[type="color"] {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
}

.button {
    appearance: none;
    border: 0;
    background: var(--accent);
    color: #fffaf6;
    font: inherit;
    font-weight: 650;
    padding: 12px 18px;
    border-radius: 999px;
    cursor: pointer;
}

.button:hover { filter: brightness(1.06); }

.button.ghost {
    background: transparent;
    color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--line);
}

.button[hidden] { display: none; }

.recap {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.recap p {
    margin: 0;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.recap span { color: var(--muted); }

.noscript-submit { margin-top: 16px; }

@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .sheet { position: static; }
}

@media (max-width: 560px) {
    .page { width: min(100% - 20px, 1120px); padding-top: 20px; }
    .choices { grid-template-columns: 1fr; }
    .downloads, .nav { flex-direction: column; }
    .button { width: 100%; }
}
