:root {
    /*--p: 50% 0.22 25; */
    --p: 49.7% 0.168 16.6;
    --pc: 98% 0 0;
    --rounded-btn: 0rem;
    --rounded-box: 0rem;
    --rounded-badge: 0rem;

    --opacity-70: 0.7;

    --step--2: clamp(0.7813rem, 0.7747rem + 0.0326vw, 0.8rem);
    --step--1: clamp(0.9375rem, 0.9158rem + 0.1087vw, 1rem);
    --step-0: clamp(1.125rem, 1.0815rem + 0.2174vw, 1.25rem);
    --step-1: clamp(1.35rem, 1.2761rem + 0.3696vw, 1.5625rem);
    --step-2: clamp(1.62rem, 1.5041rem + 0.5793vw, 1.9531rem);
    --step-3: clamp(1.944rem, 1.771rem + 0.8651vw, 2.4414rem);
    --step-4: clamp(2.3328rem, 2.0827rem + 1.2504vw, 3.0518rem);
    --step-5: clamp(2.7994rem, 2.4462rem + 1.7658vw, 3.8147rem);

    --space-3xs: clamp(0.2813rem, 0.2704rem + 0.0543vw, 0.3125rem);
    --space-2xs: clamp(0.5625rem, 0.5408rem + 0.1087vw, 0.625rem);
    --space-xs: clamp(0.8438rem, 0.8111rem + 0.163vw, 0.9375rem);
    --space-s: clamp(1.125rem, 1.0815rem + 0.2174vw, 1.25rem);
    --space-m: clamp(1.6875rem, 1.6223rem + 0.3261vw, 1.875rem);
    --space-l: clamp(2.25rem, 2.163rem + 0.4348vw, 2.5rem);
    --space-xl: clamp(3.375rem, 3.2446rem + 0.6522vw, 3.75rem);
    --space-2xl: clamp(4.5rem, 4.3261rem + 0.8696vw, 5rem);
    --space-3xl: clamp(6.75rem, 6.4891rem + 1.3043vw, 7.5rem);

    --space-3xs-2xs: clamp(0.2813rem, 0.1617rem + 0.5978vw, 0.625rem);
    --space-2xs-xs: clamp(0.5625rem, 0.4321rem + 0.6522vw, 0.9375rem);
    --space-xs-s: clamp(0.8438rem, 0.7024rem + 0.7065vw, 1.25rem);
    --space-s-m: clamp(1.125rem, 0.8641rem + 1.3043vw, 1.875rem);
    --space-m-l: clamp(1.6875rem, 1.4049rem + 1.413vw, 2.5rem);
    --space-l-xl: clamp(2.25rem, 1.7283rem + 2.6087vw, 3.75rem);
    --space-xl-2xl: clamp(3.375rem, 2.8098rem + 2.8261vw, 5rem);
    --space-2xl-3xl: clamp(4.5rem, 3.4565rem + 5.2174vw, 7.5rem);
    --space-s-l: clamp(1.125rem, 0.6467rem + 2.3913vw, 2.5rem);

    --grid-max-width: 77.5rem;
    --grid-gutter: var(--space-s-l);
    --grid-columns: 12;

    --padding-card: var(--space-m-l);
}

