/* ==========================================================================
   AssetSwap.dev — design tokens
   Palette:
     --blue-600  #006ad4  brand (mandated)
     --blue-700  #0052a8  deep / hover
     --blue-50   #eaf4ff  tint background
     --ink-900   #0b1220  primary text
     --ink-500   #5b6779  secondary text
     --paper-0   #ffffff  page background
     --amber-500 #ffb020  "seeking" accent / stitching
   Type:
     Display — "Space Grotesk"   (headlines, ticket titles)
     Body    — "Inter"           (paragraphs, UI)
     Mono    — "JetBrains Mono"  (tags, stats, listing meta — reads like dev tooling)
   ========================================================================== */

:root {
  --blue-600: #006ad4;
  --blue-700: #0052a8;
  --blue-800: #003c7a;
  --blue-50: #eaf4ff;
  --blue-100: #d3e8ff;
  --ink-900: #0b1220;
  --ink-600: #3b4657;
  --ink-500: #5b6779;
  --paper-0: #ffffff;
  --paper-100: #f6f9fd;
  --amber-500: #ffb020;
  --amber-600: #e2960a;
  --green-600: #1a9c5c;
  --radius-card: 18px;
  --shadow-card: 0 1px 2px rgba(11, 18, 32, 0.04), 0 12px 28px -12px rgba(11, 18, 32, 0.14);
  --max-width: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper-0);
  color: var(--ink-900);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  color: var(--ink-900);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }

p { margin: 0 0 1em; color: var(--ink-600); }
a { color: var(--blue-600); text-decoration: none; }

.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: 0.01em;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, color 0.12s ease;
  font-family: 'Inter', sans-serif;
}
.btn-primary { background: var(--blue-600); color: #fff; }
.btn-primary:hover { background: var(--blue-700); transform: translateY(-1px); box-shadow: 0 10px 20px -8px rgba(0, 106, 212, 0.45); }
.btn-secondary { background: transparent; color: var(--blue-600); border-color: var(--blue-100); }
.btn-secondary:hover { background: var(--blue-50); border-color: var(--blue-600); }
.btn-small { padding: 8px 14px; font-size: 0.82rem; border-radius: 8px; }
.btn-danger { background: #fff0ee; color: #b3261e; border-color: #f6c9c4; }
.btn-danger:hover { background: #ffe1dd; }
.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--amber-500);
  outline-offset: 2px;
}

/* ---------- notice bar ---------- */
.notice-bar { background: var(--blue-900, var(--ink-900)); }
.notice {
  background: var(--blue-600);
  color: #fff;
  font-size: 0.88rem;
  text-align: center;
  padding: 10px 16px;
}
.notice + .notice { border-top: 1px solid rgba(255,255,255,0.18); }

/* ---------- site header ---------- */
.site-header {
  border-bottom: 1px solid var(--blue-50);
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  z-index: 20;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--ink-900); }
.brand img { height: 30px; width: 30px; }
.main-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.main-nav a { color: var(--ink-600); font-weight: 500; font-size: 0.95rem; }
.main-nav a:hover, .main-nav a.active { color: var(--blue-600); }
.lang-switch { display: inline-flex; align-items: center; gap: 2px; background: var(--paper-100); border-radius: 999px; padding: 3px; }
.lang-switch a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-500);
  padding: 5px 10px;
  border-radius: 999px;
}
.lang-switch a.active { background: var(--blue-600); color: #fff; }
.lang-switch a:hover:not(.active) { color: var(--blue-600); }
.nav-user { font-size: 0.88rem; color: var(--ink-600); }

/* ---------- hero ---------- */
.hero {
  padding: 72px 0 56px;
  background: radial-gradient(1100px 480px at 82% -10%, var(--blue-50) 0%, rgba(255,255,255,0) 65%);
}
.hero .wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue-700);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: 999px;
  padding: 6px 12px;
  margin-bottom: 18px;
}
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-lede { font-size: 1.08rem; max-width: 46ch; }

.stat-row { display: flex; gap: 36px; margin-top: 42px; flex-wrap: wrap; }
.stat-row .stat-value { font-family: 'Space Grotesk', sans-serif; font-size: 1.9rem; font-weight: 700; color: var(--blue-600); }
.stat-row .stat-label { font-size: 0.82rem; color: var(--ink-500); max-width: 16ch; }

