@font-face {
  font-family: "FusionPixel";
  src: url("assets/fonts/fusion-pixel-subset.woff2?v=15") format("woff2");
  font-display: swap;
}

:root {
  --bg: #f2e8d0;
  --bg-2: #e9dcc0;
  --paper: #faf3e3;
  --ink: #2c2620;
  --ink-soft: #7a6f5f;
  --amber: #e8a33d;
  --amber-deep: #c07f22;
  --red: #d9534f;
  --green: #7ba05b;
  --green-deep: #5e7f45;
  --green-pale: #eef2df;
  --blue: #4a7ba6;
  --blue-pale: #e3ecf2;
  --panel: #26211a;
  --panel-2: #332c22;
  --bevel-up: inset -4px -4px 0 0 rgba(0, 0, 0, 0.22), inset 4px 4px 0 0 rgba(255, 255, 255, 0.28);
  --bevel-down: inset 4px 4px 0 0 rgba(0, 0, 0, 0.22), inset -4px -4px 0 0 rgba(255, 255, 255, 0.2);
  --pxborder: 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink), -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink);
  --notch: polygon(
    0 8px, 4px 8px, 4px 4px, 8px 4px, 8px 0,
    calc(100% - 8px) 0, calc(100% - 8px) 4px, calc(100% - 4px) 4px, calc(100% - 4px) 8px, 100% 8px,
    100% calc(100% - 8px), calc(100% - 4px) calc(100% - 8px), calc(100% - 4px) calc(100% - 4px), calc(100% - 8px) calc(100% - 4px), calc(100% - 8px) 100%,
    8px 100%, 8px calc(100% - 4px), 4px calc(100% - 4px), 4px calc(100% - 8px), 0 calc(100% - 8px)
  );
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

html::-webkit-scrollbar { width: 12px; }
html::-webkit-scrollbar-track { background: var(--bg-2); }
html::-webkit-scrollbar-thumb { background: var(--ink); border: 2px solid var(--bg-2); }

body {
  background: var(--bg);
  background-image:
    radial-gradient(rgba(44, 38, 32, 0.05) 1px, transparent 1px),
    repeating-linear-gradient(0deg, rgba(44, 38, 32, 0.02) 0 1px, transparent 1px 4px);
  background-size: 24px 24px, auto;
  color: var(--ink);
  font-family: "FusionPixel", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", monospace;
  font-size: 24px;
  line-height: 1.5;
  letter-spacing: 0;
  overflow-x: hidden;
}

.px-en { letter-spacing: 2px; }

.crt {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(20, 16, 10, 0.04) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(44, 38, 32, 0.13) 100%);
}

::selection { background: var(--amber); color: var(--ink); }

:focus-visible { outline: 4px solid var(--amber); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}

a { color: inherit; text-decoration: none; }

button { font-family: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: var(--bg);
  border-bottom: 4px solid var(--ink);
}

.site-header.scrolled { box-shadow: 0 4px 0 0 rgba(44, 38, 32, 0.12); }

.logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.logo-px svg { display: block; }

.logo-text { font-size: 24px; white-space: nowrap; }

.logo-text small {
  font-size: 12px;
  margin-left: 8px;
  padding: 2px 8px;
  color: var(--bg);
  background: var(--ink);
}

.nav { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }

.nav::-webkit-scrollbar { display: none; }

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  padding: 4px 12px;
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--paper);
  box-shadow: var(--bevel-up), var(--pxborder);
  transition: transform 0.08s steps(2), background 0.1s steps(2), color 0.1s steps(2);
}

.nav-item::after { content: none; }

.nav-item:hover { background: var(--blue-pale); }

.nav-item:active { transform: translateY(4px); }

.nav-item.active {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--bevel-down), var(--pxborder);
}

.ni-icon { display: flex; flex-shrink: 0; }

.ni-icon svg { display: block; }

.tabbar { display: none; }

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  vertical-align: -1px;
  box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink);
}

.dot-all { background: var(--ink); }
.dot-03 { background: var(--green); }
.dot-36 { background: var(--blue); }
.dot-612 { background: var(--amber); }
.dot-1218 { background: var(--red); }

.nav-stage .dot { opacity: 0.45; transition: opacity 0.1s steps(2); }

.nav-stage.active .dot { opacity: 1; }

.nav-stage.active { color: var(--ink); }

.nav-stage.active::after { transform: scaleX(1); }

