/* Level 6 — architecture. Towers of parts, built from the bottom up.

   Designed at 375px. Nothing here may scroll sideways, and every tappable
   thing is at least 44px tall on a touch screen. */

/* ---------- shared bits ---------- */

.rig { width: 100%; max-width: 360px; }

.go-row { display: flex; justify-content: center; gap: .5rem; margin-top: .9rem; flex-wrap: wrap; }

.go {
  border: 0; border-radius: 99px; cursor: pointer;
  padding: .7rem 1.5rem; min-height: 48px;
  font-size: 1rem; font-weight: 800;
  background: var(--accent); color: #fff;
  font-family: inherit;
}
@media (prefers-color-scheme: dark) { .go { color: #14201a; } }
.go:active { transform: translateY(1px); }
.go[disabled] { opacity: .4; cursor: default; }
.go.small {
  padding: .55rem 1rem; font-size: .85rem; min-height: 44px;
  background: transparent; color: var(--accent);
  border: 1px solid var(--accent); font-weight: 650;
}

.shout {
  text-align: center; font-size: 1rem; font-weight: 650;
  margin: .9rem auto 0; max-width: 330px; min-height: 3.2em; line-height: 1.45;
}
.shout.bad  { color: #c0392b; }
.shout.good { color: #2d7d46; }
@media (prefers-color-scheme: dark) {
  .shout.bad { color: #f0998c; } .shout.good { color: #8ed9a8; }
}

.tally {
  display: flex; justify-content: center; gap: .45rem; flex-wrap: wrap;
  margin-top: .6rem; font-size: .78rem;
}
.tally span {
  background: var(--accent-soft); color: var(--accent);
  padding: .22rem .6rem; border-radius: 99px; font-weight: 650;
}

.kid { font-size: 1.02rem; line-height: 1.65; }
.kid p { margin: 0 0 .9rem; }

.big-point {
  background: var(--accent-soft); border-radius: 12px;
  padding: .9rem 1rem; margin: 1.1rem 0;
  font-size: 1.04rem; font-weight: 650; line-height: 1.5;
}

.grownup {
  border: 1px dashed var(--line); border-radius: 10px;
  padding: .7rem .9rem; margin: 0 0 1.1rem;
  font-size: .88rem; color: var(--muted);
}
.grownup b { color: var(--accent); }

/* ---------- the towers ---------- */

.arch-stage { padding: 1.2rem 1rem 1.4rem; }

.arch-what {
  margin: 0; padding: .85rem 1.2rem;
  border-bottom: 1px solid var(--line);
  font-size: .98rem; color: var(--muted);
}
.arch-what b { color: var(--ink); display: block; }

.tower {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  width: 100%;
}
.tower.packed { grid-template-columns: 1fr 1fr; }
.tower.packed .spine { grid-column: 1 / -1; }

@media (min-width: 560px) {
  .tower.packed { grid-template-columns: 1fr 1fr 1fr; }
}

.blk {
  position: relative;
  display: flex; align-items: center; gap: .45rem;
  width: 100%; min-height: 46px;
  padding: .4rem .5rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-10px) scale(.96);
  transition: opacity .25s ease, transform .25s ease,
              background .2s ease, border-color .2s ease, filter .2s ease;
}
.blk.in { opacity: 1; transform: none; }

.blk-e { flex: 0 0 auto; font-size: 1.05rem; line-height: 1; }
.blk-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
/* break-word, not anywhere: a name may wrap between words, but "themselves"
   must never come out as "themselve / s". */
.blk-t b {
  font-size: .86rem; font-weight: 700; line-height: 1.25;
  overflow-wrap: break-word;
}
.blk-t i {
  font-style: normal; font-size: .7rem; color: var(--muted);
  overflow-wrap: anywhere;
}

/* Tucked into the corner rather than sitting in the row — the part names are
   long enough without giving a badge a whole column of width. */
.blk-new {
  position: absolute; top: 3px; right: 4px;
  font-size: .52rem; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--accent); color: #fff;
  padding: .06rem .28rem; border-radius: 99px;
}
.blk.is-new { padding-right: 2.3rem; }
@media (prefers-color-scheme: dark) { .blk-new { color: #14201a; } }

.blk.is-new { border-color: var(--accent); background: var(--accent-soft); }
.blk.spine  { border-width: 2px; }
.blk.spine .blk-t b { font-size: .95rem; }

.blk.lit {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  transform: scale(1.03);
}
@media (prefers-color-scheme: dark) { .blk.lit { color: #14201a; } }
.blk.lit .blk-t i { color: inherit; opacity: .75; }
.blk.lit .blk-new { background: rgba(255,255,255,.35); }

.blk.pulled {
  border: 2px dashed #c0392b;
  background: transparent;
  transform: rotate(-3deg) translateX(8px);
}
.blk.pulled .blk-t b { text-decoration: line-through; }

.blk.dead { filter: grayscale(1); opacity: .32; }
.blk.dead .blk-t b { text-decoration: line-through; }

/* the message travelling through the tower */
.pip {
  position: absolute; top: 0; left: 0;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  opacity: 0; pointer-events: none;
  transition: transform .45s cubic-bezier(.3,.8,.4,1), opacity .2s ease;
  z-index: 2;
}
.pip.on { opacity: 1; }

.ground {
  margin-top: 6px; padding-top: 7px;
  border-top: 3px solid var(--line);
  text-align: center;
}
.ground span {
  font-size: .68rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted);
}

/* ---------- the stack list ---------- */

.stack-head { font-size: .95rem; color: var(--muted); margin: 0 0 .8rem; }
.stack-head b { color: var(--ink); }

.parts-h {
  font-size: .72rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted);
  margin: 1.1rem 0 .5rem;
}

.parts { list-style: none; padding: 0; margin: 0 0 .9rem; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; padding: 0; margin: 0 0 1rem; }
.chips li {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .78rem; line-height: 1.3;
  padding: .28rem .55rem; margin: 0;
  border: 1px solid var(--line); border-radius: 99px;
  background: var(--surface); color: var(--muted);
}

.parts li {
  display: flex; gap: .6rem; align-items: flex-start;
  padding: .6rem .75rem; margin-bottom: .35rem;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface);
}
.parts li.fresh { border-color: var(--accent); background: var(--accent-soft); }

.p-e { flex: 0 0 auto; font-size: 1.1rem; line-height: 1.35; }
.p-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.p-t b { font-size: .95rem; line-height: 1.3; }
.p-grown { font-size: .74rem; color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; }
.p-why { font-size: .9rem; margin-top: .2rem; }

.pull-hint {
  font-size: .86rem; color: var(--muted);
  border-left: 3px solid var(--accent); padding-left: .7rem;
}

.think { padding-left: 1.2rem; margin: 0 0 1rem; }
.think li { margin-bottom: .45rem; }

/* ---------- the list of ten ---------- */

/* The shared .toc renders plain inline links about 18px tall. On this page
   those ten links are the main way in on a phone, so they get a real tap
   target. Scoped to this list so no other page changes. */
#arch-toc li { margin-bottom: .1rem; }
#arch-toc a {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: .2rem 0;
}
#arch-toc .toc-c {
  font-size: .78rem; color: var(--muted); white-space: nowrap;
}

/* ---------- the ruler ---------- */

.ruler { display: grid; gap: .3rem; margin: 0 0 2rem; }

.rung {
  display: grid;
  grid-template-columns: 1.6rem 4.5rem 1fr auto;
  align-items: center; gap: .5rem;
  min-height: 44px; padding: .25rem .5rem;
  border-radius: 8px;
  text-decoration: none; color: inherit;
}
.rung:hover { background: var(--accent-soft); }

.rung-n { font-weight: 800; color: var(--accent); font-size: .9rem; text-align: center; }
.rung-bar { height: 9px; border-radius: 99px; background: var(--line); overflow: hidden; }
.rung-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.rung-t { font-size: .84rem; line-height: 1.25; overflow-wrap: anywhere; }
.rung-c { font-size: .72rem; color: var(--muted); white-space: nowrap; }

/* ---------- the opener: foundations ---------- */

.pad {
  border: 2px solid var(--line); border-radius: 16px;
  background: var(--surface);
  padding: 1rem .9rem 1.1rem;
  margin: 0 0 1.6rem;
}

.switch {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px; padding: 4px;
  background: var(--line); border-radius: 99px;
  margin: 0 auto .9rem; width: 100%; max-width: 320px;
}
.switch button {
  border: 0; border-radius: 99px; cursor: pointer;
  padding: .6rem .3rem; min-height: 46px;
  font-size: .85rem; font-weight: 750; font-family: inherit;
  background: transparent; color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: .35rem;
}
.switch button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.14); }
.switch button.on.silly { color: #c0392b; }
.switch button.on.smart { color: #2d7d46; }
@media (prefers-color-scheme: dark) {
  .switch button.on.silly { color: #f0998c; }
  .switch button.on.smart { color: #8ed9a8; }
}

.site {
  min-height: 250px;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 4px;
  border-bottom: 4px solid #8a7f5c;
  overflow: hidden;
}

.bldg {
  width: 170px;
  transform-origin: bottom center;
  transition: transform .7s cubic-bezier(.6,-0.2,.8,1);
}
.bldg.wobble { animation: sway .5s ease-in-out infinite alternate; }
.bldg.toppled { transform: rotate(76deg) translateY(28px); }

@keyframes sway {
  from { transform: rotate(-1.6deg); }
  to   { transform: rotate(1.6deg); }
}

.floor {
  height: 26px; margin-bottom: 3px;
  border-radius: 5px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: .68rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(-18px);
  transition: opacity .2s ease, transform .2s ease;
}
.floor.in { opacity: 1; transform: none; }

.found-slab {
  height: 34px; border-radius: 5px;
  background: #6f6555; color: #fff;
  font-size: .6rem; font-weight: 700; letter-spacing: .03em;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 0 .3rem;
}
.found-slab.empty {
  background: transparent; color: var(--muted);
  border: 1px dashed var(--line);
}

/* ---------- quality control: catching the mistake ---------- */

.track {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: .3rem; margin-bottom: .5rem;
}

.station {
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface);
  padding: .5rem .25rem;
  text-align: center;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.st-n { display: block; font-size: .64rem; font-weight: 700; line-height: 1.25; }
.st-c { display: block; font-size: .95rem; font-weight: 800; color: var(--muted); margin-top: .2rem; }

.station.now { border-color: var(--accent); transform: translateY(-2px); }
.station.caught { background: #dff2e5; border-color: #2d7d46; }
.station.caught .st-c { color: #2d7d46; }
.station.missed { background: #fbe3e0; border-color: #c0392b; }
.station.missed .st-c { color: #c0392b; }
@media (prefers-color-scheme: dark) {
  .station.caught { background: #1a2c21; }
  .station.missed { background: #331e1b; }
  .station.caught .st-c { color: #8ed9a8; }
  .station.missed .st-c { color: #f0998c; }
}

.bug-lane { position: relative; height: 34px; }
.bug {
  position: absolute; top: 0; left: 0;
  font-size: 1.6rem; line-height: 1;
  transform: translateX(-40px);
  transition: transform .7s cubic-bezier(.4,.1,.3,1);
}
.bug.caught { filter: grayscale(1); opacity: .5; }

/* ---------- the summing-up list ---------- */

.rules { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.rules li {
  padding: .85rem 1rem; margin-bottom: .55rem;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 5px solid var(--accent); border-radius: 10px;
  font-size: 1rem; line-height: 1.5;
}
.rules li b { display: block; color: var(--accent); margin-bottom: .2rem; font-size: 1.05rem; }

/* ---------- calm mode ---------- */

@media (prefers-reduced-motion: reduce) {
  .blk, .floor, .pip, .bug, .bldg, .station { transition-duration: .01ms; }
  .bldg.wobble { animation: none; }
}

@media (pointer: coarse) {
  .blk { min-height: 48px; }
  .rung { min-height: 48px; }
}
