
@font-face {
  font-family: "Sofia Sans Condensed"; 
  font-weight: 300 800;
  font-display: block;
  src: url("/static/fonts/sofiasans-condensed.woff2") format("woff2");
}

:root {
  --paper: #e8ecf1;
  --ink: #17325c;
  --ink-soft: rgb(23 50 92 / 0.55);
  --ink-faint: rgb(23 50 92 / 0.22);
  --rose: #b4365a;
  --pad: clamp(16px, 3vw, 36px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b1626;
    --ink: #b3c6df;
    --ink-soft: rgb(179 198 223 / 0.6);
    --ink-faint: rgb(179 198 223 / 0.2);
    --rose: #e27a96;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  overflow-x: clip;
  background:
    repeating-linear-gradient(115deg, transparent 0 7px, var(--ink-faint) 7px 7.5px) fixed,
    var(--paper);
  background-blend-mode: normal;
  color: var(--ink);
  font: 500 15px/1.4 "Sofia Sans Condensed", "Arial Narrow", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before { 
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 46%, var(--paper) 0 38%, transparent 75%);
  opacity: 0.92;
  pointer-events: none;
}
h1, p, ol { margin: 0; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.seal-page {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1rem;
  min-height: 100svh;
  padding: var(--pad) var(--pad) calc(var(--pad) + 2rem);
}



.seal-wrap {
  position: relative;
  width: min(92vw, 80svh, 860px);
  aspect-ratio: 1;
  transition: width 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.is-solved .seal-wrap { width: min(80vw, 56svh, 640px); }
.seal {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  touch-action: none; 
  user-select: none;
  -webkit-user-select: none;
}

.band path { fill: none; stroke: var(--ink); stroke-width: 0.45; opacity: 0.7; }
.hair { fill: none; stroke: var(--ink); stroke-width: 0.8; }
.micro {
  fill: var(--ink);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.ring {
  
  transform-box: fill-box;
  transform-origin: 50% 50%;
  cursor: grab;
  outline: none;
}
.ring.turning { cursor: grabbing; }
.ring.settle { transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ring-band { fill: none; stroke: var(--paper); opacity: 0.55; }
.ring:hover .ring-band,
.ring.turning .ring-band { opacity: 0.85; }
.ring:focus-visible .ring-band { stroke: var(--rose); opacity: 0.18; }
.glyph { fill: var(--ink); font-weight: 700; letter-spacing: 0.02em; }
.tick { stroke: var(--ink-soft); stroke-width: 1; }

.index .window { fill: var(--rose); fill-opacity: 0.07; stroke: var(--rose); stroke-width: 2.2; }
.index .pointer { fill: var(--rose); }
.index { pointer-events: none; }

.med-face { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; }
.rosette { fill: none; stroke: var(--ink); stroke-width: 0.5; opacity: 0.75; }
.numeral {
  fill: var(--ink);
  font-size: 58px;
  font-weight: 300;
  letter-spacing: 0.14em;
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 10px;
}
.progress {
  fill: none;
  stroke: var(--rose);
  stroke-width: 5;
  stroke-dasharray: 918px;
  stroke-dashoffset: calc((1 - var(--p, 0)) * 918px);
}


.medallion {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 29.2%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s;
}
.medallion:focus-visible { outline: 2px solid var(--rose); outline-offset: 4px; }
.is-holding .medallion { transform: scale(0.97); }
.is-busy .medallion { cursor: progress; }
.no-js .medallion { display: none; }


.seal.refused { animation: refuse 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes refuse {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}


.is-solved .glyph,
.is-solved .numeral { transition: fill 1.2s; }
.is-solved .index .window { fill-opacity: 0.16; }
.is-solved .numeral { fill: var(--rose); }
.is-solved .ring { cursor: default; }



.status {
  min-height: 1.4em;
  color: var(--ink-soft);
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-align: center;
}

.verdict {
  list-style: none;
  padding: 0;
  text-align: center;
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem);
  letter-spacing: 0.05em;
}
.verdict li {
  opacity: 0;
  animation: line-in 0.9s ease forwards;
  animation-delay: calc(var(--i) * 0.9s + 0.3s);
}
.verdict li:first-child { color: var(--rose); font-weight: 700; }
@keyframes line-in { from { opacity: 0; translate: 0 4px; } to { opacity: 1; translate: 0 0; } }

.corners {
  position: fixed;
  left: var(--pad);
  right: var(--pad);
  bottom: calc(var(--pad) * 0.8);
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}



.loupe {
  position: fixed;
  left: 0;
  top: 0;
  width: 160px;
  aspect-ratio: 1;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 10px 30px -12px rgb(0 0 0 / 0.45);
  overflow: hidden;
  opacity: 0;
  scale: 0.85;
  transition: opacity 0.18s, scale 0.18s;
  pointer-events: none;
  z-index: 5;
}
.loupe.on { opacity: 1; scale: 1; }
.loupe svg { width: 100%; height: 100%; display: block; }
.loupe::after { 
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--rose), var(--rose)) center / 1px 14px no-repeat,
    linear-gradient(var(--rose), var(--rose)) center / 14px 1px no-repeat;
  opacity: 0.6;
}

.back {
  color: inherit;
  text-decoration: none;
  pointer-events: auto; 
}
.back:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 0.25em; }
.back:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }

.noscript { color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) {
  .seal .ring.settle { transition-duration: 0.2s; }
  .seal.refused { animation: none; }
  .verdict li { animation-duration: 0.01s; }
}