.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 24px 60px;
}

.hero-kicker {
  display: inline-block;
  font-size: 12px;
  color: var(--bg);
  background: var(--red);
  padding: 4px 12px;
  margin-bottom: 24px;
  box-shadow: var(--pxborder);
  animation: blink-soft 2.4s steps(1) infinite;
}

.hero-title {
  font-size: 48px;
  line-height: 1.25;
  text-shadow: 4px 4px 0 rgba(44, 38, 32, 0.1);
}

.hero-title .hl {
  color: var(--bg);
  background: var(--red);
  padding: 0 12px;
  box-shadow: var(--pxborder);
}

.hero-sub {
  margin: 24px 0;
  min-height: 36px;
  font-size: 24px;
  color: var(--ink-soft);
}

.caret {
  display: inline-block;
  width: 20px;
  height: 24px;
  background: var(--amber);
  vertical-align: -4px;
  margin-left: 8px;
  animation: blink 1s steps(1) infinite;
}

.f1 { animation: swap 0.4s linear infinite; }
.f2 { animation: swap 0.4s linear infinite -0.2s; }

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }

.btn {
  display: inline-block;
  padding: 12px 24px;
  cursor: pointer;
  font-size: 24px;
  transition: transform 0.08s steps(2), background 0.1s steps(2), color 0.1s steps(2);
}

.btn-main {
  background: var(--amber);
  color: var(--ink);
  box-shadow: var(--bevel-up), var(--pxborder);
}

.btn-main:hover { background: var(--amber-deep); color: var(--bg); }
.btn-main:active { transform: translateY(4px); box-shadow: var(--bevel-down), var(--pxborder); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: var(--pxborder);
}

.btn-ghost:hover { color: var(--blue); }
.btn-ghost:active { transform: translateY(4px); }

.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 36px; font-size: 24px; color: var(--ink-soft); }

.hero-screen { display: flex; justify-content: center; }

.screen-frame {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--panel);
  padding: 12px;
  box-shadow: 8px 8px 0 0 rgba(44, 38, 32, 0.22);
}

.screw {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #6b6155;
  box-shadow: inset 2px 2px 0 0 rgba(0, 0, 0, 0.5), inset -2px -2px 0 0 rgba(255, 255, 255, 0.12);
}

.screw.tl { top: 4px; left: 4px; }
.screw.tr { top: 4px; right: 4px; }
.screw.bl { bottom: 4px; left: 4px; }
.screw.br { bottom: 4px; right: 4px; }

.screen-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 10px;
  color: #cfc4a8;
  font-size: 12px;
}

.led { width: 10px; height: 10px; }

.led-green { background: var(--green); box-shadow: 0 0 8px var(--green); }
.led-amber { background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: blink 1.2s steps(1) infinite; }

.screen-canvas {
  background: linear-gradient(180deg, #abdcf0 0%, #9ad2e8 55%, #8fc8e0 100%);
  border: 4px solid var(--ink);
  overflow: hidden;
}

.screen-canvas svg { display: block; width: 100%; height: auto; }

.screen-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px 4px;
  color: #8d8268;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}

.screen-status .px-en::after {
  content: "■";
  margin-left: 6px;
  color: var(--amber);
  animation: blink 1.2s steps(1) infinite;
}

.speaker { display: flex; gap: 4px; flex-shrink: 0; }

.speaker i { width: 3px; height: 12px; background: #4a4234; }

.heart-float { animation: bob 1.2s steps(2) infinite; }
.kid-bob { animation: bob 1.2s steps(2) infinite 0.3s; }
.cloud-drift { animation: drift 18s steps(9) infinite; }
.cloud-drift-2 { animation: drift 24s steps(9) infinite -7s; }
.cloud-drift-3 { animation: drift-r 22s steps(9) infinite; }
.sun-rays { animation: blink-soft 2s steps(1) infinite; }
.bird-a { animation: fly-a 11s linear infinite; }
.bird-b { animation: fly-b 15s linear infinite -5s; }
.particle { animation: rise 2.4s linear infinite; }
.particle-2 { animation: rise 2.4s linear infinite 1.2s; }

.butterfly { animation: wander 7s steps(6) infinite; }
.bf1 { animation: swap 0.24s linear infinite; }
.bf2 { animation: swap 0.24s linear infinite -0.12s; }

.family-hop { animation: family-hop 3.6s steps(2) infinite; }

.char-open { animation: eyes-open 4.2s linear infinite; }
.char-closed { animation: eyes-closed 4.2s linear infinite; }
.c-1 { animation-delay: 1.1s; }
.c-2 { animation-delay: 2.3s; }
.c-3 { animation-delay: 3.4s; }

.divider {
  height: 12px;
  background: repeating-conic-gradient(var(--ink) 0% 25%, transparent 0% 50%) 0 0 / 16px 16px;
  opacity: 0.18;
}

.creed {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 24px;
}

.creed-card {
  background: var(--paper);
  padding: 36px 24px;
  text-align: center;
  box-shadow: var(--bevel-up), var(--pxborder);
  transition: transform 0.1s steps(2);
}

.creed-card:hover { transform: translate(-3px, -3px); }

.creed-icon { display: inline-block; margin-bottom: 12px; }

.creed-icon svg { display: block; }

.creed-card h3 { font-size: 36px; line-height: 1.25; margin-bottom: 12px; }

.creed-card p { font-size: 12px; color: var(--ink-soft); }

.articles { max-width: 1200px; margin: 0 auto; padding: 12px 24px 84px; scroll-margin-top: 96px; }

.section-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 36px;
  line-height: 1.25;
  margin-bottom: 12px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--ink-soft) 0 12px, transparent 12px 24px);
}

