/* ==========================================================================
   3D Zebra stylesheet
   Plain CSS on purpose: no build step, nothing to install, nothing to break.

   Colors come straight from the brand book (October 2021):
     primary   dark blue #023047, white, greys #D1D1D1 / #A3A3A3
     secondary sky #8ECAE6, teal #219DBC, amber #FFB703, orange #FB8600

   THEMING: every color used below is a semantic token defined in the two
   blocks that follow - light values in :root, dark overrides in the
   prefers-color-scheme media query. The site follows the visitor's OS
   setting automatically; there is no JavaScript involved. Dark mode is the
   brand book's other canonical treatment: white text on the dark blue.
   To restyle anything, change tokens here - never hardcode colors in rules.
   ========================================================================== */

:root {
    /* Brand palette (constant across themes) */
    --ink: #023047; /* primary dark blue */
    --ink-soft: #0b3e5c; /* the dark blue, one step lighter */
    --white: #ffffff;
    --sky: #8ecae6;
    --teal: #219dbc;
    --teal-dark: #1a7e96; /* teal that carries white text / reads on white */
    --amber: #ffb703;
    --orange: #fb8600;
    --grey-light: #d1d1d1;
    --grey-mid: #a3a3a3;

    /* Semantic tokens - LIGHT theme */
    --bg: #ffffff;
    --surface: #f2f6f8; /* illustration placeholders, panels */
    --heading: #111111;
    --text: #333a40;
    --text-muted: #5c666e;
    --border: #eeeeee; /* hairlines (header/footer rules) */
    --border-strong: var(--grey-light); /* cards, inputs */
    --link: var(--teal-dark); /* plain teal is only 3.2:1 on white */
    --brand: var(--ink); /* wordmark: dark blue on light... */
    --warn: #b85c00; /* orange as text: the brand orange is 2.5:1 on white */
    --price: var(--warn);
    --error: #b3261e;
    --scrim: rgba(0, 0, 0, 0.6); /* dims the page behind a modal */
    --viewer-model: #d7dde2; /* 3D preview material; constant, it ends up in thumbnails */

    /* Layout */
    --container: 72rem;
    --radius: 0.375rem;

    font-family: "Gotham", "Montserrat", "Noto Sans JP", system-ui, sans-serif;
    /* Native widgets (selects, file inputs, scrollbars) follow the theme. */
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Semantic tokens - DARK theme (brand dark blue background) */
        --bg: #023047;
        --surface: var(--ink-soft);
        --heading: #ffffff;
        --text: #d7e3ea;
        --text-muted: #9fb8c5;
        --border: rgba(255, 255, 255, 0.14);
        --border-strong: rgba(255, 255, 255, 0.28);
        --link: var(--sky); /* per brand book: blue/white on dark blue */
        --brand: #ffffff; /* ...and white on dark (brand book rule) */
        --warn: var(--orange);
        --error: #ffb4ab;
    }
}

/* Gotham. There is no Book (400) face in the brand kit, so Light answers for
   both 300 and 400: regular text is Gotham Light, as in the brand book, and
   500 stays a visible step up for buttons and nav. */
@font-face {
    font-family: 'Gotham';
    src: url("../fonts/GOTHAM-THIN.38f511bdd0a5.woff") format('woff');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url("../fonts/GOTHAM-XLIGHT.1d1a32049338.woff") format('woff');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url("../fonts/GOTHAM-LIGHT.32212413e229.woff") format('woff');
    font-weight: 300 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url("../fonts/GOTHAM-MEDIUM.d43b3680191f.woff") format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url("../fonts/GOTHAM-BOLD.ed3c77979267.woff") format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url("../fonts/GOTHAM-ULTRA.c83ac198b7d9.woff") format('woff');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url("../fonts/GOTHAM-BLACK.23caf67c6bbf.woff") format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}


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

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

img {
    max-width: 100%;
    display: block;
}

h1, h2, h3 {
    color: var(--heading);
    line-height: 1.2;
    margin: 0 0 0.5em;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

h3 {
    font-size: 1rem;
    font-weight: 700;
}

a {
    color: var(--link);
}

/* Supporting copy: help text, empty states, status notes. */
.hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.error {
    color: var(--error);
}

/* Something the reader has to act on before going further: full-size text in
   an amber panel, where a .hint would be passed over. */
.notice {
    margin-block: 1.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid color-mix(in srgb, var(--amber) 60%, transparent);
    border-left: 0.375rem solid var(--amber);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--amber) 14%, transparent);
    color: var(--heading);
}

