/* UST Vertex — modern dark theme.
   Strictly brand palette + Fort/Arial (skills/STYLE_GUIDE.md). No gradients. */

:root {
  /* Brand palette (exact hex from the style guide) */
  --teal: #0097AC;          /* light teal — interactive accent on dark */
  --teal-dark: #006E74;     /* dark teal — lead brand color */
  --petrol: #003C51;
  --soft-black: #231F20;
  --sand: #ECECE1;
  --purple: #881E87;
  --green: #01B27C;
  --orange: #FC6A59;

  /* Dark-mode neutrals (built from the brand's dark anchors) */
  --bg: #0E1417;            /* page background — near soft-black / petrol */
  --bg-2: #111A1E;
  --surface: #16211F;       /* cards / panels (teal-tinted charcoal) */
  --surface-2: #1E2C2B;     /* raised / hover */
  --border: #26383A;        /* hairlines */
  --ink: #F1F6F5;           /* primary copy */
  --ink-muted: #93A3A3;     /* secondary copy */

  --focus: 0 0 0 3px rgba(0,151,172,0.35);
  --radius: 6px;            /* squared/geometric */
  --radius-lg: 10px;
  --maxw: 1000px;
  --shadow: 0 1px 0 rgba(255,255,255,0.02), 0 8px 24px rgba(0,0,0,0.35);
  --font: "Fort", Arial, "Helvetica Neue", system-ui, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(0,151,172,0.35); }

