:root {
    --bg: #16120e;
    --panel: #221c16;
    --panel-2: #2d241c;
    --border: #3d342a;
    --text: #f2ece7;
    --muted: #a6988b;
    --accent: #ff7a1a;
    --accent-hover: #ff9442;
    --on-accent: #1c1006;  /* text on orange fills; white fails contrast */
    --danger: #f0616d;
    --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px 64px;
}

header.top {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(22, 18, 14, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
}

header.top .inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand {
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -0.01em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 9px;
}

.brand .mark {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 5px;
}

.spacer { flex: 1; }

footer.site-foot {
    border-top: 1px solid var(--border);
    background: var(--panel);
}

footer.site-foot .inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--muted);
    font-size: 13.5px;
}

button, .btn {
    font: inherit;
    font-size: 14px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
    cursor: pointer;
    transition: background .15s, border-color .15s, opacity .15s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

button:hover, .btn:hover { background: #392f24; border-color: #52463a; color: var(--text); }
button:disabled { opacity: .45; cursor: not-allowed; }

button.primary, .btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    font-weight: 550;
}
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }

button.ghost { background: transparent; }
button.danger:hover { border-color: var(--danger); color: var(--danger); }

input[type=password], input[type=text] {
    font: inherit;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #130f0b;
    color: var(--text);
    min-width: 200px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* ---------------------------------------------------------------- dropzone */

.dropzone {
    border: 1.5px dashed #4a3f33;
    border-radius: 14px;
    padding: 40px 24px;
    text-align: center;
    background: linear-gradient(180deg, rgba(255, 122, 26, .04), transparent);
    transition: border-color .15s, background .15s;
    margin-bottom: 28px;
}

.dropzone.over {
    border-color: var(--accent);
    background: rgba(255, 122, 26, .1);
}

.dropzone h2 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
}

.dropzone p {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 13.5px;
}

.dropzone.locked { opacity: .55; }

/* ---------------------------------------------------------------- uploads */

.uploads { margin-bottom: 24px; display: grid; gap: 10px; }

.upload-row {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 16px;
    align-items: center;
    font-size: 13.5px;
}

.upload-row .name { font-weight: 550; }
.upload-row .pct { color: var(--muted); font-variant-numeric: tabular-nums; }
.upload-row .bar {
    grid-column: 1 / -1;
    height: 5px;
    border-radius: 3px;
    background: #130f0b;
    overflow: hidden;
}
.upload-row .bar > i {
    display: block;
    height: 100%;
    background: var(--accent);
    width: 0;
    transition: width .2s;
}
.upload-row.error { border-color: var(--danger); }
.upload-row.error .pct { color: var(--danger); }

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

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

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    /* no overflow:hidden — it would clip the View dropdown. The thumb rounds
       its own top corners instead. */
    display: flex;
    flex-direction: column;
    transition: border-color .15s, transform .15s;
}

.card:hover { border-color: #52463a; transform: translateY(-2px); }

.card .thumb {
    aspect-ratio: 16 / 10;
    background: #120e0a center/cover no-repeat;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4f4439;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

.card .body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 9px; flex: 1; }

.card .title {
    font-weight: 600;
    font-size: 14.5px;
    word-break: break-word;
    line-height: 1.35;
}

.card .meta {
    color: var(--muted);
    font-size: 12.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    text-transform: uppercase;
    font-size: 10.5px;
    letter-spacing: .06em;
    padding: 2.5px 7px;
    border-radius: 5px;
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: #c6b8a9;
    font-weight: 600;
}

/* Marks the compact delivery copy that makes a large scene load quickly. */
.badge.good {
    text-transform: none;
    letter-spacing: 0;
    background: rgba(64, 160, 108, .14);
    border-color: rgba(64, 160, 108, .4);
    color: #7fd0a3;
}

.card .actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: auto; }
.card .actions button, .card .actions .btn { padding: 6px 11px; font-size: 13px; }

.note {
    font-size: 12px;
    color: #c99a4a;
    background: rgba(201, 154, 74, .09);
    border: 1px solid rgba(201, 154, 74, .28);
    border-radius: 7px;
    padding: 6px 9px;
    line-height: 1.4;
}

.empty {
    text-align: center;
    padding: 70px 20px;
    color: var(--muted);
}
.empty h2 { color: var(--text); font-size: 18px; margin: 0 0 8px; }

.toast {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 11px 18px;
    font-size: 14px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, .5);
    z-index: 100;
}
.toast.error { border-color: var(--danger); color: #ffb3b9; }

/* ---------------------------------------------------------------- viewer */

body.viewer { overflow: hidden; height: 100vh; }

#canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.viewer-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(180deg, rgba(11, 8, 6, .8), transparent);
    z-index: 5;
    pointer-events: none;
}
.viewer-bar > * { pointer-events: auto; }
.viewer-bar .title { font-weight: 600; text-shadow: 0 1px 6px rgba(0,0,0,.9); }
/* the measurement toggle reads as pressed while measurements are on screen */
.viewer-bar #measure.on { border-color: #ffd24a; color: #ffd24a; }

.viewer-hint {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12.5px;
    color: var(--muted);
    background: rgba(22, 18, 14, .78);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 14px;
    z-index: 5;
    text-shadow: none;
}

.loading {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: var(--bg);
    z-index: 20;
    transition: opacity .4s;
}
.loading.done { opacity: 0; pointer-events: none; }
.loading .track { width: 220px; height: 4px; background: #2d241c; border-radius: 2px; overflow: hidden; }
.loading .track > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.loading .msg { color: var(--muted); font-size: 13.5px; }
.loading .msg.fail { color: var(--danger); max-width: 460px; text-align: center; line-height: 1.5; }

/* COLMAP — the header entry point to the hosted registration tool, sitting
   between Masking and 3DGUT since it's the step in between: turning a photo
   set into the camera poses and point cloud 3DGUT needs. */
.colmap-btn svg { flex: none; opacity: .9; }

/* Masking — SAM 2 subject masks, the first step: cutting the subject out of
   the photos before registering/training them. */
.masking-btn svg { flex: none; opacity: .9; }

/* 3DGUT — the header entry point to the hosted trainer, the last step before a
   splat lands in the library. */
.threedgut-btn svg { flex: none; opacity: .9; }

.prep-hint {
    margin: 14px 2px 0;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.55;
}

/* Wordmark: "Fab" in the text colour, "Note" in the brand orange. */
.brand .brand-name b { color: var(--accent); font-weight: inherit; }
