/* ============================================================
   BTC Beacon — styles
   Dark ("night watch") default · light supported via media query
   Data hues validated (dark #BE851D/#4488E8 on #0B1020,
   light #B87814/#2E66C9 on #F6F5F1)
   ============================================================ */

:root {
  color-scheme: dark;

  --bg:        #090e1d;
  --surface:   #101731;
  --surface-2: #0d1327;
  --line:      #222c4e;
  --line-soft: #1a2340;

  --ink:   #e9edf9;
  --ink-2: #a0aac8;
  --ink-3: #6b7594;

  --lamp:       #f3b94e;  /* bright beacon accent: large text, glow, marks */
  --lamp-deep:  #be851d;  /* validated data amber */
  --btc-blue:   #4488e8;  /* validated data blue */
  --live-green: #43b581;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:  ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 10px;
  --pad: clamp(1.25rem, 5vw, 2.5rem);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg:        #f6f5f1;
    --surface:   #fdfdfb;
    --surface-2: #f0efe9;
    --line:      #d9d7cc;
    --line-soft: #e5e3d9;

    --ink:   #1b2033;
    --ink-2: #4e5670;
    --ink-3: #7c829b;

    --lamp:      #9a6e12;
    --lamp-deep: #b87814;
    --btc-blue:  #2e66c9;
    --live-green:#1e8a5e;
  }
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* faint lamp-glow atmosphere, top of page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60rem 30rem at 50% -8rem,
      color-mix(in srgb, var(--lamp) 7%, transparent), transparent 70%);
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

a { color: var(--btc-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); }

:focus-visible {
  outline: 2px solid var(--lamp);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--surface);
  color: var(--ink);
  padding: .5rem 1rem;
  z-index: 10;
}
.skip-link:focus { left: .5rem; top: .5rem; }

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 68rem;
  margin: 0 auto;
  padding: 1.1rem var(--pad);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-family: var(--mono);
  font-size: .85rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink);
}

/* the lamp — signature element */
.lamp {
  position: relative;
  width: 12px;
  height: 12px;
  display: inline-block;
}
.lamp-core {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--lamp);
  box-shadow: 0 0 8px 1px color-mix(in srgb, var(--lamp) 60%, transparent);
}
.lamp::before, .lamp::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--lamp);
  opacity: 0;
  animation: lamp-ring 3.2s cubic-bezier(.2,.6,.4,1) infinite;
}
.lamp::after { animation-delay: 1.6s; }

@keyframes lamp-ring {
  0%   { transform: scale(.6); opacity: .8; }
  80%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* status pill */
.pill {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .3rem .75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}
.pill-live {
  border-color: color-mix(in srgb, var(--live-green) 55%, transparent);
  color: var(--live-green);
}
.pill-sample {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--lamp) 60%, transparent);
  color: var(--lamp);
}

/* ---------- layout ---------- */

main {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 var(--pad) 4rem;
}

/* ---------- hero ---------- */

.hero { padding: clamp(2.5rem, 8vw, 5rem) 0 3.5rem; }

.eyebrow {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--lamp);
  margin: 0 0 1.25rem;
}

h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.3rem, 6vw, 3.9rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 1.5rem;
  max-width: 22ch;
}

.lede {
  font-size: clamp(1.02rem, 2vw, 1.15rem);
  color: var(--ink-2);
  max-width: 62ch;
  margin: 0 0 2.25rem;
}

.degraded-note {
  font-size: .92rem;
  color: var(--lamp);
  border: 1px dashed color-mix(in srgb, var(--lamp) 55%, transparent);
  border-radius: var(--radius);
  padding: .7rem 1rem;
  margin: 0 0 1.25rem;
  max-width: 42rem;
}
.degraded-note strong { letter-spacing: .02em; }

/* hero panel — the two heights */
.hero-panel {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--surface) 88%, transparent),
    color-mix(in srgb, var(--surface-2) 88%, transparent));
  padding: clamp(1.4rem, 4vw, 2.2rem);
}

.heights {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
}

.height-block { display: flex; flex-direction: column; gap: .35rem; }
.height-block-tip { text-align: right; align-items: flex-end; }

