/* AI Creative Producer — FIA+PROJECTS design system applied.
   Manifest as base (dense tables, bracket-text status), Signal Room's
   inline color signals and Table/Grid view toggle folded in. Mobile
   reflows tables into labeled stacked blocks — nothing hidden, nothing
   scrolls sideways. */

@font-face {
    font-family: 'Instrument Serif';
    font-style: italic;
    font-weight: 400;
    src: url('/assets/fonts/instrument-serif-italic.woff2') format('woff2');
    font-display: swap;
}
@font-face {
    font-family: 'Instrument Serif';
    font-style: normal;
    font-weight: 400;
    src: url('/assets/fonts/instrument-serif-regular.woff2') format('woff2');
    font-display: swap;
}
@font-face {
    font-family: 'Doto';
    font-style: normal;
    font-weight: 100 900;
    src: url('/assets/fonts/doto-variable.woff2') format('woff2');
    font-display: swap;
}
@font-face {
    font-family: 'Share Tech Mono';
    font-style: normal;
    font-weight: 400;
    src: url('/assets/fonts/share-tech-mono-regular.woff2') format('woff2');
    font-display: swap;
}

:root {
    --ink: #000000;
    --page: #070605;
    --bone: #F3EBE0;
    --orange: #DB5700;
    --amber: #EDB525;
    --olive: #7A9E24;
    --hair: #2A2720;
    --dim: #14130F;
    --gray4: #6E6A5E;
    --quiet: rgba(243, 235, 224, .72);
    --faint: rgba(243, 235, 224, .42);
    --ghost: rgba(243, 235, 224, .32);
    --err: #C1462E;

    --serif: 'Instrument Serif', Georgia, serif;
    --system: 'Doto', monospace;
    --body: 'Share Tech Mono', ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
    background: var(--page);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    color: var(--bone);
    font-family: var(--body);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}
::selection { background: var(--orange); color: #000; }
button { font-family: inherit; cursor: pointer; }

h1, h2 { text-wrap: balance; }

/* ---------------------------------------------------------------- */
/* Page shell                                                        */
/* ---------------------------------------------------------------- */
.shell {
    max-width: 1180px;
    margin: 0 auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 0.5px solid var(--hair);
    gap: 12px;
    flex-wrap: wrap;
}
.wordmark {
    font-family: var(--system);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    text-decoration: none;
}
.navlinks {
    display: flex;
    gap: 18px;
    font-family: var(--system);
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--faint);
    flex-wrap: wrap;
    align-items: center;
}
.navlinks a { color: inherit; text-decoration: none; }
.navlinks a:hover, .navlinks a.active { color: var(--orange); }
.navlinks form { margin: 0; }
.navlinks button.linklike {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    color: inherit;
}
.navlinks button.linklike:hover { color: var(--orange); }

.hero {
    padding: 26px 22px 22px;
    border-bottom: 0.5px solid var(--hair);
}
.hero-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.hero h1 {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(24px, 4vw, 34px);
    margin: 0;
}
.hero .stats {
    font-size: 12px;
    color: var(--faint);
}
.hero .stats b { color: var(--bone); font-weight: 400; }
.hero .stats .sep { color: var(--hair); margin: 0 7px; }
.hero .back-link {
    font-family: var(--system);
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--faint);
    text-decoration: none;
}
.hero .back-link:hover { color: var(--orange); }

main.page-body {
    padding: 20px 22px 40px;
    max-width: 1180px;
    margin: 0 auto;
}

/* ---------------------------------------------------------------- */
/* Flash messages                                                    */
/* ---------------------------------------------------------------- */
.flash {
    font-size: 12.5px;
    padding: 10px 14px;
    border: 0.5px solid var(--hair);
    margin: 0 0 16px;
}
.flash-ok { color: var(--olive); border-color: var(--olive); }
.flash-error, .error { color: var(--err); }
p.flash-error, p.error { border: 0.5px solid var(--err); padding: 10px 14px; }

/* ---------------------------------------------------------------- */
/* Cards / sections                                                  */
/* ---------------------------------------------------------------- */
.card {
    border: 0.5px solid var(--hair);
    background: var(--ink);
    padding: 18px 20px;
    margin-bottom: 20px;
}
.card h2 {
    font-family: var(--system);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin: 0 0 12px;
    color: var(--bone);
}
.card p { color: var(--quiet); font-size: 13px; }

