/* ==========================================================================
   ASTROHOT — dark celestial design system
   Палитра и стиль зафиксированы в .claude/design-system.md
   ========================================================================== */

/* --- ШРИФТЫ --------------------------------------------------------------- */

@font-face {
  font-family: 'Instrument Serif';
  src: url('/assets/fonts/instrument-serif-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Serif';
  src: url('/assets/fonts/instrument-serif-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* EB Garamond и Jost — вариативные: один файл на весь диапазон весов. */
@font-face {
  font-family: 'EB Garamond';
  src: url('/assets/fonts/eb-garamond.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Jost';
  src: url('/assets/fonts/jost.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --- ТОКЕНЫ --------------------------------------------------------------- */

:root {
  /* цвета из референса */
  --lavender: #b4a2fc;
  --night: #100821;
  --paper: #f4effe;
  --violet: #4a3e7c;

  /* производные — нужны для работы интерфейса */
  --night-soft: #1a0f35;
  --night-line: #2a1d4a;
  --lavender-dim: #8e7bd4;
  --paper-dim: #c9c0dc;
  --violet-deep: #2e2452;

  /* шрифты */
  --font-display: 'Instrument Serif', 'Bodoni Moda', Georgia, serif;
  --font-body: 'EB Garamond', 'Cormorant Garamond', Georgia, serif;
  --font-ui: 'Jost', 'Poppins', system-ui, -apple-system, sans-serif;

  /* типографическая шкала */
  --t-hero: clamp(3.5rem, 9vw, 8rem);
  --t-h1: clamp(2.5rem, 5vw, 4rem);
  --t-h2: clamp(1.875rem, 3vw, 2.5rem);
  --t-h3: 1.5rem;
  --t-body: 1.0625rem;
  --t-small: 0.875rem;
  --t-caption: 0.75rem;

  --lh-hero: 0.95;
  --lh-head: 1.1;
  --lh-body: 1.65;

  /* ритм */
  --sp-1: 0.5rem;
  --sp-2: 1rem;
  --sp-3: 1.5rem;
  --sp-4: 2rem;
  --sp-5: 3rem;
  --sp-6: 4.5rem;
  --sp-7: 7rem;

  /* формы */
  --r-card: 20px;
  --r-pill: 999px;
  --hair: 1px solid var(--night-line);

  --wrap: 1280px;
  --wrap-text: 68ch;
}

/* --- СБРОС ---------------------------------------------------------------- */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--night);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--lavender);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--paper);
}

button {
  font: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--lavender);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- ТИПОГРАФИКА ---------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-head);
  color: var(--lavender);
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--t-h1);
}

h2 {
  font-size: var(--t-h2);
}

h3 {
  font-size: var(--t-h3);
}

/* Курсивное выделение слова в заголовке — фирменный приём референса. */
h1 em,
h2 em,
h3 em,
.hero__title em {
  font-style: italic;
}

p + p {
  margin-top: var(--sp-2);
}

.lead {
  font-size: 1.25rem;
  color: var(--paper-dim);
}

.eyebrow {
  font-family: var(--font-ui);
  font-size: var(--t-caption);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lavender-dim);
}

.prose {
  max-width: var(--wrap-text);
}

.prose h2 {
  margin-top: var(--sp-5);
  margin-bottom: var(--sp-2);
}

.prose h3 {
  margin-top: var(--sp-4);
  margin-bottom: var(--sp-1);
}

.prose ul,
.prose ol {
  margin: var(--sp-2) 0;
  padding-left: 1.25em;
}

.prose li + li {
  margin-top: 0.35em;
}

/* --- РАСКЛАДКА ------------------------------------------------------------ */

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

.section {
  padding-block: var(--sp-6);
  border-top: var(--hair);
}

.section--flush {
  padding-block: 0;
}

/* Инверсная секция — акцент, 1–2 на страницу, не больше. */
.section--light {
  background: var(--lavender);
  color: var(--night);
  border-top: 0;
}

.section--light h1,
.section--light h2,
.section--light h3 {
  color: var(--night);
}

