/* nasiha — минималистичная типографика для длинного чтения.
   Моноширинный шрифт только в интерфейсе и заголовках; тело текста — антиква,
   потому что читать длинные абзацы моноширинным тяжело. */

/* Шрифты свои, не с CDN: ноль внешних запросов из браузера и никакого
   мигания текста. Файлы — подмножества Google Fonts, у которых сужены оси
   переменных шрифтов до тех весов, что реально используются (400/500 у моно,
   400/600 у антиквы). Подмножества разделены по unicode-range, поэтому
   русская страница не тянет латиницу целиком, а арабский Amiri грузится
   только там, где есть текст дуа. */

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/static/fonts/jetbrains-mono-latin.3b487a8ff313.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;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/static/fonts/jetbrains-mono-latin-ext.ec3fc83ba1f7.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/static/fonts/jetbrains-mono-cyrillic.77a92fb6760d.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/static/fonts/jetbrains-mono-cyrillic-ext.deb453ce31e4.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: "Source Serif 4";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/static/fonts/source-serif-latin.17fb4582b136.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;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/static/fonts/source-serif-latin-ext.8578249f59d8.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/static/fonts/source-serif-cyrillic.efcbfb01c891.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/static/fonts/source-serif-cyrillic-ext.989126754ee0.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: "Amiri";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/amiri-arabic.9abf8a10b4a2.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

:root {
  --bg:       #faf9f7;
  --surface:  #f2f0eb;
  --text:     #1a1a18;
  --muted:    #76736c;
  --line:     #e4e0d8;
  --accent:   #6f6448;
  --shadow:   0 1px 2px rgba(20, 18, 14, .04);

  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --serif: "Source Serif 4", Charter, Georgia, "Noto Serif", serif;
  --arabic: "Amiri", "Scheherazade New", "Noto Naskh Arabic", "Geeza Pro", serif;

  --measure: 34rem;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:      #0d0d0e;
    --surface: #151518;
    --text:    #e9e7e2;
    --muted:   #8d8a82;
    --line:    #24242a;
    --accent:  #bcab7d;
    --shadow:  none;
  }
}

[data-theme="dark"] {
  --bg:      #0d0d0e;
  --surface: #151518;
  --text:    #e9e7e2;
  --muted:   #8d8a82;
  --line:    #24242a;
  --accent:  #bcab7d;
  --shadow:  none;
}

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.75;
  transition: background-color .25s ease, color .25s ease;
}

::selection { background: var(--accent); color: var(--bg); }

a { color: inherit; }

/* Тонкая полоса прогресса чтения — единственная «живая» деталь на странице. */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 50;
  transition: width .1s linear;
}

/* ---------- шапка ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  text-decoration: none;
}

.brand-name {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -.02em;
}

.brand-tag {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 560px) { .brand-tag { display: none; } }

.controls { display: flex; align-items: center; gap: 1.25rem; }

.langs { display: flex; gap: .1rem; }

.lang {
  font-family: var(--mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  text-decoration: none;
  padding: .25rem .45rem;
  border-radius: 5px;
  transition: color .15s ease, background-color .15s ease;
}

.lang:hover { color: var(--text); background: var(--surface); }
.lang.is-active { color: var(--text); background: var(--surface); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  text-decoration: none;
  transition: border-color .15s ease;
}

.theme-toggle:hover { border-color: var(--muted); }

.theme-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--text);
  /* полумесяц: круг с вырезом, вырез исчезает в тёмной теме */
  box-shadow: inset -3px 0 0 0 var(--bg);
  transition: box-shadow .2s ease;
}

[data-theme="dark"] .theme-dot { box-shadow: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-dot { box-shadow: none; }
}

/* ---------- сетка ---------- */

.layout {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem) 6rem;
}

@media (min-width: 62rem) {
  .layout {
    grid-template-columns: 13rem minmax(0, var(--measure));
    gap: 5rem;
    justify-content: center;
  }
}

/* ---------- оглавление ---------- */

.toc { display: none; }

@media (min-width: 62rem) {
  .toc {
    display: block;
    position: sticky;
    top: 7rem;
    align-self: start;
    padding-top: 5rem;
  }
}

.toc-title,
.toc-updated {
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}

.toc-updated { margin: 2rem 0 0; }

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}

.toc-list li { counter-increment: toc; margin-bottom: .55rem; }

.toc-list a {
  display: block;
  font-family: var(--mono);
  font-size: .78rem;
  line-height: 1.5;
  color: var(--muted);
  text-decoration: none;
  padding-left: 1.6rem;
  position: relative;
  transition: color .15s ease;
}

.toc-list a::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  font-size: .68rem;
  opacity: .5;
}

.toc-list a:hover { color: var(--text); }

.toc-list a.is-current {
  color: var(--text);
}

.toc-list a.is-current::before { opacity: 1; color: var(--accent); }

/* ---------- контент ---------- */

.content { padding-top: 5rem; min-width: 0; }

.section { margin-bottom: 7rem; }

.section-title {
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(2rem, 6vw, 2.9rem);
  line-height: 1.1;
  letter-spacing: -.04em;
  margin: 0 0 1.25rem;
}

.section-intro {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 3.5rem;
  max-width: 30rem;
}

.reminder {
  display: grid;
  grid-template-columns: 1fr;
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
}

@media (min-width: 40rem) {
  .reminder { grid-template-columns: 3rem minmax(0, 1fr); }
}

.reminder-num {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--muted);
  padding-top: .55rem;
  letter-spacing: .05em;
}

@media (max-width: 40rem) {
  .reminder-num { margin-bottom: .5rem; }
}

.reminder-body { min-width: 0; }

.reminder-title {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.12rem;
  line-height: 1.4;
  letter-spacing: -.02em;
  margin: 0 0 1.1rem;
  text-wrap: balance;
}

.reminder-body p {
  margin: 0 0 1.15rem;
  hyphens: auto;
}

.reminder-body p:last-child { margin-bottom: 0; }

.pending {
  display: inline-block;
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .15rem .6rem;
  margin-top: 1rem;
}

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

/* ---------- зикры ---------- */

.dhikr-block { margin-top: 4rem; }

.dhikr-heading {
  font-family: var(--mono);
  font-weight: 500;
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.dhikr {
  margin: 0 0 1rem;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dhikr-purpose {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
}

.dhikr-arabic {
  font-family: var(--arabic);
  font-size: 1.85rem;
  line-height: 2;
  margin: 0 0 1rem;
  text-align: right;
}

.dhikr-translit {
  font-family: var(--mono);
  font-size: .84rem;
  line-height: 1.6;
  margin: 0 0 .6rem;
}

.dhikr-meaning {
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.6;
}

/* ---------- подвал ---------- */

.footer {
  margin-top: 5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

.footer-note {
  font-size: .9rem;
  color: var(--muted);
  margin: 0 0 2rem;
  max-width: 30rem;
}

.footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.to-top {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}

.to-top:hover { color: var(--text); border-bottom-color: var(--muted); }

/* ---------- фокус ---------- */

a:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ---------- страница ошибки ---------- */

/* Отдельная простая страница: та же типографика, но без оглавления и без
   колонок — читать здесь нечего, надо только понять, что произошло. */
.error {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 9rem 1.5rem 6rem;
}

.error-code {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .12em;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.error-title {
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -.03em;
  margin: 0 0 1.25rem;
}

.error-text {
  color: var(--muted);
  margin: 0 0 2.5rem;
}

.error-home {
  font-family: var(--mono);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}
