/*
 * Zyvolab design system: shared by the home page, sign-in, sign-up, Library and admin pages.
 *
 *   Porcelain and paper  the cool grey of a photo studio's backdrop; products sit on it
 *   Graphite             text and primary actions
 *   Amber                dimension lines and measurements only (the one bold colour)
 *   Archivo              one family in two widths: expanded for headlines, normal for reading
 */

@font-face {
    font-family: "Archivo";
    src: url("../../vendor/fonts/archivo-latin-wdth-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Archivo";
    src: url("../../vendor/fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

[hidden] { display: none !important; }

:root {
    --porcelain: #eef0f1;
    --paper: #f8f9fa;
    --white: #ffffff;
    --graphite: #1d2226;
    --graphite-2: #2b3237;
    --slate: #5b646b;
    --mist: #8a949b;
    --hair: #d8dde0;
    --hair-2: #c4cbd0;
    --amber: #f2a900;
    --amber-soft: #fbefcf;
    --amber-ink: #6b4a00;
    --ok: #1e6a4e;
    --ok-soft: #dcefe6;
    --danger: #b3261e;
    --danger-soft: #f8e1df;

    --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --wide: 118%;     /* headlines */
    --wider: 125%;    /* the wordmark */

    --r-s: 6px;
    --r-m: 10px;
    --r-l: 16px;
    --shadow-lift: 0 1px 2px rgba(29, 34, 38, 0.06), 0 12px 32px -12px rgba(29, 34, 38, 0.22);
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--porcelain);
    color: var(--graphite);
    font: 400 16px/1.55 var(--font);
    font-stretch: 100%;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--graphite); outline-offset: 2px; }
::selection { background: var(--amber-soft); }

/* ---------- type ---------- */

.display {
    margin: 0;
    font-stretch: var(--wide);
    font-weight: 500;
    letter-spacing: -0.022em;
    line-height: 0.98;
}
h1, h2, h3 { font-stretch: var(--wide); font-weight: 560; letter-spacing: -0.015em; line-height: 1.1; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--slate); }

/* ---------- wordmark ---------- */

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
    font-stretch: var(--wider);
    font-weight: 620;
    font-size: 19px;
    letter-spacing: -0.01em;
}
.wordmark svg { width: 26px; height: 26px; color: currentColor; }
.wordmark svg path:last-child { fill: var(--amber); opacity: 1; }

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border: 1px solid var(--hair-2);
    border-radius: var(--r-s);
    background: var(--white);
    color: var(--graphite);
    font-weight: 550;
    font-size: 15px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--graphite); }
.btn.primary { background: var(--graphite); border-color: var(--graphite); color: var(--porcelain); }
.btn.primary:hover { background: var(--graphite-2); }
.btn.quiet { border-color: transparent; background: transparent; }
.btn.quiet:hover { background: rgba(29, 34, 38, 0.06); border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.small { height: 34px; padding: 0 12px; font-size: 14px; }
.btn.full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* on graphite */
.on-dark .btn { background: transparent; color: var(--porcelain); border-color: rgba(238, 240, 241, 0.35); }
.on-dark .btn:hover { border-color: var(--porcelain); }
.on-dark .btn.primary { background: var(--porcelain); color: var(--graphite); border-color: var(--porcelain); }
.on-dark .btn.primary:hover { background: var(--white); }

/* ---------- fields ---------- */

.field { display: grid; gap: 6px; margin: 0 0 16px; }
.field > span { font-size: 14px; font-weight: 520; color: var(--graphite); }
.field > small { color: var(--slate); font-size: 13px; }
.field input, .field select, .field textarea, .input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--hair-2);
    border-radius: var(--r-s);
    background: var(--white);
    font-size: 15px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { min-height: 88px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
    outline: none;
    border-color: var(--graphite);
    box-shadow: 0 0 0 3px rgba(29, 34, 38, 0.1);
}
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--graphite); }

.msg { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--r-s); font-size: 14px; line-height: 1.45; }
.msg.error { background: var(--danger-soft); color: #7d1a14; }
.msg.ok { background: var(--ok-soft); color: #134a35; }
.msg.warn { background: var(--amber-soft); color: var(--amber-ink); }

/* ---------- dimension line: the platform's signature mark ----------
 * A thin amber line with end ticks, like a measurement on a product drawing. */
.dim {
    position: relative;
    height: 11px;
    border: 0;
    margin: 0;
}
.dim::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 5px;
    height: 1px;
    background: var(--amber);
}
.dim::after {
    content: "";
    position: absolute;
    inset: 0;
    border-left: 1px solid var(--amber);
    border-right: 1px solid var(--amber);
}

/* ---------- tags ---------- */

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(29, 34, 38, 0.07);
    color: var(--graphite);
    font-size: 12.5px;
    font-weight: 520;
    white-space: nowrap;
}
.tag.live { background: var(--ok-soft); color: #134a35; }
.tag.draft { background: var(--amber-soft); color: var(--amber-ink); }
.tag.off { background: var(--danger-soft); color: #7d1a14; }
.tag.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- toast ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 100;
    max-width: min(560px, calc(100vw - 32px));
    padding: 12px 18px;
    border-radius: var(--r-m);
    background: var(--graphite);
    color: var(--porcelain);
    font-size: 14px;
    transform: translate(-50%, 10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); color: #fff; }

/* ---------- dialog ---------- */

dialog.sheet {
    width: min(520px, calc(100vw - 32px));
    padding: 28px;
    border: 0;
    border-radius: var(--r-l);
    background: var(--paper);
    color: var(--graphite);
    box-shadow: 0 30px 80px -20px rgba(29, 34, 38, 0.45);
}
dialog.sheet::backdrop { background: rgba(29, 34, 38, 0.42); }
dialog.sheet h2 { margin: 0 0 8px; font-size: 22px; }
dialog.sheet p { margin: 0 0 18px; color: var(--slate); }
dialog.sheet .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ---------- app bar (Library, admin) ---------- */

.app-top {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 28px;
    height: 64px;
    padding: 0 clamp(16px, 3vw, 32px);
    background: var(--graphite);
    color: var(--porcelain);
}
.app-top .wordmark { color: var(--porcelain); font-size: 17px; }
.app-top .wordmark svg { width: 22px; height: 22px; }
.app-nav { display: flex; gap: 4px; }
.app-nav a {
    display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: var(--r-s);
    color: #b9c1c7; text-decoration: none; font-size: 15px;
}
.app-nav a:hover { color: var(--porcelain); background: rgba(238, 240, 241, 0.08); }
.app-nav a[aria-current="page"] { color: var(--porcelain); background: rgba(238, 240, 241, 0.12); }
.app-top .spacer { flex: 1; }
.app-top .who { color: #b9c1c7; font-size: 14px; }

@media (max-width: 640px) {
    .app-top { gap: 12px; }
    .app-top .wordmark span { display: none; }
    .app-nav a { padding: 0 8px; font-size: 14px; }
    .app-top .who { display: none; }
}

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