.section--light a {
  color: var(--night);
}

.section--violet {
  background: var(--violet-deep);
  border-top: 0;
}

.grid {
  display: grid;
  gap: var(--sp-4);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

/* Жёсткая сетка с hairline-разделителями, как на референсе:
   блоки стыкуются вплотную, разделены только линией. */
.split {
  display: grid;
  gap: 0;
  border-top: var(--hair);
}

.split > * {
  padding: var(--sp-4);
  border-bottom: var(--hair);
}

@media (min-width: 800px) {
  .split {
    grid-template-columns: repeat(var(--cols, 2), 1fr);
  }

  .split > * + * {
    border-left: var(--hair);
  }
}

/* --- ШАПКА ---------------------------------------------------------------- */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--night) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: var(--hair);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-block: var(--sp-2);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--lavender);
  text-decoration: none;
  white-space: nowrap;
}

.header__logo svg {
  width: 24px;
  height: 24px;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-ui);
  font-size: var(--t-small);
}

.nav__group {
  position: relative;
}

.nav__top {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-block: 0.5rem;
  color: var(--paper-dim);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.nav__top:hover,
.nav__top[aria-current='page'] {
  color: var(--lavender);
}

.nav__chev {
  opacity: 0.55;
  transition: transform 0.18s ease;
}

.nav__group:hover .nav__chev,
.nav__group:focus-within .nav__chev {
  transform: rotate(180deg);
}

/* Выпадающая панель. Открывается по hover и по focus — с клавиатуры тоже. */
.nav__panel {
  position: absolute;
  top: 100%;
  left: -1rem;
  min-width: 232px;
  padding: 0.5rem 0;
  background: var(--night-soft);
  border: var(--hair);
  border-radius: var(--r-card);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 60;
}

.nav__group:hover .nav__panel,
.nav__group:focus-within .nav__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav__panel a {
  display: block;
  padding: 0.5rem 1.1rem;
  color: var(--paper-dim);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav__panel a:hover,
.nav__panel a[aria-current='page'] {
  background: var(--violet-deep);
  color: var(--lavender);
}

.burger {
  display: none;
  background: none;
  border: 0;
  padding: 0.4rem;
  color: var(--lavender);
}

@media (max-width: 1100px) {
  .nav {
    position: fixed;
    inset: 61px 0 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--night);
    border-top: var(--hair);
    padding: var(--sp-2) 1.25rem var(--sp-6);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.25s ease;
  }

  .nav[data-open='true'] {
    transform: translateX(0);
  }

  /* На мобиле панели раскрыты — прятать их за вторым тапом незачем. */
  .nav__group {
    border-bottom: var(--hair);
    padding-block: 0.6rem;
  }

  .nav__top {
    font-size: 1.05rem;
    color: var(--lavender);
    font-family: var(--font-display);
  }

  .nav__chev {
    display: none;
  }

  .nav__panel {
    position: static;
    min-width: 0;
    padding: 0.25rem 0 0;
    background: none;
    border: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    columns: 2;
    column-gap: var(--sp-2);
  }

  .nav__panel a {
    padding: 0.4rem 0;
    font-size: 0.9rem;
  }

  .burger {
    display: block;
  }
}

/* --- HERO ----------------------------------------------------------------- */

.hero {
  position: relative;
  padding-block: var(--sp-6) var(--sp-5);
  overflow: hidden;
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--t-hero);
  line-height: var(--lh-hero);
  color: var(--lavender);
  letter-spacing: -0.02em;
  position: relative;
  z-index: 2;
}

/* Иллюстрация заходит за текст — приём с референса. */
.hero__art {
  position: absolute;
  right: 4%;
  top: 50%;
  translate: 0 -50%;
  width: min(42vw, 460px);
  z-index: 1;
  opacity: 0.9;
  pointer-events: none;
}

.hero__text {
  position: relative;
  z-index: 2;
  max-width: 46ch;
  margin-top: var(--sp-3);
  color: var(--paper-dim);
}

