@font-face { font-family: "Bricolage"; src: url(fonts/BricolageGrotesque.ttf) format("truetype"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "VT323"; src: url(fonts/VT323-Regular.ttf) format("truetype"); font-display: swap; }

:root {
  --night: #0f1610;
  --moss: #18241a;
  --moss-2: #22331f;
  --bark: #3b2415;
  --wood: #c98a4b;
  --ring: #ecc994;
  --paper: #f2e9d4;
  --paper-2: #e6d9bb;
  --ink: #1d150d;
  --frog: #63d63a;
  --frog-dark: #3e9e1e;
  --rec: #e8342b;
  --text: #efe8d6;
  --muted: #a9a58f;
  --r: 18px;
  --mono: "VT323", ui-monospace, monospace;
  --sans: "Bricolage", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--night); color: var(--text); font-family: var(--sans); font-size: 18px; line-height: 1.55; overflow-x: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1; font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(44px, 7vw, 96px); font-stretch: 80%; margin-bottom: 18px; }
section { position: relative; padding: 120px 6vw; }
.eyebrow { font-family: var(--mono); font-size: 24px; color: var(--frog); margin: 0 0 10px; letter-spacing: .04em; }
.eyebrow.dark { color: var(--frog-dark); }
.sub { color: var(--muted); max-width: 680px; font-size: 20px; margin: 0 0 40px; }

/* film grain + scanlines over the whole page */
.grain { position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1s steps(6) infinite; }
@keyframes grain { 0% { transform: translate(0,0) } 20% { transform: translate(-3%,2%) } 40% { transform: translate(2%,-3%) } 60% { transform: translate(-2%,-1%) } 80% { transform: translate(3%,3%) } 100% { transform: translate(0,0) } }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none; font: 700 18px var(--sans);
  padding: 14px 26px; border-radius: 999px; border: 2px solid transparent; transition: transform .15s ease, box-shadow .15s ease, background .15s; }
.btn:hover { transform: translateY(-2px) rotate(-1deg); }
.btn-frog { background: var(--frog); color: #0c1a07; box-shadow: 0 4px 0 var(--frog-dark); }
.btn-frog:hover { box-shadow: 0 6px 0 var(--frog-dark); }
.btn-ghost { border-color: currentColor; color: var(--text); background: transparent; }
.btn-ghost:hover { background: var(--text); color: var(--night); }
.btn.small { padding: 9px 18px; font-size: 15px; }

/* header */
.top { position: fixed; z-index: 40; inset: 14px 14px auto; display: flex; align-items: center; gap: 24px; padding: 8px 10px 8px 12px;
  border-radius: 999px; background: rgba(15, 22, 16, .62); backdrop-filter: blur(14px); border: 1px solid rgba(239, 232, 214, .1); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.brand img { width: 38px; height: 38px; border-radius: 50%; }
.top nav { margin-left: auto; display: flex; gap: 22px; font-family: var(--mono); font-size: 22px; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--frog); }

/* hero */
.hero { min-height: 100vh; padding: 0; display: grid; align-items: end; overflow: hidden; }
.hero-vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 10%; }
.hero-shade { position: absolute; inset: 0; background:
  linear-gradient(90deg, rgba(15,22,16,.78) 0%, rgba(15,22,16,.35) 42%, rgba(15,22,16,0) 62%),
  linear-gradient(180deg, rgba(15,22,16,.25) 0%, rgba(15,22,16,0) 30%, rgba(15,22,16,.2) 70%, var(--night) 100%); }