/* ------------------------------------------------------------------ topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(14,20,23,0.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-logo { height: 26px; width: auto; display: block; }
.brand-name { font-size: 20px; letter-spacing: 0.3px; font-weight: 700; color: var(--teal); }
.tagline { margin: 0; color: var(--ink-muted); font-size: 13.5px; margin-left: auto; }

/* ----------------------------------------------------------------- stepper */
.stepper { border-bottom: 1px solid var(--border); background: var(--bg-2); }
.stepper-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  gap: 8px;
  list-style: none;
}
.step {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink-muted);
  font-size: 13.5px;
  flex: 1;
  position: relative;
}
.step:not(:last-child)::after {
  content: ""; flex: 1; height: 1px; background: var(--border); margin-left: 8px;
}
.step-dot {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 12px; font-weight: 700;
  background: var(--surface);
  transition: all 0.2s;
}
.step.active .step-dot { background: var(--teal-dark); border-color: var(--teal); color: #fff; }
.step.active { color: var(--ink); }
.step.done .step-dot { background: var(--teal); border-color: var(--teal); color: #04211f; }
.step.done .step-label { color: var(--ink); }

/* ------------------------------------------------------------------ layout */
.container { max-width: var(--maxw); margin: 0 auto; padding: 56px 32px 112px; }
.state { display: none; }
.state.active { display: block; animation: rise 0.32s cubic-bezier(0.16,1,0.3,1); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.eyebrow {
  text-transform: uppercase; letter-spacing: 2px;
  font-size: 12px; font-weight: 800; color: var(--teal);
  margin: 0 0 10px;
}
.h1 { font-size: 44px; font-weight: 300; margin: 0 0 10px; line-height: 1.08; letter-spacing: -0.5px; }
.lead { color: var(--ink-muted); margin: 0 0 36px; font-size: 18px; max-width: 60ch; }

/* --------------------------------------------------------------- dropzone */
.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 56px 24px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  cursor: pointer;
}
.dropzone:hover { border-color: var(--teal); background: var(--surface-2); }
.dropzone.dragover { border-color: var(--teal); background: var(--surface-2); transform: scale(1.005); }
.dz-primary { margin: 6px 0 2px; font-size: 16px; }
.hint { color: var(--ink-muted); font-size: 13px; margin: 4px 0 0; }
.dz-icon {
  width: 44px; height: 44px; display: inline-block; margin-bottom: 14px; position: relative;
  border: 2.5px solid var(--teal); border-radius: 8px;
}
.dz-icon::after { content: ""; position: absolute; inset: 0; margin: auto; width: 2.5px; height: 22px; background: var(--teal); }
.dz-icon::before { content: ""; position: absolute; inset: 0; margin: auto; width: 22px; height: 2.5px; background: var(--teal); }

.divider { display: flex; align-items: center; text-align: center; color: var(--ink-muted); font-size: 13px; margin: 28px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.divider span { padding: 0 16px; text-transform: uppercase; letter-spacing: 1px; font-size: 11px; }

/* ----------------------------------------------------------------- inputs */
.textarea, .input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 14px 16px;
  font-family: var(--font);
  font-size: 15px;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea::placeholder { color: var(--ink-muted); }
.textarea.mono { font-family: var(--mono); font-size: 13px; line-height: 1.7; }
.textarea.flush { border: none; border-radius: 0; background: transparent; }
.textarea:focus, .input:focus { outline: none; border-color: var(--teal); box-shadow: var(--focus); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }

.options { display: flex; gap: 24px; margin: 28px 0 8px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field span { font-size: 13px; color: var(--ink-muted); font-weight: 600; }
.field .input { min-width: 240px; }
.field input[type="number"] { min-width: 140px; }

/* ---------------------------------------------------------------- buttons */
.actions { display: flex; gap: 12px; margin-top: 32px; align-items: center; flex-wrap: wrap; }
.btn {
  font-family: var(--font); font-size: 15px; font-weight: 600;
  padding: 13px 24px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal-dark); color: #fff; }
.btn-primary:hover { background: var(--teal); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-arrow { transition: transform 0.15s; }
.btn-primary:hover .btn-arrow { transform: translateX(3px); }
.link-btn { background: none; border: none; color: var(--teal); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }

/* ----------------------------------------------------------------- review */
.review-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.toggle-btn { background: transparent; color: var(--ink-muted); border: none; padding: 7px 18px; cursor: pointer; font: inherit; font-weight: 600; }
.toggle-btn.active { background: var(--teal-dark); color: #fff; }
.char-count { color: var(--ink-muted); font-size: 13px; }
.preview { padding: 22px 24px; min-height: 360px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }

/* --------------------------------------------------------------- progress */
.progress-track { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 16px 0 28px; }
.progress-bar { height: 100%; width: 0; background: var(--teal); transition: width 0.4s ease; }
.progress-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.progress-list li {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface);
  animation: rise 0.3s ease;
}
.p-thumb { width: 64px; height: 36px; border-radius: 4px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); flex: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-muted); flex: none; }
.dot.working { background: var(--teal); animation: pulse 1s infinite; }
.dot.ok { background: var(--green); }
.dot.fail { background: var(--orange); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.p-title { flex: 1; font-weight: 500; }
.p-note { color: var(--ink-muted); font-size: 13px; }

/* ---------------------------------------------------------------- gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; margin: 8px 0 36px; }
.card { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s; }
.card:hover { transform: translateY(-3px); border-color: var(--teal); box-shadow: var(--shadow); }
.card.clickable { cursor: pointer; }
.card .thumb { aspect-ratio: 16 / 9; width: 100%; background: var(--surface-2); object-fit: cover; display: block; }
.card .thumb.failed { display: flex; align-items: center; justify-content: center; color: var(--orange); font-size: 13px; text-align: center; padding: 12px; }
.card .meta { padding: 13px 16px; }
.card .meta .idx { color: var(--teal); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.card .meta .t { margin: 5px 0 0; font-size: 15px; }

/* --------------------------------------------------------------- lightbox */
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(8,12,13,0.92); display: grid; place-items: center; padding: 40px; animation: fadein 0.2s ease; }
.lightbox[hidden] { display: none; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.lightbox-img { max-width: 90vw; max-height: 80vh; border-radius: var(--radius); border: 1px solid var(--border); }
.lightbox-caption { color: var(--ink); margin-top: 14px; text-align: center; font-size: 15px; }
.lightbox-close { position: absolute; top: 20px; right: 26px; background: none; border: none; color: var(--ink); font-size: 40px; line-height: 1; cursor: pointer; }
.lightbox-close:hover { color: var(--teal); }

/* ------------------------------------------------------------------- misc */
.alert { color: #ffd9d3; background: rgba(252,106,89,0.10); border: 1px solid rgba(252,106,89,0.4); border-radius: var(--radius); padding: 12px 16px; margin-top: 18px; }

@media (max-width: 720px) {
  .container { padding: 40px 20px 80px; }
  .h1 { font-size: 34px; }
  .topbar-inner, .stepper-inner { padding-left: 20px; padding-right: 20px; }
  .tagline { display: none; }
  .step-label { display: none; }
}
