/* tyday.ru — цианотипия звёздной карты */
:root {
  --ink: #163A70;      /* фон, синий отпечаток */
  --deep: #0D2651;     /* низ страницы */
  --paper: #ECF2FB;    /* основной текст */
  --mist: #A7BCDC;     /* вторичный текст */
  --star: #F3D98A;     /* акцент: знаки, активная вкладка */
  --line: rgba(236, 242, 251, .24);

  --serif: "Literata", Georgia, "Times New Roman", serif;
  --display: "Forum", "Literata", Georgia, serif;
  --symbols: "Noto Sans Symbols", "Segoe UI Symbol", "Apple Symbols", serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background-color: var(--deep); }

body {
  margin: 0;
  min-height: 100vh;
  font: 17px/1.65 var(--serif);
  color: var(--paper);
  background-color: var(--ink);
  /* редкие звёзды поверх синего, плюс затемнение книзу */
  background-image:
    radial-gradient(1px 1px at 24px 38px, rgba(236,242,251,.75), transparent 60%),
    radial-gradient(1px 1px at 142px 96px, rgba(236,242,251,.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 88px 170px, rgba(243,217,138,.7), transparent 60%),
    radial-gradient(1px 1px at 196px 22px, rgba(236,242,251,.45), transparent 60%),
    radial-gradient(1px 1px at 58px 118px, rgba(236,242,251,.35), transparent 60%),
    linear-gradient(180deg, var(--ink) 0%, var(--deep) 100%);
  background-size: 220px 220px, 220px 220px, 220px 220px, 220px 220px, 220px 220px, 100% 100%;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
}
.narrow { max-width: 700px; }

:focus-visible {
  outline: 2px solid var(--star);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- шапка ---------- */
.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 26px;
  padding-bottom: 8px;
}
.brand {
  font-family: var(--display);
  font-size: 46px;
  line-height: 1;
  letter-spacing: .01em;
  text-decoration: none;
}
.brand-small { font-size: 30px; }
.today {
  margin: 0;
  font-size: 15px;
  color: var(--mist);
  text-align: right;
}
.back {
  font-size: 15px;
  color: var(--mist);
  text-decoration: none;
  padding: 8px 0;
}
.back:hover { color: var(--paper); }

/* ---------- главная: знаки ---------- */
.lead {
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
  color: var(--mist);
  margin: 22px 0 26px;
}

.wheel {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px 8px;
}
.wheel a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  padding: 4px 0;
  -webkit-tap-highlight-color: transparent;
}

.glyph {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--symbols);
  font-size: 32px;
  line-height: 1;
  color: var(--star);
  transition: border-color .2s, background-color .2s, transform .2s;
}
/* внутреннее кольцо — как на круге зодиака */
.wheel .glyph { box-shadow: inset 0 0 0 5px transparent, inset 0 0 0 6px rgba(236,242,251,.1); }

.wheel a:hover .glyph,
.wheel a:focus-visible .glyph {
  border-color: var(--star);
  background-color: rgba(243, 217, 138, .08);
}
.wheel a:active .glyph { transform: scale(.94); }

.wheel .name {
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.2;
  margin-top: 10px;
}
.wheel .range {
  font-size: 12.5px;
  color: var(--mist);
  margin-top: 2px;
  white-space: nowrap;
}

/* ---------- страница знака ---------- */
.hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 22px 0 26px;
}
.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 42px;
  line-height: 1.05;
  margin: 0 0 6px;
}
.meta {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--mist);
}
.glyph-big {
  flex: none;
  width: 92px;
  height: 92px;
  font-size: 46px;
  border-color: var(--star);
}
.glyph-small {
  width: 38px;
  height: 38px;
  font-size: 18px;
}

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
  margin: 0 -18px;
  padding: 0 18px;
  scroll-padding: 0 18px;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: none;
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 12px 10px 11px;
  font: 15px/1.2 var(--serif);
  color: var(--mist);
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tab:hover { color: var(--paper); }
.tab[aria-selected="true"] {
  color: var(--paper);
  border-bottom-color: var(--star);
}
.tab-empty { opacity: .5; }

.panel { padding: 22px 0 6px; }
.panel:focus-visible { outline-offset: 6px; }
.panel p { margin: 0 0 1em; max-width: 64ch; }

.src {
  font-size: 14px;
  color: var(--mist);
  margin-top: 1.4em !important;
}
.src a { color: var(--star); text-underline-offset: 3px; }

.empty { color: var(--mist); }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 34px 0 10px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.pager-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 19px;
  text-decoration: none;
  padding: 4px 0;
}
.pager-link:hover .glyph { border-color: var(--star); }

/* ---------- сообщения и подвал ---------- */
.message h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 34px;
  margin: 30px 0 10px;
}
.message a { color: var(--star); }

.foot {
  margin-top: 56px;
  padding-bottom: 28px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--mist);
}
.foot p { margin: 0 0 4px; }

/* ---------- экраны пошире ---------- */
@media (min-width: 560px) {
  .wheel { grid-template-columns: repeat(4, 1fr); gap: 34px 12px; }
  .glyph { width: 84px; height: 84px; font-size: 38px; }
  .glyph-big { width: 108px; height: 108px; font-size: 54px; }
  .glyph-small { width: 40px; height: 40px; font-size: 19px; }
  .brand { font-size: 56px; }
  .brand-small { font-size: 32px; }
  .hero h1 { font-size: 52px; }
  .tab { padding-left: 14px; padding-right: 14px; }
}
@media (min-width: 960px) {
  .wheel { grid-template-columns: repeat(6, 1fr); }
  .lead { margin-top: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
