/* =====================================================================
   LockDrop design system
   Monochrome, text-first, Pinterest-style masonry feed.
   No build step: this file is served as-is.
   ===================================================================== */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --surface-3: #e9e9ec;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #18181b;
  --text-muted: #71717a;
  --text-subtle: #a1a1aa;
  --inverse: #18181b;
  --inverse-fg: #fafafa;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --warn: #92400e;
  --warn-bg: #fffbeb;
  --ok: #166534;
  --ok-bg: #f0fdf4;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.04);
  --shadow: 0 4px 16px rgba(24, 24, 27, 0.06);

  --font-display: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --shell-max: 1180px;
  --bottom-nav-height: 66px;
}

.dark {
  --bg: #09090b;
  --surface: #101012;
  --surface-2: #18181b;
  --surface-3: #27272a;
  --border: #27272a;
  --border-strong: #3f3f46;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-subtle: #71717a;
  --inverse: #f4f4f5;
  --inverse-fg: #18181b;
  --danger: #fca5a5;
  --danger-bg: #2a1414;
  --warn: #fcd34d;
  --warn-bg: #2a2213;
  --ok: #86efac;
  --ok-bg: #10231a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  transition: background-color 0.18s ease, color 0.18s ease;
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
}

code, pre, .mono, .font-mono {
  font-family: var(--font-mono);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.boot {
  display: grid;
  place-items: center;
  min-height: 100vh;
  color: var(--text-subtle);
  font-size: 13px;
}

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

.shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(14px);
  display: none;
}

@media (min-width: 1024px) {
  .topbar {
    display: block;
  }
}

.topbar-inner {
  margin: 0 auto;
  max-width: var(--shell-max);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--inverse);
  color: var(--inverse-fg);
}

/* A brand mark on a plain surface — the inverse foreground would be
   invisible here, so the colour is set explicitly. */
.drop-brand {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text);
  flex-shrink: 0;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topnav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.topnav a:hover {
  color: var(--text);
}

.topnav a.is-active {
  color: var(--text);
  font-weight: 500;
}

.topnav a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -13px;
  height: 1px;
  background: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main {
  flex: 1;
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 28px 20px calc(var(--bottom-nav-height) + 32px);
}

@media (min-width: 1024px) {
  .main {
    padding: 40px 24px 64px;
  }
}

.narrow {
  max-width: 620px;
  margin: 0 auto;
}

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

/*
 * A transparent bar with the buttons floating on it. The container never
 * catches a tap — only the pills do — so the content behind stays usable.
 */
.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 0 16px calc(18px + env(safe-area-inset-bottom));
  background: transparent;
  pointer-events: none;
}

@media (min-width: 1024px) {
  .bottomnav {
    display: none;
  }
}

.bottomnav a {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 116px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease,
    border-color 0.15s ease, box-shadow 0.15s ease;
}

.bottomnav a:active {
  transform: scale(0.96);
}

.bottomnav a:hover {
  color: var(--text);
}

.bottomnav a.is-active {
  background: var(--inverse);
  border-color: var(--inverse);
  color: var(--inverse-fg);
  box-shadow: var(--shadow), 0 0 0 4px color-mix(in srgb, var(--text) 7%, transparent);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 11px;
  border: 1px solid transparent;
  padding: 12px 18px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--inverse);
  color: var(--inverse-fg);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.88;
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 10px;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
}

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  gap: 8px;
}

.btn-row .grow {
  flex: 1;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ---------------------------------------------------------------- inputs */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label,
.field-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.input,
.select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  padding: 12px 14px;
  font-size: 13px;
  letter-spacing: -0.005em;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 8%, transparent);
}

.input.mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.input::placeholder {
  color: var(--text-subtle);
  opacity: 0.75;
}

.hint {
  font-size: 11px;
  color: var(--text-subtle);
  font-weight: 400;
}

/* --------------------------------------------------------------- surfaces */

.panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 22px;
}

.panel-lg {
  padding: 28px;
}

@media (min-width: 640px) {
  .panel-lg {
    padding: 34px;
  }
}

.panel-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.alert {
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  padding: 12px 14px;
  font-size: 12.5px;
}

.alert-error {
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  background: var(--danger-bg);
  color: var(--danger);
}

.alert-warn {
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
  background: var(--warn-bg);
  color: var(--warn);
}

.alert-ok {
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
  background: var(--ok-bg);
  color: var(--ok);
}

.muted {
  color: var(--text-muted);
}

.subtle {
  color: var(--text-subtle);
}

.tiny {
  font-size: 11px;
}

/* ----------------------------------------------------------------- steps */

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.stepper-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-3);
}

.stepper-dot.is-done {
  background: var(--text);
}

