:root {
  /* Forest desk — cool stone tool surface, copper signal, deep ink */
  --bg-0: #dfe6df;
  --bg-1: #cfd8d0;
  --ink: #122018;
  --ink-soft: #24352c;
  --mute: #5c6f64;
  --line: rgba(18, 32, 24, 0.12);
  --line-strong: rgba(18, 32, 24, 0.22);
  --panel: rgba(248, 251, 247, 0.82);
  --panel-solid: #f7faf6;
  --panel-top: #eef5ef;
  --accent: #0f6b45;
  --accent-ink: #f4fff8;
  --copper: #b86a2a;
  --danger: #b84332;
  --ok: #0f6b45;
  --warn-bg: #f3e6d2;
  --display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px rgba(18, 32, 24, 0.08);
  --shadow-hover: 0 22px 48px rgba(18, 32, 24, 0.12);
  --focus: 0 0 0 3px rgba(15, 107, 69, 0.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  font-family: var(--serif);
  background: var(--bg-0);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(165deg, #e8eee7 0%, #d7e0d7 42%, #c8d2c8 100%);
}
.wash {
  position: absolute;
  border-radius: 50%;
  filter: blur(56px);
  opacity: 0.55;
  pointer-events: none;
}
.wash-a {
  width: min(52vw, 420px);
  height: min(52vw, 420px);
  left: -8%;
  top: -10%;
  background: radial-gradient(circle, rgba(15, 107, 69, 0.22), transparent 70%);
  animation: driftA 16s ease-in-out infinite;
}
.wash-b {
  width: min(44vw, 360px);
  height: min(44vw, 360px);
  right: -12%;
  top: 22%;
  background: radial-gradient(circle, rgba(184, 106, 42, 0.16), transparent 72%);
  animation: driftB 20s ease-in-out infinite;
}
.mesh {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    radial-gradient(rgba(18, 32, 24, 0.07) 0.8px, transparent 0.9px);
  background-size: 18px 18px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
}

@keyframes driftA {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(3%, 5%, 0); }
}
@keyframes driftB {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-4%, 6%, 0); }
}

.site-head, main {
  width: min(720px, calc(100% - 2.25rem));
  margin: 0 auto;
}

.site-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.1rem;
  padding: 2rem 0 0.35rem;
  animation: rise 0.65s ease both;
}

.kicker {
  margin: 0;
  font-family: var(--display);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0.2rem 0 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.5rem, 13vw, 5.8rem);
  letter-spacing: -0.065em;
  line-height: 0.84;
  color: var(--ink);
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.65rem;
  padding: 0.42rem 0.72rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(248, 251, 247, 0.7);
  backdrop-filter: blur(10px);
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}
.pulse {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: var(--mute);
  flex-shrink: 0;
}
.live.on .pulse { background: var(--accent); }
.live.stale .pulse { background: var(--copper); }
.live.off .pulse { background: var(--danger); }

.hero {
  padding: 1.85rem 0 1.5rem;
  animation: rise 0.75s ease both 0.04s;
  border-bottom: 1px solid var(--line);
}

.hero h2 {
  margin: 0;
  max-width: 12ch;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 5.8vw, 2.95rem);
  letter-spacing: -0.05em;
  line-height: 1.0;
  color: var(--ink);
}

.lede {
  margin: 1rem 0 0;
  max-width: 38ch;
  color: var(--mute);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.5;
}

.mode-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.35rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.42rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(248, 251, 247, 0.72);
  font-family: var(--display);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  color: var(--ink-soft);
}
.chip.auto {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: transparent;
}
.chip.warn {
  color: #5a3208;
  background: var(--warn-bg);
  border-color: rgba(184, 106, 42, 0.28);
}
.chip.dim { color: var(--mute); }

.api-note {
  margin: 1rem 0 0;
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(184, 106, 42, 0.35);
  background: var(--warn-bg);
  color: #6a3a0c;
  font-size: 0.92rem;
}
.api-note.ok {
  border-color: rgba(15, 107, 69, 0.3);
  background: rgba(15, 107, 69, 0.08);
  color: var(--accent);
}

