/* Syntonic Electronics: powder-coat enclosure colours, ink outlines, hard offset shadows. */
:root {
    --bg: #f0ebf8;
    --fg: #231942;
    --muted: #6b5f8a;
    --line: #cfc6e3;
    --tile: #e2daf1;
    --accent: #ff5d2a;
    --accent-fg: #231942;
    --drop: #231942;
    --hot: #ff5d2a;
    --signal: #1fa89c;
    --sun: #ffc53d;
    --lilac: #a58bff;
    --led: #ff2e63;
    --label-fill: #9a7bf2;
    --label-ink: #3b1784;
    --led-off: #cfc6e3;
    --error: #c4213a;
    --notice: #fff0c2;
    --display: "Shrikhand", "Cooper Black", Georgia, serif;
    --max: 72rem;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #191427;
        --fg: #efe8ff;
        --muted: #a79cc7;
        --line: #3a3157;
        --tile: #251e3a;
        --drop: #07040f;
        --signal: #3fd6c8;
        --led-off: #3a3157;
        --label-fill: #a98bff;
        --label-ink: #5228b8;
        --error: #ff8496;
        --notice: #3a2f12;
    }
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 16px/1.6 "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 2px; text-decoration-color: var(--hot); }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 4px; }
img { display: block; max-width: 100%; }
h1, h2 { line-height: 1.15; }
h1 { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 1.4rem + 2vw, 2.75rem); margin: 0 0 0.75rem; }
h2 { font-size: 1.15rem; font-weight: 700; margin: 2rem 0 0.75rem; }
code { font-size: 0.9em; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error { color: var(--error); }
.notice { background: var(--notice); padding: 0.6rem 0.9rem; border: 2px solid var(--fg); border-radius: 10px; }

.site-header, main, .site-footer {
    max-width: var(--max);
    margin: 0 auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    padding-bottom: 2.5rem;
}
.brand {
    display: inline-grid;
    text-decoration: none;
    font-size: clamp(2rem, 1.4rem + 2vw, 2.9rem);
    line-height: 1;
}
.brand .lettered { white-space: nowrap; }

/* Lettered like the pedal labels: chunky hand-drawn caps, dark outline, lighter fill, each letter a little off. */
.lettered {
    font-family: "Londrina Solid", var(--display);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.lettered-word { display: inline-block; white-space: nowrap; }
.lettered-word span {
    display: inline-block;
    color: var(--label-fill);
    -webkit-text-stroke: 0.14em var(--label-ink);
    paint-order: stroke fill;
    transform: rotate(var(--tilt, 0deg)) translateY(var(--bob, 0));
}
.lettered-word span:nth-child(3n+1) { --tilt: -3deg; --bob: 0.02em; }
.lettered-word span:nth-child(3n+2) { --tilt: 2deg; --bob: -0.03em; }
.lettered-word span:nth-child(4n) { --tilt: -1deg; --bob: 0.04em; }
.lettered-word span:nth-child(5n) { --tilt: 4deg; }
.pedal-name { font-size: clamp(2.2rem, 1.6rem + 2vw, 3rem); line-height: 1.1; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* A resonance swell under the wordmark; it draws itself once on page load. */
.wave { width: 100%; height: 0.7em; margin-top: 0.15em; overflow: visible; }
.wave path { fill: none; stroke: var(--signal); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; animation: wave-in 1.4s cubic-bezier(.3, .7, .2, 1) both; }
@keyframes wave-in { from { stroke-dashoffset: 1; } }
@media (prefers-reduced-motion: reduce) { .wave path { animation: none; } }

.site-footer { padding-top: 5rem; padding-bottom: 2rem; font-size: 0.85rem; }

.tagline { font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem); font-weight: 500; line-height: 1.35; margin: 0 0 2rem; max-width: 34rem; }

/* Tag filters, styled as footswitches: the lit LED is the active filter. */
.tags { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2.5rem; font-size: 0.9rem; font-weight: 600; }
.tags a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.85rem 0.3rem 0.7rem;
    border: 2px solid var(--fg);
    border-radius: 999px;
    text-decoration: none;
}
.tags a::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--led-off); }
.tags a:hover::before { background: var(--muted); }
.tags a.active::before { background: var(--led); box-shadow: 0 0 0 2px color-mix(in srgb, var(--led) 25%, transparent), 0 0 8px 1px var(--led); }