.stepper-label {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-right: auto;
}

/* ------------------------------------------------------------- segmented */

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-2);
}

.segmented button {
  border: none;
  background: transparent;
  border-radius: 9px;
  padding: 8px 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.segmented button.is-active {
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

/* -------------------------------------------------------- category picker */

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

.category-option {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.category-option:hover {
  background: var(--surface-2);
}

.category-option.is-active {
  border-color: var(--text);
  background: var(--surface-2);
}

.category-option .brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text);
  flex-shrink: 0;
}

.category-option.is-active .brand-mark {
  background: var(--inverse);
  color: var(--inverse-fg);
}

.category-option-text {
  min-width: 0;
  flex: 1;
}

.category-option-name {
  display: block;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-option-hint {
  display: block;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* --------------------------------------------------------------- verdict */

.verdict {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.verdict-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
}

.verdict-Trusted {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
  background: var(--ok-bg);
}

.verdict-Caution {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
  background: var(--warn-bg);
}

.verdict-Blocked {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
  background: var(--danger-bg);
}

.report {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 14px;
  font-size: 12px;
}

.finding {
  display: flex;
  gap: 9px;
  padding: 7px 0;
  border-top: 1px solid var(--border);
}

.finding:first-child {
  border-top: none;
}

.finding-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  margin-top: 6px;
  flex-shrink: 0;
  background: var(--text-subtle);
}

.sev-critical .finding-dot { background: var(--danger); }
.sev-high .finding-dot { background: var(--danger); }
.sev-medium .finding-dot { background: var(--warn); }
.sev-low .finding-dot { background: var(--text-subtle); }

/* ------------------------------------------------------------- the feed */

.feed-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.feed-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

.feed-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 0;
}

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

.chip {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  padding: 6px 12px;
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.chip:hover {
  background: var(--surface-2);
  color: var(--text);
}

.chip.is-active {
  background: var(--inverse);
  border-color: var(--inverse);
  color: var(--inverse-fg);
}

/* Pinterest-style masonry using CSS multi-column. */
.feed {
  columns: 1;
  column-gap: 16px;
}

@media (min-width: 600px) {
  .feed { columns: 2; }
}

@media (min-width: 1024px) {
  .feed { columns: 3; }
}

@media (min-width: 1360px) {
  .feed { columns: 4; }
}

.card {
  break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin: 0 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 16px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.card-brand {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  flex-shrink: 0;
}

.card-category {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-verdict {
  margin-left: auto;
  flex-shrink: 0;
}

.card-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 6px;
  color: var(--text);
}

.card-summary {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-subtle);
}

.card-price {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
}

.card-badge {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  vertical-align: 1px;
}

.card-score {
  position: relative;
  height: 2px;
  border-radius: 999px;
  background: var(--surface-3);
  margin-top: 12px;
  overflow: hidden;
}

.card-score span {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--text-subtle);
}

.card-score.is-trusted span { background: var(--ok); }
.card-score.is-caution span { background: var(--warn); }
.card-score.is-blocked span { background: var(--danger); }

/* ----------------------------------------------------------------- table */

.table-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

table.data th {
  font-weight: 400;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-subtle);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}

table.data td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.data tr:last-child td {
  border-bottom: none;
}

table.data tbody tr:hover {
  background: var(--surface-2);
}

/* ---------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(9, 9, 11, 0.55);
  backdrop-filter: blur(3px);
}

.modal {
  width: 100%;
  max-width: 620px;
  max-height: 86vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 24px;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
}

/* ------------------------------------------------------------------ misc */

.divider {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 4px 0;
}

.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  padding: 7px 0;
}

.kv + .kv {
  border-top: 1px solid var(--border);
}

.kv dt {
  color: var(--text-muted);
}

.kv dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
}

pre.code {
  margin: 0;
  overflow: auto;
  max-height: 62vh;
  border-radius: var(--radius);
  background: #0c0c0e;
  color: #e4e4e7;
  padding: 20px;
  font-size: 11.5px;
  line-height: 1.65;
}

.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-subtle);
  font-size: 13px;
}

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.spin {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.footer {
  border-top: 1px solid var(--border);
  padding: 14px 20px calc(14px + var(--bottom-nav-height));
  text-align: center;
  font-size: 10.5px;
  color: var(--text-subtle);
}

@media (min-width: 1024px) {
  .footer {
    padding-bottom: 14px;
  }
}

.footer a:hover {
  text-decoration: underline;
}

.crumb {
  font-size: 12px;
  color: var(--text-muted);
}

.crumb:hover {
  color: var(--text);
}

.urlbox {
  display: flex;
  gap: 8px;
  align-items: center;
}

.urlbox .input {
  flex: 1;
  min-width: 0;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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