.row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 2.1rem 0 0.95rem;
}
.row-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.035em;
}
.meta { color: var(--mute); font-size: 0.82rem; font-family: var(--display); font-weight: 600; }

.drafts-wrap { animation: rise 0.85s ease both 0.08s; }
.prices-wrap { animation: rise 0.78s ease both 0.05s; }
.recent-wrap { animation: rise 0.95s ease both 0.12s; }

.price-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
.price-tile {
  display: grid;
  gap: 0.32rem;
  padding: 0.95rem 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(248, 251, 247, 0.78);
  backdrop-filter: blur(10px);
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.price-tile:hover {
  border-color: rgba(15, 107, 69, 0.3);
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(18, 32, 24, 0.06);
}
.price-tile .sym-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
}
.price-tile .sym {
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}
.price-tile .name {
  color: var(--mute);
  font-size: 0.72rem;
  font-family: var(--display);
  font-weight: 600;
}
.price-tile .usd {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.price-tile .chg {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.price-tile .chg.up { color: var(--accent); }
.price-tile .chg.down { color: var(--danger); }
.price-tile .chg.flat { color: var(--mute); }
.price-tile.is-stale { opacity: 0.78; }
.price-empty {
  grid-column: 1 / -1;
  padding: 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--mute);
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
  .price-grid { grid-template-columns: 1fr; }
}

.drafts {
  display: grid;
  gap: 1rem;
}

.draft {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.05rem 1.15rem;
  padding: 1.25rem 1.3rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.draft:hover {
  border-color: rgba(15, 107, 69, 0.28);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}
.draft.is-top {
  border-color: rgba(15, 107, 69, 0.35);
  background: linear-gradient(180deg, var(--panel-top), var(--panel-solid));
}

.tag.chars.near { color: var(--copper); border-color: rgba(184, 106, 42, 0.4); }
.tag.chars.over { color: var(--danger); border-color: rgba(184, 67, 50, 0.4); }
.tag.critic { color: var(--copper); border-color: rgba(184, 106, 42, 0.4); }

.critic-note {
  margin: 0.65rem 0 0;
  color: var(--mute);
  font-size: 0.94rem;
  line-height: 1.45;
}
.critic-note strong {
  font-family: var(--display);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper);
  margin-right: 0.4rem;
}

.rate-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}
.btn.icon {
  min-width: 2.85rem;
  padding: 0.7rem 0.85rem;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}
.btn.icon.on-up {
  background: rgba(15, 107, 69, 0.12);
  border-color: rgba(15, 107, 69, 0.4);
  color: var(--accent);
}
.btn.icon.on-down {
  background: rgba(184, 67, 50, 0.1);
  border-color: rgba(184, 67, 50, 0.35);
  color: var(--danger);
}
.rate-note {
  flex: 1 1 11rem;
  min-width: 9rem;
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.72rem 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.rate-note::placeholder { color: #8a9a90; }
.rate-note:focus {
  outline: none;
  border-color: rgba(15, 107, 69, 0.45);
  box-shadow: var(--focus);
}
.rate-note:disabled {
  background: rgba(255, 255, 255, 0.5);
  color: var(--mute);
}

.score {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: linear-gradient(165deg, rgba(15, 107, 69, 0.14), rgba(15, 107, 69, 0.04));
  border: 1px solid rgba(15, 107, 69, 0.22);
}
.score strong {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
}
.score span {
  display: block;
  margin-top: 0.18rem;
  font-family: var(--display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}
.score.high {
  background: linear-gradient(165deg, rgba(15, 107, 69, 0.22), rgba(15, 107, 69, 0.06));
  border-color: rgba(15, 107, 69, 0.4);
}
.score.mid {
  border-color: rgba(184, 106, 42, 0.4);
  background: linear-gradient(165deg, rgba(184, 106, 42, 0.14), rgba(184, 106, 42, 0.04));
}
.score.low { opacity: 0.9; }

.draft-body { min-width: 0; }
.draft-thumb {
  display: block;
  margin: 0.2rem 0 0.9rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #1a2a20;
  aspect-ratio: 16 / 9;
  max-width: min(28rem, 100%);
  width: 100%;
}
.draft-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #142018;
}
.draft-thumb.is-missing {
  display: grid;
  place-items: center;
  border-style: dashed;
  background: rgba(18, 32, 24, 0.04);
}
.draft-thumb .thumb-missing {
  margin: 0;
  color: var(--mute);
  font-size: 0.85rem;
}
.draft-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  margin-bottom: 0.6rem;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--mute);
}
.tag {
  padding: 0.18rem 0.48rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
}
.tag.hot {
  color: var(--accent);
  border-color: rgba(15, 107, 69, 0.3);
  background: rgba(15, 107, 69, 0.06);
}
.tag.dim { color: var(--mute); opacity: 0.9; }