@font-face {
    font-family: "Arcon-Regular";
    src: url("/static/Arcon-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

html {
    overflow-y: scroll;
}

img {
    pointer-events: none;
}

body {
    font-family: "Arcon-Regular", sans-serif;
    font-size: var(--step-0);
    --flow-space: 3rem;
}

/* Arcon only comes in one weight. Text is thinned by stroking its edges in
   the color of the surface behind it, so --stroke-bg has to follow every
   background that carries text. A larger --text-thin gives thinner text. */
:root {
    --text-thin: 0.4px;
    --stroke-bg: oklch(var(--b1));
}

body,
body * {
    -webkit-text-stroke: var(--text-thin) var(--stroke-bg);
}

.bg-base-200,
.alert,
.product-choice:hover,
.product-mode__option:hover {
    --stroke-bg: oklch(var(--b2));
}

/* Light text on a filled surface loses too much contrast when thinned. */
.btn,
.btn *,
.product-mode__option[aria-checked="true"],
.product-mode__option[aria-checked="true"] * {
    -webkit-text-stroke: 0;
}

body h1 {
    font-size: var(--step-5);
    --flow-space: 3rem;
}
body h2 {
    font-size: var(--step-4);
    --flow-space: 3rem;
}

body h3 {
    font-size: var(--step-3);
    --flow-space: 2rem;
}

body h4 {
    font-weight: 400;
    font-size: var(--step-0);
    --flow-space: 3rem;
}

body p {
    opacity: var(--opacity-70);
    font-weight: 400;
    font-size: var(--step-0);
    --flow-space: 3rem;
}

body blockquote {
    font-size: var(--step-2);
}

body blockquote,
body blockquote + * {
    --flow-space: 4rem;
}

body span {
    font-size: var(--step-0);
}

.border-3 {
    border-width: 3px;
}

.small-text {
    font-size: var(--step--1);
    opacity: var(--opacity-70);
    font-weight: 400;
}

.btn {
    font-size: var(--step--1);
}

.btn.btn-action {
    padding-inline: var(--space-m);
    padding-block: var(--space-s);
    font-size: var(--step-0);
    min-height: auto;
    height: auto;
}

/* The navbar stays at the top while the page scrolls; it sits above the
 * color panels (z-index 30) so their shadows slide beneath it. */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    padding-block: var(--space-2xs);
    transition:
        min-height 0.2s ease,
        padding 0.2s ease;
}

/* Scrolled, the bar gives its height back to the page; the script in the
 * layout sets is-scrolled with some hysteresis so the change in height
 * can't flip it back and forth. */
.is-scrolled .navbar {
    min-height: 3.25rem;
    padding-block: 0;
}

/* The links stay quiet so the logo is the heaviest thing in the bar. */
.navbar .menu li a,
.navbar .menu li span {
    font-size: var(--step--1);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* The email in the user menu is data, not a label. */
.navbar .menu li span.text-sm {
    text-transform: none;
    letter-spacing: normal;
}

.flow {
    --flow-space: 1em;
}

.flow > * + * {
    margin-top: 1em;
    margin-top: var(--flow-space);
}

.u-container {
    max-width: var(--grid-max-width);
    margin-inline: auto;
    padding-inline: var(--grid-gutter);
}

.u-stack-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.u-grid {
    display: grid;
    grid-template-columns: repeat(
        var(--grid-placement, auto-fit),
        minmax(var(--grid-min-item-size, 20rem), 1fr)
    );
    gap: var(--gutter, var(--space-s-l));
}

.u-grid--centered {
    align-items: center;
    justify-items: center;
}

.logo {
    height: clamp(3rem, 2.2rem + 3vw, 4.5rem);
    width: auto;
    max-width: none;
    flex-shrink: 0;
    transition: height 0.2s ease;
}

.is-scrolled .logo {
    height: clamp(2.25rem, 1.8rem + 1.6vw, 2.75rem);
}

@media (prefers-reduced-motion: reduce) {
    .navbar,
    .logo {
        transition: none;
    }
}

.line-indent {
    border-left: 0.25rem solid oklch(var(--p));
    padding-left: var(--space-s);
    --flow-space: 2rem;
}

/* The hero art: PNGs only. The lines image sets the size of the frame, and
 * the colored layers are flat colors shaped by white PNG masks over it. */
.hero-art-box {
    position: relative;
    max-width: 100%;
    /* Fills its container's height so the frame can size itself against it.
     * A container without a set height collapses the box onto its content;
     * the frame is then bounded by the home hero's cap alone. */
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* The frame hugs the artwork itself, whatever its aspect ratio, so the outline
 * and shadow stay tight around the image rather than around the centering box.
 * outline is used instead of border so it never changes the image's layout.
 * The frame's size is fractional while the image inside is snapped to whole
 * device pixels, which at some zoom levels leaves a gap of page background
 * between image and outline. The outline is drawn inside the frame, over the
 * image's edge, so it covers that gap. */
.art-frame {
    outline: 4px solid black;
    outline-offset: -2px;
    box-shadow: 8px 8px 12px -4px rgba(0, 0, 0, 0.42);
}

/* The frame shrink-wraps the lines image, so the absolutely positioned layers
 * fill exactly the same box the lines draw in, and their masks never distort. */
.art-frame {
    position: relative;
    max-width: 100%;
}

/* Two ways to bound the frame, both keeping the artwork's aspect ratio. In a
 * size container, like the detail stage on a wide screen, the frame fits
 * inside the container in both directions. Everywhere else it keeps the
 * artwork's natural width and is capped in height. */
.hero-art-box .art-frame {
    width: auto;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: var(--art-w, 1) / var(--art-h, 1);
}
.hero-art-box .art-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.home-hero {
    --hero-art-max-h: 34rem;
}

/* The artwork is one column of a two-column grid with no height of its own,
 * so it caps its height and lets the frame shrink to the width that height
 * allows. */
.home-hero .art-frame {
    width: min(100%, calc(var(--hero-art-max-h, 34rem) / var(--art-hr, 1)));
    max-height: var(--hero-art-max-h, 34rem);
}

/* A product card has a fixed height, so its frame fits the artwork inside both
 * dimensions instead of only the width. */
.product-thumb {
    width: 100%;
    height: 100%;
    container-type: size;
}
.product-thumb .art-frame {
    width: auto;
    height: min(100cqh, calc(100cqw * var(--art-hr, 1)));
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: var(--art-w, 1) / var(--art-h, 1);
}
.product-thumb .art-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Color changes animate only after the first paint, so a page transition
 * doesn't replay the artwork from another color. */
.art-layer {
    position: absolute;
    inset: 0;
    transition: none;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    will-change: background-color;
}

.hero-art-layers.is-ready .art-layer {
    transition: background-color 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
    .hero-art-layers.is-ready .art-layer {
        transition: none;
    }
}

/* Home intro: every color layer starts as the same dark grey and fades to its
 * own color. It plays only on a full page load, while the layout script keeps
 * `first-load` on <html>; boosted navigation drops the class before the page
 * swaps in. The color cycle starts once it has finished (see ColorCycle). */
.first-load .home-hero .art-layer {
    animation: hero-colorize 1.6s ease-out 1.5s backwards;
}

@keyframes hero-colorize {
    from {
        background-color: #464646;
    }
}

@media (prefers-reduced-motion: reduce) {
    .first-load .home-hero .art-layer {
        animation: none;
    }
}

/* The scheme name fades out and back in, together taking as long as the art. */
#scheme-name {
    transition: opacity 0.75s ease-in-out;
}

/*
 * Cart confirmation: a bar drains over --cart-toast-time, then the toast fades
 * out. Hovering drops both animations, so they restart from the beginning on
 * mouse leave.
 */
.cart-toast {
    --cart-toast-time: 4s;
    animation: cart-toast-hide 0.6s ease-in var(--cart-toast-time) forwards;
}
.cart-toast:hover {
    animation: none;
}
.cart-toast-timer {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 0.25rem;
    width: 100%;
    background: oklch(var(--p));
    transform-origin: left;
    animation: cart-toast-drain var(--cart-toast-time) linear forwards;
}
.cart-toast:hover .cart-toast-timer {
    animation: none;
}
@keyframes cart-toast-drain {
    to {
        transform: scaleX(0);
    }
}
@keyframes cart-toast-hide {
    to {
        opacity: 0;
        transform: translateY(-0.5rem);
        visibility: hidden;
    }
}
@media (prefers-reduced-motion: reduce) {
    .cart-toast {
        animation-duration: 0s;
    }
}

/*
 * Product detail: the framed artwork on a dark stage next to the choices.
 * Every control lives in the form, so the stage and the workspace share one
 * card and the price sits with the thing it describes.
 */
.product {
    display: grid;
    gap: 0;
    background: oklch(var(--b1));
    border: 1px solid oklch(var(--bc) / 0.15);
    box-shadow: 0 1.5rem 3rem -1.5rem oklch(var(--bc) / 0.3);
}

@media (min-width: 64rem) {
    .product {
        grid-template-columns: minmax(0, 1.25fr) minmax(22rem, 1fr);
        align-items: stretch;
    }

    /* The workspace can grow as choices change; the stage keeps its height and
     * the divider lives on the workspace so it still spans the whole card. */
    .product-stage {
        align-self: start;
        /* The artwork is sized against the padding box, so the stage's height
         * includes its padding; content-box keeps the card the stated height. */
        box-sizing: content-box;
        height: 34rem;
        /* A definite height lets the frame be sized from the stage itself
         * rather than from the image's intrinsic size. */
        container-type: size;
    }

    /* Fits the frame inside the stage in both directions: it takes the smaller
     * of the available width and the width the available height allows. */
    .product-stage .art-frame {
        width: min(100cqw, calc(100cqh / var(--art-hr, 1)));
    }

    .product-workspace {
        border-left: 1px solid oklch(var(--bc) / 0.12);
    }
}

.product-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-s-m);
    overflow: hidden;
}

