/* ==========================================================================
   Catalog Studio — Atelier design system
   Warm ivory · ink · bronze · editorial serif · hairline precision
   ========================================================================== */

:root {
    --canvas: #F6F4EF;
    --surface: #FFFFFF;
    --surface-soft: #FAF9F5;
    --ink: #1C1A15;
    --ink-soft: #3D3A33;
    --muted: #8C8778;
    --line: #EAE6DE;
    --line-strong: #D9D4C8;

    --red-bg: #F4E7E1;    --red-ink: #94423B;
    --blue-bg: #E7ECEF;   --blue-ink: #3D5568;
    --green-bg: #ECF0E2;  --green-ink: #4C5F38;
    --yellow-bg: #F4ECD9; --yellow-ink: #84682D;

    --accent: #8A6B45;
    --accent-ink: #6E5435;

    --sans: 'Inter', -apple-system, 'Helvetica Neue', sans-serif;
    --serif: 'Instrument Serif', Georgia, serif;
    --mono: 'IBM Plex Mono', 'SF Mono', monospace;

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --radius-card: 10px;
    --radius-ctl: 5px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
    font-family: var(--sans);
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--ink-soft);
    background: var(--canvas);
}

::selection { background: rgba(138, 107, 69, 0.16); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.mono { font-family: var(--mono); }

/* ------------------------------------------------------------- shell */

.shell { max-width: 1220px; margin: 0 auto; padding: 0 40px 110px; }

.page-head { padding: 64px 0 40px; }

.kicker {
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.kicker i { font-size: 13px; }

.display {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 46px;
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-top: 12px;
}

.head-note {
    margin-top: 12px;
    color: var(--muted);
    font-size: 13.5px;
    max-width: 58ch;
    line-height: 1.65;
}

/* --------------------------------------------------------------- nav */

.nav {
    position: sticky;
    top: 0;
    z-index: 40;
    height: 60px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--line);
}

.nav-inner {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 40px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 40px;
}

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.brand-mark {
    width: 9px;
    height: 9px;
    background: var(--ink);
    border-radius: 1px;
    transform: rotate(45deg);
}

.brand-name {
    font-family: var(--serif);
    font-size: 19px;
    color: var(--ink);
    letter-spacing: 0.01em;
}

.nav-links { display: flex; align-items: center; gap: 2px; }

.nav-links a {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: var(--radius-ctl);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.005em;
    color: var(--muted);
    transition: color 0.2s, background 0.2s;
}

.nav-links a i { font-size: 15px; }

.nav-links a:hover { color: var(--ink); background: var(--surface-soft); }
.nav-links a.active { color: var(--ink); }

.nav-links a.active::after {
    content: '';
    position: absolute;
}

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.inline-form { display: inline; }

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

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--ink);
    color: #F6F4EF;
    border: 1px solid var(--ink);
    border-radius: var(--radius-ctl);
    padding: 9px 20px;
    font-family: var(--sans);
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: -0.005em;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.btn-primary:hover { background: #33302A; border-color: #33302A; }
.btn-primary:active { transform: scale(0.985); }
.btn-primary:disabled { background: #6B675E; border-color: #6B675E; cursor: default; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    color: var(--ink-soft);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-ctl);
    padding: 9px 18px;
    font-family: var(--sans);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.15s;
}
.btn-ghost:hover { border-color: var(--muted); background: var(--surface); color: var(--ink); }
.btn-ghost:active { transform: scale(0.985); }

.btn-danger { color: var(--red-ink); }
.btn-danger:hover { border-color: rgba(148, 66, 59, 0.4); background: var(--red-bg); }
.btn-danger.armed { background: var(--red-bg); border-color: rgba(148, 66, 59, 0.45); }

.btn-sm { padding: 6px 13px; font-size: 12.5px; }
.btn-block { width: 100%; }

.btn-primary:focus-visible, .btn-ghost:focus-visible, .input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ------------------------------------------------------------ badges */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}
.badge i { font-size: 11px; }

.badge-completed { background: var(--green-bg); color: var(--green-ink); }
.badge-failed    { background: var(--red-bg);    color: var(--red-ink); }
.badge-pending   { background: var(--yellow-bg); color: var(--yellow-ink); }
.badge-selection { background: var(--blue-bg);   color: var(--blue-ink); }
.badge-processing{ background: var(--blue-bg);   color: var(--blue-ink); }

.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 9999px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

