/* ============================================================================
   Stays Locked — design system
   ----------------------------------------------------------------------------
   Tokens extracted from the design prototypes shipped with this repo;
   see docs/design/ for where they live and what else came from them.

   The three hardness colours carry product meaning, not decoration:
     red = loose condition (easy) · brass = medium · teal = hard
   Any restyle has to keep those three distinguishable at a glance — colour is
   how a reader judges whether a certificate is worth anything.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Noto+Sans+SC:wght@400;500;700;900&display=swap");

:root {
  --lime:        #E3FF4D;
  --lime-page:   #E7F75A;
  --lime-deep:   #4B5A00;

  --ink:         #1F1F1F;
  --ink-2:       #4A4A4A;
  --ink-3:       #8A8F80;

  --paper:       #FFFFFF;
  --panel:       #F3F5EE;
  --line:        #E9ECE3;
  --line-2:      #C9CFC0;

  /* hardness triad — see the file header */
  --loose:       #E8473C;
  --loose-bg:    #FFF1EF;
  --medium:      #B08D3C;
  --medium-bg:   #FBF5E6;
  --hard:        #3E8E7E;
  --hard-bg:     #EDF6F3;

  --font:  Manrope, "Noto Sans SC", system-ui, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  --r-card: 18px;
  --r-box:  12px;
  --r-pill: 999px;

  --shadow: 0 1px 2px rgba(31, 31, 31, .05), 0 12px 32px -18px rgba(31, 31, 31, .35);
}

* { box-sizing: border-box; }

/* The UA rule for [hidden] is a bare attribute selector, so any class that sets
   `display` (.btn, .split, .card…) silently beats it and the element shows
   anyway. Everything on this page toggles via el.hidden, so this has to win. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--lime-page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--lime-deep); }

/* ---------------------------------------------------------------- shell */

.shell { min-height: 100vh; padding: 22px; }

.frame {
  max-width: 1280px;
  margin: 0 auto;
  background: var(--paper);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.pad { padding: 22px 28px; }

/* ---------------------------------------------------------------- type */

h1, h2, h3 { margin: 0; letter-spacing: -.02em; }

.h-hero { font: 800 clamp(24px, 4.2vw, 34px)/1.15 var(--font); }
.h-sec  { font: 800 20px/1.2 var(--font); }
.h-card { font: 700 15px/1.3 var(--font); }

.sub  { color: var(--ink-2); font-size: 13px; }
.tiny { font: 600 11px/1.4 var(--font); color: var(--ink-3); letter-spacing: .04em; }
.num  { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- topbar */

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 800 17px var(--font);
  text-decoration: none;
}

/* Holds the logo <img>. No tile or background: the mark is already a round
   seal, and framing it in a square undoes that. */
.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
  display: block;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--panel);
  font: 600 11.5px var(--font);
  color: var(--ink-2);
  white-space: nowrap;
}

.spacer { margin-left: auto; }

/* ---------------------------------------------------------------- buttons */

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  padding: 10px 18px;
  font: 700 13px var(--font);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform .12s ease, background .15s ease, opacity .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn-dark  { background: var(--ink); color: var(--lime); }
.btn-dark:hover:not(:disabled) { background: #000; color: var(--lime); }

.btn-lime  { background: var(--lime); color: var(--ink); }
.btn-lime:hover:not(:disabled) { background: #d8f83a; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover:not(:disabled) { background: var(--panel); }

.btn-block { display: block; width: 100%; padding: 14px; border-radius: var(--r-box); font-size: 14px; text-align: center; }

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--panel);
  border-radius: var(--r-card);
  padding: 20px 22px;
}
.card + .card { margin-top: 14px; }

.card-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.step-no {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--lime);
  font: 700 11px/20px var(--font);
  text-align: center;
}

/* ---------------------------------------------------------------- forms */

.field {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-box);
  background: var(--paper);
  font: 600 14px var(--font);
  color: var(--ink);
}
.field:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.field::placeholder { color: var(--line-2); font-weight: 500; }
.field.bad { border-color: var(--loose); background: var(--loose-bg); }

.row { display: flex; gap: 10px; align-items: center; }
.row > .field { flex: 1; min-width: 0; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 14px;
}

