/* Публічні сторінки (головна, стандарти, блог, про нас) і спільні шапка й підвал сайту й застосунку.
   Стиль: великий щільний гротеск (Onest), кремовий фон із м'якими градієнтами, світлі контури, круглі кнопки,
   один акцент — Soft Blue. */
.site { padding: 0 0 88px; }
.site > section, .site > article { padding-top: 72px; }
.site h1 { font-size: var(--t-xxl); line-height: 1.04; letter-spacing: -0.035em; font-weight: 800; max-width: 18ch; }
.site h2 { font-size: var(--t-xl); line-height: 1.15; letter-spacing: -0.03em; margin-bottom: 24px; max-width: 30ch; }
.site h3 { font-size: var(--t-l); line-height: 1.3; letter-spacing: -0.015em; font-weight: 700; }
.site p { font-size: var(--t-m); line-height: 1.65; color: var(--graphite); }
.site .lead { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.6; color: var(--pencil); max-width: 58ch; margin: 22px 0 34px; }
.btn.xl { font-size: var(--t-l); padding: 18px 36px; font-weight: 700; letter-spacing: -0.01em; }
.site .row { gap: 12px; }

/* Перший екран: кремовий градієнт із туманом Ash Mist */
.site > .hero-s { padding: 96px 0 104px; background: var(--grad-hero); border-bottom: 1px solid var(--grid); }
.hero-s h1 { background: linear-gradient(100deg, var(--graphite) 0%, var(--graphite) 55%, var(--ink-deep) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
@supports not (background-clip: text) { .hero-s h1 { color: var(--graphite); } }

/* Як працює: п'ять кроків рядками на всю ширину — номер, назва, опис; номери з'єднані лінією.
   Широкий опис читається в 1–2 рядки, без «сходинок» з одного-двох слів, як у вузьких колонках. */
.how-steps { list-style: none; margin: 0; padding: 0; position: relative; display: flex; flex-direction: column; gap: 12px; }
.how-steps::before { content: ""; position: absolute; left: 47px; top: 34px; bottom: 34px; width: 2px; background: linear-gradient(180deg, var(--ink), var(--mist) 60%, transparent); opacity: .35; }
.how-steps li { position: relative; display: grid; grid-template-columns: 52px clamp(190px, 24vw, 300px) minmax(0, 1fr); gap: 4px clamp(16px, 2vw, 28px); align-items: center; background: var(--grad-card); border: 1px solid var(--grid); border-radius: var(--r); padding: 20px 28px 20px 22px; box-shadow: var(--shadow); }
.how-steps .n { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-pill); background: var(--grad-accent); color: #fff; font-weight: 700; font-size: var(--t-s); letter-spacing: 0; position: relative; z-index: 1; }
.how-steps h3 { font-size: var(--t-l); }
.how-steps p { color: var(--pencil); font-size: var(--t-m); line-height: 1.6; max-width: 64ch; }
@media (max-width: 820px) {
  .how-steps::before { left: 41px; }
  .how-steps::before { display: none; }
  .how-steps li { grid-template-columns: 40px minmax(0, 1fr); gap: 12px 14px; padding: 18px; align-items: center; }
  .how-steps .n { width: 40px; height: 40px; }
  .how-steps p { grid-column: 1 / -1; font-size: 16px; }
}

/* Комп'ютер із мишею: п'ять кроків в одну лінію — номер на лінії, під ним жирна назва; опис — у віконці
   при наведенні або фокусі з клавіатури (Tab). Опис весь час є в HTML, тож його бачать пошуковики.
   На телефоні й планшеті (без наведення) лишається список із відкритими описами — вище. */
@media (hover: hover) and (min-width: 960px) {
  .how { position: relative; z-index: 2; padding-bottom: 24px; }
  .how-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding-bottom: 8px; }
  .how-steps::before { left: 10%; right: 10%; top: 27px; bottom: auto; width: auto; height: 2px; background: linear-gradient(90deg, var(--ink), var(--mist) 70%, var(--grid-strong)); opacity: .5; }
  .how-steps li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; background: none; border: 0; box-shadow: none; border-radius: var(--r); padding: 0 12px 6px; cursor: default; }
  .how-steps li:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }
  .how-steps .n { width: 56px; height: 56px; font-size: var(--t-m); box-shadow: 0 0 0 8px var(--notebook), 0 8px 20px -10px rgba(78, 97, 105, .7); transition: transform .2s; }
  .how-steps h3 { font-size: var(--t-l); line-height: 1.3; max-width: 15ch; padding-bottom: 6px; border-bottom: 1px dashed transparent; transition: border-color .2s, color .2s; }
  .how-steps li:hover .n, .how-steps li:focus .n { transform: scale(1.08); }
  .how-steps li:hover h3, .how-steps li:focus h3 { color: var(--ink-deep); border-bottom-color: var(--mist); }
  .how-steps p { position: absolute; top: calc(100% + 6px); left: 50%; width: 340px; max-width: none; text-wrap: wrap; transform: translate(-50%, 8px); text-align: left;
    background: var(--paper); border: 1px solid var(--grid); border-radius: var(--r); padding: 16px 18px; color: var(--graphite); font-size: 16px; line-height: 1.6;
    box-shadow: 0 18px 40px -18px rgba(78, 97, 105, .45), 0 2px 6px rgba(42, 39, 36, .05); opacity: 0; visibility: hidden; transition: opacity .18s, transform .18s, visibility .18s; z-index: 5; pointer-events: none; }
  .how-steps p::before { content: ""; position: absolute; top: -7px; left: calc(50% - 7px); width: 12px; height: 12px; background: var(--paper); border-left: 1px solid var(--grid); border-top: 1px solid var(--grid); transform: rotate(45deg); }
  .how-steps li:first-child p { left: 0; transform: translate(0, 8px); } .how-steps li:first-child p::before { left: 40px; }
  .how-steps li:last-child p { left: auto; right: 0; transform: translate(0, 8px); } .how-steps li:last-child p::before { left: auto; right: 40px; }
  .how-steps li:hover p, .how-steps li:focus p, .how-steps li:focus-within p { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
  .how-steps li:first-child:hover p, .how-steps li:first-child:focus p, .how-steps li:last-child:hover p, .how-steps li:last-child:focus p { transform: none; }
}