.notice__title {
    font-size: 1.125rem;
    font-weight: 700;
}

.notice > * + * {
    margin-top: 0.25rem;
}

:focus-visible {
    outline: 3px solid var(--link);
    outline-offset: 2px;
}

.container {
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 1.5rem);
}

/* --- Buttons ------------------------------------------------------------ */
.btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border: 0;
    border-radius: var(--radius);
    font: inherit;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

/* White on the dark teal is 4.7:1 (plain teal is only 3.2:1), and it holds on
   both themes - buttons stay stable. */
.btn--primary {
    background: var(--teal-dark);
    color: var(--white);
}

.btn--primary:hover {
    background: color-mix(in srgb, var(--teal-dark) 80%, var(--ink));
}

.btn--secondary {
    background: var(--grey-light);
    color: var(--ink);
}

.btn--amber {
    background: var(--amber);
    color: var(--ink);
}

.btn--orange {
    background: var(--orange);
    color: var(--ink);
}

.btn--small {
    padding: 0.35rem 1rem;
    font-size: 0.9rem;
}

/* --- Impersonation bar ---------------------------------------------------- */
/* Shown above the header while a superuser is using the site as someone
   else. Amber with ink text in both themes: it must not blend in. */
.impersonation-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1rem;
    padding: 0.5rem 1rem;
    background: var(--amber);
    color: var(--ink);
    font-weight: 500;
}

/* --- Warnings before something irreversible ------------------------------- */
/* What the reader is about to lose (the delete-my-account page). */
.warning-list {
    margin: 0 0 1.5rem;
    padding: 1rem 1rem 1rem 2.25rem;
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--warn);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--heading);
}

.warning-list li + li {
    margin-top: 0.5rem;
}

/* --- Header / footer ------------------------------------------------------ */
.site-header {
    border-bottom: 1px solid var(--border);
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap; /* nav drops below the wordmark when cramped */
    align-items: center;
    justify-content: space-between;
    padding-block: 1rem;
    gap: 0.5rem 1.5rem; /* row-gap for the wrapped state, column-gap otherwise */
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    font-size: clamp(1.15rem, 3.5vw, 1.6rem);
    letter-spacing: 0.06em;
    text-decoration: none;
    color: var(--brand);
    font-weight: 300;
}

.logo {
    display: block;
    height: 3.4em;
    width: auto;
    flex-shrink: 0;
}

.site-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* links themselves may wrap too */
    gap: clamp(0.75rem, 2.5vw, 1.5rem); /* breathing room shrinks fluidly */
}

.site-nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

.site-nav a.btn {
    color: var(--white);
}

.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 5rem;
    padding-block: 3rem;
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
}

.site-footer__brand {
    font-weight: 700;
    color: var(--brand);
    flex: 1 1 12rem;
}