/* Below 64rem the stage has no definite height, so it cannot be a size
 * container; the artwork caps its own height instead of growing to the full
 * column width. */
@media (max-width: 63.999rem) {
    .product-stage .art-frame {
        width: min(100%, calc(34rem / var(--art-hr, 1)));
        max-height: 34rem;
    }
}

.product-workspace {
    display: flex;
    flex-direction: column;
    gap: var(--space-m);
    padding: var(--space-s-m);
}

.product-header .small-text {
    margin: 0;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.product-header h1 {
    margin: var(--space-3xs) 0 0;
    font-size: var(--step-4);
    line-height: 1.05;
}

/* The configurator only re-renders the price, so it has to sit where the
 * price belongs: right under the title, above the color mode. */
.price {
    margin: var(--space-2xs) 0 0;
    font-size: var(--step-1);
    font-weight: 400;
    opacity: 1;
}

/* A size or frame change re-renders the price; the flash makes the new
 * number noticeable without moving the layout. htmx puts htmx-settling on
 * the element it swaps in. */
.price.htmx-settling {
    animation: price-flash 0.5s ease;
}

@keyframes price-flash {
    from {
        opacity: 0.15;
        transform: translateY(-0.125rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .price.htmx-settling {
        animation: none;
    }
}

.product-step {
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    margin: 0 0 var(--space-2xs);
    font-size: var(--step--1);
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.7;
}

.product-step__number {
    display: grid;
    place-items: center;
    width: 1.375rem;
    height: 1.375rem;
    font-size: var(--step--2);
    letter-spacing: 0;
    border: 1px solid currentColor;
    border-radius: 999px;
}

.product-mode {
    position: relative;
}

.product-mode__options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2xs);
}

.product-mode__option {
    display: flex;
    flex-direction: column;
    gap: var(--space-3xs);
    padding: var(--space-2xs) var(--space-2xs) var(--space-xs);
    text-align: left;
    background: transparent;
    border: 1px solid oklch(var(--bc) / 0.2);
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease;
}

.product-mode__option:hover {
    border-color: oklch(var(--bc) / 0.5);
    background: oklch(var(--b2));
}

.product-mode__option[aria-checked="true"] {
    border-color: oklch(var(--bc));
    background: oklch(var(--bc));
    color: oklch(var(--b1));
}

.product-mode__option:focus-visible {
    outline: 2px solid oklch(var(--p));
    outline-offset: 2px;
}

.product-mode__title {
    position: relative;
    padding-bottom: var(--space-3xs);
    font-size: var(--step-0);
    font-weight: 400;
}

/* The selected mode gets a short rule under its title, so the state reads
 * without relying on the fill alone. */
.product-mode__option[aria-checked="true"] .product-mode__title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 1.5rem;
    height: 2px;
    background: currentColor;
}

