/* ==========================================================================
   TOKEN LLC — design tokens
   Palette: petrol ground, brass (the token), verdigris (brass oxidised = a
   verified link), rust reserved solely for a broken chain.
   ========================================================================== */

@font-face {
  font-family: 'Archivo Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/archivo-var.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Public Sans Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('../fonts/public-sans-var.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('../fonts/plex-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url('../fonts/plex-mono-500.woff2') format('woff2');
}

:root {
  --ink:        #0D1418;
  --ink-2:      #121C21;
  --ink-3:      #17242A;
  --rule:       #22333A;
  --rule-soft:  #1A282E;

  --brass:      #D6A93F;
  --brass-mute: #8C6F2A;
  --verdigris:  #56C3A6;
  --rust:       #CE6B4D;

  --text:       #E4EDF0;
  --muted:      #93A8B1;
  --faint:      #62777F;

  --display: 'Archivo Variable', 'Archivo', system-ui, sans-serif;
  --body:    'Public Sans Variable', 'Public Sans', system-ui, sans-serif;
  --data:    'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --wrap: 1140px;
  --gut: clamp(1.15rem, 4vw, 3rem);
  --radius: 3px;
}

/* --------------------------------------------------------------- reset -- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 380;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: var(--verdigris); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--text); }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brass);
  color: var(--ink);
  padding: 0.6rem 1rem;
  font-family: var(--data);
  font-size: 0.8rem;
  z-index: 100;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

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

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.band { padding-block: clamp(4rem, 9vw, 7.5rem); }
.band--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.band + .band { border-top: 1px solid var(--rule-soft); }

/* --------------------------------------------------------- typography -- */

.eyebrow {
  font-family: var(--data);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 760;
  letter-spacing: -0.028em;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}

h2 { font-size: clamp(1.75rem, 3.6vw, 2.7rem); }
h3 { font-size: 1.1rem; letter-spacing: -0.01em; line-height: 1.3; }

.lede {
  font-size: clamp(1.05rem, 1.9vw, 1.24rem);
  color: var(--muted);
  max-width: 62ch;
  margin: 1.5rem 0 0;
  line-height: 1.6;
}

p { max-width: 68ch; }

/* ----------------------------------------------------------- nav bar --- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(13, 20, 24, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}

.topbar__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 62px;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
}
.mark:hover { color: var(--text); }
.mark__glyph {
  width: 22px; height: 22px;
  flex: none;
  color: var(--brass);
}
.mark__sub {
  font-family: var(--data);
  font-weight: 400;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--faint);
  text-transform: uppercase;
}

.nav { display: flex; gap: clamp(0.85rem, 2.4vw, 1.9rem); align-items: center; }
.nav a {
  font-family: var(--data);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding-block: 0.4rem;
  border-bottom: 1px solid transparent;
}
.nav a:hover, .nav a[aria-current='page'] {
  color: var(--brass);
  border-bottom-color: var(--brass);
}
.nav__hide { display: none; }
@media (min-width: 600px) { .nav__hide { display: inline; } }

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

.hero {
  padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(3rem, 7vw, 5.5rem);
  position: relative;
  overflow: hidden;
}

.hero__grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: start;
}
@media (min-width: 940px) {
  .hero__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
}

.hero__name {
  font-size: clamp(2.35rem, 6.4vw, 4.3rem);
  font-weight: 820;
  letter-spacing: -0.038em;
  line-height: 0.97;
}
.hero__name span { display: block; }
.hero__name .n2 { color: var(--brass); }

.hero__role {
  font-family: var(--data);
  font-size: 0.78rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 1.5rem;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--data);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.78rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.btn:hover { border-color: var(--brass); color: var(--brass); }
.btn--solid {
  background: var(--brass);
  border-color: var(--brass);
  color: #0D1418;
  font-weight: 600;
}
.btn--solid:hover { background: #E7BC55; border-color: #E7BC55; color: #0D1418; }

/* ------------------------------------------------- record (the token) -- */

.record {
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

.record__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.95rem;
  background: var(--ink-3);
  border-bottom: 1px solid var(--rule);
  font-family: var(--data);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}
.record__seq { color: var(--brass); font-weight: 500; }
.record__ts { color: var(--faint); }
.record__flag {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.66rem;
}
.record__flag[data-state='current'] { color: var(--verdigris); }
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.record__flag[data-state='current'] .dot { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.record__body { padding: 1.15rem 0.95rem 0.5rem; }

.field {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 0.5rem 0.9rem;
  padding-block: 0.5rem;
  border-bottom: 1px dashed var(--rule-soft);
  align-items: baseline;
}
.field:last-of-type { border-bottom: 0; }
.field__k {
  font-family: var(--data);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
}
.field__v { font-size: 0.95rem; color: var(--text); margin: 0; max-width: none; }
.field__v.sub { color: var(--muted); font-size: 0.9rem; }

.record__foot {
  border-top: 1px solid var(--rule);
  padding: 0.7rem 0.95rem;
  display: grid;
  gap: 0.35rem;
  background: rgba(0,0,0,0.18);
}

.hashline {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  font-family: var(--data);
  font-size: 0.7rem;
}
.hashline__k { color: var(--faint); letter-spacing: 0.1em; text-transform: uppercase; }

.hash {
  color: var(--brass);
  overflow-wrap: anywhere;
  padding: 0.12rem 0.3rem;
  margin-inline: -0.3rem;
  border-radius: 2px;
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: help;
  transition: background 0.15s, border-color 0.15s;
}
.hash--prev { color: var(--muted); }
.hash.is-linked {
  background: rgba(214, 169, 63, 0.12);
  border-color: var(--brass-mute);
  color: var(--brass);
}
.hash.is-pending { color: var(--faint); }
.hash.is-bad { color: var(--rust); border-color: var(--rust); background: rgba(206,107,77,0.1); }

/* ---------------------------------------------------------- the chain -- */

.chain { display: grid; gap: 0; }

.link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: clamp(0.75rem, 2vw, 1.5rem);
}
@media (min-width: 780px) {
  .link { grid-template-columns: 54px minmax(0, 1fr); }
}

.link__rail {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.link__node {
  width: 11px; height: 11px;
  margin-top: 1.05rem;
  flex: none;
  background: var(--ink);
  border: 1px solid var(--brass-mute);
  transform: rotate(45deg);
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  z-index: 1;
}
.link.is-verified .link__node {
  background: var(--verdigris);
  border-color: var(--verdigris);
  box-shadow: 0 0 0 4px rgba(86, 195, 166, 0.12);
}
.link.is-broken .link__node { background: var(--rust); border-color: var(--rust); }
.link__wire {
  flex: 1;
  width: 1px;
  background: var(--rule);
  position: relative;
}
.link__wire::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  background: var(--verdigris);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.5s ease;
}
.link.is-verified .link__wire::after { transform: scaleY(1); }
.link:last-child .link__wire { display: none; }

.link__card { padding-bottom: 2.25rem; min-width: 0; }

/* reveal on scroll */
.rise { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.rise.is-in { opacity: 1; transform: none; }

/* If scripting is off or blocked, nothing reveals itself, so never hide it.
   The chain digests degrade to their build-time values, which still render. */
@media (scripting: none) {
  .rise { opacity: 1; transform: none; }
}

/* ----------------------------------------------------- verify control -- */

.verify {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.25rem;
  margin-bottom: 2.5rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--rule);
  border-left: 2px solid var(--brass);
  border-radius: var(--radius);
  background: var(--ink-2);
}
.verify__note {
  font-family: var(--data);
  font-size: 0.73rem;
  color: var(--muted);
  margin: 0;
  max-width: 58ch;
  line-height: 1.55;
}
.verify__status {
  font-family: var(--data);
  font-size: 0.73rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-left: auto;
}
.verify__status[data-state='ok'] { color: var(--verdigris); }
.verify__status[data-state='bad'] { color: var(--rust); }

/* --------------------------------------------------------- claims ------ */

.claims__sub {
  font-family: var(--data);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 2.75rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: none;
}
.claims__sub::after { content: ''; flex: 1; height: 1px; background: var(--rule-soft); }

.claims {
  display: grid;
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1.1rem;
}
@media (min-width: 640px) { .claims { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .claims { grid-template-columns: repeat(3, 1fr); } }

.claim {
  background: var(--ink);
  padding: 1.35rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}
.claim:hover { background: var(--ink-2); color: inherit; }
.claim__code {
  font-family: var(--data);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--brass);
}
.claim__name { font-family: var(--display); font-weight: 680; font-size: 1.02rem; letter-spacing: -0.015em; }

.claim__term {
  font-family: var(--data);
  font-size: 0.68rem;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.claim__term::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.claim[data-status='current'] .claim__term { color: var(--verdigris); }

.claim--lapsed { opacity: 0.66; }
.claim--lapsed .claim__code { color: var(--brass-mute); }
.claim--lapsed:hover { opacity: 1; }

.claim__meta {
  font-family: var(--data);
  font-size: 0.7rem;
  color: var(--faint);
  margin-top: auto;
  padding-top: 0.6rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.claim__verify { color: var(--verdigris); }

/* ---------------------------------------------------------- focus ------ */

.focus {
  display: grid;
  gap: 2rem;
  margin-top: 2.5rem;
}
@media (min-width: 860px) { .focus { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }

.focus__item { border-top: 2px solid var(--brass); padding-top: 1.1rem; }
.focus__item h3 { margin-bottom: 0.55rem; }
.focus__item p { color: var(--muted); font-size: 0.95rem; margin: 0; }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; padding: 0; list-style: none; }
.tags li {
  font-family: var(--data);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.2rem 0.5rem;
}

/* -------------------------------------------------------- dispatch ----- */

.posts { list-style: none; padding: 0; margin: 2.5rem 0 0; display: grid; gap: 0; }

.post {
  border-top: 1px solid var(--rule-soft);
}
.post:last-child { border-bottom: 1px solid var(--rule-soft); }

.post__a {
  display: grid;
  gap: 0.35rem 1.75rem;
  padding: 1.5rem 0;
  text-decoration: none;
  color: inherit;
  align-items: baseline;
}
@media (min-width: 780px) {
  .post__a { grid-template-columns: 130px minmax(0, 1fr) auto; }
}
.post__a:hover { color: inherit; }
.post__a:hover .post__title { color: var(--brass); }

.post__date { font-family: var(--data); font-size: 0.72rem; color: var(--faint); letter-spacing: 0.08em; }
.post__title { font-family: var(--display); font-weight: 700; font-size: 1.18rem; letter-spacing: -0.02em; line-height: 1.25; transition: color 0.18s; }
.post__sum { color: var(--muted); font-size: 0.94rem; margin: 0.4rem 0 0; grid-column: 1 / -1; max-width: 72ch; }
@media (min-width: 780px) { .post__sum { grid-column: 2 / 3; } }
.post__no { font-family: var(--data); font-size: 0.7rem; color: var(--faint); }

.subscribe {
  margin-top: 2.75rem;
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--ink-2);
  display: grid;
  gap: 1rem;
}
@media (min-width: 760px) {
  .subscribe { grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 2rem; }
}
.subscribe p { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.95rem; }

/* ------------------------------------------------------ attestation ---- */

.attest {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}
@media (min-width: 820px) { .attest { grid-template-columns: 240px minmax(0, 1fr); } }

.badge {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--ink-2);
  overflow: hidden;
  max-width: 240px;
}
.badge__img {
  aspect-ratio: 1 / 1.14;
  width: 100%;
  object-fit: cover;
  background: var(--ink-3);
  display: block;
}
.badge__fallback {
  aspect-ratio: 1 / 1.14;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(135deg, transparent 0 9px, rgba(214,169,63,0.05) 9px 10px),
    var(--ink-3);
  font-family: var(--display);
  font-weight: 800;
  font-size: 2.6rem;
  letter-spacing: -0.04em;
  color: var(--brass-mute);
}
.badge__foot {
  border-top: 1px solid var(--rule);
  padding: 0.65rem 0.8rem;
  font-family: var(--data);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.badge__foot span:last-child { color: var(--verdigris); }

.contact__list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 0; }
.contact__list li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule-soft);
  align-items: baseline;
}
.contact__k {
  font-family: var(--data);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
}
.contact__v { font-size: 0.98rem; overflow-wrap: anywhere; }

