/* ==========================================================================
   christineteaches.ru — Swiss Grid
   Один файл стилей на весь сайт. Без сборки, без зависимостей.
   ========================================================================== */

/* --- Шрифты. Вариативный Inter, только кириллица и латиница -------------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/fonts/inter-latin.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;
}

/* --- Токены ------------------------------------------------------------- */
/* Корневой размер — единственная ручка масштаба сайта.
   16px = 100 %, 26,4px = 165 % (десктоп). Всё остальное задано в rem. */
:root {
  --ink: #111111;
  --accent: #e5432b;
  --paper: #ffffff;
  --text: #3d3d3d;
  --muted: #6b6b6b;
  --line: #e4e4e4;
  --line-strong: #111111;
  --wrap: 1188px;
  --pad: 1.35rem;
}

/* --- Сброс -------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

/* На телефоне 150 % превращают заголовок в 49 px — он не влезает в 390 px.
   Уменьшаем ручку масштаба, остальное подстраивается само. */
@media (max-width: 620px) {
  html {
    font-size: 118%;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

/* --- Каркас ------------------------------------------------------------- */
.site {
  max-width: var(--wrap);
  margin: 0 auto;
}

.shell {
  padding: 0 var(--pad);
}

.lab {
  display: inline-block;
  font-size: 0.56rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 0;
  top: 0;
  z-index: 10;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
}

/* --- Навигация ---------------------------------------------------------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem var(--pad);
  border-bottom: 1px solid var(--line-strong);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.62rem;
  letter-spacing: 0.17em;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.brand i {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  background: var(--accent);
  flex: none;
}

.nav ul {
  display: flex;
  gap: 1.1rem;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav ul a {
  text-decoration: none;
}

.nav ul a:hover {
  color: var(--ink);
}

.nav ul li.on a {
  color: var(--ink);
  font-weight: 700;
}

/* --- Hero --------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  border-bottom: 1px solid var(--line-strong);
}

.hero-copy {
  padding: 2.1rem 1.6rem 2.1rem var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line-strong);
  min-height: 350px;
}

.hero-eyebrow {
  margin-bottom: 1.7rem;
}

.hero-name {
  margin: 0;
  font-size: 2.62rem;
  line-height: 0.9;
  letter-spacing: -0.048em;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--ink);
}

.hero-lead {
  margin-top: 0.95rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #4a4a4a;
  max-width: 26ch;
}

.hero-cta {
  margin-top: 1.6rem;
}

.hero-photo {
  position: relative;
  overflow: hidden;
  background: #111;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
}

/* --- Кнопки ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.68rem 1rem;
  border: 1px solid var(--line-strong);
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  background: var(--ink);
  color: #fff;
}

.btn-fill {
  background: var(--ink);
  color: #fff;
}

.btn-fill:hover {
  background: #000;
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: #cf3a24;
  border-color: #cf3a24;
}

/* --- Секции ------------------------------------------------------------- */
.sec {
  padding: 1.7rem 0 1.8rem;
}

.sec--tight {
  padding-top: 0;
}

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 1.15rem;
}

.sec-head .no {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  flex: none;
}

.sec-head h2 {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  font-weight: 700;
}

/* --- Списки ------------------------------------------------------------- */
.jlist {
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
}

.jlist li {
  position: relative;
  padding-left: 1rem;
  font-size: 0.76rem;
  line-height: 1.62;
  color: var(--text);
  text-align: justify;
  hyphens: auto;
}

.jlist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.66em;
  width: 0.4rem;
  height: 1px;
  background: var(--ink);
}

.jlist b {
  font-weight: 600;
  color: var(--ink);
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
}

.col h3 {
  margin: 0 0 0.6rem;
  padding-bottom: 0.36rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.col ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.col li {
  position: relative;
  padding-left: 0.85rem;
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--text);
  text-align: justify;
  hyphens: auto;
}

.col li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 0.28rem;
  height: 0.28rem;
  background: var(--ink);
}

.col li b {
  font-weight: 600;
  color: var(--ink);
}

/* --- Стоимость ---------------------------------------------------------- */
.price {
  display: flex;
  flex-direction: column;
}

.prow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}

.prow .nm {
  font-size: 0.8rem;
  font-weight: 600;
}

.prow .nm small {
  display: block;
  margin-top: 0.16rem;
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}

.prow .pr {
  text-align: right;
}

