@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/golos-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/golos-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/golos-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/golos-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;
}

:root {
  --ink: #1a2740;
  --muted: #5e6e7e;
  --line: #e3e8ee;
  --green: #62b84a;
  --green-dark: #4ea338;
  --good: #c6dfb6;
  --good-ink: #2f6b3c;
  --good-line: #8fbf7a;
  --good-swatch: #5fa85a;
  --neutral: #f2df9a;
  --neutral-ink: #7a5f00;
  --neutral-line: #d4b85a;
  --neutral-swatch: #d4b03a;
  --bad: #ecc0b8;
  --bad-ink: #8f3d36;
  --bad-line: #d18f86;
  --bad-swatch: #c9685d;
  --text: "Golos Text", "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  min-height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: #fff;
  font-family: var(--text);
  font-size: 1.05rem;
  line-height: 1.55;
}

main {
  flex: 1 0 auto;
}

.wrap {
  width: min(1080px, calc(100% - 2.4rem));
  margin: 0 auto;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid #eef1f4;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand-logo {
  flex: 0 0 auto;
  display: block;
  width: 1.79rem;
  height: 1.35rem;
}

.brand-text {
  display: inline-flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
  max-width: 100%;
}

.brand-name {
  width: max-content;
  max-width: 100%;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
}

.brand-tag {
  width: 0;
  min-width: 100%;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.25;
  text-transform: uppercase;
}

.nav-menu {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: #fff;
  cursor: pointer;
  color: var(--ink);
}

.nav-burger-lines {
  display: grid;
  gap: 0.28rem;
  width: 1.05rem;
}

.nav-burger-lines span {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.nav-toggle:checked + .nav-burger .nav-burger-lines span:nth-child(1) {
  transform: translateY(0.34rem) rotate(45deg);
}

.nav-toggle:checked + .nav-burger .nav-burger-lines span:nth-child(2) {
  opacity: 0;
}

.nav-toggle:checked + .nav-burger .nav-burger-lines span:nth-child(3) {
  transform: translateY(-0.34rem) rotate(-45deg);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topnav-link {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.topnav-link:hover,
.topnav-link.is-active {
  color: var(--ink);
}

.prose a.term {
  color: var(--ink);
  border-bottom: 1px dotted rgba(26, 39, 64, 0.45);
  text-decoration: none;
  cursor: help;
  position: relative;
}

.prose a.term:hover,
.prose a.term:focus-visible {
  color: var(--green-dark);
  border-bottom-color: var(--green-dark);
}

.prose a.term::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.55rem);
  transform: translateX(-50%);
  width: max-content;
  max-width: min(18rem, calc(100vw - 2rem));
  padding: 0.55rem 0.7rem;
  border-radius: 0.55rem;
  background: #1a2740;
  color: #f7f9fa;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.35;
  text-align: left;
  text-transform: none;
  white-space: normal;
  display: none;
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(26, 39, 64, 0.22);
}

.prose a.term:hover::after,
.prose a.term:focus-visible::after {
  display: block;
}

.header-back {
  color: inherit;
  text-decoration: none;
}

.header-back:hover {
  color: var(--green-dark);
}

.glossary-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
  margin: 0 0 1.6rem;
}

.glossary-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.45rem;
  border: 2px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  background: #fff;
}

.glossary-letter:hover {
  border-color: var(--green);
  color: var(--green-dark);
  background: #f3faf1;
}

.glossary-block + .glossary-block {
  margin-top: 1.5rem;
}