/* ---------------------------------------------------------------- */
/* Buttons + form controls                                           */
/* ---------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--system);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 9px 16px;
    border: 0.5px solid var(--hair);
    background: transparent;
    color: var(--bone);
    text-decoration: none;
    line-height: 1;
}
.btn:hover { border-color: var(--bone); }
.btn-primary {
    background: var(--orange);
    color: #000;
    border-color: var(--orange);
}
.btn-primary:hover { background: #c24d00; border-color: #c24d00; }
.btn-danger { color: var(--err); border-color: var(--err); }
.btn-danger:hover { background: rgba(193, 70, 46, .12); }
.btn:active { transform: scale(.97); }

input[type="text"], input[type="email"], input[type="password"], input[type="date"] {
    font-family: var(--body);
    font-size: 13px;
    padding: 9px 10px;
    background: var(--dim);
    border: 0.5px solid var(--hair);
    color: var(--bone);
    border-radius: 0;
}
input[type="text"]::placeholder, input[type="email"]::placeholder { color: var(--ghost); }
label {
    display: block;
    font-family: var(--system);
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--faint);
    margin: 12px 0 6px;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 340px;
    border: 0.5px solid var(--hair);
    padding: 32px 28px;
}
.auth-card h1 {
    font-family: var(--serif);
    font-style: italic;
    font-size: 26px;
    margin: 0 0 20px;
}
.auth-card form { display: flex; flex-direction: column; }
.auth-card input { width: 100%; }
.auth-card .btn { margin-top: 20px; justify-content: center; }

/* ---------------------------------------------------------------- */
/* Filters + tag chips                                               */
/* ---------------------------------------------------------------- */
.filters {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin: 0 0 20px;
    align-items: center;
}
.filters .filters-label {
    font-family: var(--system);
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--faint);
    margin-right: 4px;
}
.filter-pill, .m-filter {
    font-family: var(--system);
    font-size: 9.5px;
    letter-spacing: .07em;
    text-transform: uppercase;
    padding: 5px 10px;
    border: 0.5px solid var(--hair);
    color: var(--faint);
    background: transparent;
    text-decoration: none;
    display: inline-block;
}
.filter-pill.active, .m-filter.active {
    background: var(--orange);
    color: #000;
    border-color: var(--orange);
}
.tag-check {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--system);
    font-size: 10px;
    letter-spacing: .05em;
    color: var(--quiet);
}

/* ---------------------------------------------------------------- */
/* Signal dots + status text                                         */
/* ---------------------------------------------------------------- */
.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex: none;
}
.dot-olive { background: var(--olive); }
.dot-amber { background: var(--amber); }
.dot-err { background: var(--err); }
.dot-gray { background: var(--gray4); }

.status-olive { color: var(--olive); }
.status-amber { color: var(--amber); }
.status-err { color: var(--err); }
.status-gray { color: var(--gray4); }

.status-inline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

/* ---------------------------------------------------------------- */
/* Section label + view toggle                                       */
/* ---------------------------------------------------------------- */
.section-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 28px 0 8px;
}
.section-label-row:first-child { margin-top: 0; }
.section-label {
    font-family: var(--system);
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--faint);
}
.view-toggle {
    display: inline-flex;
    border: 0.5px solid var(--hair);
    flex: none;
}
.view-toggle button {
    font-family: var(--system);
    font-size: 9.5px;
    letter-spacing: .07em;
    text-transform: uppercase;
    padding: 5px 12px;
    border: none;
    background: transparent;
    color: var(--faint);
}
.view-toggle button.active { background: var(--bone); color: #000; }

/* ---------------------------------------------------------------- */
/* Dense tables (Stories, Media list, rough-cut plan)                 */
/* ---------------------------------------------------------------- */
table.m-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    margin-bottom: 8px;
}
table.m-table th {
    text-align: left;
    font-family: var(--system);
    font-size: 9.5px;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 400;
    padding: 7px 10px;
    border-bottom: 0.5px solid var(--hair);
    white-space: nowrap;
}
table.m-table td {
    padding: 9px 10px;
    border-bottom: 0.5px solid var(--hair);
    color: var(--quiet);
    vertical-align: top;
}
table.m-table tbody tr { text-decoration: none; }
table.m-table tbody tr:hover td { background: var(--dim); color: var(--bone); }
table.m-table a.row-link { color: inherit; text-decoration: none; display: block; }
table.m-table a.row-link:hover { color: var(--bone); }
table.m-table td.mono-strong { color: var(--bone); }
table.m-table td.mono-strong a { color: var(--bone); text-decoration: none; }
table.m-table td.mono-strong a:hover { color: var(--orange); }
table.m-table td.num {
    font-variant-numeric: tabular-nums;
    color: var(--faint);
    width: 30px;
}

/* ---------------------------------------------------------------- */
/* Media grid (view-toggle "Grid" mode)                               */
/* ---------------------------------------------------------------- */
.m-grid {
    display: none;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    background: var(--hair);
    border: 0.5px solid var(--hair);
    margin-bottom: 8px;
}
.m-grid.active { display: grid; }
table.m-table.js-hidden { display: none; }