.prow .val {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.prow .per {
  display: block;
  margin-top: 0.13rem;
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.prow--best {
  background: var(--ink);
  color: #fff;
  padding: 0.9rem;
  margin: 0.5rem 0;
  border: none;
  grid-template-columns: 1fr auto;
}

.prow--best .nm {
  font-size: 0.88rem;
}

.prow--best .nm small {
  color: rgba(255, 255, 255, 0.55);
}

.prow--best .val {
  font-size: 1.45rem;
  color: #fff;
}

.prow--best .per {
  color: var(--accent);
}

.note {
  margin-top: 0.85rem;
  padding-left: 0.8rem;
  border-left: 2px solid var(--accent);
  font-size: 0.66rem;
  line-height: 1.6;
  color: var(--muted);
  text-align: justify;
  hyphens: auto;
}

.note--plain {
  border-left-color: var(--ink);
}

/* --- FAQ ---------------------------------------------------------------- */
details {
  border-bottom: 1px solid var(--line);
}

summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.72rem 0;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

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

summary .pl {
  flex: none;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.86rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

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

details p {
  padding: 0 1.4rem 0.8rem 0;
  font-size: 0.72rem;
  line-height: 1.62;
  color: #4a4a4a;
  text-align: justify;
  hyphens: auto;
}

/* --- Полоса Homework ---------------------------------------------------- */
.hw {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
  padding: 1.5rem var(--pad);
  background: var(--ink);
  color: #fff;
}

.hw .lab {
  color: rgba(255, 255, 255, 0.55);
}

.hw h2 {
  margin: 0.25rem 0 0.3rem;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.hw p {
  max-width: 34ch;
  font-size: 0.7rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.68);
}

/* --- Контакты ----------------------------------------------------------- */
.contact {
  padding: 1.6rem var(--pad) 1.3rem;
}

.contact h2 {
  margin: 0 0 0.9rem;
  font-size: 1.55rem;
  line-height: 1.02;
  letter-spacing: -0.038em;
  font-weight: 800;
  text-transform: uppercase;
}

.contact h2 em {
  font-style: normal;
  color: var(--accent);
}

.contact p {
  max-width: 36ch;
  font-size: 0.76rem;
  line-height: 1.6;
  color: #4a4a4a;
  text-align: justify;
  hyphens: auto;
}

.links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-top: 1rem;
}

.link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.62rem 0.7rem;
  border: 1px solid var(--line-strong);
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.link span {
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.link:hover {
  background: var(--ink);
  color: #fff;
}

.link:hover span {
  color: rgba(255, 255, 255, 0.6);
}

/* --- Футер -------------------------------------------------------------- */
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.7rem var(--pad);
  border-top: 1px solid var(--line-strong);
  font-size: 0.53rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ==========================================================================
   Страница Homework
   ========================================================================== */
.hw-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.hw-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
  padding: 1.5rem var(--pad) 1.1rem;
  border-bottom: 1px solid var(--line-strong);
}

.hw-intro {
  min-width: 0;
}

.hw-title {
  margin: 0.35rem 0 0;
  font-size: 1.9rem;
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-weight: 800;
  text-transform: uppercase;
}

.hw-hint {
  max-width: 42ch;
  margin: 0.6rem 0 0;
  font-size: 0.7rem;
  line-height: 1.55;
  color: var(--muted);
}

.hw-tools {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* --- Обёртка встроенного Affine ----------------------------------------- */
/* Оформляем iframe как элемент сайта: тонкая рамка, панель сверху,
   подписи снизу. Так чужой интерфейс не выглядит вставленным наугад. */
.hw-wrap {
  padding: 0 var(--pad);
}

.hw-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-bottom: none;
  font-size: 0.55rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  font-weight: 600;
}

.hw-bar-l {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
}

.hw-bar-l i {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  background: var(--accent);
  flex: none;
}

.hw-bar-r {
  color: var(--muted);
}

.hw-frame {
  position: relative;
  min-height: 68vh;
  background: #fafafa;
  border: 1px solid var(--line-strong);
}

.hw-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.hw-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 2rem;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.hw-loading.is-hidden {
  opacity: 0;
}

.hw-loading .spinner {
  width: 1.4rem;
  height: 1.4rem;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.hw-loading p {
  max-width: 40ch;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--muted);
}

.hw-loading-t {
  font-size: 0.6rem !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink) !important;
  margin: 0;
}

/* Подписи под окном — как строка реквизитов в остальных блоках сайта */
.hw-note {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-top: none;
  font-size: 0.53rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hw-foot {
  padding: 0.7rem var(--pad);
  font-size: 0.53rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* --- Узкие экраны ------------------------------------------------------- */
@media (max-width: 620px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-photo {
    order: -1;
    height: 270px;
  }

  .hero-copy {
    border-right: none;
    min-height: 0;
    padding: 1.5rem var(--pad);
  }

  .hero-name {
    font-size: 2.4rem;
  }

  .hero-eyebrow {
    margin-bottom: 1.2rem;
  }

  .two,
  .links {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .nav ul {
    display: none;
  }

  /* По ширине на телефоне не выравниваем: короткие строки превращаются в дырки */
  .jlist li,
  .col li,
  .note,
  details p,
  .contact p {
    text-align: left;
    hyphens: none;
  }

  .hw-title {
    font-size: 1.5rem;
  }

  .hw-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.9rem;
  }

  .hw-frame {
    min-height: 74vh;
  }

  /* На телефоне панель и подписи теснее: рамка не должна съедать ширину */
  .hw-bar {
    padding: 0.5rem 0.6rem;
    font-size: 0.5rem;
    letter-spacing: 0.14em;
  }

  .hw-note {
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0.6rem;
    font-size: 0.5rem;
  }
}

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

  .hw-loading .spinner {
    animation: none;
  }

  summary .pl {
    transition: none;
  }
}

@media print {
  .nav,
  .hero-photo,
  .hw,
  .links {
    display: none;
  }
}