/* Storefront grid: every card is an enclosure with its own powder-coat shadow. */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 2.75rem 2rem;
}
.card { --coat: var(--hot); text-decoration: none; display: block; }
.card:nth-child(4n+2) { --coat: var(--signal); }
.card:nth-child(4n+3) { --coat: var(--sun); }
.card:nth-child(4n+4) { --coat: var(--lilac); }
.card-img {
    aspect-ratio: 4 / 5;
    background: var(--tile);
    overflow: hidden;
    border: 3px solid var(--fg);
    border-radius: 16px;
    box-shadow: 7px 7px 0 var(--coat);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card:hover .card-img { transform: translate(-2px, -2px); box-shadow: 9px 9px 0 var(--coat); }
.card:active .card-img { transform: translate(5px, 5px); box-shadow: 2px 2px 0 var(--coat); }
.card-body { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-top: 0.9rem; font-size: 1rem; }
.card-name { font-weight: 700; }
.card-body .muted { font-variant-numeric: tabular-nums; }

/* Pedal page */
.pedal { display: grid; grid-template-columns: 3fr 2fr; gap: 3rem; align-items: start; }
.gallery { display: grid; gap: 1.25rem; }
.gallery img { width: 100%; background: var(--tile); border: 3px solid var(--fg); border-radius: 16px; }
.details { position: sticky; top: 2rem; }
.price {
    display: inline-block;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    padding: 0.15rem 0.8rem;
    background: var(--sun);
    color: #231942;
    border: 2px solid var(--fg);
    border-radius: 999px;
    transform: rotate(-2deg);
}
.price + .muted { margin-top: 0.5rem; }
.description { margin-top: 2rem; max-width: 36rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.9rem; font-weight: 600; margin-top: 2rem; }

@media (max-width: 48rem) {
    .pedal { grid-template-columns: 1fr; gap: 1.5rem; }
    .details { position: static; }
}

/* Forms */
button, .button {
    font: inherit;
    cursor: pointer;
    font-weight: 700;
    border: 2px solid var(--fg);
    background: var(--accent);
    color: var(--accent-fg);
    padding: 0.55rem 1.1rem;
    border-radius: 10px;
    box-shadow: 3px 3px 0 var(--drop);
}
button:active, .button:active { transform: translate(3px, 3px); box-shadow: none; }
button.small { padding: 0.2rem 0.6rem; font-size: 0.85rem; font-weight: 500; box-shadow: none; background: transparent; color: var(--fg); border-color: var(--line); }
button.small:hover { border-color: var(--fg); }
button.danger { color: var(--error); }
button.link { box-shadow: none; font-weight: inherit; border: 0; background: none; color: inherit; padding: 0; text-decoration: underline; text-underline-offset: 0.2em; }
button.buy { width: 100%; padding: 0.9rem; margin-top: 1.5rem; font-size: 1.1rem; box-shadow: 5px 5px 0 var(--drop); }
button.buy:active { box-shadow: none; transform: translate(5px, 5px); }

input, select, textarea {
    font: inherit;
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--bg);
    color: var(--fg);
}
input[type="file"] { border: 0; padding-left: 0; }
input[type="checkbox"] { width: auto; }
textarea { resize: vertical; }
label { display: block; font-size: 0.9rem; }
label > input, label > select, label > textarea { margin-top: 0.25rem; }
.stack { display: grid; gap: 1rem; }
.row { display: flex; gap: 1rem; align-items: end; }
.row > * { flex: 1; }
.row > button { flex: 0 0 auto; }
form.inline { display: inline; }
.inline-check { display: inline-flex; gap: 0.4rem; align-items: center; margin-right: 0.75rem; }

.narrow { max-width: 32rem; }