.mode {
  flex: 1 1 150px;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--r-box);
  border: 1px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  transition: all .15s ease;
  font-family: var(--font);
  color: inherit;
}
.mode:hover { border-color: var(--line-2); }
.mode[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.mode[aria-pressed="true"] .sub { color: #b9beb0; }
.mode-name { font: 800 15px var(--font); }
.mode-bars { display: flex; gap: 3px; margin-bottom: 4px; }
.mode-bars i { width: 5px; height: 12px; border-radius: 2px; background: var(--line-2); display: block; }
.mode-bars i.on { background: var(--ink); }
.mode[aria-pressed="true"] .mode-bars i.on { background: var(--lime); }

/* ---------------------------------------------------------------- seal */

.seal {
  --c: var(--medium);
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--c);
  color: var(--c);
  display: grid;
  place-content: center;
  text-align: center;
  font: 800 10px/1.15 var(--font);
  transform: rotate(-8deg);
}
.seal[data-h="loose"]  { --c: var(--loose); }
.seal[data-h="medium"] { --c: var(--medium); }
.seal[data-h="hard"]   { --c: var(--hard); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font: 700 11px var(--font);
}
.tag[data-h="loose"]  { background: var(--loose-bg);  color: var(--loose); }
.tag[data-h="medium"] { background: var(--medium-bg); color: var(--medium); }
.tag[data-h="hard"]   { background: var(--hard-bg);   color: var(--hard); }

/* ---------------------------------------------------------------- warning */

.warn {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-box);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  line-height: 1.65;
}
.warn b { color: var(--loose); }
.warn .bang {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--loose);
  color: #fff;
  font: 800 12px/18px var(--font);
  text-align: center;
}

/* ---------------------------------------------------------------- ladder */

.ladder {
  position: relative;
  height: 46px;
  border-radius: 10px;
  background: var(--line);
  overflow: hidden;
  margin: 14px 0 6px;
}
.ladder-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--lime);
  transition: width .35s cubic-bezier(.2,.9,.3,1);
}
.ladder-wall {
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 26px;
  background: repeating-linear-gradient(-45deg, var(--ink) 0 4px, transparent 4px 9px);
  opacity: .55;
}
.ladder-pin {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--paper);
  border: 1px solid var(--ink);
  font: 800 11px var(--font);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- checks */

.checks { display: grid; gap: 7px; }
.check {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 12.5px;
  color: var(--ink-3);
}
.check b { display: inline-block; width: 16px; text-align: center; font-size: 12px; }
.check.ok   { color: var(--ink); }
.check.ok b { color: var(--hard); }
.check.no b { color: var(--line-2); }
.check.err  { color: var(--loose); }
.check.err b { color: var(--loose); }

/* ---------------------------------------------------------------- ticker */

.ticker {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.ticker-live {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--paper);
  font: 700 12px var(--font);
}
.ticker-live i {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4ade80;
  display: block;
}

.ticker-track { display: flex; gap: 10px; flex: 1; min-width: 0; overflow: hidden; }
.ticker-item {
  display: flex; align-items: center; gap: 9px;
  height: 40px; padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--panel);
  font: 600 12.5px var(--font);
  white-space: nowrap;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
}
.ticker-item:hover { background: var(--line); color: var(--ink); }
.ticker-item .sym { font-weight: 800; }
.ticker-item .mult {
  padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--lime); font-weight: 800;
}
.ticker-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--line); flex: none;
  object-fit: cover;
}
.ticker-ini {
  display: grid; place-content: center;
  background: var(--ink); color: var(--lime);
  font: 800 11px var(--font);
}

/* ---------------------------------------------------------------- sheets */

.sheet {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(31, 31, 31, .45);
  display: grid; place-items: center;
  padding: 20px;
}
.sheet[hidden] { display: none; }
.sheet-box {
  background: var(--paper);
  border-radius: var(--r-card);
  padding: 22px;
  width: min(400px, 100%);
  max-height: 86vh;
  overflow: auto;
  box-shadow: var(--shadow);
}
.wallet-opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px; margin-top: 8px;
  border: 1px solid var(--line); border-radius: var(--r-box);
  background: var(--paper); cursor: pointer;
  font: 700 14px var(--font); text-align: left;
  color: inherit;
}
.wallet-opt:hover { background: var(--panel); }
.wallet-opt img { width: 26px; height: 26px; border-radius: 7px; flex: none; }

/* ---------------------------------------------------------------- layout */

.split { display: flex; flex-wrap: wrap; gap: 28px; padding: 8px 28px 28px; }
.col-main { flex: 1 1 560px; min-width: 0; }
.col-side { flex: 0 1 340px; min-width: 260px; }

.side-sticky { position: sticky; top: 22px; }

.hr { height: 1px; background: var(--line); border: 0; margin: 16px 0; }

.muted { color: var(--ink-3); }
.err   { color: var(--loose); }

@media (max-width: 760px) {
  .shell { padding: 10px; }
  .pad, .topbar { padding-left: 16px; padding-right: 16px; }
  .split { padding: 8px 16px 20px; gap: 18px; }
  .side-sticky { position: static; }
  .topbar { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* The track shoves sideways when a new lock lands. Paired with the per-item
   entrance animation; on its own either half reads as a glitch. */
.ticker-bump { animation: squeezeA .5s cubic-bezier(.3,.9,.3,1); }