.product-mode__hint {
    font-size: var(--step--2);
    line-height: 1.35;
    opacity: 0.7;
}

/* Color options float over the steps below instead of pushing them down, so
 * opening a mode never changes the height of the form. */
.product-panel {
    position: absolute;
    top: calc(100% + var(--space-2xs));
    right: 0;
    left: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    background: oklch(var(--b1));
    border: 1px solid oklch(var(--bc) / 0.25);
    box-shadow: 0 1.5rem 3rem -1rem oklch(var(--bc) / 0.35);
    /* The panel is taken out of the flow while closed instead of being
     * display: none, so opening and closing it can be animated. */
    visibility: hidden;
    opacity: 0;
    transform: translateY(-0.5rem);
    pointer-events: none;
    transition:
        opacity 0.24s ease,
        transform 0.24s ease,
        visibility 0s linear 0.24s;
}

.product-panel[hidden] {
    display: flex;
    visibility: hidden;
}

.product-panel:not([hidden]) {
    visibility: visible;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    transition:
        opacity 0.34s ease,
        transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1),
        visibility 0s;
}

.product-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-s);
    padding: var(--space-2xs) var(--space-xs) var(--space-2xs) var(--space-s);
    border-bottom: 1px solid oklch(var(--bc) / 0.12);
}