/* Панелі: тестовий режим і заклик */
.panel { border-radius: calc(var(--r) + 10px); padding: clamp(28px, 5vw, 56px); border: 1px solid var(--grid); }
.free .panel { background: linear-gradient(135deg, #FFFDF9 0%, #F4EEE6 55%, #E8EDEE 100%); }
.free .panel p { max-width: 64ch; margin-bottom: 26px; }
.end .panel { text-align: center; background: radial-gradient(700px 260px at 50% 0%, rgba(137, 152, 155, .24), transparent 70%), linear-gradient(180deg, #FFFDF9, #F4EEE6); }
.end h2 { margin: 0 auto 28px; }

/* Часті запитання — відповіді відкриті (читаються й індексуються) */
.qa-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.qa { background: var(--paper); border: 1px solid var(--grid); border-radius: var(--r); padding: 24px 26px; }
.qa h3 { font-size: var(--t-l); margin-bottom: 10px; }
.qa p { color: var(--graphite); }
@media (max-width: 820px) { .qa-list { grid-template-columns: minmax(0, 1fr); } }

/* Текстові сторінки */
.doc { max-width: 860px; }
.doc h1 { margin-bottom: 8px; }
.doc h2 { font-size: var(--t-l); margin: 32px 0 10px; letter-spacing: -0.02em; }
.doc p { margin-bottom: 12px; }
.doc section { padding: 22px 24px; margin-top: 14px; background: var(--paper); border: 1px solid var(--grid); border-radius: var(--r); }
.doc section h2 { margin-top: 0; }

.crumbs { padding-top: 22px; font-size: var(--t-xs); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; color: var(--pencil); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--pencil); }
.crumbs a { color: var(--pencil); }
.crumbs a:hover { color: var(--ink-deep); }

.cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 8px; }
.cats a { padding: 8px 16px; border: 1px solid var(--grid-strong); border-radius: var(--r-pill); background: var(--paper); text-decoration: none; font-size: var(--t-s); font-weight: 500; color: var(--graphite); }
.cats a:hover { border-color: var(--ink); color: var(--ink-deep); }
.posts { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.posts li { background: var(--paper); border: 1px solid var(--grid); border-radius: var(--r); padding: 22px 24px; box-shadow: var(--shadow); }
.posts h2 { font-size: var(--t-l); margin: 0 0 8px; }
.posts a { text-decoration: none; }

/* Підвал — спільний для сайту й застосунку */
.foot { border-top: 1px solid var(--grid); background: linear-gradient(180deg, var(--notebook), #F7F1E8); color: var(--pencil); font-size: var(--t-s); }
.foot .wrap { display: grid; grid-template-columns: 1fr auto; gap: 16px 24px; padding-top: 32px; padding-bottom: 32px; }
.foot-nav, .foot-contacts { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-contacts { justify-content: flex-end; }
.foot a { color: var(--graphite); text-decoration: none; font-weight: 500; }
.foot a:hover { color: var(--ink-deep); text-decoration: underline; }
.foot-note { grid-column: 1 / -1; font-size: var(--t-xs); color: var(--pencil); max-width: none; }
@media (max-width: 700px) { .foot .wrap { grid-template-columns: 1fr; } .foot-contacts { justify-content: flex-start; } }

/* Застосунок: рядок стану під шапкою */
.appbar { border-bottom: 1px solid var(--grid); }
.appbar .wrap { display: flex; justify-content: flex-end; gap: 16px; align-items: center; min-height: 36px; }

@media (max-width: 700px) {
  .site > section, .site > article { padding-top: 52px; }
  .site > .hero-s { padding: 56px 0 64px; }
  .btn.xl { width: 100%; }
  .panel { padding: 24px 20px; border-radius: calc(var(--r) + 4px); }
  .qa { padding: 20px; }
  .site .row .btn { flex: 1 1 auto; }
}

/* Перший екран: текст ліворуч, легкий аркуш курсової праворуч */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 56px; align-items: center; }
.hero-copy h1 { font-size: clamp(34px, 3.9vw, 54px); max-width: none; }
.hero-art { position: relative; justify-self: end; width: min(100%, 380px); aspect-ratio: 210 / 297; }
.sheet-back, .sheet-a4 { position: absolute; inset: 0; border-radius: 10px; }
.sheet-back { background: linear-gradient(160deg, #F4EEE6, #E8EDEE); border: 1px solid var(--grid); transform: rotate(5deg) translate(14px, 6px); }
.sheet-a4 { background: var(--paper); border: 1px solid var(--grid); box-shadow: 0 24px 60px -28px rgba(78, 97, 105, .45), 0 2px 6px rgba(42, 39, 36, .05); transform: rotate(-2deg); }
.sheet-field { position: absolute; left: 14.3%; right: 7.1%; top: 6.7%; bottom: 6.7%; border: 1px dashed var(--grid-strong); border-radius: 4px; padding: 9% 8%; display: flex; flex-direction: column; gap: 7px; }
.sheet-field i { display: block; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #ECE6DD, #EEF1F1); }
.sheet-h { font: 700 12px/1.35 "Times New Roman", Times, serif; text-align: center; letter-spacing: .02em; color: var(--graphite); margin-bottom: 10px; }
.site .sheet-cite { font: 400 13px/1.5 "Times New Roman", Times, serif; color: var(--graphite); margin: 6px 0; }
.sheet-cite b { font-weight: 400; color: var(--ink-deep); border-bottom: 1.5px solid var(--ink); }
.dim { position: absolute; font-size: 11px; color: var(--pencil); font-weight: 500; }
.dim.t { top: 1.6%; left: 50%; transform: translateX(-50%); } .dim.b { bottom: 1.6%; left: 50%; transform: translateX(-50%); }
.dim.l { left: 3.5%; top: 50%; } .dim.r { right: 1.6%; top: 32%; }
.sheet-badge { position: absolute; left: -26px; top: 41%; background: var(--grad-accent); color: #fff; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: var(--r-pill); box-shadow: 0 8px 20px -10px rgba(78, 97, 105, .7); transform: rotate(2deg); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .hero-art { display: none; } }

/* Без «висячих» рядків: рівні заголовки, абзаци без одиноких слів у кінці */
.site h1, .site h2, .site h3 { text-wrap: balance; }
.site p, .site li { text-wrap: pretty; }
.sheet-sub { font: 700 11px/1.3 "Times New Roman", Times, serif; color: var(--graphite); margin: 8px 0 2px 6%; }