/* ---------- signature: the trade ticket ---------- */
.ticket {
  --stub: 128px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr var(--stub);
  background: var(--paper-0);
  border: 1.5px solid var(--blue-100);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
a.ticket:hover {
  transform: translateY(-4px);
  border-color: var(--blue-600);
  box-shadow: 0 1px 2px rgba(11, 18, 32, 0.04), 0 20px 34px -14px rgba(0, 106, 212, 0.28);
}
a.ticket:hover .trade-arrow { transform: rotate(180deg); }
.ticket-main { padding: 22px 22px 20px; }
.ticket-stub {
  background: var(--blue-600);
  color: #fff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.ticket-perf {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 0;
  border-left: 2px dashed rgba(255,255,255,0.55);
}
.ticket-perf::before, .ticket-perf::after {
  content: '';
  position: absolute;
  left: -9px;
  width: 18px; height: 18px;
  background: var(--paper-0);
  border-radius: 50%;
}
.ticket-perf::before { top: -9px; }
.ticket-perf::after { bottom: -9px; }

.ticket-id { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; opacity: 0.85; }
.ticket-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  width: fit-content;
}
.ticket-status.matched { background: var(--amber-500); color: var(--ink-900); }

.trade-row { display: flex; gap: 14px; margin-top: 12px; }
.trade-col { flex: 1; min-width: 0; }
.trade-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue-700);
  margin-bottom: 4px;
  display: block;
}
.trade-label.seeking { color: var(--amber-600); }
.trade-arrow {
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-500);
  font-size: 1.1rem;
  transition: transform 0.25s ease;
}
.ticket-title { font-size: 1.05rem; margin-bottom: 8px; }
.ticket-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 0.82rem; color: var(--ink-500); margin-top: 14px;
}

/* ---------- reputation badge ---------- */
.rep-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  color: var(--ink-900);
  background: #fff8e8;
  border: 1px solid #ffe1a3;
  border-radius: 999px;
  padding: 3px 9px 3px 7px;
}
.rep-star { width: 12px; height: 12px; fill: var(--amber-600); flex-shrink: 0; }
.rep-dot { color: var(--ink-500); margin: 0 1px; }
.rep-badge.rep-new {
  background: var(--paper-100);
  border-color: var(--blue-50);
  color: var(--ink-500);
  font-family: 'Inter', sans-serif;
  font-style: italic;
}
.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--blue-50);
  color: var(--blue-700);
  border-radius: 6px;
  padding: 3px 8px;
}

@media (max-width: 720px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .ticket { grid-template-columns: 1fr; }
  .ticket-stub { flex-direction: row; justify-content: space-between; align-items: center; }
  .ticket-perf { display: none; }
}

/* ---------- generic sections ---------- */
.section { padding: 64px 0; }
.section-alt { background: var(--paper-100); }
.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head .eyebrow { margin-bottom: 14px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-listings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 860px) { .grid-2, .grid-3, .grid-listings { grid-template-columns: 1fr; } }

.card {
  background: var(--paper-0);
  border: 1px solid var(--blue-50);
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.step-list { display: flex; flex-direction: column; gap: 0; counter-reset: step; }
.step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--blue-50);
}
.step:first-child { border-top: none; }
.step-num {
  font-family: 'JetBrains Mono', monospace;
  color: var(--blue-600);
  font-weight: 700;
}

.swot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 980px) { .swot-grid { grid-template-columns: repeat(2, 1fr); } }
.swot-card h3 { font-size: 0.95rem; }
.swot-card ul { margin: 0; padding-left: 18px; color: var(--ink-600); font-size: 0.92rem; }
.swot-card li { margin-bottom: 8px; }
.swot-strengths { border-top: 4px solid var(--green-600); }
.swot-weaknesses { border-top: 4px solid #d1483d; }
.swot-opportunities { border-top: 4px solid var(--blue-600); }
.swot-threats { border-top: 4px solid var(--amber-600); }

.roadmap-rail { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; position: relative; }
@media (max-width: 980px) { .roadmap-rail { grid-template-columns: 1fr; } }
.roadmap-item .phase-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--blue-600);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pill-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pill-list li {
  list-style: none;
  background: var(--blue-50);
  color: var(--blue-700);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.86rem;
}