.section-title .px-en { font-size: 12px; color: var(--ink-soft); }

.section-sub { font-size: 12px; color: var(--ink-soft); margin-bottom: 36px; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 48px; }

.filter {
  padding: 12px 24px;
  background: var(--paper);
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: var(--ink);
  box-shadow: var(--bevel-up), var(--pxborder);
  transition: transform 0.08s steps(2), background 0.1s steps(2), color 0.1s steps(2);
}

.filter:hover { color: var(--blue); }

.filter.active {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--bevel-down), var(--pxborder);
}

.filter-random {
  background: transparent;
  color: var(--red);
  box-shadow: 0 -4px 0 0 var(--red), 0 4px 0 0 var(--red), -4px 0 0 0 var(--red), 4px 0 0 0 var(--red);
}

.filter-random:hover {
  background: var(--red);
  color: var(--bg);
  animation: wobble 0.4s steps(3);
}

.filter:active { transform: translateY(4px); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
  gap: 24px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  padding: 24px;
  cursor: pointer;
  box-shadow: var(--bevel-up), var(--pxborder);
  transition: transform 0.1s steps(2);
}

.card::after {
  content: attr(data-idx);
  position: absolute;
  right: 12px;
  bottom: -12px;
  font-size: 36px;
  color: rgba(44, 38, 32, 0.07);
  pointer-events: none;
}

.card:hover { transform: translate(-3px, -3px); }
.card:hover .card-icon svg { animation: nudge-y 0.5s steps(2) infinite; }

.card.hide { display: none; }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }

.card-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  padding: 3px;
  flex-shrink: 0;
}

.card-icon span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--blue-pale);
  clip-path: var(--notch);
}

.card-icon svg { display: block; }

.card-age {
  font-size: 24px;
  padding: 6px 12px;
  color: var(--bg);
  background: var(--ink);
  letter-spacing: 2px;
}