.product-panel__head h2 {
    margin: 0;
    font-size: var(--step-0);
    font-weight: 400;
}

.product-panel__close {
    padding: var(--space-3xs) var(--space-2xs);
    font-size: var(--step--1);
    background: transparent;
    border: 1px solid oklch(var(--bc) / 0.25);
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.product-panel__close:hover {
    border-color: oklch(var(--bc));
}

.product-panel__close:focus-visible {
    outline: 2px solid oklch(var(--p));
    outline-offset: 2px;
}

.product-panel__body {
    padding: var(--space-s);
}

#color-picker [data-panel] {
    overscroll-behavior: contain;
}

@media (max-width: 47.999rem) {
    /* The color panel is a sheet over the page; keep the page still while it
     * is open instead of letting focus changes scroll it behind the sheet. */
    html:has(.product-panel:not([hidden])) {
        overflow: hidden;
    }

    .product-panel {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        max-height: 75vh;
        overflow-y: auto;
        overscroll-behavior: contain;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        box-shadow: 0 -1rem 3rem -0.5rem oklch(var(--bc) / 0.35);
        transform: translateY(1rem);
    }

    .product-panel:not([hidden]) {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-panel,
    .product-panel:not([hidden]) {
        transform: none;
        transition: visibility 0s;
    }
}

/* Curated palettes: the colors are the choice, arranged as large contiguous
 * swatches so a scheme reads at a glance. */
.product-schemes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
    gap: var(--space-2xs);
}

.product-scheme {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2xs);
    padding: var(--space-2xs);
    background: oklch(var(--b1));
    border: 1px solid oklch(var(--bc) / 0.2);
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.product-scheme:hover {
    border-color: oklch(var(--bc) / 0.5);
}

.product-scheme[aria-pressed="true"] {
    border-color: oklch(var(--bc));
    outline: 2px solid oklch(var(--p));
    outline-offset: -3px;
}

.product-scheme:focus-visible {
    outline: 2px solid oklch(var(--p));
    outline-offset: 2px;
}

.product-scheme__swatches {
    display: flex;
    height: 4rem;
    overflow: hidden;
}

.product-scheme__swatches span {
    flex: 1 1 0;
}

.product-scheme__name {
    font-size: var(--step--1);
    text-align: left;
}

/* The configurator holds the size and frame steps, so it carries the rule
 * that separates them from the color step above. */
.product-configurator {
    display: flex;
    flex-direction: column;
    gap: var(--space-s);
    padding-top: var(--space-s);
    border-top: 1px solid oklch(var(--bc) / 0.12);
}

.product-step-group {
    padding-top: var(--space-s);
    border-top: 1px solid oklch(var(--bc) / 0.12);
}

.product-choices {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
}

.product-choice {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 6.5rem;
    flex: 1 1 6.5rem;
    padding: var(--space-2xs) var(--space-xs);
    background: oklch(var(--b1));
    border: 1px solid oklch(var(--bc) / 0.2);
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease;
}

.product-choice:hover {
    border-color: oklch(var(--bc) / 0.5);
    background: oklch(var(--b2));
}

.product-choice--selected {
    border-color: oklch(var(--bc));
    box-shadow: inset 0 0 0 1px oklch(var(--bc));
}

.product-choice:has(input:focus-visible) {
    outline: 2px solid oklch(var(--p));
    outline-offset: 2px;
}

.product-footer {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
    margin-top: auto;
    padding-top: var(--space-s);
    border-top: 1px solid oklch(var(--bc) / 0.12);
}

.product-footer .small-text {
    margin: 0;
    text-align: center;
}

::view-transition-group(root) {
    animation-duration: 100ms;
}

.divider::before,
.divider::after {
  height: 1px; /* for horizontal dividers */
  width: 1px;  /* for vertical dividers */
}