/* -------------------------------------------------------------- card */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.card-pad { padding: 26px; }
.card-link { display: block; cursor: pointer; }
.card-link:hover { border-color: var(--line-strong); box-shadow: 0 1px 3px rgba(28, 26, 21, 0.04); }

/* ------------------------------------------------------------- bento */

.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.cell-3  { grid-column: span 3; }
.cell-4  { grid-column: span 4; }
.cell-5  { grid-column: span 5; }
.cell-6  { grid-column: span 6; }
.cell-7  { grid-column: span 7; }
.cell-8  { grid-column: span 8; }
.cell-12 { grid-column: span 12; }

/* -------------------------------------------------------------- stat */

.stat { padding: 24px 26px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }

.stat-label {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}
.stat-top i { font-size: 15px; color: var(--line-strong); }

.stat-value {
    font-family: var(--serif);
    font-size: 46px;
    font-weight: 400;
    line-height: 1;
    color: var(--ink);
    margin-top: 16px;
    font-variant-numeric: tabular-nums;
}
.stat-value .unit { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-left: 4px; }
.stat-sub { margin-top: 8px; font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------ tables */

.table { width: 100%; border-collapse: collapse; }

.table th {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
    padding: 11px 18px;
    border-bottom: 1px solid var(--line);
}

.table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    font-size: 13.5px;
    color: var(--ink-soft);
    vertical-align: top;
}
.table tr:last-child td { border-bottom: 0; }
.table .num { font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.table .dim { color: var(--muted); }

/* -------------------------------------------------------------- form */

.form { display: flex; flex-direction: column; gap: 6px; }
.form-label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink-soft);
    margin-bottom: 2px;
}

.input {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-ctl);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 13.5px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(138, 107, 69, 0.09);
}

.search { position: relative; min-width: 280px; }
.search i {
    position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--muted); font-size: 14px;
}
.search .input { padding-left: 34px; }

/* -------------------------------------------------------------- pills */

.pills { display: flex; gap: 6px; flex-wrap: wrap; }

.pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 9999px;
    border: 1px solid var(--line);
    background: transparent;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.pill:hover { border-color: var(--muted); color: var(--ink-soft); }
.pill.active { background: var(--ink); border-color: var(--ink); color: var(--canvas); }

/* ------------------------------------------------------ product grid */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(226px, 1fr));
    gap: 14px;
}

.product-card { display: flex; flex-direction: column; }

.product-thumb {
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    background: var(--surface-soft);
    position: relative;
}
.product-thumb img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform 0.7s var(--ease), opacity 0.4s;
}
.product-card:hover .product-thumb img { transform: scale(1.025); }
.product-thumb .badge { position: absolute; top: 10px; left: 10px; }

.thumb-fallback {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--line-strong);
}
.thumb-fallback i { font-size: 30px; }

.product-body {
    padding: 15px 17px 17px;
    display: flex; flex-direction: column; gap: 6px;
}

.product-style {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.02em;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.45;
}

.clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta { margin-top: 7px; display: flex; align-items: center; gap: 9px; }
.product-meta .sizes { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }

/* ---------------------------------------------------------- shot pairs */

.shot {
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    overflow: hidden;
    background: var(--surface-soft);
}
.shot img { width: 100%; display: block; }
.shot-label {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 17px;
    border-top: 1px solid var(--line);
    background: var(--surface);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}
.shot-empty {
    aspect-ratio: 1 / 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 10px;
    color: var(--muted); padding: 24px; text-align: center;
}
.shot-empty i { font-size: 28px; color: var(--line-strong); }
.shot-empty .t { font-size: 13px; }

/* ------------------------------------------------------------ notices */

.note {
    border-radius: var(--radius-ctl);
    padding: 13px 16px;
    font-size: 13.5px;
    display: flex; gap: 10px;
    align-items: flex-start;
    line-height: 1.55;
    border: 1px solid transparent;
}
.note i { margin-top: 2px; flex-shrink: 0; }

.note-red    { background: var(--red-bg);    color: var(--red-ink);    border-color: rgba(148, 66, 59, 0.14); }
.note-blue   { background: var(--blue-bg);   color: var(--blue-ink);   border-color: rgba(61, 85, 104, 0.14); }
.note-green  { background: var(--green-bg);  color: var(--green-ink);  border-color: rgba(76, 95, 56, 0.14); }
.note-yellow { background: var(--yellow-bg); color: var(--yellow-ink); border-color: rgba(132, 104, 45, 0.14); }
.note .mono { font-size: 12px; word-break: break-all; }