/* ---------- footer ---------- */
.site-footer { background: var(--ink-900); color: #cbd5e1; padding: 40px 0; margin-top: 40px; }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }
.footer-links { display: flex; gap: 20px; font-size: 0.85rem; }

/* ---------- listing filters ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.filter-bar a {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--blue-100);
  color: var(--ink-600);
  font-size: 0.86rem;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.filter-bar a:hover { border-color: var(--blue-600); color: var(--blue-600); }
.filter-bar a.active { background: var(--blue-600); color: #fff; border-color: var(--blue-600); }

/* ---------- forms (public + admin) ---------- */
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; color: var(--ink-900); }
.form-field .hint { font-size: 0.78rem; color: var(--ink-500); margin-top: 4px; }
input[type=text], input[type=password], input[type=date], input[type=color], input[type=number], textarea, select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1.5px solid var(--blue-100);
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
  color: var(--ink-900);
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus, select:focus { border-color: var(--blue-600); }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

/* ==========================================================================
   Admin panel
   ========================================================================== */
.admin-body { background: var(--paper-100); min-height: 100vh; }
.admin-shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.admin-sidebar {
  background: var(--ink-900);
  color: #cbd5e1;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
}
.admin-sidebar .brand { color: #fff; margin-bottom: 28px; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.admin-nav a {
  color: #cbd5e1;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
}
.admin-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.admin-nav a.active { background: var(--blue-600); color: #fff; }
.admin-sidebar .logout-link { color: #f2a49c; font-size: 0.85rem; margin-top: 12px; }

.admin-main { padding: 32px 40px; max-width: 980px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.admin-topbar h1 { margin: 0; font-size: 1.5rem; }
.admin-topbar .view-site { font-size: 0.86rem; }

.flash {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 22px;
}
.flash-success { background: #e6f7ee; color: #146c43; border: 1px solid #b9e6cd; }
.flash-error { background: #fdeceb; color: #b3261e; border: 1px solid #f6c9c4; }

.panel { background: #fff; border: 1px solid var(--blue-50); border-radius: 16px; padding: 24px; margin-bottom: 24px; }
.panel h2 { font-size: 1.05rem; margin-bottom: 4px; }
.panel .panel-desc { font-size: 0.86rem; color: var(--ink-500); margin-bottom: 18px; }

.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: repeat(2, 1fr); } }
.dash-card { background: #fff; border: 1px solid var(--blue-50); border-radius: 14px; padding: 18px; }
.dash-card .dash-value { font-family: 'Space Grotesk', sans-serif; font-size: 1.7rem; font-weight: 700; color: var(--blue-600); }
.dash-card .dash-label { font-size: 0.82rem; color: var(--ink-500); margin-top: 4px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th { text-align: left; color: var(--ink-500); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 12px; border-bottom: 1px solid var(--blue-50); }
.admin-table td { padding: 12px; border-bottom: 1px solid var(--blue-50); vertical-align: top; }
.admin-table tr:last-child td { border-bottom: none; }
.row-actions { display: flex; gap: 8px; }

.quick-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .quick-links { grid-template-columns: 1fr; } }
.quick-link { display: block; background: #fff; border: 1px solid var(--blue-50); border-radius: 14px; padding: 18px; }
.quick-link:hover { border-color: var(--blue-600); }
.quick-link h3 { margin-bottom: 4px; font-size: 1rem; }
.quick-link p { margin: 0; font-size: 0.85rem; }

.repeater-item { border: 1px solid var(--blue-50); border-radius: 12px; padding: 16px; margin-bottom: 14px; position: relative; background: var(--paper-100); }
.repeater-item .remove-btn { position: absolute; top: 12px; right: 12px; }

/* ---------- login page ---------- */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(900px 500px at 50% -10%, var(--blue-50), #fff 60%);
}
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 18px; box-shadow: var(--shadow-card); border: 1px solid var(--blue-50); padding: 34px; }
.login-card .brand { justify-content: center; margin-bottom: 6px; }
.login-card p.hint { text-align: center; margin-bottom: 24px; }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