.m-cell {
    background: var(--dim);
    aspect-ratio: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}
.m-cell img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.m-cell .signals {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    padding: 7px;
}
.m-cell .fname {
    position: relative;
    z-index: 1;
    font-size: 9.5px;
    color: var(--bone);
    background: linear-gradient(transparent, rgba(0,0,0,.85) 60%);
    padding: 14px 7px 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------------------------------------------------------------- */
/* Meta table (asset / story detail key-value display)                */
/* ---------------------------------------------------------------- */
.meta-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}
.meta-table th {
    text-align: left;
    font-family: var(--system);
    font-size: 9.5px;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 400;
    padding: 8px 16px 8px 0;
    vertical-align: top;
    white-space: nowrap;
}
.meta-table td { padding: 8px 0; color: var(--quiet); }

/* ---------------------------------------------------------------- */
/* Asset thumbnail (detail pages)                                    */
/* ---------------------------------------------------------------- */
.detail-thumb {
    max-width: 320px;
    width: 100%;
    border: 0.5px solid var(--hair);
    display: block;
    margin-bottom: 18px;
}

/* ---------------------------------------------------------------- */
/* Upload rows                                                       */
/* ---------------------------------------------------------------- */
.upload-list { list-style: none; padding: 0; margin: 16px 0 0; }
.upload-row {
    display: grid;
    grid-template-columns: 1fr 2fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font-size: 12.5px;
    border-bottom: 0.5px solid var(--hair);
}
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-bar { height: 4px; background: var(--dim); border: 0.5px solid var(--hair); overflow: hidden; }
.upload-bar-fill { height: 100%; background: var(--orange); transition: width .2s ease; }
.upload-status { color: var(--faint); font-size: 11px; }
.upload-retry {
    padding: 4px 10px;
    border: 0.5px solid var(--err);
    background: transparent;
    color: var(--err);
    font-family: var(--system);
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: .07em;
}

/* ---------------------------------------------------------------- */
/* Search page                                                       */
/* ---------------------------------------------------------------- */
.search-form { display: flex; flex-direction: column; gap: 12px; margin: 0 0 20px; }
.search-form input[type="text"] { font-size: 14px; padding: 12px; }
.search-results { list-style: none; padding: 0; }
.search-result {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 0.5px solid var(--hair);
    text-decoration: none;
    color: inherit;
}
.search-result img { width: 72px; height: 72px; object-fit: cover; border: 0.5px solid var(--hair); flex: none; }
.search-result .r-name { color: var(--bone); text-decoration: none; }
.search-result .r-snippet { color: var(--faint); font-size: 12px; margin-top: 4px; }
.match-badge {
    font-family: var(--system);
    font-size: 9px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--faint);
    margin-left: 8px;
}

/* ---------------------------------------------------------------- */
/* Responsive: 640px and under                                       */
/* nothing hidden — tables reflow into stacked labeled blocks         */
/* ---------------------------------------------------------------- */
@media (max-width: 640px) {
    .site-header, .hero, main.page-body { padding-left: 16px; padding-right: 16px; }
    .hero-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .navlinks { gap: 12px; }
    .m-grid { grid-template-columns: repeat(2, 1fr); }
    .upload-row { grid-template-columns: 1fr; gap: 4px; }

    table.m-table, table.m-table thead, table.m-table tbody,
    table.m-table th, table.m-table td, table.m-table tr {
        display: block;
        width: 100%;
    }
    table.m-table thead {
        position: absolute;
        width: 1px; height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
    table.m-table tr {
        border: 0.5px solid var(--hair);
        margin-bottom: 10px;
        padding: 10px 12px;
    }
    table.m-table tbody tr:hover { background: var(--dim); }
    table.m-table td {
        border-bottom: none;
        padding: 5px 0;
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 12px;
        color: var(--bone);
    }
    table.m-table td::before {
        content: attr(data-label);
        font-family: var(--system);
        font-size: 9px;
        letter-spacing: .07em;
        text-transform: uppercase;
        color: var(--faint);
        flex: none;
    }
    table.m-table td.num { display: none; }
    table.m-table td.mono-strong {
        display: block;
        font-size: 13.5px;
        padding-top: 2px;
        margin-bottom: 4px;
    }
    table.m-table td.mono-strong::before { content: none; }
    table.m-table td.status-inline { justify-content: flex-start; }

    .meta-table, .meta-table tbody, .meta-table tr, .meta-table th, .meta-table td {
        display: block;
        width: 100%;
    }
    .meta-table tr { padding: 6px 0; border-bottom: 0.5px solid var(--hair); }
    .meta-table th { padding: 0 0 3px; }
    .meta-table td { padding: 0; }
}
