/* «Тээгэ» — сайт автора. Палитра с обложки: вечернее небо над заснеженными сопками. */
@font-face { font-family: "Lora"; src: url("fonts/Lora-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("fonts/Lora-Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Lora"; src: url("fonts/Lora-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --night: #2c3642;   /* небо на обложке */
  --dusk: #56606f;    /* сумерки */
  --glow: #e3b98a;    /* последний свет над горизонтом — только для покупки */
  --glow-deep: #c99a66;
  --snow: #f4f5f7;    /* фон страницы — снег на сопках */
  --frost: #dfe3ea;   /* дальние сопки, линии */
  --ink: #232b36;
  --muted: #5b6476;
  --ok: #3d6b55;
  --err: #a1402f;
  --radius: 6px;
  --measure: 36rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--snow); color: var(--ink);
  font: 400 1.0625rem/1.7 "Lora", Georgia, "Times New Roman", serif;
  font-kerning: normal; font-variant-numeric: oldstyle-nums proportional-nums;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--glow-deep); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: 68rem; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.narrow { max-width: calc(var(--measure) + 64px); }
.center { text-align: center; }
.muted { color: var(--muted); }

h1, h2, h3 { font-weight: 400; line-height: 1.2; margin: 0 0 .6em; letter-spacing: .01em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
h2 { font-size: clamp(1.55rem, 3.4vw, 2rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; max-width: var(--measure); }
strong { font-weight: 700; }

/* ---------- Верхняя строка ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 16px; color: var(--snow); background: var(--night);
}
@media (min-width: 720px) { .topbar { padding: 18px 32px; } }
.home .topbar { position: absolute; inset: 0 0 auto; background: transparent; z-index: 2; }
.brand { text-decoration: none; letter-spacing: .14em; font-size: .9rem; }
.topbar nav { display: flex; gap: 20px; font-size: .95rem; }
.topbar nav a { text-decoration: none; opacity: .82; }
.topbar nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 560px) { .topbar nav { display: none; } .home .topbar { display: none; } }

/* ---------- Первый экран: продолжение обложки ---------- */
.hero-sky {
  position: relative; color: var(--snow);
  background:
    radial-gradient(120% 60% at 70% 100%, rgba(227,185,138,.38), rgba(227,185,138,0) 60%),
    linear-gradient(180deg, var(--night) 0%, #3c4553 55%, var(--dusk) 100%);
  padding: 96px 0 150px;
}
@media (min-width: 900px) { .hero-sky { padding: 120px 0 190px; } }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.25fr .75fr; gap: 64px; } }
.hero-author { letter-spacing: .32em; font-size: .9rem; margin: 0 0 1.4rem; opacity: .9; }
.hero-title {
  font-size: clamp(4.2rem, 15vw, 9.5rem); line-height: .95; margin: 0;
  letter-spacing: .2em; margin-right: -.2em; font-weight: 400;
}
.hero-sub { font-style: italic; font-size: 1.15rem; margin: .9rem 0 2rem; opacity: .85; letter-spacing: .04em; }
.hero-lead { font-size: 1.15rem; line-height: 1.65; max-width: 30rem; opacity: .95; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }
.hero-cover { margin: 0; justify-self: center; width: min(300px, 70vw); }
.hero-cover img { border-radius: 3px; box-shadow: 0 30px 60px -20px rgba(10,14,22,.65), 0 0 0 1px rgba(255,255,255,.08); }
@media (max-width: 899px) { .hero-cover { order: -1; width: min(220px, 56vw); } }

.hills { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: clamp(70px, 11vw, 160px); }
.hill-far { fill: var(--frost); }
.hill-near { fill: var(--snow); }

/* Один раз при загрузке название проявляется, как свет на небе. */
@media (prefers-reduced-motion: no-preference) {
  .hero-title { animation: dawn 1.6s ease-out both; }
  @keyframes dawn { from { opacity: 0; letter-spacing: .32em; } to { opacity: 1; letter-spacing: .2em; } }
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-block; font: inherit; font-size: 1rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  padding: 14px 22px; border-radius: var(--radius); border: 1px solid transparent; text-align: center;
}
.btn-dawn { background: var(--glow); color: #2a2118; }
.btn-dawn:hover { background: #ecc69b; }
.btn-ghost { border-color: rgba(244,245,247,.55); color: var(--snow); }
.btn-ghost:hover { border-color: var(--snow); background: rgba(244,245,247,.08); }
.btn-ink { background: var(--ink); color: var(--snow); }
.btn-ink:hover { background: #313b48; }
.btn-wide { width: 100%; padding: 16px 22px; font-size: 1.05rem; }

/* ---------- Разделы ---------- */
.section { padding: 64px 0; }
@media (min-width: 900px) { .section { padding: 88px 0; } }
.epigraph {
  margin: 0 0 1.6em; padding: 0; font-style: italic; font-size: 1.3rem; line-height: 1.55; max-width: var(--measure);
}
.book-facts { color: var(--muted); }
.link { text-decoration: underline; text-decoration-color: var(--glow-deep); text-underline-offset: 4px; text-decoration-thickness: 2px; }
.link:hover { color: var(--night); }

.section-buy { background: #e9ecf1; }
.offers { display: grid; gap: 20px; margin: 2rem auto 0; max-width: 54rem; }
@media (min-width: 760px) { .offers { grid-template-columns: 1fr 1fr; gap: 28px; } }
.offer {
  background: var(--snow); border-radius: var(--radius); padding: 28px 24px;
  display: flex; flex-direction: column; border: 1px solid var(--frost);
}
.offer h3 { margin-bottom: .2em; }
.price { font-size: 2rem; margin: 0 0 .6em; font-variant-numeric: lining-nums; }
.price span { font-size: 1rem; color: var(--muted); }
.offer ul { list-style: none; padding: 0; margin: 0 0 1.6em; flex: 1; }
.offer li { padding: 8px 0 8px 22px; border-top: 1px solid var(--frost); position: relative; font-size: .98rem; line-height: 1.5; }
.offer li::before { content: ""; position: absolute; left: 2px; top: 1em; width: 8px; height: 8px; border-radius: 50%; background: var(--frost); }
.offer li.avail::before { background: var(--ok); }
.offer li.avail.pre::before { background: var(--glow-deep); }
.pay-note { text-align: center; margin: 1.6rem auto 0; color: var(--muted); font-size: .95rem; }

.author { display: grid; gap: 32px; align-items: start; }
@media (min-width: 800px) { .author { grid-template-columns: 300px 1fr; gap: 56px; } }
.author-photo { border-radius: var(--radius); width: 100%; max-width: 300px; aspect-ratio: 4 / 5; object-fit: cover; background: var(--frost); }

/* ---------- Формы и заказ ---------- */
.form-page { padding-top: 40px; }
.back { margin-bottom: 1.5rem; font-size: .95rem; }
.back a { color: var(--muted); }
.lead { font-size: 1.1rem; }
.notice { background: #fbf3e8; border-left: 3px solid var(--glow-deep); padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; }
.notice.ok { background: #edf4ef; border-color: var(--ok); }
.form { margin-top: 2rem; max-width: var(--measure); }
.field { margin: 0 0 1.4rem; border: 0; padding: 0; }
.field > label, .field legend { display: block; margin-bottom: 6px; font-weight: 700; font-size: .98rem; }
.opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input:not([type]), textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #c6ccd6; border-radius: var(--radius); padding: 12px 14px;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--glow-deep); outline-offset: 0; border-color: transparent; }
.hint { color: var(--muted); font-size: .92rem; margin: 6px 0 0; }
.error { color: var(--err); font-size: .95rem; margin: 6px 0 0; }
.has-error input, .has-error textarea, .has-error select { border-color: var(--err); }
.qty { display: flex; align-items: center; gap: 16px; }
.qty select { width: 6rem; }
.total { font-size: 1.15rem; font-variant-numeric: lining-nums; }
fieldset { min-width: 0; }
.methods { display: grid; gap: 8px; }
.field > label.method { font-weight: 400; margin: 0; }
.method { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: #fff; border: 1px solid #c6ccd6; border-radius: var(--radius); cursor: pointer; font-weight: 400; }
.method:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.method input { margin-top: .45em; accent-color: var(--ink); }
.method small { display: block; color: var(--muted); font-size: .9rem; }
.check label { font-weight: 400; display: flex; gap: 10px; align-items: flex-start; }
.check input { margin-top: .45em; accent-color: var(--ink); width: 18px; height: 18px; flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
[hidden] { display: none !important; }

.summary { display: grid; grid-template-columns: 1fr; margin: 1.5rem 0 2rem; max-width: var(--measure); }
.summary dt { color: var(--muted); font-size: .92rem; margin-top: 12px; }
.summary dd { margin: 0; padding-bottom: 12px; border-bottom: 1px solid var(--frost); }
@media (min-width: 600px) {
  .summary { grid-template-columns: 9rem 1fr; }
  .summary dt, .summary dd { padding: 12px 0; margin: 0; border-bottom: 1px solid var(--frost); }
}
.downloads { display: grid; gap: 12px; margin: 1.6rem 0; max-width: var(--measure); }
.dl { display: block; text-decoration: none; background: var(--ink); color: var(--snow); padding: 16px 20px; border-radius: var(--radius); }
.dl:hover { background: #313b48; }
.dl strong { display: block; font-size: 1.1rem; }
.dl span { font-size: .92rem; opacity: .8; }
.help { margin-top: 1.4rem; max-width: var(--measure); }
.help summary { cursor: pointer; color: var(--muted); }

/* ---------- Документы ---------- */
.doc h1 { margin-bottom: .3em; }
.doc h2 { font-size: 1.3rem; margin-top: 2em; }
.doc ul { max-width: var(--measure); padding-left: 1.2em; }

/* ---------- Кабинет ---------- */
.admin .stats { display: grid; gap: 8px 24px; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); margin: 1rem 0 2rem; }
.admin .stats p { margin: 0; }
.admin .stats strong { font-size: 1.3rem; }
.settings { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: end; padding: 20px; background: #e9ecf1; border-radius: var(--radius); margin-bottom: 2.5rem; }
.settings label, .order-actions label { display: flex; flex-direction: column; gap: 4px; font-size: .92rem; }
.settings input, .order-actions input { width: auto; padding: 8px 10px; }
.order-card { background: #fff; border: 1px solid var(--frost); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.order-card.is-pre { border-left: 4px solid var(--glow-deep); }
.order-card header h3 { margin: 0; font-size: 1.15rem; }
.order-card p { margin: .4em 0; max-width: none; }
.comment { font-style: italic; }
.tag { font-size: .8rem; background: #fbf3e8; padding: 2px 8px; border-radius: 99px; vertical-align: middle; }
.order-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; }
.order-actions form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.order-actions .btn, .settings .btn, .order-card .btn { padding: 9px 14px; font-size: .95rem; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; margin-bottom: 2rem; }
.table td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--frost); }
@media (max-width: 640px) { .table, .table tbody, .table tr, .table td { display: block; } .table tr { border-bottom: 1px solid var(--frost); padding: 6px 0; } .table td { border: 0; padding: 2px 0; } }

/* ---------- Подвал ---------- */
.footer { background: var(--night); color: #cfd5de; padding: 40px 0; font-size: .92rem; line-height: 1.6; }
.footer a { color: var(--snow); }
.footer-grid { display: grid; gap: 24px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.5fr 1fr; } }
.footer-name { color: var(--snow); font-size: 1rem; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 6px; }
