@font-face { font-family: 'Dela Gothic One'; src: url('/fonts/DelaGothicOne-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url('/fonts/DMMono-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url('/fonts/DMMono-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --paper: #F2EFE9;
  --ink: #0A0A0A;
  --half: #7E7D7A;
  --orange: #F2641A;
  --cell: clamp(28px, 6.25vw, 90px);
  --display: 'Dela Gothic One', 'Arial Black', sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.65 var(--mono);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* halftone paper grain */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .07;
  background-image: radial-gradient(var(--ink) 0.8px, transparent 1px);
  background-size: 5px 5px;
}
main, .foot, .rail { position: relative; z-index: 1; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--orange); color: var(--paper); }

/* the loose orange tile that rides the page */
.tile {
  position: fixed; z-index: 40; top: 0; left: 0; width: 22px; height: 22px;
  background: var(--orange); box-shadow: 3px 3px 0 var(--ink);
  pointer-events: none; will-change: transform;
  transform: translate3d(calc(100vw - 52px), 80px, 0) rotate(-14deg);
}

/* coordinate rail */
.rail {
  position: fixed; top: 0; left: 0; bottom: 0; width: 64px; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 14px 0; border-right: 2px solid var(--ink); background: var(--paper);
}
.rail-mark img { width: 40px; height: 40px; border: 2px solid var(--ink); transition: transform .2s; }
.rail-mark:hover img { transform: rotate(-8deg) scale(1.06); }
.rail-coords { display: flex; flex-direction: column; gap: 0; border: 2px solid var(--ink); }
.rail-coords a {
  display: grid; place-items: center; width: 40px; height: 40px; text-decoration: none;
  font: 500 13px var(--mono); transition: background .15s, color .15s;
}
.rail-coords a:nth-child(odd) { background: var(--ink); color: var(--paper); }
.rail-coords a:hover, .rail-coords a.on { background: var(--orange); color: var(--ink); }
.rail-ticker { writing-mode: vertical-rl; transform: rotate(180deg); font: 400 15px var(--display); letter-spacing: .08em; }

main { margin-left: 64px; }
.sq { position: relative; padding: clamp(56px, 9vw, 130px) clamp(20px, 6vw, 96px); }
.coord { align-self: flex-start; justify-self: start; width: fit-content;
  display: inline-block; margin: 0 0 18px; padding: 2px 8px; font: 500 13px var(--mono);
  background: var(--ink); color: var(--paper); letter-spacing: .06em;
}
h1, h2 { font-family: var(--display); font-weight: 400; margin: 0; line-height: .92; letter-spacing: -.01em; }
h2 { font-size: clamp(40px, 6.4vw, 96px); }

/* a1: hero — art on the right, the type hung on the left, split like two halves of a board */
.sq-hero {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0; min-height: 100svh;
  border-bottom: 2px solid var(--ink);
}
.hero-art { position: relative; overflow: hidden; border-bottom: 2px solid var(--ink); min-height: 52svh; }
.hero-art img { object-position: 50% 0; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: drift 26s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1.04) translate3d(-1%, 0, 0); } to { transform: scale(1.1) translate3d(1.5%, -1%, 0); } }
.hero-type { padding: 36px 20px 44px; display: flex; flex-direction: column; justify-content: flex-end; }
h1 { font-size: clamp(64px, 8.4vw, 132px); display: flex; flex-direction: column; text-transform: uppercase; }
@media (max-width: 899px) { h1 { font-size: clamp(64px, 21vw, 132px); } }
h1 span:first-child { font-size: .42em; line-height: 1; margin-bottom: .08em; }
.hero-line { margin: 26px 0 0; font-size: clamp(16px, 1.5vw, 19px); max-width: 30ch; }
.hero-ticker { margin: 22px 0 0; display: flex; align-items: center; gap: 12px; font: 400 22px var(--display); }
.chip { width: 22px; height: 22px; background: var(--orange); box-shadow: 3px 3px 0 var(--ink); transform: rotate(-14deg); }
@media (min-width: 900px) {
  .sq-hero { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .hero-type { order: -1; padding: 60px clamp(28px, 4vw, 64px); border-right: 2px solid var(--ink); }
  .hero-art { border-bottom: 0; min-height: 100svh; }
}

/* checker band, slowly running */
.band { height: 40px; overflow: hidden; border-bottom: 2px solid var(--ink); }
.band-run {
  height: 100%; width: calc(100% + 80px);
  background: repeating-conic-gradient(var(--ink) 0 25%, var(--paper) 0 50%) 0 0 / 40px 40px;
  animation: run 6s linear infinite;
}
@keyframes run { to { transform: translate3d(-80px, 0, 0); } }

/* b2: the story — a wide square with its text set in columns */
.sq-story { border-bottom: 2px solid var(--ink); }
.sq-story h2 { max-width: 12ch; }
.story-cols { margin-top: 44px; display: grid; gap: 22px; max-width: 1100px; }
.story-cols p { margin: 0; font-size: 17px; }
.story-kicker { font: 400 clamp(26px, 3vw, 38px)/1.1 var(--display) !important; align-self: end; }
.story-kicker::before { content: ''; display: inline-block; width: .7em; height: .7em; background: var(--orange); margin-right: .35em; box-shadow: 3px 3px 0 var(--ink); transform: rotate(-14deg); }
@media (min-width: 900px) { .story-cols { grid-template-columns: repeat(3, 1fr); gap: 40px; } }

/* c3: the board — black square, paper text */
.sq-board { background: var(--ink); color: var(--paper); border-bottom: 2px solid var(--ink); }
.sq-board .coord { background: var(--paper); color: var(--ink); }
.board-head { max-width: 640px; }
.board-head p:last-child { margin: 22px 0 0; font-size: 17px; }
.board-frame { position: relative; margin-top: 44px; border: 2px solid var(--paper); box-shadow: 10px 10px 0 var(--orange); }
#board { display: block; width: 100%; height: clamp(320px, 56vw, 640px); cursor: crosshair; touch-action: pan-y; background: var(--paper); }
.board-pos { position: absolute; right: 0; bottom: 0; margin: 0; padding: 6px 12px; background: var(--ink); color: var(--paper); font-size: 13px; }
.board-pos b { color: var(--orange); font-weight: 500; }

/* d4: the contract-address slot */
.sq-ca { display: grid; gap: 40px; align-items: end; }
@media (min-width: 900px) { .sq-ca { grid-template-columns: auto 1fr; gap: 80px; } .sq-ca .coord { grid-column: 1 / -1; margin-bottom: -20px; justify-self: start; } }
.ca { display: flex; align-items: stretch; border: 2px solid var(--ink); background: var(--paper); max-width: 760px; min-height: 58px; }
.ca-label { display: grid; place-items: center; padding: 0 18px; background: var(--ink); color: var(--paper); font: 400 18px var(--display); }
.ca-value { flex: 1; min-width: 0; display: flex; align-items: center; padding: 0 16px; font: 500 15px var(--mono); overflow-wrap: anywhere; }
.ca-tools { display: flex; }
.ca-tools[hidden] { display: none; }
.ca-copy, .ca-exp {
  display: flex; align-items: center; gap: 8px; padding: 0 16px; border: 0; border-left: 2px solid var(--ink);
  background: var(--paper); color: var(--ink); font: 500 13px var(--mono); cursor: pointer; text-decoration: none;
  transition: background .15s;
}
.ca-copy:hover, .ca-exp:hover, .ca-copy.done { background: var(--orange); }
.ca-copy:active, .ca-exp:active { transform: translate(1px, 1px); }
.ca svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

/* footer */
.foot {
  margin-left: 64px; border-top: 2px solid var(--ink); padding: 40px clamp(20px, 6vw, 96px) 56px;
  display: grid; gap: 28px; align-items: center;
  background:
    linear-gradient(var(--paper), var(--paper)) padding-box;
}
@media (min-width: 900px) { .foot { grid-template-columns: auto 1fr auto; gap: 48px; } }
.foot-id { display: flex; align-items: center; gap: 16px; }
.foot-id img { width: 64px; height: 64px; border: 2px solid var(--ink); }
.foot-id b { display: block; font: 400 24px/1 var(--display); }
.foot-id span { font-size: 13px; color: var(--half); }
.ca-small { min-height: 48px; }
.ca-small .ca-label { font-size: 15px; padding: 0 14px; }
.foot-links { display: flex; }
.foot-links:empty { display: none; }
.foot-links a { display: grid; place-items: center; width: 48px; height: 48px; border: 2px solid var(--ink); margin-left: -2px; transition: background .15s, transform .15s; }
.foot-links a:nth-child(odd) { background: var(--ink); color: var(--paper); }
.foot-links a:hover { background: var(--orange); color: var(--ink); transform: translateY(-3px); }
.foot-links svg { width: 20px; height: 20px; fill: currentColor; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translate3d(0, 28px, 0); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* mobile: the rail becomes a top bar */
@media (max-width: 699px) {
  .rail { bottom: auto; right: 0; width: auto; height: 56px; flex-direction: row; padding: 0 12px; border-right: 0; border-bottom: 2px solid var(--ink); }
  .rail-mark img { width: 36px; height: 36px; }
  .rail-coords { flex-direction: row; }
  .rail-coords a { width: 34px; height: 34px; font-size: 12px; }
  .rail-ticker { writing-mode: horizontal-tb; transform: none; font-size: 14px; }
  main, .foot { margin-left: 0; }
  main { padding-top: 56px; }
  .sq-hero { min-height: auto; }
  .hero-art { min-height: 46svh; }
  .tile { display: none; }
  .ca { flex-wrap: wrap; }
  .ca-value { min-height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-art img, .band-run { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .tile { transition: none; }
}

/* manifesto strip: the kit's own words, set like a printed proclamation between b2 and c3 */
.manifesto {
  position: relative; z-index: 1; padding: clamp(48px, 7vw, 96px) clamp(20px, 6vw, 96px);
  border-bottom: 2px solid var(--ink); display: grid; gap: 36px;
}
.manifesto blockquote { margin: 0; max-width: 1050px; }
.manifesto blockquote p {
  margin: 0; font: 400 clamp(22px, 2.6vw, 36px)/1.25 var(--display); text-indent: 1.4em; position: relative;
}
.manifesto blockquote p::before {
  content: ''; position: absolute; left: -1.4em; top: .2em; width: .8em; height: .8em; text-indent: 0;
  background: var(--orange); box-shadow: 3px 3px 0 var(--ink); transform: translateX(1.4em) rotate(-14deg);
}
.vows { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; border: 2px solid var(--ink); width: fit-content; max-width: 100%; }
.vows li { padding: 10px 16px; font: 500 13px var(--mono); text-transform: uppercase; letter-spacing: .05em; border-right: 2px solid var(--ink); }
.vows li:last-child { border-right: 0; }
.vows li:nth-child(even) { background: var(--ink); color: var(--paper); }
@media (max-width: 699px) { .vows { flex-direction: column; width: 100%; } .vows li { border-right: 0; border-bottom: 2px solid var(--ink); } .vows li:last-child { border-bottom: 0; } }
