:root {
  --ground: #FFFFFF;
  --table: #F4F5F4;
  --grid: rgba(36, 39, 43, .07);
  --ink: #24272B;
  --muted: #5B6067;
  --faint: #9AA0A6;
  --rule: #C3C8CC;
  --accent: #8A5300;
  --hatch: rgba(138, 83, 0, .22);
  --sans: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #16181B;
    --table: #101215;
    --grid: rgba(232, 230, 225, .05);
    --ink: #E8E6E1;
    --muted: #A3A7AD;
    --faint: #6E747B;
    --rule: #3E444B;
    --accent: #D9A441;
    --hatch: rgba(217, 164, 65, .22);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: clamp(20px, 5vw, 56px) clamp(14px, 4vw, 48px);
  background-color: var(--table);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: var(--serif);
}
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.sheet { position: relative; width: 100%; max-width: 880px; margin: 0 auto; padding: clamp(24px, 5vw, 56px); background: var(--ground); }
.cm { position: absolute; width: 16px; height: 16px; border: 0 solid var(--faint); }
.cm.tl { top: -10px; left: -10px; border-top-width: 1px; border-left-width: 1px; }
.cm.tr { top: -10px; right: -10px; border-top-width: 1px; border-right-width: 1px; }
.cm.bl { bottom: -10px; left: -10px; border-bottom-width: 1px; border-left-width: 1px; }
.cm.br { bottom: -10px; right: -10px; border-bottom-width: 1px; border-right-width: 1px; }

.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.mark { margin: 0; font-family: var(--sans); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.mark a { text-decoration: none; }
.sub { margin: 4px 0 0; font-family: var(--sans); font-size: 14px; color: var(--muted); }
.rev { margin: 0; font-family: var(--mono); font-size: 12px; line-height: 22px; color: var(--muted); white-space: nowrap; }

.box { position: relative; border: 1px dashed var(--rule); }
.tag { position: absolute; top: -9px; left: 16px; padding: 0 8px; background: var(--ground); font-family: var(--mono); font-size: 12px; line-height: 18px; color: var(--accent); }
.output { margin-top: clamp(44px, 8vh, 80px); padding: clamp(26px, 4.5vw, 44px) clamp(20px, 4vw, 40px); }
.output h1 { margin: 0; font-weight: 400; font-size: clamp(29px, 5.2vw, 52px); line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }
.joint { width: 0; height: 36px; margin-left: 32px; border-left: 1px dashed var(--rule); }
.source {
  display: grid;
  place-items: center;
  min-height: clamp(160px, 26vh, 220px);
  padding: 36px 16px 28px;
  border-color: var(--accent);
  background-image: linear-gradient(135deg, var(--hatch) 0 6%, transparent 6% 50%, var(--hatch) 50% 56%, transparent 56% 100%);
  background-size: 16px 16px;
}
.chip { padding: 14px 22px; background: var(--ground); text-align: center; }
.state { margin: 0; display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.pulse { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.building { margin: 6px 0 0; font-size: clamp(24px, 3.4vw, 30px); line-height: 1.2; }

.foot { margin-top: clamp(40px, 7vh, 64px); }
.k { margin: 0; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.mail { display: inline-flex; align-items: center; min-height: 44px; font-size: clamp(18px, 2.4vw, 22px); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }

@media (prefers-reduced-motion: no-preference) {
  .source { animation: stripes 1.8s linear infinite; }
  .pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: ping 2.4s cubic-bezier(0, 0, .2, 1) infinite; }
}
@keyframes stripes { to { background-position: 16px 0; } }
@keyframes ping { 0% { transform: scale(1); opacity: .55; } 80%, 100% { transform: scale(3.2); opacity: 0; } }