.lang-switch {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.lang-switch button {
    background: none;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 0.2rem 0.6rem;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
    cursor: pointer;
}

.lang-switch button[aria-current="true"] {
    border-color: var(--brand);
    color: var(--brand);
    font-weight: 700;
}

.site-footer__col {
    display: grid;
    gap: 0.4rem;
    align-content: start;
}

.site-footer__col h3 {
    font-size: 0.9rem;
    margin: 0 0 0.25rem;
}

.site-footer__col a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.site-footer__col h3 a {
    color: var(--text);
    font-size: 0.9rem;
    margin: 0 0 0.25rem;
}

.site-footer__col a:hover {
    text-decoration: underline;
}

/* --- Homepage sections ---------------------------------------------------- */
.hero {
    display: grid;
    gap: 2rem;
    align-items: center;
    padding-block: 3rem;
}

@media (min-width: 50rem) {
    .hero {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    }
}

.hero__figure {
    background: var(--bg);
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    color: var(--text-muted); /* fallback text readable on both themes */
    font-weight: 700;
    overflow: hidden;
}

.hero__figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero__copy {
    text-align: right;
    display: grid;
    gap: 1rem;
    justify-items: end;
}

.hero__copy p {
    color: var(--text-muted);
    margin: 0;
}

.section {
    padding-block: 2.5rem;
}

.card-grid {
    display: grid;
    gap: 2rem;
}

@media (min-width: 50rem) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.card h3 a {
    color: var(--link);
}

.card p {
    color: var(--text-muted);
    margin: 0.4rem 0 0;
}

.split {
    display: grid;
    gap: 2.5rem;
    align-items: center;
}

@media (min-width: 50rem) {
    .split {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

.split__figure {
    background: var(--surface);
    border-radius: var(--radius);
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    color: var(--text-muted);
    overflow: hidden;
}

.split__figure svg {
    display: block;
    width: 100%;
    height: 100%;
}

.split__figure img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.split__body {
    display: grid;
    gap: 1.25rem;
    justify-items: start;
}

.button-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.review-card {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: grid;
    gap: 2.5rem;
    align-content: space-between;
}

.review-card blockquote {
    margin: 0;
    font-weight: 700;
    color: var(--heading);
}

.review-card figcaption {
    font-size: 0.85rem;
}

.review-card .reviewer-role {
    color: var(--text-muted);
}

/* --- Ordering flow --------------------------------------------------------- */
.flow {
    padding-block: 3rem;
    max-width: 56rem;
    margin-inline: auto;
}

.flow__step {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.flow__head {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
}

.price {
    color: var(--price);
    font-size: 2rem;
    font-weight: 500;
    text-align: right;
}

.price small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.dropzone {
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 4rem 2rem;
    margin-block: 2rem;
    display: grid;
    gap: 1rem;
    justify-items: center;
    transition: border-color 0.15s, background-color 0.15s;
}

.dropzone label strong {
    color: var(--heading);
}

.dropzone input[type="url"] {
    width: min(20rem, 100%);
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--teal);
    border-radius: var(--radius);
    font: inherit;
    background: var(--bg);
    color: var(--text);
}

.dropzone--active {
    border-color: var(--teal);
    background-color: color-mix(in srgb, var(--teal) 8%, transparent);
}

.dropzone--reject {
    border-color: var(--error);
}


.option-group {
    margin-block: 1.5rem;
}

/* Kill the browser's default fieldset box + legend notch. */
fieldset.option-group {
    border: 0;
    padding: 0;
    margin-inline: 0;
    min-width: 0;
}

.option-group > legend, .option-group > label {
    font-weight: 700;
    color: var(--heading);
}

.option-group > div {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.option-group div > label {
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    font-weight: 400;
    color: var(--text);
    cursor: pointer;
}

.option-group input[type="radio"] {
    margin: 0; /* UA margins are what usually skew the axis */
    width: 1.1em;
    height: 1.1em;
    flex-shrink: 0;
    accent-color: var(--teal); /* brand the control - no more default blue */
}

/* Selects get the same box as the text inputs below. The arrow itself is
   left native on purpose: :root sets color-scheme, so the UA draws it in
   the visitor's theme without us shipping an icon per theme. */
.option-group select,
.data-table select,
.summary-table select {
    font: inherit;
    width: min(24rem, 100%);
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
}

.option-group select:hover,
.data-table select:hover,
.summary-table select:hover {
    border-color: var(--link);
}

.option-group select:disabled,
.data-table select:disabled,
.summary-table select:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

.option-group input:where([type="text"], [type="email"], [type="password"]) {
    font: inherit;
    width: min(24rem, 100%);
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
}

.option-group textarea {
    font: inherit;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    resize: vertical;
}

/* The conversation on an order's page: the customer's messages to the left,
   ours set in from it and tinted, so the two sides read apart at a glance. */
.conversation {
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.message {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-block: 0.75rem;
    margin-right: 15%;
    overflow-wrap: anywhere;
}

.message--staff {
    margin-right: 0;
    margin-left: 15%;
    background: var(--surface);
}

.message p {
    margin: 0;
}

.message .message__meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

/* Who wrote it (and who changed it): the one thing in the small print that
   is read first. */
.message__author {
    color: var(--heading);
    font-size: 0.9rem;
    font-weight: 700;
}

/* Files sent with a message: a list of downloads. */
.message__files {
    list-style: none;
    margin-top: 0.5rem;
    padding: 0;
}

.message__files li::before {
    content: "\1F4CE\00A0"; /* a paper clip */
}

/* Staff: edit, redact. */
.message__actions {
    float: right;
    display: flex;
    gap: 0.75rem;
}

/* What a message says, from Markdown (orders/markdown.py). */
.message__body > * + * {
    margin-top: 0.5rem;
}

.message__body :is(ul, ol) {
    padding-left: 1.5rem;
}

.message__body blockquote {
    border-left: 3px solid var(--border-strong);
    padding-left: 0.75rem;
    color: var(--text-muted);
}

.message__body :is(code, pre) {
    font-size: 0.9em;
    background: color-mix(in srgb, var(--grey-mid) 20%, transparent);
    border-radius: 0.25rem;
    padding: 0.1em 0.3em;
}

.message__body pre {
    padding: 0.5rem 0.75rem;
    overflow-x: auto;
}

.message__body pre code {
    background: none;
    padding: 0;
}

.message__body :is(h1, h2, h3, h4, h5, h6) {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
}

/* Something in the message the customer has to agree to (orders/approvals.py):
   amber while it waits, teal once given, red when refused. */
.approval {
    --approval: var(--amber);
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-left: 0.375rem solid var(--approval);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--approval) 14%, transparent);
    color: var(--heading);
}

.approval--approved {
    --approval: var(--teal);
}

.approval--declined {
    --approval: var(--error);
}

.approval--withdrawn {
    --approval: var(--grey-mid);
}

.approval > * + * {
    margin-top: 0.5rem;
}

/* Staff: how a message was changed after it was sent. */
.message__history {
    list-style: none;
    margin-top: 0.75rem;
    padding: 0.5rem 0 0;
    border-top: 1px dashed var(--border-strong);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.message__history summary {
    cursor: pointer;
    color: var(--link);
}

.message__diff {
    margin-top: 0.25rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
}

.message__diff ins {
    background: color-mix(in srgb, var(--teal) 25%, transparent);
    text-decoration: none;
}

.message__diff del {
    background: color-mix(in srgb, var(--error) 20%, transparent);
}

/* The message editor (static/js/message_editor.js), in the site's own type. */
.markdown-editor {
    margin-top: 0.25rem;
}

.markdown-editor .toastui-editor-defaultUI,
.markdown-editor .toastui-editor-defaultUI :is(.toastui-editor-contents, .ProseMirror) {
    font-family: inherit;
    font-size: 1rem;
}

.markdown-editor .toastui-editor-defaultUI .toastui-editor-contents p {
    color: var(--text);
}

label.checkbox {
    font-weight: 400;
}

/* Staff: the form that changes what an order is for. */
.order-change {
    margin-top: 2rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
}

.order-change > summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--heading);
}

.order-change__fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.5rem;
}

.order-change :is(p, form) {
    margin-top: 0.75rem;
}

.order-change label:not(.checkbox) {
    font-weight: 700;
    color: var(--heading);
}

/* Photos sent with a message: small, in a row; each opens at full size. */
.message__photos,
.option-group > .message__photos {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.message__photos img {
    display: block;
    width: 9rem;
    height: 9rem;
    object-fit: cover;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
}

.option-group input:where([type="number"]) {
    font: inherit;
    width: min(24rem, 100%);
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.errorlist {
    color: var(--error);
    list-style: none;
    padding: 0;
}

.flow__actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.flow__actions:has(> :only-child) {
    justify-content: flex-end;
}

.details-thumbnail {
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
}

.summary-table {
    border-collapse: collapse;
    width: 100%;
    margin-block: 1.5rem;
}

.summary-table th {
    text-align: left;
    padding: 0.6rem 1rem 0.6rem 0;
    color: var(--heading);
}

.summary-table td {
    padding: 0.6rem 0;
    color: var(--text-muted);
}

.summary-table tr + tr {
    border-top: 1px solid var(--border);
}

.summary-table .error {
    color: var(--error);
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

.flow--split {
    max-width: none;
}

.order-layout {
    display: grid;
    gap: 2.5rem;
    align-items: start;
}

@media (min-width: 60rem) {
    .order-layout {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .order-layout .viewer {
        position: sticky;
        top: 1.5rem;
    }
}

.viewer__title {
    font-size: 1rem;
}

.viewer canvas {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    background: var(--bg);
    outline: var(--border) 1px solid;
}

/* Guard: sections hidden by the step logic must stay hidden even if a
   display rule targets them. */
[hidden] {
    display: none !important;
}

.orient {
    margin-top: 1rem;
}

.orient__label {
    font-weight: 700;
    color: var(--heading);
}

.orient__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}