.osd { position: absolute; z-index: 2; font-family: var(--mono); font-size: clamp(22px, 2.6vw, 40px); color: #f5f3ea; text-shadow: 2px 2px 0 #000; letter-spacing: .04em; }
.osd-tl { top: 92px; left: 4vw; display: flex; align-items: center; gap: 10px; }
.osd-tr { top: 92px; right: 4vw; }
.osd-bl { bottom: 26px; left: 4vw; }
.osd-br { bottom: 26px; right: 4vw; }
.rec-dot { width: .6em; height: .6em; border-radius: 50%; background: var(--rec); box-shadow: 0 0 12px var(--rec); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-copy { position: relative; z-index: 3; text-align: left; padding: 0 6vw 90px; max-width: calc(min(640px, 52vw) + 12vw); }
.kicker { font-family: var(--mono); font-size: 24px; color: var(--ring); margin: 0 0 4px; letter-spacing: .1em; }
.wordmark { font-size: clamp(110px, 17vw, 270px); font-stretch: 75%; line-height: .82; letter-spacing: -.05em;
  background: repeating-radial-gradient(circle at 50% 110%, #f3d7a6 0 10px, #d9a464 10px 13px, #f0cf98 13px 22px, #b57b41 22px 24px);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 0 #4a2c15) drop-shadow(0 18px 30px rgba(0,0,0,.6)); }
.tag { font-size: clamp(19px, 2.2vw, 26px); margin: 18px 0 26px; max-width: 560px; }
.tag b { color: var(--frog); font-weight: 700; }
.ca { display: inline-flex; align-items: center; gap: 12px; max-width: 92vw; padding: 7px 7px 7px 18px; border-radius: 999px;
  background: rgba(242, 233, 212, .92); color: var(--ink); margin-bottom: 20px; }
.ca-label { font-weight: 800; }
.ca code { font-family: var(--mono); font-size: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca button { border: 0; border-radius: 999px; padding: 9px 18px; background: var(--ink); color: var(--paper); font: 700 15px var(--sans); cursor: pointer; }
.links { display: flex; flex-wrap: wrap; gap: 12px; }

/* marquee */
.marquee { overflow: hidden; background: var(--wood); color: var(--ink); border-block: 3px solid var(--bark); }
.marquee-track { display: flex; align-items: center; gap: 28px; width: max-content; padding: 12px 0; animation: scroll 30s linear infinite; font-family: var(--mono); font-size: 34px; }
.marquee i { width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: repeating-radial-gradient(circle, #f2d3a0 0 2px, #9c6531 2px 3px); border: 2px solid var(--bark); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* lore */
.lore { background: radial-gradient(ellipse at 80% 20%, var(--moss-2), var(--night) 60%); }
.lore-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 6vw; align-items: center; }
.lore-text p { font-size: 21px; max-width: 620px; }
.pull { font-family: var(--mono); font-size: 40px !important; line-height: 1.05; color: var(--ring); margin-top: 30px; }
.specimen { margin: 0; justify-self: end; width: 100%; max-width: 520px; background: var(--paper); color: var(--ink); border-radius: 10px; padding: 16px; transform: rotate(1.5deg);
  box-shadow: 0 30px 60px rgba(0,0,0,.5), inset 0 0 0 1px rgba(0,0,0,.08); cursor: pointer; transition: transform .2s; }
.specimen:hover { transform: rotate(0deg) scale(1.01); }
.specimen.knock { animation: knock .25s ease; }
@keyframes knock { 30% { transform: rotate(1.5deg) translateX(-6px); } 60% { transform: rotate(1.5deg) translateX(5px); } }
.specimen-head { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 22px; border-bottom: 2px dashed rgba(29,21,13,.3); padding-bottom: 8px; margin-bottom: 12px; }
.specimen video { width: 100%; border-radius: 6px; background: #efe6d0; }
.specimen dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; margin: 14px 0 6px; }
.specimen dl div { border-bottom: 1px solid rgba(29,21,13,.15); padding-bottom: 4px; }
.specimen dt { font-family: var(--mono); font-size: 18px; color: #7a6a52; }
.specimen dd { margin: 0; font-weight: 700; }
.specimen figcaption { font-family: var(--mono); font-size: 18px; color: #7a6a52; text-align: center; }

/* machine */
.machine { background: var(--moss); }
.steps { list-style: none; padding: 0; margin: 0 0 50px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
.steps li { position: relative; background: var(--night); border: 1px solid rgba(239,232,214,.1); border-radius: var(--r); padding: 28px; }
.steps li:not(:last-child)::after { content: "→"; position: absolute; right: -18px; top: 50%; transform: translate(50%, -50%); z-index: 2;
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--frog); color: #0c1a07; font-weight: 800; }
.step-n { font-family: var(--mono); font-size: 30px; color: var(--wood); }
.steps h3 { font-size: 54px; font-stretch: 80%; margin: 6px 0 10px; text-transform: uppercase; }
.steps p { margin: 0; color: var(--muted); }
.steps b { color: var(--frog); }
.counters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.counter { background: var(--paper); color: var(--ink); border-radius: var(--r); padding: 20px 22px; display: flex; flex-direction: column; }
.c-label { font-family: var(--mono); font-size: 22px; color: #7a6a52; }
.c-val { font-size: clamp(34px, 4vw, 54px); font-weight: 800; font-stretch: 80%; letter-spacing: -.02em; line-height: 1.1; }
.c-unit { font-family: var(--mono); font-size: 20px; color: #7a6a52; }

.pile-wrap { margin-top: 60px; text-align: center; }
.pile-stage { position: relative; display: inline-flex; flex-direction: column; align-items: center; min-height: 260px; justify-content: flex-end; }
.pile-flog { width: 120px; margin-bottom: -6px; position: relative; z-index: 1; filter: drop-shadow(0 8px 10px rgba(0,0,0,.4)); }
.pile { display: flex; flex-direction: column-reverse; align-items: center; }
.pile-row { display: flex; gap: 2px; margin-top: -8px; }
.log-end { width: 46px; height: 46px; border-radius: 50%; border: 4px solid #3b2415;
  background: repeating-radial-gradient(circle at 46% 54%, #f0cf98 0 3px, #b9803f 3px 4px, #e9c08a 4px 7px, #a26b33 7px 8px);
  box-shadow: inset 0 0 6px rgba(0,0,0,.35); animation: pop .4s backwards; }
@keyframes pop { from { transform: scale(0) rotate(-90deg); } }
.pile-ground { width: min(520px, 80vw); height: 16px; border-radius: 50%; background: radial-gradient(ellipse, rgba(0,0,0,.45), transparent 70%); margin: 0 auto; }
.pile-cap { font-family: var(--mono); font-size: 26px; color: var(--ring); margin-top: 14px; }

/* ledger */
.log { background: var(--night); }
.ledger { background: var(--paper) repeating-linear-gradient(transparent 0 37px, rgba(64, 104, 160, .18) 37px 38px);
  color: var(--ink); border-radius: 8px; padding: 40px 4vw 50px; box-shadow: 0 40px 80px rgba(0,0,0,.5);
  border-left: 34px solid var(--paper-2); position: relative; }
.ledger::before { content: ""; position: absolute; left: 22px; top: 0; bottom: 0; border-left: 2px solid rgba(200, 60, 50, .45); }
.ledger-head { display: flex; justify-content: space-between; align-items: end; gap: 30px; flex-wrap: wrap; margin-bottom: 24px; }
.ledger h2 { margin: 0; }
.ledger-note { max-width: 420px; margin: 0; font-size: 19px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 24px; min-width: 760px; }
th { text-align: left; font-weight: 400; color: #7a6a52; border-bottom: 2px solid var(--ink); padding: 6px 10px; }
td { padding: 6px 10px; border-bottom: 1px dashed rgba(29,21,13,.25); }
td a { color: var(--frog-dark); }
tr.empty td { color: #7a6a52; }

/* tapes */
.tapes { background: linear-gradient(var(--night), var(--moss)); }
.tape-grid { display: grid; grid-template-columns: 1fr 1.78fr; gap: 20px; align-items: start; }
.tape { margin: 0; background: #151515; border-radius: 12px; padding: 12px; box-shadow: 0 20px 40px rgba(0,0,0,.5); }
.tape video { width: 100%; border-radius: 6px; }
.tape figcaption { font-family: var(--mono); font-size: 22px; padding: 10px 6px 2px; color: var(--muted); }
.tape-no { background: var(--paper); color: var(--ink); padding: 0 8px; margin-right: 8px; }
.hint { font-family: var(--mono); color: var(--muted); font-size: 20px; margin-top: 14px; }

/* galleries */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card { cursor: pointer; border-radius: 6px; overflow: hidden; background: #f4f1ea; padding: 10px 10px 0; color: var(--ink);
  box-shadow: 0 10px 24px rgba(0,0,0,.35); transition: transform .18s ease; }
.card:nth-child(3n+1) { transform: rotate(-1deg); }
.card:nth-child(3n+2) { transform: rotate(.8deg); }
.card:hover { transform: rotate(0) scale(1.03); z-index: 2; position: relative; }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.card .meta { font-family: var(--mono); font-size: 19px; padding: 8px 2px 10px; line-height: 1.15; }
.card .meta b { display: block; font-weight: 400; color: #8a7b63; font-size: 16px; }
.memes-grid .card { padding: 0; background: #fff; }
.memes-grid .card img { aspect-ratio: auto; }

/* maker */
.maker { background: var(--moss); }
.maker-ui { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4vw; align-items: start; }
#mk-canvas { width: 100%; height: auto; border-radius: 8px; background: #fff; box-shadow: 0 20px 40px rgba(0,0,0,.4); }
.mk-controls { display: flex; flex-direction: column; gap: 18px; }
.mk-controls label { display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: 24px; }
.mk-controls textarea, .mk-controls select { font: 18px var(--sans); padding: 12px 14px; border-radius: 12px; border: 0; background: var(--paper); color: var(--ink); }
.mk-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; max-height: 290px; overflow: auto; }
.mk-thumbs img { cursor: pointer; border-radius: 8px; border: 3px solid transparent; aspect-ratio: 1; object-fit: cover; }
.mk-thumbs img.on { border-color: var(--frog); }
.mk-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* how */
.how ol { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: s; }
.how li { counter-increment: s; background: var(--paper); color: var(--ink); border-radius: var(--r); padding: 24px; font-size: 18px; }
.how li::before { content: "0" counter(s); display: block; font-family: var(--mono); font-size: 44px; color: var(--frog-dark); line-height: 1; margin-bottom: 8px; }
.how b { display: block; font-size: 22px; }

footer { text-align: center; padding: 80px 6vw 100px; color: var(--muted); background: var(--moss); }
footer img { width: 90px; border-radius: 50%; margin: 0 auto 10px; }
.foot-big { font-size: clamp(80px, 16vw, 220px); font-weight: 800; font-stretch: 75%; color: var(--text); line-height: .9; margin: 0 0 20px; letter-spacing: -.05em; }
footer p { max-width: 700px; margin: 8px auto; }
.muted { font-family: var(--mono); font-size: 20px; }

.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(8, 12, 8, .9); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 76vh; max-width: 92vw; border-radius: 8px; }
.lightbox p { font-family: var(--mono); font-size: 24px; margin: 0; text-align: center; }

@media (max-width: 960px) {
  .hero-vid { object-position: 72% center; }
  .hero-copy { text-align: center; max-width: none; padding: 0 20px 90px; }
  .tag { margin: 18px auto 26px; }
  .links { justify-content: center; }
  .top nav { display: none; }
  .lore-grid, .maker-ui, .tape-grid { grid-template-columns: 1fr; }
  .steps, .counters, .how ol { grid-template-columns: 1fr 1fr; }
  .steps li:not(:last-child)::after { display: none; }
}
@media (max-width: 560px) {
  section { padding: 90px 5vw; }
  .steps, .counters, .how ol { grid-template-columns: 1fr; }
  .osd-tl, .osd-tr { top: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  .grain, .marquee-track, .rec-dot { animation: none; }
}