.height-label {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.height-block-tip .height-label { flex-direction: row-reverse; }

.dot {
  width: 9px; height: 9px; border-radius: 50%;
  display: inline-block; flex: none;
}
.dot-beacon { background: var(--lamp-deep); }
.dot-tip    { background: var(--btc-blue); }

.height-num {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.num-beacon { color: var(--lamp); text-shadow: 0 0 24px color-mix(in srgb, var(--lamp) 25%, transparent); }
.num-tip    { color: color-mix(in srgb, var(--btc-blue) 80%, var(--ink)); }

.height-sub { font-size: .82rem; color: var(--ink-3); max-width: 24ch; }
.height-block-tip .height-sub { text-align: right; }

/* the rail between the two heights — a diagram, not a scale */
.gap-rail {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 9rem;
}
.rail-node { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.rail-node-beacon {
  background: var(--lamp-deep);
  box-shadow: 0 0 10px 1px color-mix(in srgb, var(--lamp) 45%, transparent);
}
.rail-node-tip { background: transparent; border: 2px solid var(--btc-blue); }
.rail-line { flex: 1; height: 2px; border-radius: 1px; background: var(--line); min-width: .75rem; }
.rail-gap {
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .15rem .6rem;
  white-space: nowrap;
}

.gap-sentence {
  margin: 1.1rem 0 0;
  font-size: .95rem;
  color: var(--ink-2);
}

.freshness {
  margin-top: .35rem;
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--ink-3);
}

.tip-hash-row {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.tip-hash-label {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tip-hash {
  font-size: clamp(.72rem, 1.6vw, .88rem);
  word-break: break-all;
  color: var(--ink-3);
  line-height: 1.5;
}
.tip-hash .zeros {
  color: var(--lamp);
  font-weight: 600;
  text-shadow: 0 0 14px color-mix(in srgb, var(--lamp) 30%, transparent);
}
.tip-hash-note { font-size: .8rem; color: var(--ink-3); font-style: italic; }
.tip-hash-note em { color: var(--ink-2); }

/* ---------- sections ---------- */

.section { padding: 3.25rem 0 0; }

h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 .9rem;
}

.section-lede {
  color: var(--ink-2);
  max-width: 62ch;
  margin: 0 0 1.8rem;
}

/* ---------- lineage feed ---------- */

.feed {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.1rem;
  border-left: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: .9rem;
  max-width: 46rem;
}

.feed-item {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .4rem 1rem;
  padding: .7rem .9rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.feed-item::before {
  content: "";
  position: absolute;
  left: calc(-1.1rem - 6px);
  top: 1.15rem;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ink-3);
}
.feed-item-crank::before      { background: var(--lamp-deep); }
.feed-item-checkpoint::before { background: var(--btc-blue); }
.feed-item-open::before {
  background: transparent;
  border: 2px solid var(--lamp-deep);
  width: 6px; height: 6px;
}

.kind {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .12rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  flex: none;
}
.kind-crank      { color: var(--lamp); border-color: color-mix(in srgb, var(--lamp) 45%, transparent); }
.kind-checkpoint { color: color-mix(in srgb, var(--btc-blue) 85%, var(--ink)); border-color: color-mix(in srgb, var(--btc-blue) 45%, transparent); }

.feed-height {
  font-family: var(--mono);
  font-size: .9rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.feed-block {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--ink-3);
}
.feed-tx {
  font-family: var(--mono);
  font-size: .78rem;
  margin-left: auto;
}

.feed-empty {
  list-style: none;
  color: var(--ink-3);
  font-style: italic;
  padding: .5rem 0;
}

/* ---------- accumulated work ---------- */

.section-work .work-figure {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--surface) 88%, transparent),
    color-mix(in srgb, var(--surface-2) 88%, transparent));
  padding: clamp(1.6rem, 5vw, 2.6rem);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  align-items: flex-start;
  max-width: 46rem;
}

.work-big {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  font-weight: 600;
  line-height: 1;
  color: var(--lamp);
  text-shadow: 0 0 32px color-mix(in srgb, var(--lamp) 22%, transparent);
}
.work-big sup { font-size: .55em; }

.work-sub { color: var(--ink-2); font-size: 1rem; }
.work-digits {
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--ink-3);
}

/* ---------- anyone can advance it ---------- */

.facts {
  list-style: none;
  margin: 0 0 1.8rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 52rem;
}
.fact {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.fact-head {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--ink);
}
.fact-body { font-size: .88rem; color: var(--ink-2); }

.crank-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  max-width: 34rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.crank-copy { display: flex; flex-direction: column; gap: .15rem; }
.crank-title { font-weight: 600; }
.crank-sub { font-size: .88rem; color: var(--ink-2); }

.crank-btn {
  align-self: flex-start;
  font-family: var(--sans);
  font-size: .95rem;
  font-weight: 600;
  padding: .6rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--lamp-deep);
  background: var(--lamp);
  color: #14100a;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.crank-btn:hover:not(:disabled) {
  box-shadow: 0 0 18px color-mix(in srgb, var(--lamp) 35%, transparent);
  transform: translateY(-1px);
}
.crank-btn:disabled {
  background: transparent;
  color: var(--ink-3);
  border-color: var(--line);
  cursor: not-allowed;
}

.crank-hint { font-size: .82rem; color: var(--ink-3); margin: 0; }
.crank-result {
  font-family: var(--mono);
  font-size: .85rem;
  margin: 0;
  padding: .6rem .8rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  word-break: break-all;
}
.crank-result.ok  { border-color: color-mix(in srgb, var(--live-green) 55%, transparent); color: var(--live-green); }
.crank-result.err { border-color: color-mix(in srgb, var(--lamp) 55%, transparent); color: var(--lamp); }

/* ---------- checkpoints ---------- */

.ckpt-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  max-width: 46rem;
}
.ckpt {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  padding: .9rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .4rem 1.2rem;
  font-family: var(--mono);
  font-size: .84rem;
}
.ckpt-height { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.ckpt-meta   { color: var(--ink-3); }
.ckpt-work   { color: var(--ink-2); }
.ckpt-link   { margin-left: auto; }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--line-soft);
  max-width: 68rem;
  margin: 4rem auto 0;
  padding: 2rem var(--pad) 3rem;
  text-align: center;
}
.footer-honest {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-2);
  margin: 0 0 .5rem;
}
.footer-prov {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .pill { white-space: normal; text-align: center; min-width: 0; }
  .heights { grid-template-columns: 1fr; }
  .height-block-tip { text-align: left; align-items: flex-start; }
  .height-block-tip .height-label { flex-direction: row; }
  .height-block-tip .height-sub { text-align: left; }
  .gap-rail { min-width: 0; max-width: 16rem; }
  .facts { grid-template-columns: 1fr; }
  .feed-tx { margin-left: 0; }
  .ckpt-link { margin-left: 0; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lamp::before, .lamp::after { animation: none; opacity: .35; transform: scale(1.6); }
  .crank-btn, .crank-btn:hover:not(:disabled) { transition: none; transform: none; }
}