@media (max-width: 800px) {
  .hero__art {
    position: static;
    translate: none;
    width: 60%;
    margin: var(--sp-3) auto 0;
  }
}

/* --- АРКА: фирменная форма иллюстраций ------------------------------------ */

.arch {
  display: block;
  width: 100%;
  max-width: 200px;
  height: auto;
  color: var(--lavender);
}

.arch--sm {
  max-width: 120px;
}

/* --- КАРТОЧКИ ------------------------------------------------------------- */

.card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--night-soft);
  border: var(--hair);
  border-radius: var(--r-card);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

a.card:hover {
  border-color: var(--lavender-dim);
  transform: translateY(-2px);
}

.card__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--lavender);
}

.card__text {
  font-size: var(--t-small);
  color: var(--paper-dim);
  line-height: 1.55;
}

/* Карточка числа — плитка кластера angel numbers */
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: var(--sp-3) var(--sp-2);
  background: var(--night-soft);
  border: var(--hair);
  border-radius: var(--r-card);
  text-decoration: none;
  text-align: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.tile:hover {
  background: var(--violet-deep);
  border-color: var(--lavender-dim);
}

.tile__number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  line-height: 1;
  color: var(--lavender);
}

.tile__label {
  font-family: var(--font-ui);
  font-size: var(--t-caption);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-dim);
}

/* --- СТРОКИ ДАННЫХ -------------------------------------------------------- */

.data-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  justify-content: space-between;
  padding-block: 0.85rem;
  border-bottom: var(--hair);
}

.data-row__key {
  font-family: var(--font-ui);
  font-size: var(--t-small);
  color: var(--paper-dim);
}

.data-row__value {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--lavender);
}

/* --- ТАБЛИЦЫ -------------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: var(--t-small);
  text-align: left;
}

.table th,
.table td {
  padding: 0.85rem 1rem;
  border-bottom: var(--hair);
  vertical-align: top;
}

.table thead th {
  font-size: var(--t-caption);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lavender-dim);
  font-weight: 500;
  white-space: nowrap;
  border-bottom-color: var(--lavender-dim);
}

.table tbody th {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--lavender);
  white-space: nowrap;
}

.table tbody tr:hover {
  background: var(--night-soft);
}

.table a {
  text-decoration: none;
}

.table a:hover {
  text-decoration: underline;
}

.section--light .table thead th {
  color: var(--violet);
  border-bottom-color: var(--violet);
}

.section--light .table tbody th {
  color: var(--night);
}

@media (max-width: 640px) {
  .table th,
  .table td {
    padding: 0.7rem 0.6rem;
  }
}

/* --- КНОПКИ --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-ui);
  font-size: var(--t-small);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--lavender);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--lavender);
  transition: background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  background: var(--lavender);
  color: var(--night);
}

.btn--solid {
  background: var(--lavender);
  color: var(--night);
}

.btn--solid:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--night);
}

/* --- ФОРМА КАЛЬКУЛЯТОРА --------------------------------------------------- */

.calc {
  display: grid;
  gap: var(--sp-2);
  max-width: 420px;
}

.calc label {
  font-family: var(--font-ui);
  font-size: var(--t-small);
  color: var(--paper-dim);
}

.calc input,
.calc select {
  width: 100%;
  padding: 0.8rem 1rem;
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--paper);
  background: var(--night-soft);
  border: var(--hair);
  border-radius: var(--r-card);
}

.calc input:focus,
.calc select:focus {
  border-color: var(--lavender);
  outline: none;
}

.result {
  padding: var(--sp-4);
  background: var(--violet-deep);
  border-radius: var(--r-card);
  text-align: center;
}

.result__number {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 7rem);
  line-height: 1;
  color: var(--lavender);
}

/* --- ДИАГРАММА МАТРИЦЫ СУДЬБЫ --------------------------------------------- */

.matrix {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--night-line);
  border: var(--hair);
  max-width: 720px;
  margin-inline: auto;
}

