/* AT'school — общие токены и база. Страницы подключают этот файл первым. */
@font-face { font-family: 'Carolina'; src: url('/assets/fonts/Carolina.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Golos Text'; src: url('/assets/fonts/GolosText-wght-.ttf') format('truetype'); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/assets/fonts/Manrope-wght-.ttf') format('truetype'); font-weight: 200 800; font-style: normal; font-display: swap; }

:root {
  --rose: #f4e7e1;
  --ivory: #faf4ee;
  --cocoa: #4a2c22;
  --cocoa-dark: #1f120d;
  --terracotta: #7d4a3f;
  --rose-light: #f6dcd7;
  --rose-mid: #e9cfc9;
  --marker: #efc3ba;
  --pink: #c77c83;
  --ink: #1f120d;
  --ink-2: #4a3329;
  --ink-3: #765a4f;
  --line: rgba(47,24,16,0.16);
  --line-strong: rgba(47,24,16,0.25);
  --error: #a4545d;
  --font-text: 'Golos Text', Arial, system-ui, sans-serif;
  --font-display: 'Manrope', 'Golos Text', Arial, sans-serif;
  --font-svc: 'Courier New', Courier, monospace;
  --font-hand: 'Carolina', cursive;
  --svc-track: 0.14em;
  --wrap: 1120px;
  --gutter: 32px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--rose); color: var(--ink); font-family: var(--font-text); -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--ink-3); }
button { font-family: inherit; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* Mobile navigation and shared footer. */
@media (max-width: 679px) {
  .home-nav { flex-direction: column !important; align-items: center; gap: 6px !important; }
  .home-nav > span { display: none; }
  .home-nav > a { display: flex; align-items: center; justify-content: center; min-height: 44px; max-width: 100%; line-height: 1.6; }
  .foot-nav { display: grid !important; grid-template-columns: minmax(0, 1fr); gap: 0 !important; font-size: 12px !important; letter-spacing: .08em !important; }
  .foot-nav > span { display: none; }
  .foot-nav > span[style] { display: flex; }
  .foot-nav > a, .foot-nav > span[style] { align-items: center; padding: 10px 0; min-height: 44px; line-height: 1.6; }
  .foot-meta { display: flex !important; flex-direction: column; align-items: flex-start; gap: 14px !important; font-size: 11px !important; letter-spacing: .08em !important; line-height: 1.6; }
  .foot-meta > div { max-width: 100%; }
  .foot-meta > div:last-child { flex-wrap: wrap; gap: 4px 16px !important; }
  .foot-meta > div:last-child > span { display: none; }
  .foot-meta a { display: inline-flex; align-items: center; min-height: 44px; }
}
/* Document preview keeps both controls inside the viewport. */
#ov { padding: 16px; gap: 12px; height: 100vh; height: 100dvh; }
#ov > :first-child { flex: none; }
#ovMid { flex: 1; min-height: 0; max-height: 78vh; max-height: 78dvh; display: grid !important; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 12px !important; }
#ovFrame { width: 100% !important; height: 100% !important; max-height: 100% !important; min-height: 0; aspect-ratio: auto !important; background: transparent !important; touch-action: pan-y pinch-zoom; }
#ovCount { flex: none; width: 100%; max-width: 900px; text-align: center; line-height: 1.6; letter-spacing: .06em !important; }
#ovClose, #ovPrev, #ovNext { border: 0; background: transparent; color: #f4e7e1; cursor: pointer; min-height: 44px; min-width: 44px; }
#ovClose { font: inherit; text-transform: inherit; letter-spacing: inherit; }
#ovPrev, #ovNext { font-size: 32px; padding: 0; }
#ov button:focus-visible { outline: 2px solid #f4e7e1; outline-offset: 2px; }
@media (max-width: 679px) {
  #ovMid { grid-template-columns: 44px minmax(0, 1fr) 44px; grid-template-rows: minmax(0, 1fr) 44px; gap: 8px !important; }
  #ovFrame { grid-column: 1 / -1; grid-row: 1; }
  #ovPrev { grid-column: 1; grid-row: 2; }
  #ovNext { grid-column: 3; grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) { #ov { transition: none; } }

/* Keep Safari text decoration on the text, independently of flex/grid link boxes. */
.foot-nav a, .foot-meta a { text-decoration: none !important; }
.foot-nav .foot-link-label, .foot-meta .foot-link-label {
  text-decoration-line: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: .25em;
  text-decoration-skip-ink: auto;
}
.foot-nav a:hover .foot-link-label, .foot-meta a:hover .foot-link-label { text-decoration-thickness: 2px; }

/* Home hero: underlines belong to the text, while the link retains a touch target. */
.home-nav > a { border-bottom: 0 !important; text-decoration: none !important; }
.home-link-label { text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: rgba(47,24,16,.4); text-underline-offset: 1px; text-decoration-skip-ink: auto; }
[style*="'Carolina'"] { font-weight: 400 !important; -webkit-text-stroke: 0 !important; font-synthesis: none; }
@media (max-width: 679px) {
  .home-wordmark { font-size: clamp(46px, 14vw, 88px) !important; }
}

/* Compact mobile hero links with a small, even interval between rows. */
@media (max-width: 679px) {
  .home-nav { gap: 4px !important; }
  .home-nav > a { min-height: 30px; padding: 6px 0 !important; line-height: 1.5; }
}