.draft-text {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.48;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
}

.draft-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.2rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.93rem;
  border-radius: 11px;
  padding: 0.82rem 1.22rem;
  letter-spacing: -0.015em;
  min-height: 2.75rem;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }
.btn.primary {
  color: var(--accent-ink);
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(15, 107, 69, 0.2);
}
.btn.primary:hover:not(:disabled) {
  background: #0c5a3a;
  box-shadow: 0 12px 26px rgba(15, 107, 69, 0.24);
}
.btn.ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line-strong);
}
.btn.ghost:hover:not(:disabled) {
  background: #fff;
  border-color: rgba(18, 32, 24, 0.32);
}

.msg {
  margin: 0;
  font-size: 0.88rem;
  width: 100%;
}
.msg.ok { color: var(--ok); }
.msg.err { color: var(--danger); }
.msg.warn { color: var(--copper); }

.empty {
  padding: 1.6rem 1.25rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--mute);
  background: rgba(248, 251, 247, 0.45);
  font-size: 1.02rem;
}

.recent {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  border-top: 1px solid var(--line);
}
.recent li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.recent .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  margin-bottom: 0.4rem;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--mute);
}
.recent p { margin: 0; color: var(--ink-soft); }
.recent a {
  color: var(--accent);
  font-family: var(--display);
  font-weight: 800;
  text-decoration: none;
}
.recent a:hover { text-decoration: underline; text-underline-offset: 3px; }

.foot {
  margin: 1.8rem 0 3rem;
  color: var(--mute);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
}

.sheet {
  width: min(480px, calc(100% - 2rem));
  border: 1px solid var(--line-strong);
  border-radius: calc(var(--radius) + 2px);
  padding: 1.25rem 1.3rem;
  background: var(--panel-solid);
  color: var(--ink);
  box-shadow: 0 28px 64px rgba(18, 32, 24, 0.22);
}
.sheet::backdrop { background: rgba(18, 32, 24, 0.48); }
.sheet h3 {
  margin: 0.25rem 0 0;
  font-family: var(--display);
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}
.sheet-body {
  margin: 0.85rem 0 0.4rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 1.15rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.draft { animation: rise 0.5s ease both; }

@media (prefers-reduced-motion: reduce) {
  .wash-a, .wash-b, .draft,
  .site-head, .hero, .drafts-wrap, .recent-wrap, .prices-wrap {
    animation: none !important;
  }
}

@media (max-width: 560px) {
  .site-head { flex-direction: column; gap: 0.65rem; }
  .live { align-self: flex-start; }
  .draft { grid-template-columns: 1fr; padding: 1rem; }
  .score {
    width: 100%;
    height: auto;
    padding: 0.65rem 0.75rem;
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    justify-content: flex-start;
  }
  .score span { margin-top: 0; }
  .btn.primary { width: 100%; text-align: center; }
  .rate-row { gap: 0.45rem; }
  .rate-note { flex: 1 1 100%; min-width: 0; }
  .hero h2 { max-width: none; }
  .draft-actions { padding-top: 0.75rem; }
}
