/* Shake */
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 300 600; font-display: swap; src: url(fonts/source-serif-4-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 300 600; font-display: swap; src: url(fonts/source-serif-4-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/plex-mono-400-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/plex-mono-400-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --soot: #141210;
  --bone: #e8e1d5;
  --dim: #8e8679;
  --faint: #3a3531;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}

html, body { height: 100%; margin: 0; }
html {
  background: var(--soot);
  color: var(--bone);
  overflow: hidden;
  overflow: clip;
  -webkit-text-size-adjust: 100%;
}
body {
  font: 400 14px/1.5 var(--mono);
  overflow: hidden;
  overflow: clip;
}

/* The stage never moves and clips everything; only #page inside it shakes. */
#stage { position: fixed; inset: 0; overflow: hidden; }
#page {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  will-change: transform;
  backface-visibility: hidden;
}

.quake {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.mag {
  display: block;
  margin: 0;
  font: 300 1em/0.9 var(--serif);
  font-size: min(46vw, 38vh);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.03em;
  color: var(--bone);
  text-decoration: none;
}
.mag:hover, .mag:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 0.025em;
  text-underline-offset: 0.06em;
}
.place {
  margin: 0.55em 0 0;
  max-width: 32ch;
  font: 400 clamp(17px, 2.3vw, 23px)/1.3 var(--serif);
  text-wrap: balance;
}
.detail {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 1.75em;
  row-gap: 0.2em;
  margin: 1.1em 0 0;
  font-size: 13px;
  color: var(--dim);
}
.status { margin: 1.2em 0 0; font-size: 13px; color: var(--dim); }

.foot {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.counter { margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.world { position: relative; width: min(52vw, 220px); margin: 14px 0 12px; }
.world svg { display: block; width: 100%; height: auto; }
.world path {
  fill: none;
  stroke: var(--faint);
  stroke-width: 1;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.dot {
  position: absolute;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--bone);
  box-shadow: 0 0 0 2px var(--soot);
}
.dot[hidden] { display: none; }
.credit { margin: 0; font-size: 11px; color: var(--dim); }
.credit a { color: inherit; text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 2px; }
.credit a:hover, .credit a:focus-visible { text-decoration-color: currentColor; }

.toggle {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  padding: 7px 10px;
  font: inherit;
  font-size: 11px;
  line-height: 1;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--faint);
  border-radius: 999px;
  cursor: pointer;
}
.toggle:hover { color: var(--bone); border-color: var(--dim); }
:focus-visible { outline: 2px solid var(--bone); outline-offset: 3px; }

/* Still mode (reduced motion, or "Stop shaking"): the outline pulses instead. */
.ring { position: absolute; inset: 0; display: none; pointer-events: none; }
.still .ring { display: block; }
#ring {
  box-shadow: inset 0 0 0 var(--ring-w, 2px) var(--bone);
  opacity: 0.22;
  animation: pulse var(--ring-period, 3s) ease-in-out infinite;
}
#flash {
  box-shadow: inset 0 0 0 calc(var(--ring-w, 2px) * 2 + 8px) var(--bone);
  opacity: 0;
}
#flash.flash { animation: flash 2.4s cubic-bezier(0.05, 0.7, 0.2, 1) forwards; }
@keyframes pulse { 0%, 100% { opacity: 0.22; } 50% { opacity: 0.85; } }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

@media (max-height: 460px) {
  .mag { font-size: min(46vw, 34vh); }
  .place { margin-top: 0.3em; }
  .detail { margin-top: 0.6em; }
  .world { width: 120px; margin: 8px 0 6px; }
}