/* ---------------------------------------------------------- empty state */

.empty {
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: 80px 32px;
    display: flex; flex-direction: column;
    align-items: center; gap: 12px; text-align: center;
    background: var(--surface);
}
.empty i { font-size: 30px; color: var(--line-strong); }
.empty .empty-title { font-family: var(--serif); font-size: 23px; color: var(--ink); }
.empty .empty-sub { font-size: 13.5px; color: var(--muted); max-width: 46ch; }

/* ----------------------------------------------------------------- kbd */

kbd {
    font-family: var(--mono);
    font-size: 11px;
    padding: 2px 6px;
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: var(--surface-soft);
    color: var(--ink-soft);
}

/* --------------------------------------------------------------- login */

.login-page {
    min-height: 100dvh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 32px;
    position: relative;
    background: var(--canvas);
}
.login-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 55% 45% at 50% 28%, rgba(138, 107, 69, 0.07), transparent 70%);
    pointer-events: none;
}
.login-wrap { position: relative; width: 100%; max-width: 390px; }

.login-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 44px 40px;
    display: flex; flex-direction: column; gap: 26px;
}
.login-brand { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.login-brand .brand-mark { width: 10px; height: 10px; }

.login-title {
    font-family: var(--serif);
    font-size: 31px;
    color: var(--ink);
    line-height: 1.1;
}
.login-sub {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--muted);
}

.login-error, .login-notice {
    border-radius: var(--radius-ctl);
    padding: 11px 14px;
    font-size: 13px;
    display: flex; align-items: center; gap: 8px;
}
.login-error { background: var(--red-bg); color: var(--red-ink); }
.login-notice { background: var(--green-bg); color: var(--green-ink); }

.login-foot {
    text-align: center; margin-top: 22px;
    font-family: var(--mono);
    font-size: 9.5px; letter-spacing: 0.22em;
    color: var(--muted);
}

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

.toast {
    position: fixed;
    right: 28px; bottom: 28px;
    z-index: 60;
    background: var(--ink);
    color: var(--canvas);
    padding: 12px 20px;
    border-radius: var(--radius-ctl);
    font-size: 13px;
    box-shadow: 0 4px 16px rgba(28, 26, 21, 0.18);
    transition: opacity 0.4s, transform 0.4s;
    max-width: 420px;
}
.toast.toast-out { opacity: 0; transform: translateY(8px); }

/* ------------------------------------------------------------- footer */

.footer {
    max-width: 1220px;
    margin: 0 auto;
    padding: 26px 40px 44px;
    border-top: 1px solid var(--line);
    display: flex; align-items: center; gap: 12px;
    font-size: 11.5px;
    color: var(--muted);
}
.footer .mono { font-size: 9.5px; letter-spacing: 0.18em; }
.footer-sep { width: 22px; height: 1px; background: var(--line-strong); }

/* -------------------------------------------------------------- motion */

.reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 550ms var(--ease), transform 550ms var(--ease);
    transition-delay: calc(var(--index, 0) * 70ms);
}
.reveal.revealed { opacity: 1; transform: none; }

/* --------------------------------------------------------- status dot */

.status-badge { gap: 7px; }
.status-dot { width: 5px; height: 5px; border-radius: 9999px; flex-shrink: 0; }

.dot-live { background: currentColor; animation: dot-pulse 1.8s ease-in-out infinite; }
.dot-still { background: currentColor; opacity: 0.5; }

@keyframes dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.3; transform: scale(0.75); }
}

@media (prefers-reduced-motion: reduce) {
    .dot-live { animation: none; opacity: 1; }
    .reveal { transition: none; opacity: 1; transform: none; }
}

/* ---------------------------------------------------------- responsive */

@media (max-width: 960px) {
    .cell-3, .cell-4, .cell-5, .cell-6, .cell-7, .cell-8 { grid-column: span 12; }
    .display { font-size: 36px; }
    .stat-value { font-size: 38px; }
    .shell { padding: 0 24px 88px; }
    .nav-inner { padding: 0 24px; gap: 20px; }
}

@media (max-width: 640px) {
    .nav-links a span { display: none; }
    .nav-links a { padding: 8px 10px; }
    .page-head { padding: 44px 0 28px; }
    .login-card { padding: 30px; }
    .search { min-width: 0; width: 100%; }
    .toast { left: 16px; right: 16px; }
}