@font-face { font-family: "Golos Text"; src: url("./fonts/golos-cyrillic.woff2") format("woff2"); font-weight: 400 800; font-display: swap; unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; src: url("./fonts/golos-latin.woff2") format("woff2"); font-weight: 400 800; font-display: swap; 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+2074, U+20AC, U+2122, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Prata"; src: url("./fonts/prata-cyrillic.woff2") format("woff2"); font-display: swap; unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Prata"; src: url("./fonts/prata-latin.woff2") format("woff2"); font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+2212; }

:root {
  --paper: #eeece3;
  --blue: #354966;
  --blue-dark: #293a53;
  --ink: #2e3642;
  --muted: #56594f;
  --red: #95533e;
  --red-dark: #784332;
  --stroke: #bbb5a4;
  --serif: Prata, Georgia, serif;
  font: 16px/1.5 "Golos Text", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  color-scheme: light;
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
body, h1, h2, h3, p, figure { margin: 0; }
body {
  background: url("./art/paper-grain.svg") repeat,
              radial-gradient(ellipse at 12% 18%, #f8f5ec 0, transparent 52%),
              var(--paper);
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button, a, summary, input, select { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
::selection { color: #fff5df; background: var(--blue); }
.wrap { width: min(89%, 1440px); margin-inline: auto; }
header { border-bottom: 3px double var(--stroke); }
.mast, footer .wrap, .legend, figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.mast { min-height: 72px; }
.logo {
  display: inline-flex;
  align-items: baseline;
  gap: .32em;
  color: var(--blue);
  font: 400 30px/1 var(--serif);
  letter-spacing: -.025em;
}
.logo i { align-self: center; font: normal 1.18em/1 Georgia, serif; color: var(--red); }
.mast nav { display: flex; gap: clamp(14px, 3vw, 42px); color: var(--blue); font-size: .94rem; }
.mast a, footer a { text-underline-offset: 5px; }
.mast nav a:hover, footer a:hover { color: var(--red); text-decoration: underline; }
#reading-nav, #saved-map, #cancel-date { display: none; }
body:is([data-view="reading"], [data-view="edit"]) #entry-nav { display: none; }
body:is([data-view="reading"], [data-view="edit"]) #reading-nav { display: flex; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr);
  gap: clamp(2rem, 6vw, 7rem);
  align-items: center;
  padding-block: clamp(32px, 4vw, 72px);
}
.opening { padding-block: 12px; }
h1 {
  color: var(--blue);
  font: 400 clamp(64px, 7.65vw, 130px)/1.03 var(--serif);
  letter-spacing: -.027em;
}
h1 em {
  display: inline-block;
  color: var(--red);
  font: italic 1.23em/.85 Georgia, "Times New Roman", serif;
  letter-spacing: -.03em;
}
.lead {
  max-width: 26em;
  margin: 1.7rem 0 2.1rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.25vw, 1.22rem);
  line-height: 1.55;
}
label { display: block; margin-bottom: 8px; font-size: .9rem; font-weight: 550; }
#date-format { margin-left: .5rem; color: var(--muted); font-size: .74rem; font-weight: 400; }
.entry { display: flex; flex-wrap: wrap; gap: 8px; }
.entry input, .entry button[type="submit"] { min-height: 52px; border-radius: 2px; padding: 12px 16px; }
.entry input {
  width: 10rem;
  color: var(--ink);
  background: #f9f6ee;
  border: 1px solid #96958a;
  font-variant-numeric: tabular-nums;
}
.entry input::placeholder { color: #686b63; }
.entry input[aria-invalid="true"] { border-color: var(--red-dark); }
.entry button[type="submit"] {
  padding-inline: 1.35rem;
  border: 1px solid var(--red-dark);
  color: #fff8ea;
  background: var(--red);
  box-shadow: inset 0 0 0 2px var(--red), inset 0 0 0 3px #efcbb285;
  font-weight: 550;
}
.entry button[type="submit"]:hover { background: var(--red-dark); }
#status { margin-top: 8px; color: var(--red-dark); font-size: .9rem; }
#status:empty { margin: 0; }
.text-action {
  width: fit-content;
  padding: .4rem 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: #a8acae;
  text-underline-offset: .22em;
}
.text-action:hover { color: var(--red-dark); text-decoration-color: currentColor; }
body[data-view="reading"] #calculator,
body:is([data-view="reading"], [data-view="edit"]) .lead { display: none; }
body[data-view="reading"] #saved-map { display: grid; gap: 1.4rem; margin-top: 1.8rem; }
.saved-summary p { color: var(--muted); }
#saved-date {
  display: inline-block;
  color: var(--red-dark);
  font: italic 1.45em/1.2 Georgia, serif;
  letter-spacing: 0;
  font-variant-numeric: lining-nums tabular-nums;
}
.saved-summary .text-action, .saved-actions .text-action, #cancel-date { font-size: .88rem; }
.saved-actions {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  align-items: center;
  gap: .35rem clamp(.75rem, 1.5vw, 1.5rem);
}
.reading-jump, .reset-confirm {
  padding: .66rem 1.05rem;
  border: 1px solid var(--blue-dark);
  border-radius: 2px;
  background: var(--blue);
  color: #fff8e9;
  text-align: center;
  font-weight: 550;
}
.reading-jump:hover, .reset-confirm:hover { background: var(--blue-dark); }
.reading-jump span { margin-left: .4rem; }
#share-note, #share-status { grid-column: 1 / -1; color: var(--muted); font-size: .78rem; }
#share-status:empty { display: none; }
#share-status input { max-width: 100%; width: 100%; background: #f8f5ec; border: 1px solid var(--stroke); padding: .4rem; }
body[data-view="edit"] #calculator { margin-top: 1.8rem; }
body[data-view="edit"] #cancel-date { display: inline-block; margin-inline: .3em; }

.plate {
  --plate-ink: var(--blue);
  --plate-rule: #b8ab90;
  position: relative;
  isolation: isolate;
  min-width: 0;
  padding: clamp(12px, 1.4vw, 20px) clamp(14px, 1.8vw, 26px);
  overflow: hidden;
  color: var(--plate-ink);
  background-color: #f4e9d3;
  border: 1px solid var(--plate-rule);
  box-shadow: inset 0 0 0 4px #f4ebd9, inset 0 0 0 5px #ada08b83, 0 7px 20px -15px #4c4943;
}
.plate figcaption, .legend {
  position: relative;
  z-index: 1;
  gap: .65rem;
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}
.plate figcaption { padding-bottom: 8px; border-bottom: 1px solid var(--plate-rule); }
.plate figcaption strong { font-weight: 550; }
.plate-hint { margin-block: .1rem .35rem; text-align: center; color: var(--muted); font-size: .8rem; }
.diagram { position: relative; width: min(100%, 540px); aspect-ratio: 1; margin: 6px auto; }
#nodes { position: absolute; inset: 0; pointer-events: none; }
.node { pointer-events: auto; }
.legend { flex-wrap: wrap; border-top: 1px solid var(--plate-rule); padding-top: 6px; }
.legend button {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: inherit;
  text-decoration: underline;
  text-decoration-color: #99a0a8;
  text-underline-offset: 3px;
}
.legend button:hover { text-decoration-color: currentColor; }

.atlas {
  border-block: 3px double var(--stroke);
  background: #e5e5da url("./art/paper-grain.svg") repeat;
  padding-block: clamp(30px, 3.75vw, 62px);
}
h2 { color: var(--blue); font: 400 clamp(30px, 3.25vw, 52px)/1.22 var(--serif); letter-spacing: -.025em; }
small { color: var(--muted); font-size: .875rem; }
.symbols {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 22px;
  border: 1px solid var(--stroke);
}
.choice {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: clamp(8px, .9vw, 14px);
  padding: clamp(10px, 1.3vw, 20px);
  border: 0;
  background: #f3f0e5;
  color: var(--ink);
  text-align: left;
}
.choice + .choice { border-inline-start: 1px solid var(--stroke); }
.choice:hover { background: #e2e4dc; }
.choice[aria-pressed="true"] { color: #fff7e7; background: var(--blue); }
.choice > span { min-width: 0; font-weight: 560; line-height: 1.3; }
.choice small { display: block; margin-top: 2px; color: inherit; font-size: .83rem; font-weight: 400; }
.choice .choice-medallion {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 2.55rem;
  height: 2.55rem;
  color: var(--red-dark);
  background: #f1e3c9;
  border: 3px double var(--red);
  border-radius: 50%;
  font: normal 1.4rem/1 Georgia, serif;
  font-variant-numeric: lining-nums;
  box-shadow: inset 0 0 0 2px #f1e3c9, inset 0 0 0 3px #b89474;
}
.choice[aria-pressed="true"] .choice-medallion {
  color: #f9e5ba;
  border-color: #dfcdaa;
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--blue), inset 0 0 0 3px #bfa47f;
}
#interpretation[hidden] { display: none; }

footer { border-top: 3px double var(--stroke); color: var(--blue); }
footer .wrap { min-height: 74px; }
footer .logo { font-size: 23px; }
footer a, .footer-actions button { font-size: .9rem; }
.footer-actions, .reset-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem 1.3rem; }
#reset-dialog {
  box-sizing: border-box;
  width: min(28rem, calc(100% - 2rem));
  padding: clamp(1.3rem, 3vw, 2rem);
  border: 3px double #a69b87;
  background: var(--paper) url("./art/paper-grain.svg");
  color: var(--ink);
}
#reset-dialog::backdrop { background: #252c38a6; }
#reset-dialog h2 { font-size: clamp(1.65rem, 3vw, 2.25rem); }
#reset-dialog p { margin: .85rem 0 1.2rem; color: var(--muted); }
.reset-actions { justify-content: flex-end; }

@media (max-width: 1000px) {
  .wrap { width: 92%; }
  .hero { gap: 24px; }
  .saved-actions { grid-template-columns: 1fr; justify-items: start; }
  .plate { padding: 13px; }
  .lead { margin: 1rem 0 1.4rem; }
  .choice { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 680px) {
  .mast { min-height: 60px; }
  .logo { font-size: 24px; }
  .mast nav { gap: 14px; font-size: .85rem; }
  body:is([data-view="reading"],[data-view="edit"]) .mast { flex-wrap: wrap; justify-content: flex-start; gap: 0; padding-block: .55rem .2rem; }
  #reading-nav { flex-basis: 100%; flex-wrap: wrap; column-gap: 1.1rem; }
  #reading-nav a { padding-block: .55rem; }
  body[data-view="reading"] #saved-map { margin-top: 1rem; gap: .65rem; }
  .saved-actions { gap: .2rem .8rem; }
  .hero { grid-template-columns: minmax(0, 1fr); padding-block: 28px; gap: 24px; }
  .opening { padding: 0; }
  h1 { font-size: clamp(46px, 11.9vw, 79px); }
  h1 br { display: none; }
  h1 em { margin-inline-start: .13em; font-size: 1.06em; }
  .symbols { grid-template-columns: repeat(2, minmax(0, 1fr)); border: 0; gap: 5px; margin-top: 16px; }
  .choice, .choice + .choice {
    border: 1px solid var(--stroke);
    flex-direction: row;
    align-items: center;
    padding: 9px;
  }
  .choice .choice-medallion { width: 2.1rem; height: 2.1rem; font-size: 1.13rem; }
  .choice:last-child { grid-column: 1 / -1; }
  .entry input { min-width: 7.65rem; flex: 1; padding: 8px; }
  .entry button[type="submit"] { padding-inline: 12px; }
  .footer-actions { justify-content: flex-end; gap: 0 1rem; }
}
@media (max-width: 360px) {
  .mast { gap: 8px; }
  .mast nav { gap: 8px; font-size: .78rem; }
  .choice { gap: 6px; font-size: .89rem; }
  .choice small { font-size: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
}