.card-age.g-body, .rp-age.g-body { background: var(--green-deep); }
.card-age.g-mood, .rp-age.g-mood { background: var(--blue); }
.card-age.g-rel, .rp-age.g-rel { background: var(--red); }
.card-age.g-money, .rp-age.g-money { background: var(--amber-deep); }
.card-age.g-time, .rp-age.g-time { background: #8b6fae; }
.card-age.g-career, .rp-age.g-career { background: #6b8fa6; }

.card h3 { font-size: 24px; line-height: 1.5; margin-bottom: 12px; transition: color 0.1s steps(2); }

.card:hover h3 { color: var(--red); }

.card-excerpt { font-size: 24px; color: var(--ink-soft); flex: 1; }

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 12px;
  border-top: 4px dashed rgba(44, 38, 32, 0.18);
}

.card-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.card-tags span { font-size: 12px; color: var(--blue); padding: 2px 8px; border: 2px solid var(--blue); }

.card-read { font-size: 12px; color: var(--red); animation: nudge-x 1.6s steps(2) infinite; }

.about { background: var(--panel); color: #e6dcc4; scroll-margin-top: 96px; }

.about-inner { max-width: 1200px; margin: 0 auto; padding: 72px 24px 84px; }

.about-inner .section-title::after {
  background: repeating-linear-gradient(90deg, #8d8268 0 12px, transparent 12px 24px);
}

.about-inner .section-title .px-en { color: #8d8268; }

.about-text { max-width: 840px; margin: 24px 0 48px; color: #c9bda0; }

.rules { display: grid; gap: 24px; }

.rule {
  display: flex;
  gap: 24px;
  align-items: baseline;
  padding: 24px;
  background: var(--panel-2);
  box-shadow: var(--bevel-up), 0 -3px 0 0 #12100c, 0 3px 0 0 #12100c, -3px 0 0 0 #12100c, 3px 0 0 0 #12100c;
}

.rule-num { flex-shrink: 0; font-size: 12px; color: var(--amber); }

.site-footer {
  background: #12100c;
  color: #8d8268;
  text-align: center;
  padding: 24px 24px 48px;
  font-size: 12px;
  line-height: 2.4;
}

.walker-track {
  position: relative;
  height: 96px;
  overflow: hidden;
  margin: 0 -24px 12px;
}

.walker-track::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  height: 4px;
  background: #7a6a4e;
}

.walker {
  position: absolute;
  top: 20px;
  left: 0;
  width: 60px;
  height: 64px;
  animation: walk-across 20s linear infinite;
}

.walker-bob { position: absolute; inset: 0; animation: bob-x 0.5s steps(2) infinite; }

.walker .frame { position: absolute; inset: 0; animation: swap 0.5s steps(1) infinite; }

.walker .frame-2 { animation-delay: -0.25s; }

.footer-title { font-size: 24px; color: #e6dcc4; }

.footer-title .px-en { font-size: 12px; color: #8d8268; }

.footer-heart { display: inline-block; margin: 12px 0; }

.footer-heart svg { display: block; animation: beat 1.2s steps(2) infinite; }

.footer-copy { font-size: 12px; }

.footer-icp { font-size: 12px; }

.footer-icp a { color: #8d8268; transition: color 0.1s steps(2); }

.footer-icp a:hover { color: var(--amber); }

.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  width: 60px;
  height: 60px;
  border: none;
  cursor: pointer;
  background: var(--amber);
  color: var(--ink);
  font-size: 24px;
  box-shadow: var(--bevel-up), var(--pxborder);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s steps(2), transform 0.08s steps(2);
}

.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { background: var(--amber-deep); color: var(--bg); }
.to-top:active { transform: translateY(4px); }

.reader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(24, 20, 14, 0.94);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.reader::-webkit-scrollbar { width: 12px; }
.reader::-webkit-scrollbar-track { background: #12100c; }
.reader::-webkit-scrollbar-thumb { background: var(--amber); border: 2px solid #12100c; }

.reader-progress {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 12px;
  background: rgba(0, 0, 0, 0.45);
}

#reader-bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--amber);
}

.reader-page {
  position: relative;
  max-width: 780px;
  margin: 72px auto 96px;
  background: var(--paper);
  padding: 48px;
  box-shadow: 0 0 0 4px var(--ink), 0 0 0 8px var(--amber);
  animation: page-in 0.25s steps(4);
}

.rp-close {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10;
  width: 60px;
  height: 60px;
  border: none;
  cursor: pointer;
  background: var(--ink);
  color: var(--bg);
  font-size: 24px;
  box-shadow: var(--bevel-up), 0 -3px 0 0 var(--amber), 0 3px 0 0 var(--amber), -3px 0 0 0 var(--amber), 3px 0 0 0 var(--amber);
  transition: transform 0.08s steps(2);
}

.rp-close:active { transform: translateY(4px); }

.rp-age {
  display: inline-block;
  font-size: 24px;
  padding: 6px 12px;
  color: var(--bg);
  background: var(--red);
  letter-spacing: 2px;
  margin-bottom: 24px;
}

.rp-head h2 { font-size: 36px; line-height: 1.25; margin-bottom: 16px; }

.rp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.rp-meta .dot { color: var(--amber); }

.rp-body { border-top: 4px solid var(--ink); padding-top: 24px; }

.rp-body .lead { color: var(--ink); margin-bottom: 24px; }

.rp-body h3 {
  position: relative;
  font-size: 24px;
  margin: 36px 0 12px;
  padding-left: 24px;
}

.rp-body h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 12px;
  height: 12px;
  background: var(--amber);
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink);
}

.rp-body p { color: #4a4234; margin-bottom: 12px; }

.checklist {
  list-style: none;
  margin: 24px 0;
  background: var(--green-deep);
  padding: 4px;
}

.checklist li {
  position: relative;
  background: var(--green-pale);
  padding: 12px 24px 12px 60px;
  margin-bottom: 4px;
}

.checklist li:last-child { margin-bottom: 0; }

.checklist li::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 24px;
  width: 16px;
  height: 16px;
  background: var(--green);
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink);
}

.rp-ending {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 4px dashed rgba(44, 38, 32, 0.2);
  color: var(--red);
}

.rp-nav { display: flex; gap: 16px; margin-top: 48px; }

.rp-nav a,
.rp-nav .placeholder {
  flex: 1;
  display: block;
  padding: 12px 24px;
  background: var(--ink);
  box-shadow: var(--bevel-up), var(--pxborder);
  transition: background 0.1s steps(2), transform 0.08s steps(2);
}

.rp-nav a:hover { background: var(--blue); }
.rp-nav a:active { transform: translateY(4px); }

.rp-nav .placeholder { opacity: 0.35; }

.nav-line1 { display: block; font-size: 24px; color: var(--bg); }

.nav-line2 {
  display: block;
  font-size: 12px;
  color: #b8ac94;
  margin-top: 4px;
}

.reader-hint {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 10;
  font-size: 12px;
  color: rgba(230, 220, 196, 0.5);
}

body.no-scroll { overflow: hidden; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.35s steps(4), transform 0.35s steps(4); }

.reveal.in { opacity: 1; transform: none; }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

@keyframes blink-soft { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

@keyframes bob-x { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

@keyframes drift { 0% { transform: translateX(0); } 100% { transform: translateX(48px); } }

@keyframes drift-r { 0% { transform: translateX(48px); } 100% { transform: translateX(0); } }

@keyframes fly-a { 0% { transform: translateX(-20px); } 100% { transform: translateX(440px); } }

@keyframes fly-b { 0% { transform: translateX(440px); } 100% { transform: translateX(-20px); } }

@keyframes rise { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-40px); opacity: 0; } }

@keyframes swap { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

@keyframes walk-across { from { transform: translateX(-72px); } to { transform: translateX(100vw); } }

@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }

@keyframes nudge-x { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }

@keyframes nudge-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

@keyframes page-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

@keyframes toast-in { from { transform: translate(-50%, -24px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }


.acct {
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  background: var(--ink);
  color: var(--bg);
  padding: 6px 12px;
  font-size: 24px;
  box-shadow: var(--bevel-up), var(--pxborder);
  flex-shrink: 0;
  transition: background 0.1s steps(2);
}

.acct:hover { background: #3d3529; }
.acct-avatar { display: flex; }
.acct-avatar svg { display: block; }
.acct-label { white-space: nowrap; }

.debates { max-width: 1200px; margin: 0 auto; padding: 60px 24px 12px; scroll-margin-top: 96px; }
.debate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(560px, 1fr)); gap: 24px; }

.debate { background: var(--paper); padding: 24px; box-shadow: var(--bevel-up), var(--pxborder); }

.d-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.d-topic { font-size: 12px; color: var(--bg); background: var(--ink); padding: 4px 12px; }
.d-age { font-size: 12px; color: var(--ink-soft); }
.d-q { font-size: 24px; line-height: 1.5; margin-bottom: 16px; }

.d-sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.d-side { padding: 12px; border: 3px solid; }
.d-for { border-color: var(--blue); background: #eef3f7; }
.d-against { border-color: var(--red); background: #f9eeec; }
.d-side h4 { font-size: 24px; margin-bottom: 8px; }
.d-for h4 { color: var(--blue); }
.d-against h4 { color: var(--red); }
.d-side li { font-size: 12px; color: var(--ink-soft); list-style: none; padding-left: 16px; position: relative; margin-bottom: 6px; }
.d-side li:last-child { margin-bottom: 0; }
.d-side li::before { content: ""; position: absolute; left: 0; top: 7px; width: 8px; height: 8px; background: currentColor; opacity: 0.6; }
.d-vs { align-self: center; font-size: 12px; color: var(--ink-soft); }

.d-tally { display: flex; height: 20px; margin: 16px 0; background: #e6dcc4; box-shadow: inset 0 0 0 2px rgba(44, 38, 32, 0.35); }
.t-for { background: var(--blue); }
.t-mid { background: var(--amber); }
.t-against { background: var(--red); }
.t-for, .t-mid, .t-against { height: 100%; transition: width 0.3s steps(6); }

.d-vote { display: flex; gap: 8px; margin-bottom: 8px; }
.d-vote button {
  flex: 1;
  border: none;
  cursor: pointer;
  font-size: 24px;
  padding: 10px 6px;
  background: var(--paper);
  box-shadow: var(--bevel-up), var(--pxborder);
  transition: transform 0.08s steps(2);
}
.d-vote button:active { transform: translateY(4px); }
.d-vote .v-for { color: var(--blue); }
.d-vote .v-mid { color: var(--amber-deep); }
.d-vote .v-against { color: var(--red); }
.d-vote button.picked { color: var(--bg); }
.d-vote .v-for.picked { background: var(--blue); }
.d-vote .v-mid.picked { background: var(--amber-deep); }
.d-vote .v-against.picked { background: var(--red); }

.d-opinions { border-top: 4px dashed rgba(44, 38, 32, 0.18); padding-top: 12px; }
.d-op-list { display: grid; gap: 8px; margin-top: 8px; }
.d-op { display: flex; gap: 10px; align-items: flex-start; background: var(--bg-2); padding: 8px 12px; }
.d-op-avatar svg { display: block; }
.d-op-body { flex: 1; }
.d-op-meta { font-size: 12px; color: var(--ink-soft); margin-bottom: 2px; }
.d-op-side { font-size: 12px; padding: 1px 8px; color: var(--bg); margin-left: 8px; }
.d-op-side.s-for { background: var(--blue); }
.d-op-side.s-mid { background: var(--amber-deep); }
.d-op-side.s-against { background: var(--red); }
.d-op-text { font-size: 24px; word-break: break-all; }
.d-op-none { font-size: 12px; color: var(--ink-soft); }

.d-write {
  display: block;
  width: 100%;
  margin-top: 12px;
  border: none;
  cursor: pointer;
  font-size: 24px;
  padding: 10px;
  background: transparent;
  color: var(--blue);
  box-shadow: var(--pxborder);
  transition: background 0.1s steps(2), color 0.1s steps(2);
}
.d-write:hover { background: var(--blue); color: var(--bg); }

.d-form { margin-top: 12px; background: var(--bg-2); padding: 16px; }
.d-form textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  background: var(--paper);
  border: 4px solid var(--ink);
  font-family: inherit;
  font-size: 24px;
  color: var(--ink);
  padding: 12px;
  outline: none;
}
.d-form textarea:focus { border-color: var(--blue); }
.d-form-actions { display: flex; gap: 12px; margin-top: 12px; align-items: center; flex-wrap: wrap; }
.d-form-hint { font-size: 12px; color: var(--ink-soft); }

.toolbox { max-width: 1200px; margin: 0 auto; padding: 12px 24px 84px; scroll-margin-top: 96px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); gap: 24px; }
.tool { background: var(--paper); padding: 24px; box-shadow: var(--bevel-up), var(--pxborder); display: flex; flex-direction: column; gap: 12px; }
.tool-head { display: flex; align-items: center; gap: 12px; }
.tool-icon { width: 56px; height: 56px; background: var(--ink); padding: 3px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tool-icon span { width: 100%; height: 100%; background: var(--blue-pale); display: flex; align-items: center; justify-content: center; clip-path: var(--notch); }
.tool h3 { font-size: 24px; }
.tool p { font-size: 12px; color: var(--ink-soft); }
.tool pre {
  background: var(--bg-2);
  border: 3px dashed rgba(44, 38, 32, 0.3);
  padding: 16px;
  font-family: inherit;
  font-size: 12px;
  line-height: 2;
  white-space: pre-wrap;
  color: var(--ink);
}
.tool-actions { display: flex; gap: 12px; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(24, 20, 14, 0.94);
  overflow-y: auto;
  padding: 24px 12px 48px;
}
.modal-box {
  max-width: 640px;
  margin: 48px auto;
  background: var(--paper);
  padding: 36px;
  box-shadow: 0 0 0 4px var(--ink), 0 0 0 8px var(--amber);
  animation: page-in 0.25s steps(4);
  position: relative;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  border: none;
  cursor: pointer;
  background: var(--ink);
  color: var(--bg);
  font-size: 24px;
  box-shadow: var(--bevel-up), var(--pxborder);
}
.modal h2 { font-size: 36px; line-height: 1.25; margin-bottom: 20px; }
.modal h3 { font-size: 24px; margin: 20px 0 8px; }
.modal p { font-size: 24px; color: #4a4234; }
.modal .m-sub { font-size: 12px; color: var(--ink-soft); }

.m-tabs { display: flex; gap: 12px; margin-bottom: 24px; }
.m-tab { flex: 1; border: none; cursor: pointer; font-size: 24px; padding: 10px; background: transparent; color: var(--ink-soft); box-shadow: var(--pxborder); }
.m-tab.active { background: var(--ink); color: var(--bg); }

.m-field { margin-bottom: 16px; }
.m-field label { display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.m-field input {
  width: 100%;
  background: var(--paper);
  border: 4px solid var(--ink);
  font-family: inherit;
  font-size: 24px;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}
.m-field input:focus { border-color: var(--blue); }
.m-err { font-size: 12px; color: var(--red); min-height: 20px; }

.avatar-pick { display: flex; gap: 12px; flex-wrap: wrap; }
.avatar-opt { width: 64px; height: 64px; border: 3px solid transparent; cursor: pointer; background: var(--bg-2); display: flex; align-items: center; justify-content: center; }
.avatar-opt.sel { border-color: var(--amber); background: var(--blue-pale); }
.avatar-opt svg { display: block; }

.m-submit { width: 100%; border: none; cursor: pointer; font-size: 24px; padding: 12px; background: var(--amber); color: var(--ink); box-shadow: var(--bevel-up), var(--pxborder); }
.m-submit:hover { background: var(--amber-deep); color: var(--bg); }
.m-submit:active { transform: translateY(4px); }

.acct-panel-head { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.ap-avatar { width: 84px; height: 84px; background: var(--bg-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--pxborder); }
.ap-name { font-size: 36px; }
.ap-level { font-size: 12px; color: var(--bg); background: var(--ink); display: inline-block; padding: 2px 10px; margin-top: 6px; }

.xp-bar { height: 20px; background: #e6dcc4; box-shadow: inset 0 0 0 2px rgba(44, 38, 32, 0.35); margin: 12px 0 4px; }
.xp-fill { display: block; height: 100%; background: var(--amber); transition: width 0.3s steps(6); }
.xp-label { font-size: 12px; color: var(--ink-soft); }

.badges { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 16px; }
.badge { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; font-size: 24px; cursor: default; }
.badge.on { background: var(--amber); box-shadow: var(--bevel-up), var(--pxborder); }
.badge.off { background: #e6dcc4; color: rgba(44, 38, 32, 0.3); box-shadow: var(--pxborder); }

.style-badge { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; font-size: 24px; color: var(--bg); margin: 12px 0; }
.style-desc { font-size: 24px; color: #4a4234; margin-bottom: 8px; }

.quiz-q { margin-bottom: 20px; }
.quiz-q h3 { font-size: 24px; margin-bottom: 10px; }
.quiz-opts { display: grid; gap: 8px; }
.quiz-opt { text-align: left; border: none; cursor: pointer; font-size: 24px; padding: 10px 12px; background: var(--paper); color: var(--ink); box-shadow: var(--bevel-up), var(--pxborder); }
.quiz-opt:hover { color: var(--blue); }
.quiz-opt.sel { background: var(--ink); color: var(--bg); box-shadow: var(--bevel-down), var(--pxborder); }

.style-counts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0; }
.sc-item { padding: 12px; background: var(--bg-2); box-shadow: var(--pxborder); }
.sc-name { font-size: 24px; margin-bottom: 4px; }
.sc-count { font-size: 12px; color: var(--ink-soft); }

.toast {
  position: fixed;
  top: 96px;
  left: 50%;
  z-index: 300;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 24px;
  font-size: 24px;
  box-shadow: 0 0 0 4px var(--amber);
  animation: toast-in 0.25s steps(4);
}

.creed-card p { font-size: 24px; }
.section-sub { font-size: 24px; }
.d-side li { font-size: 24px; }
.d-op-none { font-size: 24px; }
.d-form-hint { font-size: 24px; }
.modal .m-sub { font-size: 24px; }
.m-field label { font-size: 24px; }
.m-err { font-size: 24px; }
.tool p { font-size: 24px; }
.tool pre { font-size: 24px; line-height: 1.6; }
.xp-label { font-size: 24px; }
.sc-count { font-size: 24px; }
.m-field input { height: 60px; }

@keyframes eyes-open { 0%, 92% { opacity: 1; } 94%, 96% { opacity: 0; } 98%, 100% { opacity: 1; } }

@keyframes eyes-closed { 0%, 92% { opacity: 0; } 94%, 96% { opacity: 1; } 98%, 100% { opacity: 0; } }

@keyframes family-hop { 0%, 82% { transform: translateY(0); } 86%, 93% { transform: translateY(-8px); } 97%, 100% { transform: translateY(0); } }

@keyframes wander {
  0% { transform: translate(0, 0); }
  25% { transform: translate(20px, -10px); }
  50% { transform: translate(6px, -18px); }
  75% { transform: translate(-14px, -8px); }
  100% { transform: translate(0, 0); }
}

@keyframes wobble {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-2deg); }
  75% { transform: rotate(2deg); }
}

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; padding-top: 48px; gap: 48px; }
  .hero-screen { order: -1; }
  .grid { grid-template-columns: 1fr; }
  .creed { grid-template-columns: 1fr; padding: 60px 24px; }
}

@media (max-width: 640px) {
  .site-header {
    position: static;
    flex-wrap: wrap;
    gap: 0;
    padding: 12px;
  }
  .logo { padding-bottom: 0; }
  .logo-text { font-size: 24px; }
  .logo-text small { display: none; }
  .nav { display: none; }
  .acct { font-size: 24px; padding: 4px 10px; gap: 6px; }

  body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    background: var(--paper);
    border-top: 4px solid var(--ink);
    box-shadow: 0 -4px 0 0 rgba(44, 38, 32, 0.15);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tab {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 0 6px;
    min-width: 0;
    transition: background 0.1s steps(2);
  }
  .tab.active { background: var(--bg-2); }
  .tab.active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 4px;
    background: var(--amber);
  }
  .tab-icon {
    display: flex;
    padding: 5px;
    background: transparent;
    box-shadow: none;
    transition: background 0.1s steps(2);
  }
  .tab-icon svg { display: block; }
  .tab.active .tab-icon {
    background: var(--ink);
    box-shadow: 0 -2px 0 0 var(--amber), 0 2px 0 0 var(--amber), -2px 0 0 0 var(--amber), 2px 0 0 0 var(--amber);
  }
  .tab-label { font-size: 12px; color: #9a8f7d; }
  .tab.active .tab-label { color: var(--red); }

  .debates { padding: 48px 12px 12px; scroll-margin-top: 24px; }
  .debate-grid { grid-template-columns: 1fr; }
  .d-q { font-size: 24px; }
  .d-vote button { font-size: 24px; }
  .d-sides { grid-template-columns: 1fr; }
  .d-vs { justify-self: center; }
  .toolbox { padding: 12px 12px 72px; scroll-margin-top: 24px; }
  .tool-grid { grid-template-columns: 1fr; }
  .modal-box { margin: 24px auto; padding: 28px 16px; }
  .style-counts { grid-template-columns: 1fr; }
  .toast { top: 72px; font-size: 24px; }
  .hero { padding: 36px 12px 48px; }
  .hero-title { font-size: 36px; }
  .hero-sub { font-size: 24px; }
  .hero-meta { flex-wrap: wrap; gap: 8px; }
  .creed { padding: 48px 12px; }
  .articles { padding: 12px 12px 72px; scroll-margin-top: 24px; }
  .about { scroll-margin-top: 24px; }
  .section-title { font-size: 36px; }
  .filters {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .filter { padding: 12px 8px; text-align: center; }
  .filters .dot { display: none; }
  #random-btn { grid-column: span 2; }
  .card { padding: 24px; }
  .reader-page { margin: 48px 12px 84px; padding: 36px 24px; }
  .rp-head h2 { font-size: 36px; }
  .rp-close { top: 12px; right: 12px; width: 48px; height: 48px; font-size: 24px; }
  .rp-nav { flex-direction: column; }
  .reader-hint { display: none; }
  .site-footer { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
  .to-top { right: 12px; bottom: calc(104px + env(safe-area-inset-bottom)); }
}

