/* compact.observer. COMPACT's purple night, mint light and brass, on
   period materials: a carved lintel, a vellum scroll on wooden rollers,
   inset writing tablets and a wax seal. One UI face (IM Fell English);
   VT323 only where the Watchers themselves speak in numbers. */

:root {
  --ink: #1b1530;
  --wall: #2a1f4d;
  --paper: #fff6e0;
  --mint: #8dffbf;
  --teal: #19b3a6;
  --gold: #d4a53c;
  --mustard: #ffc83d;
  --tomato: #ff5a36;
  --pink: #ff4f9a;
  --sepia: #3a2306;
  --vellum-1: #f6e7c1;
  --vellum-2: #e9d29b;
  --f-ui: "IM Fell English", Georgia, serif;
  --f-cap: "IM Fell English SC", "IM Fell English", Georgia, serif;
  --f-eye: "VT323", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { background: #120d22; }
body {
  margin: 0; min-height: 100vh; color: var(--sepia);
  font: 19px/1.5 var(--f-ui);
  background: #120d22;
  overflow-x: hidden;
}

/* the sky is a scene at the top of the page, not wallpaper: the wheel and
   Hermon have to be seen above the lintel, and the scroll comes down over
   the mountain's foot */
body {
  background:
    radial-gradient(1px 1px at 20% 30%, rgba(255,246,224,.6), transparent),
    radial-gradient(1px 1px at 70% 60%, rgba(255,246,224,.5), transparent),
    radial-gradient(1.5px 1.5px at 40% 80%, rgba(141,255,191,.5), transparent),
    linear-gradient(180deg, #0e0a1a 0, #120d22 900px, #0b0815 100%);
  background-size: 300px 300px, 260px 260px, 340px 340px, 100% 100%;
}
.sky {
  position: absolute; top: 0; left: 0; width: 100%; height: 780px; z-index: 0;
}
.wheel .ring-a { animation: spin-a 60s linear infinite; transform-origin: 0 0; }
.wheel .ring-b { transform-origin: 0 0; }
.hub-eye { animation: blink 7s infinite; transform-origin: 0 0; }
.beam { animation: beam 6s ease-in-out infinite; }
@keyframes spin-a { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 92%, 100% { transform: scale(1.9); } 95% { transform: scale(1.9, .1); } }
@keyframes beam { 0%, 100% { opacity: .55; } 50% { opacity: .95; } }
@media (prefers-reduced-motion: reduce) {
  .wheel .ring-a, .hub-eye, .beam { animation: none; }
}

.wrap {
  position: relative; z-index: 1;
  width: min(880px, calc(100% - 32px));
  margin: 0 auto; padding: 540px 0 60px;
}

/* ---------- the lintel: carved stone over the scroll ---------- */
.lintel { display: flex; justify-content: center; margin-bottom: -18px; position: relative; z-index: 3; }
.lintel-stone {
  text-align: center; padding: 18px 48px 16px;
  background:
    radial-gradient(120% 90% at 30% 20%, rgba(255,255,255,.18), transparent 60%),
    repeating-linear-gradient(98deg, rgba(0,0,0,.05) 0 3px, transparent 3px 11px),
    linear-gradient(180deg, #cbbfa4 0%, #a89878 45%, #7b6c52 100%);
  border-radius: 6px 6px 3px 3px;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.45),
    inset 0 -6px 10px rgba(0,0,0,.35),
    0 14px 30px rgba(0,0,0,.55),
    0 0 60px rgba(141,255,191,.12);
  border: 1px solid #4a3d2a;
}
.aramaic {
  margin: 0; font: 600 26px/1 "Noto Serif Hebrew", serif; letter-spacing: .08em;
  color: #3b2f22; text-shadow: 0 1px 0 rgba(255,255,255,.4), 0 -1px 0 rgba(0,0,0,.35);
}
.lintel h1 {
  margin: 4px 0 2px; font: 400 clamp(34px, 6vw, 54px)/1 var(--f-cap); letter-spacing: .06em;
  color: #2c2219;
  /* incised: light below the cut, dark above it */
  text-shadow: 0 1px 0 rgba(255,255,255,.55), 0 -1px 1px rgba(0,0,0,.6);
}
.lintel-sub { margin: 0; font: italic 15px var(--f-ui); color: #3b2f22; }
.lintel-sub span { color: var(--teal); }

/* ---------- the scroll ---------- */
.scroll { position: relative; filter: drop-shadow(0 26px 40px rgba(0,0,0,.6)); }
.roller {
  position: relative; height: 34px; margin: 0 -26px; z-index: 2;
  border-radius: 17px;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.08) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #c58a52 0%, #8a4f22 40%, #5a2f12 75%, #3a1c08 100%);
  box-shadow: inset 0 3px 2px rgba(255,220,170,.45), inset 0 -4px 6px rgba(0,0,0,.45);
}
.roller::before, .roller::after {   /* brass finials */
  content: ""; position: absolute; top: -6px; width: 34px; height: 46px; border-radius: 50%;
  background: radial-gradient(60% 50% at 40% 30%, #fff1b8, #e0b45a 40%, #a87526 70%, #5a3608);
  box-shadow: 0 4px 8px rgba(0,0,0,.5);
}
.roller::before { left: -22px; }
.roller::after { right: -22px; }
.roller-top { margin-bottom: -10px; }
.roller-bottom { margin-top: -10px; }

.vellum {
  position: relative; padding: 46px clamp(20px, 6vw, 70px) 50px;
  background:
    radial-gradient(140% 60% at 50% 0%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(60% 40% at 15% 70%, rgba(150,100,40,.18), transparent 70%),
    radial-gradient(50% 35% at 85% 30%, rgba(150,100,40,.14), transparent 70%),
    linear-gradient(90deg, rgba(90,55,15,.35), transparent 7%, transparent 93%, rgba(90,55,15,.35)),
    linear-gradient(180deg, var(--vellum-1), var(--vellum-2));
  box-shadow: inset 0 0 40px rgba(90,55,15,.35);
}
.vellum::before { /* grain */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .3 0 0 0 0 .1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.vellum > * { position: relative; }

.epigraph { margin: 0 0 22px; text-align: center; font-style: italic; color: #5a3a14; }
.epigraph p { margin: 0; font-size: 18px; }
.epigraph cite { display: block; margin-top: 4px; font: 14px var(--f-cap); letter-spacing: .12em; color: #7b5a2a; }
.lede { margin: 0 0 26px; }
.lede::first-letter {
  float: left; font: 64px/.8 var(--f-cap); margin: 6px 8px 0 0; color: #6b3fd6;
  text-shadow: 1px 1px 0 var(--gold);
}

/* ---------- the writing tablets ---------- */
.rite { display: grid; gap: 18px; }
.tablet { display: grid; grid-template-columns: 46px 1fr; column-gap: 10px; }
.numeral {
  grid-row: span 3; align-self: start; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  font: 22px/1 var(--f-cap); color: #fff6e0;
  background: radial-gradient(60% 50% at 40% 30%, #9a7bff, #6b3fd6 55%, #2a1f4d);
  box-shadow: inset 0 2px 2px rgba(255,255,255,.35), 0 3px 6px rgba(0,0,0,.35);
}
.t-head { font: 22px/1.2 var(--f-cap); color: #2c1c08; }
.t-head small { font: italic 14px var(--f-ui); color: #7b5a2a; }
.t-hint { font-size: 15px; font-style: italic; color: #6a4a1c; }
.tablet textarea {
  grid-column: 2; margin-top: 6px; width: 100%; resize: vertical;
  font: 16px/1.5 var(--f-ui); color: #2c1c08; padding: 10px 12px;
  border: 1px solid #8a6a36; border-radius: 4px;
  background:
    repeating-linear-gradient(180deg, transparent 0 23px, rgba(120,80,30,.18) 23px 24px),
    linear-gradient(180deg, #efdcae, #f7ead0);
  box-shadow: inset 0 3px 8px rgba(80,50,10,.35), 0 1px 0 rgba(255,255,255,.6);
}
.tablet textarea:focus { outline: 2px solid var(--teal); outline-offset: 2px; }
.margin-note {
  margin: 4px 0 0 56px; font-size: 15px; font-style: italic; color: #5a3a14;
  border-left: 2px solid rgba(107,63,214,.4); padding-left: 10px;
}

/* ---------- the wax seal ---------- */
.seal {
  justify-self: center; display: flex; align-items: center; gap: 14px;
  margin-top: 8px; padding: 0 22px 0 0; border: 0; cursor: pointer; background: none;
  font: 22px var(--f-cap); color: #2c1c08;
}
.seal-wax {
  width: 86px; height: 86px; border-radius: 46% 54% 50% 50% / 52% 48% 52% 48%;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 22px, rgba(0,0,0,.22) 23px 25px, transparent 26px),
    radial-gradient(55% 45% at 38% 30%, #ff8a7a, #d8262f 45%, #8e0f1c 80%, #5a0610);
  box-shadow: inset -4px -6px 10px rgba(0,0,0,.35), inset 4px 4px 6px rgba(255,200,190,.35), 0 6px 10px rgba(60,0,0,.45);
  position: relative; transition: transform .15s;
}
.seal-wax::after { /* the embossed eye */
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-43 -43 86 86'%3E%3Cpath d='M-20 0Q0-15 20 0Q0 15-20 0Z' fill='none' stroke='%235a0610' stroke-width='3'/%3E%3Ccircle r='6' fill='%235a0610'/%3E%3Cpath d='M-20 0Q0-15 20 0' fill='none' stroke='%23ffb0a6' stroke-width='1' transform='translate(0 1.5)' opacity='.6'/%3E%3C/svg%3E") center/100% no-repeat;
}
.seal:hover .seal-wax, .seal:focus-visible .seal-wax { transform: rotate(-6deg) scale(1.04); }
.seal:disabled { cursor: wait; opacity: .7; }
.seal:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; border-radius: 40px; }
.status { min-height: 1.4em; margin: 0; text-align: center; font-style: italic; color: #6b3fd6; }
.status.err { color: #a3180f; }

/* ---------- the reckoning ---------- */
.reckoning { margin-top: 34px; padding-top: 26px; border-top: 3px double rgba(120,80,30,.5); }
.reckoning h2 { margin: 0 0 6px; text-align: center; font: 32px var(--f-cap); color: #2c1c08; }
.verdict { margin: 0 0 18px; text-align: center; font-size: 21px; }
.verdict strong { color: #6b3fd6; }

/* the figures are the Watchers speaking: a dark brass-framed glass */
.sums {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px;
  margin: 0 0 22px; padding: 14px; border-radius: 10px;
  background: radial-gradient(120% 120% at 50% 0%, #2a1f4d, #120d22);
  border: 6px solid transparent;
  border-image: linear-gradient(180deg, #fff1b8, #e0b45a 30%, #a87526 60%, #5a3608) 1;
  box-shadow: inset 0 0 24px rgba(141,255,191,.15), 0 4px 10px rgba(0,0,0,.4);
}
.sums div { text-align: center; }
.sums dt { font: 13px var(--f-cap); letter-spacing: .1em; color: #c9b98f; }
.sums dd { margin: 2px 0 0; font: 40px/1 var(--f-eye); color: var(--mint); text-shadow: 0 0 10px rgba(141,255,191,.6); }
.sums dd.warn { color: var(--mustard); text-shadow: 0 0 10px rgba(255,200,61,.5); }

.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px;
  padding: 8px 4px; border-bottom: 1px dashed rgba(120,80,30,.35);
}
.ledger .mark { width: 30px; height: 20px; }
.ledger .name { font-size: 18px; }
.ledger .note { display: block; font-size: 14px; font-style: italic; color: #7b5a2a; }
.ledger .price { font: 22px var(--f-eye); color: #2c1c08; }
.via { margin: 12px 0 0; text-align: center; font-size: 14px; font-style: italic; color: #7b5a2a; }

.deeds { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 26px; }
.messenger label, .carve .t-hint { display: block; }
.messenger label { font: 18px var(--f-cap); margin-bottom: 6px; }
.messenger-row { display: flex; gap: 8px; }
.messenger input {
  flex: 1; min-width: 0; font: 16px var(--f-ui); padding: 9px 10px; border: 1px solid #8a6a36; border-radius: 4px;
  background: linear-gradient(180deg, #efdcae, #f7ead0); box-shadow: inset 0 2px 6px rgba(80,50,10,.3);
}
.messenger button, .carve button {
  font: 18px var(--f-cap); color: #fff6e0; cursor: pointer; padding: 9px 16px; border-radius: 6px;
  border: 1px solid #1b1530;
  background: linear-gradient(180deg, #8a6bf0, #6b3fd6 50%, #3d2490);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 3px 0 #1b1530;
}
.messenger button:active, .carve button:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 1px 0 #1b1530; }
.carve button { width: 100%; }
.carve .t-hint { margin-top: 6px; }

.colophon { margin-top: 26px; text-align: center; color: #c9b98f; font-size: 15px; font-style: italic; }
.colophon a { color: var(--mint); }

@media (max-width: 640px) {
  body { font-size: 17px; }
  .wrap { padding-top: 470px; }
  .sky { height: 680px; }
  .lintel-stone { padding: 14px 22px; }
  .roller { margin: 0 -10px; }
  .roller::before { left: -12px; } .roller::after { right: -12px; }
  .tablet { grid-template-columns: 1fr; }
  .numeral { grid-row: auto; width: 34px; height: 34px; font-size: 18px; margin-bottom: 4px; }
  .tablet textarea { grid-column: 1; }
  .margin-note { margin-left: 0; }
  .deeds { grid-template-columns: 1fr; }
}