/* --------------------------------------------------------- article ----- */

.article { max-width: 720px; margin-inline: auto; }
.article__head { border-bottom: 1px solid var(--rule); padding-bottom: 1.75rem; margin-bottom: 2.25rem; }
.article__meta {
  font-family: var(--data);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}
.article__meta .no { color: var(--brass); }
.article h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); }
.article__body { font-size: 1.06rem; }
.article__body h2 { font-size: 1.4rem; margin-top: 2.75rem; margin-bottom: 0.85rem; }
.article__body h3 { font-size: 1.08rem; margin-top: 2rem; margin-bottom: 0.5rem; color: var(--brass); }
.article__body p { margin: 0 0 1.15rem; color: #D3DFE3; }
.article__body ul, .article__body ol { color: #D3DFE3; padding-left: 1.2rem; margin: 0 0 1.15rem; }
.article__body li { margin-bottom: 0.5rem; }
.article__body code {
  font-family: var(--data);
  font-size: 0.86em;
  background: var(--ink-2);
  border: 1px solid var(--rule-soft);
  border-radius: 2px;
  padding: 0.1em 0.35em;
  color: var(--brass);
}
.article__body pre {
  font-family: var(--data);
  font-size: 0.8rem;
  background: var(--ink-2);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--brass);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  line-height: 1.6;
  margin: 0 0 1.4rem;
}
.article__body pre code { background: none; border: 0; padding: 0; color: var(--muted); }
.article__body blockquote {
  margin: 0 0 1.4rem;
  padding-left: 1.15rem;
  border-left: 2px solid var(--brass-mute);
  color: var(--muted);
  font-style: normal;
}
.article__body hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

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

.foot {
  border-top: 1px solid var(--rule-soft);
  padding-block: 2.5rem 3.5rem;
  font-family: var(--data);
  font-size: 0.72rem;
  color: var(--faint);
}
.foot__in { display: flex; flex-wrap: wrap; gap: 0.75rem 1.75rem; align-items: center; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--brass); }
.foot__sep { margin-left: auto; }

/* ------------------------------------------------------- 404 / empty --- */

.empty { text-align: center; padding-block: clamp(5rem, 14vw, 9rem); }
.empty__code {
  font-family: var(--data);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--rust);
  text-transform: uppercase;
}
.empty h1 { margin: 1rem 0 0.75rem; }
.empty p { margin-inline: auto; color: var(--muted); }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .rise { opacity: 1; transform: none; }
}