.glossary-heading {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.glossary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.glossary-item {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.glossary-item:hover {
  border-color: var(--green);
  background: #f3faf1;
}

.glossary-item-title {
  color: var(--ink);
  font-weight: 700;
}

.glossary-item-short {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.header {
  width: 100%;
  margin: 0;
  padding: 1.57rem 1.5rem 1.67rem;
  background: linear-gradient(180deg, #f7f9fa 0%, #d5dee6 100%);
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.header h1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin: 0 auto;
  max-width: 28rem;
  color: #1a2740;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-transform: uppercase;
}

.header-date {
  display: block;
}

.header-lead {
  display: block;
  max-width: 22rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
  text-transform: none;
}

.day-status {
  display: inline-block;
  margin: 1rem auto 0;
  padding: 0.55rem 1.15rem;
  border: 2px solid #c5ccd4;
  border-radius: 4px;
  background: #fff;
  color: #6a7684;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-transform: uppercase;
}

.day-status.is-today {
  border-color: var(--green);
  background: #f3faf1;
  color: var(--green-dark);
}

.day-status.is-past {
  border-color: #c5ccd4;
  background: #fff;
  color: #6a7684;
}

.day-status.is-future {
  border-color: #c5ccd4;
  background: #fff;
  color: #6a7684;
}

.header-text {
  max-width: 46rem;
  margin: 0.7rem auto 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.header-text.tone-waning { color: var(--good-ink); }
.header-text.tone-waxing { color: var(--neutral-ink); }
.header-text.tone-syzygy { color: var(--bad-ink); }

.header-note {
  margin: 1.2rem 0 0;
  color: var(--muted);
}

.btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.55rem 1.15rem;
  border: 2px solid var(--green);
  border-radius: 4px;
  background: #f3faf1;
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.btn:hover {
  border-color: var(--green-dark);
  color: var(--green-dark);
  background: #e8f6e3;
}

.section {
  padding: 3.2rem 0 4rem;
  text-align: center;
}

.month-nav {
  display: grid;
  grid-template-columns: 3rem 1fr 3rem;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.4rem;
}

.month-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.month-arrow svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.month-arrow:hover { border-color: var(--green); color: var(--green-dark); background: #f3faf1; }

.section h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.accent {
  display: block;
  width: 3.2rem;
  height: 3px;
  margin: 0.85rem auto 0;
  background: var(--green);
}

.section-lead {
  max-width: 46rem;
  margin: 1.2rem auto 2rem;
  color: var(--muted);
}

.wdays,
.board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  text-align: left;
}

.wday {
  padding: 0 0.2rem 0.35rem;
  color: #8b97a3;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cell {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 5.2rem;
  padding: 0.45rem 0.5rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
  text-decoration: none;
}

.cell .moonlet {
  width: 1.15rem;
  height: 1.15rem;
  align-self: flex-end;
  color: var(--ink);
}

.num {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}

.mon {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.tone-waning.cell { background-color: var(--good); border-color: var(--good-line); }
.tone-waxing.cell { background-color: var(--neutral); border-color: var(--neutral-line); }
.tone-syzygy.cell { background-color: var(--bad); border-color: var(--bad-line); }

.cell.is-outside,
.cell.is-outside.tone-waning,
.cell.is-outside.tone-waxing,
.cell.is-outside.tone-syzygy {
  background-color: #e4e8ed;
  border-color: #d5dbe2;
  color: #8b97a3;
}

.cell.is-outside .moonlet,
.cell.is-outside .num,
.cell.is-outside .mon { color: #8b97a3; }

.cell.is-empty,
.cell.is-locked {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0 6px,
    rgba(26, 39, 64, 0.18) 6px 7px
  );
}

.cell.is-past .num s {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(26, 39, 64, 0.65);
}

a.cell:hover { box-shadow: inset 0 0 0 2px var(--green); }

.cell.is-today {
  position: relative;
  z-index: 1;
  border-color: var(--ink);
  box-shadow:
    inset 0 0 0 3px var(--ink),
    0 0 0 3px rgba(98, 184, 74, 0.45);
}

.cell.is-today .num {
  color: var(--ink);
  font-size: 1.2rem;
}

.cell.is-blank {
  background: transparent;
  border-color: transparent;
  min-height: 0;
}

.today-tag {
  position: absolute;
  left: 0.35rem;
  bottom: 0.3rem;
  max-width: calc(100% - 0.7rem);
  padding: 0.12rem 0.35rem;
  border-radius: 3px;
  background: var(--ink);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
  box-sizing: border-box;
}

.today-tag-short { display: none; }

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem 1.4rem;
  max-width: 52rem;
  margin: 1.4rem auto 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: left;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 24rem;
  line-height: 1.35;
}

.swatch {
  flex: 0 0 auto;
  width: 0.95rem;
  height: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.swatch.tone-waning { background: var(--good-swatch); }
.swatch.tone-waxing { background: var(--neutral-swatch); }
.swatch.tone-syzygy { background: var(--bad-swatch); }

.swatch.is-empty {
  background:
    repeating-linear-gradient(
      -45deg,
      #eef1f4 0 4px,
      rgba(26, 39, 64, 0.2) 4px 5px
    );
}

.swatch.is-past {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dfe4ea;
  color: var(--ink);
  font-size: 0.55rem;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
}

.swatch.is-past s {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(26, 39, 64, 0.65);
}

.folio { text-align: left; }

.prose {
  max-width: 68ch;
  margin: 0 auto;
}

.prose p { margin: 0.95rem 0; }

.turn {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem 1rem;
  max-width: 68ch;
  margin: 2rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.turn-link {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.turn-prev { justify-content: flex-start; }
.turn-next { justify-content: flex-end; text-align: right; }

.turn-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.turn-arrow { flex: 0 0 auto; }

.turn-link:hover { color: var(--green-dark); }

.turn-link.is-quiet {
  color: var(--muted);
  font-weight: 500;
}

.site-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 1.4rem 0 2rem;
  border-top: 1px solid var(--line);
  background: #f7f9fa;
}

.site-footer-inner {
  text-align: center;
}

.footer-sky {
  max-width: 52rem;
  margin: 0 auto 0.85rem;
  color: #8b97a3;
  font-size: 0.78rem;
  line-height: 1.45;
}

.site-footer-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer-nav {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.site-footer-nav a {
  color: var(--ink);
  text-decoration: none;
}

.site-footer-nav a:hover { color: var(--green-dark); }

.about .prose { margin-top: 0; }

a:focus-visible,
.cell:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

@media (max-width: 720px) {
  .topbar-inner {
    min-height: 3.8rem;
    gap: 0.8rem;
  }
  .brand { gap: 0.5rem; }
  .brand-name { font-size: 0.72rem; }
  .brand-tag { font-size: 0.52rem; letter-spacing: 0.02em; }
  .brand-logo { width: 1.525rem; height: 1.15rem; }
  .nav-burger { display: inline-flex; }
  .topnav {
    display: none;
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    min-width: 11.5rem;
    padding: 0.55rem;
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    background: #fff;
    box-shadow: 0 10px 28px rgba(26, 39, 64, 0.12);
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    z-index: 40;
  }
  .nav-toggle:checked ~ .topnav { display: flex; }
  .topnav-link {
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    padding: 0.65rem 0.7rem;
    border-radius: 0.45rem;
  }
  .topnav-link:hover,
  .topnav-link.is-active {
    background: #f3faf1;
  }
  .header { padding: 1.45rem 1rem 1.5rem; }
  .header-lead { font-size: 0.84rem; }
  .month-arrow { width: 2.6rem; height: 2.6rem; }
  .cell { min-height: 4.15rem; padding: 0.28rem; }
  .num { font-size: 0.92rem; }
  .cell.is-today {
    box-shadow:
      inset 0 0 0 2px var(--ink),
      0 0 0 2px rgba(98, 184, 74, 0.45);
  }
  .cell.is-today .num { font-size: 1.05rem; }
  .today-tag {
    left: 0.2rem;
    bottom: 0.18rem;
    max-width: calc(100% - 0.4rem);
    font-size: 0.5rem;
    letter-spacing: 0.02em;
    padding: 0.08rem 0.2rem;
  }
  .today-tag-full { display: none; }
  .today-tag-short { display: inline; }
  .cell.is-today .moonlet {
    width: 0.78rem;
    height: 0.78rem;
  }
  .cell .moonlet { width: 0.95rem; height: 0.95rem; }
  .turn {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.5rem 0.75rem;
    width: 100%;
    max-width: 100%;
  }
  .turn-prev { justify-content: flex-start; text-align: left; }
  .turn-next { justify-content: flex-end; text-align: right; }
  .turn-link { font-size: 0.9rem; }
  .turn-label { overflow-wrap: normal; word-break: normal; }
}