.matrix__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: var(--sp-3) var(--sp-2);
  background: var(--night);
  text-decoration: none;
  text-align: center;
  transition: background 0.2s ease;
}

.matrix__cell:hover {
  background: var(--night-soft);
}

.matrix__cell--centre {
  background: var(--violet-deep);
}

.matrix__cell--centre:hover {
  background: var(--violet);
}

.matrix__num {
  font-family: var(--font-display);
  font-size: 2.25rem;
  line-height: 1;
  color: var(--lavender);
}

.matrix__label {
  font-family: var(--font-ui);
  font-size: var(--t-caption);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-dim);
}

.matrix__name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--paper);
}

@media (max-width: 560px) {
  .matrix__cell {
    padding: var(--sp-2) 0.4rem;
  }

  .matrix__num {
    font-size: 1.6rem;
  }

  .matrix__name {
    font-size: 0.8rem;
  }
}

/* --- ПОБУКВЕННАЯ РАСКЛАДКА (нумерология имени) ---------------------------- */

.letters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: flex-end;
}

.letters__gap {
  width: 1.25rem;
}

.letter {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 2.4rem;
  padding: 0.4rem 0.3rem;
  border: var(--hair);
  border-radius: 8px;
  background: var(--night-soft);
}

.letter--vowel {
  background: var(--violet-deep);
  border-color: var(--lavender-dim);
}

.letter__char {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--paper);
}

.letter__val {
  font-family: var(--font-ui);
  font-size: var(--t-caption);
  color: var(--lavender);
}

/* --- ХЛЕБНЫЕ КРОШКИ ------------------------------------------------------- */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-block: var(--sp-2);
  font-family: var(--font-ui);
  font-size: var(--t-caption);
  color: var(--paper-dim);
  list-style: none;
}

.crumbs a {
  color: var(--paper-dim);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--lavender);
}

.crumbs li + li::before {
  content: '·';
  margin-right: 0.5rem;
  color: var(--night-line);
}

/* --- FAQ ------------------------------------------------------------------ */

.faq details {
  border-bottom: var(--hair);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding-block: var(--sp-2);
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--lavender);
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  font-family: var(--font-ui);
  font-size: 1.5rem;
  color: var(--lavender-dim);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details > *:not(summary) {
  padding-bottom: var(--sp-3);
  color: var(--paper-dim);
  max-width: var(--wrap-text);
}

/* --- ТАБЫ ----------------------------------------------------------------- */

.tabs {
  display: flex;
  border-block: var(--hair);
  font-family: var(--font-ui);
  font-size: var(--t-small);
}

.tabs a {
  flex: 1;
  padding: var(--sp-2);
  text-align: center;
  text-decoration: none;
  color: var(--paper-dim);
  border-right: var(--hair);
}

.tabs a:last-child {
  border-right: 0;
}

.tabs a[aria-current='page'] {
  color: var(--lavender);
  background: var(--night-soft);
}

/* --- ПОДВАЛ --------------------------------------------------------------- */

.footer {
  margin-top: var(--sp-6);
  padding-block: var(--sp-5) var(--sp-4);
  border-top: var(--hair);
  font-family: var(--font-ui);
  font-size: var(--t-small);
}

.footer__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-4);
}

.footer h3 {
  font-family: var(--font-ui);
  font-size: var(--t-caption);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--lavender-dim);
  margin-bottom: var(--sp-2);
}

.footer ul {
  list-style: none;
  padding: 0;
}

.footer li + li {
  margin-top: 0.5rem;
}

.footer a {
  color: var(--paper-dim);
  text-decoration: none;
}

.footer a:hover {
  color: var(--lavender);
}

.footer__bottom {
  margin-top: var(--sp-5);
  padding-top: var(--sp-3);
  border-top: var(--hair);
  color: var(--paper-dim);
  font-size: var(--t-caption);
}

/* --- УТИЛИТЫ -------------------------------------------------------------- */

.stack > * + * {
  margin-top: var(--sp-3);
}

.center {
  text-align: center;
}

.muted {
  color: var(--paper-dim);
}

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