/* Admin */
.admin-nav { display: flex; gap: 1.5rem; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.admin-nav form { margin-left: auto; }
.search { max-width: 20rem; margin-bottom: 1.5rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1.5rem; }
.filters input[type="search"] { flex: 1 1 12rem; max-width: 20rem; }
.filters select { width: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.admin-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 0.8rem; }
.admin-table td, .admin-table th { padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table .thumb { width: 3.5rem; }
.admin-table .thumb img { width: 3rem; height: 3rem; object-fit: cover; background: var(--tile); }
.admin-table .actions { white-space: nowrap; text-align: right; }
.admin-table .actions form { display: inline; margin-right: 0.5rem; }

.status { font-size: 0.75rem; padding: 0.1rem 0.45rem; border-radius: 3px; border: 1px solid var(--line); white-space: nowrap; }
.status-published, .status-paid { border-color: currentColor; }
.status-sold, .status-shipped, .status-archived, .status-cancelled { color: var(--muted); }
.status-failed { color: var(--error); }

.edit-header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.edit { display: grid; grid-template-columns: 3fr 2fr; gap: 3rem; align-items: start; }
.edit section h2:first-child { margin-top: 0; }
@media (max-width: 48rem) {
    .edit { grid-template-columns: 1fr; }
    .admin-table .thumb { display: none; }
}

.photo-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 1rem; }
.photo-list img { aspect-ratio: 1; object-fit: cover; width: 100%; background: var(--tile); }
.photo-list img.cover { outline: 2px solid var(--fg); outline-offset: 2px; }
.photo-list li.private img { opacity: 0.55; }
.photo-actions { display: flex; gap: 0.25rem; margin-top: 0.4rem; }

.listing summary { cursor: pointer; font-size: 0.9rem; margin-bottom: 1rem; }
.log { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 1rem; }
.log li { border-left: 2px solid var(--line); padding-left: 0.75rem; }
.log p { margin: 0.2rem 0; }
.log-meta { display: flex; gap: 0.75rem; }
.log-meta button.link { color: var(--muted); font-size: inherit; }

/* Build board: full-width columns that scroll sideways, each scrolling on its own. */
.board-bar { display: flex; gap: 1rem; align-items: baseline; justify-content: space-between; }
.board-bar .search { flex: 1; }
.board {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    overflow-x: auto;
    margin-inline: calc(50% - 50vw);
    padding: 0 1.25rem 1rem;
    scroll-snap-type: x proximity;
}
.column {
    flex: 0 0 17rem;
    background: var(--tile);
    border-radius: 6px;
    padding: 0.6rem;
    scroll-snap-align: start;
}
.column header { display: flex; justify-content: space-between; align-items: baseline; padding: 0 0.2rem 0.5rem; }
.column h2 { margin: 0; font-size: 0.95rem; }
.column-cards { display: grid; gap: 0.5rem; max-height: calc(100vh - 16rem); overflow-y: auto; }
.add-card { display: block; padding: 0.5rem 0.2rem 0.1rem; text-decoration: none; }
.add-card:hover { color: var(--fg); }

.build-card { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 0.5rem 0.6rem; font-size: 0.9rem; scroll-margin: 4rem; }
.build-card:target { border-color: var(--fg); }
.build-card[draggable="true"] { cursor: grab; }
.build-card.dragging { opacity: 0.35; }
.column-cards[data-list-id] { min-height: 1rem; }
.build-card-link { display: block; text-decoration: none; line-height: 1.35; }
.build-card-link:hover span { text-decoration: underline; }
.build-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 2px; margin-bottom: 0.45rem; background: var(--tile); }
.build-card footer { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.build-card footer .muted { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.card-move { display: flex; white-space: nowrap; }
button.icon { box-shadow: none; border: 0; background: none; color: var(--muted); padding: 0.1rem 0.3rem; font-size: 0.9rem; line-height: 1; }
button.icon:hover { color: var(--fg); }

.chips { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.4rem; }
.chip { font-size: 0.72rem; padding: 0 0.4rem; border-radius: 3px; border: 1px dashed var(--muted); color: var(--muted); }
.chip-tag { border-style: solid; border-color: var(--line); }

@media (max-width: 48rem) {
    .column { flex-basis: 82vw; }
    .column-cards { max-height: none; }
}

.orders { display: grid; gap: 1rem; }
.order { border: 1px solid var(--line); padding: 1rem; border-radius: 4px; }
.order header { display: flex; gap: 0.75rem; align-items: baseline; flex-wrap: wrap; }
.order p { margin: 0.4rem 0; }
.order address { font-style: normal; font-size: 0.9rem; }
.order address p { margin: 0; }
address p { margin: 0; }
