:root {
  /* Гайдлайн Академії: дві фірмові фарби. Решта гами — тінти й шейди
     саме з них, жодного стороннього кольору. */
  --ink: #1a1617;
  --charcoal: #1a1617;
  --copper: #a67c52;

  /* Шкала чорнила: другорядність — це колір, а не прозорість. */
  --ink-soft: #3d3530;
  --ink-muted: #6b5f56;

  --copper-dark: #7a5538;
  --copper-light: #d4b89a;

  /* Контрастна фарба — патина: тим кольором мідь укривається з часом, і на
     колірному колі він навпроти міді. Її мало (мітки, вибране, одна-дві
     панелі), основу далі тримають пергамент і мідь. Щоб змінити фарбу,
     досить цих шести значень. */
  --contrast: #2a6b66;
  --contrast-dark: #1d4f4c;
  --contrast-deep: #143b39;
  --contrast-light: #a9cdc4;
  --contrast-100: #d8e8e2;
  --contrast-50: #ecf4f0;

  /* Пергамент: чисті тінти міді на теплому білому. */
  --cream: #faf6ef;
  --paper: #f0e8d8;
  --muted: var(--ink-muted);
  --border: #e8dcc8;
  --border-strong: #dcc8a8;

  /* Мідна шкала — мідь, домішана в пергамент, далі в бік чорнила */
  --accent-50:  #fdf9f4;
  --accent-100: #f5ebe0;
  --accent-200: #eadcc9;
  --accent-300: #dcc8a8;
  --accent-400: #c9b08a;
  --accent-500: #a67c52;
  --accent-600: #8a6441;
  --accent-700: #6d4d31;
  --accent-800: #543a25;
  --accent-900: #3d281a;

  --neutral-50:  #faf6ef;
  --neutral-100: #f0e8d8;
  --neutral-200: #e4d8c0;
  --neutral-300: #dcc8a8;

  --wrap: 1200px;

  /* Шрифти: заголовки й текст. Тема платформи (platform.css) підставляє свої. */
  --font-head: "Lora", Georgia, "Times New Roman", serif;
  --font-body: "PT Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Статуси розкладу — сигнальні, несуть зміст */
  --sky: #7bb0dd;
  --sky-bg: #eef5fc;
  --blue: #2f6fb0;
  --blue-bg: #e5f0fb;
  --green: #2f8f52;
  --green-bg: #e6f6ec;
  --red: #b3261e;
  --red-bg: #fbe2e0;

  /* Типографічний масштаб: fluid, editorial */
  --display: clamp(44px, 6vw, 80px);
  --h1: clamp(38px, 5vw, 64px);
  --h2: clamp(30px, 3.5vw, 44px);
  --h3: clamp(22px, 2.2vw, 28px);
  --h4: 18px;
  --lead: clamp(18px, 2.2vw, 22px);
  --body: 16px;
  --small: 14px;
  --tiny: 12px;
  --stat: clamp(28px, 3.5vw, 40px);

  /* Радіуси */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* Тіні: layered, purposeful */
  --shadow-xs: 0 1px 2px rgba(26, 22, 23, 0.04);
  --shadow-sm: 0 2px 8px rgba(26, 22, 23, 0.06);
  --shadow: 0 8px 24px rgba(26, 22, 23, 0.08);
  --shadow-lg: 0 20px 48px rgba(26, 22, 23, 0.10);
  --shadow-xl: 0 32px 64px rgba(26, 22, 23, 0.12);

  /* Glassmorphism */
  --glass-bg: rgba(250, 246, 239, 0.85);
  --glass-border: rgba(220, 200, 168, 0.6);
  --glass-shadow: 0 8px 32px rgba(26, 22, 23, 0.06);

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.7, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-base: 300ms;
  --duration-slow: 500ms;
  --stagger: 80ms;

  /* Z-index scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-toast: 400;
}

* { box-sizing: border-box; }

@font-face {
  font-family: "Lora";
  src: url("https://fonts.gstatic.com/s/lora/v32/0QIvMX1D_JOuGQbT0gvTJPa787z5vb_C.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PT Sans";
  src: url("https://fonts.gstatic.com/s/ptsans/v17/jizfRExUiTo99u79D0KEwA.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--cream);
  background-image:
    url("../img/brand/pattern.db3ece19d818.svg"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)' opacity='0.04'/%3E%3C/svg%3E"),
    radial-gradient(1100px 620px at 90% -5%, rgba(166, 124, 82, 0.12), transparent 65%);
  background-repeat: repeat, repeat, no-repeat;
  background-size: 460px 460px, 180px 180px, auto;
  background-attachment: scroll, scroll, fixed;
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1; }

@media (hover: none) {
  body { background-attachment: scroll, scroll, scroll; }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
}
h1 { font-size: var(--h1); line-height: 1.05; letter-spacing: -0.03em; text-wrap: pretty; }
h2 { font-size: var(--h2); line-height: 1.15; letter-spacing: -0.02em; text-wrap: pretty; }
h3 { font-size: var(--h3); line-height: 1.25; letter-spacing: -0.01em; }
h4 { font-size: var(--h4); line-height: 1.3; letter-spacing: -0.005em; }

.display { font-size: var(--display); line-height: 1.0; letter-spacing: -0.04em; font-weight: 400; }
.lead { font-size: var(--lead); line-height: 1.7; font-weight: 300; color: var(--ink-soft); max-width: 40ch; }
.body { font-size: var(--body); line-height: 1.6; }
.small { font-size: var(--small); line-height: 1.5; }
.tiny { font-size: var(--tiny); line-height: 1.4; letter-spacing: 0.05em; text-transform: uppercase; }

.container {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

a { color: var(--copper); text-underline-offset: 3px; transition: color var(--duration-fast) var(--ease-out); }
a:hover { color: var(--copper-dark); }
.muted { color: var(--muted); }

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
}

/* Атрибути width/height у розмітці задають CLS-підказку, але як
   презентаційні хінти вони ж перебивають aspect-ratio. Скидаємо висоту —
   правила нижче самі задають пропорції. */
img { max-width: 100%; height: auto; }
/* Scroll reveal — elements start shifted, JS clears it when they enter view. */
[data-reveal] { 
  opacity: 0; 
  transform: translateY(40px); 
  transition: opacity 900ms cubic-bezier(0.16, 1, 0.3, 1), transform 900ms cubic-bezier(0.16, 1, 0.3, 1); 
}
[data-reveal].is-revealed { opacity: 1; transform: none; }

/* Stagger delays */
[data-reveal][style*="transition-delay"] { /* inline style takes precedence */ }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* Reveal variants */
.reveal-fade { transform: none; }
.reveal-scale { transform: scale(0.95); }
.reveal-slide-left { transform: translateX(-30px); }
.reveal-slide-right { transform: translateX(30px); }

/* ---- header ---- */
/* Смуга «парасольки»: Академія — підрозділ Українського центру
   агропереробки. Вугільна, як підвал, щоб не вносити в гаму Академії
   зелений Центру; кольорові в ній лише листки на знаку UFIC. */
.umbrella {
  background: var(--charcoal);
  color: var(--copper-light);
  font-size: var(--small);
}
.umbrella-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding-top: 4px;
  padding-bottom: 4px;
}
.umbrella a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cream);
  text-decoration: none;
}
.umbrella a:hover { text-decoration: underline; text-underline-offset: 3px; }
.umbrella img { width: 28px; height: 28px; }
@media (max-width: 480px) {
  .umbrella-here { display: none; }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  backdrop-filter: saturate(180%) blur(16px);
  background: color-mix(in srgb, var(--cream) 92%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-row {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  text-decoration: none;
  color: var(--ink) !important;
}
.brand-mark {
  width: 48px; height: 48px;
  object-fit: contain;
  flex: none;
}
.brand-name { font-family: var(--font-head); font-size: 17px; line-height: 1.1; letter-spacing: -0.01em; }

/* — знак Навчальної платформи — */
.brand-mark-platform { width: 58px; height: 53px; object-fit: contain; }
.cta-link { display: inline-flex; align-items: center; gap: 8px; }
.cta-link img { width: 24px; height: auto; }
.brand-sub {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 2px;
}
.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a { 
  color: var(--ink); 
  text-decoration: none; 
  font-size: 15px; 
  font-weight: 500;
  position: relative;
  padding: 4px 0;
  transition: color var(--duration-fast) var(--ease-out);
}
.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--copper);
  transition: width var(--duration-base) var(--ease-out);
}
.main-nav a:hover { color: var(--copper); }
.main-nav a:hover::after { width: 100%; }
.cta-link {
  background: var(--copper);
  color: var(--cream) !important;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 15px;
  transition: 
    background var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.cta-link:hover { 
  background: var(--copper-dark); 
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.cta-link:active { transform: translateY(0); }
/* `.main-nav a` специфічніший за `.cta-link` і з'їдав поля кнопки: напис
   упирався в краї пігулки. Риска-підкреслення кнопці теж не потрібна. */
.main-nav .cta-link { padding: 10px 20px; }
.main-nav .cta-link::after { content: none; }
.link-button {
  background: none;
  border: none;
  color: inherit;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* — сендвіч-меню акаунту в шапці платформи; так само виглядає кнопка
   головного меню на вузькому екрані (.nav-toggle) — */
.account-menu { position: relative; display: flex; margin-left: auto; }
.nav-toggle,
.account-menu-toggle {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    background: none;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    color: var(--ink);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
/* Кнопку головного меню показує лише вузький екран (див. наприкінці файла). */
.nav-toggle { display: none; flex: none; padding: 0; }
.nav-toggle:hover,
.nav-toggle[aria-expanded="true"],
.account-menu-toggle:hover,
.account-menu.is-open .account-menu-toggle {
    background: color-mix(in srgb, var(--copper) 12%, transparent);
    border-color: var(--copper);
}
/* Три смуги — сама смуга та дві її копії, без додаткової розмітки. */
.account-menu-bars,
.account-menu-bars::before,
.account-menu-bars::after {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}
.account-menu-bars { position: relative; }
.account-menu-bars::before,
.account-menu-bars::after { content: ""; position: absolute; left: 0; }
.account-menu-bars::before { top: -6px; }
.account-menu-bars::after { top: 6px; }
/* Відкрите меню: три смуги складаються в хрестик. */
.account-menu-bars,
.account-menu-bars::before,
.account-menu-bars::after { transition: top 0.2s ease, transform 0.2s ease, background 0.2s ease; }
[aria-expanded="true"] > .account-menu-bars { background: transparent; }
[aria-expanded="true"] > .account-menu-bars::before { top: 0; transform: rotate(45deg); }
[aria-expanded="true"] > .account-menu-bars::after { top: 0; transform: rotate(-45deg); }
@media (prefers-reduced-motion: reduce) {
    .account-menu-bars, .account-menu-bars::before, .account-menu-bars::after { transition: none; }
}
/* Розділи платформи в панелі сендвіча — лише на вузькому екрані (див. нижче). */
.account-menu-sections { display: none; }

.account-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    min-width: 260px;
    max-width: calc(100vw - 32px);
    padding: 10px;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
/* Панель закрита атрибутом hidden, тож display треба зняти явно. */
.account-menu-panel[hidden] { display: none; }
.account-menu-who {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px 12px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.account-menu-who strong { font-family: var(--font-head); font-size: 16px; }
.account-menu-login { font-size: 13px; color: var(--muted); }
.account-menu-roles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.account-menu-panel a,
.account-menu-exit {
    display: block;
    width: 100%;
    padding: 9px 12px;
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 15px;
    text-align: left;
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
}
.account-menu-panel a:hover,
.account-menu-exit:hover {
    background: color-mix(in srgb, var(--copper) 12%, transparent);
    color: var(--copper-dark);
}
.account-menu-panel form {
    margin: 6px 0 0;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}
.account-menu-exit { color: var(--copper-dark); font-weight: 600; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ---- hero: editorial asymmetric layout, masked photo, kinetic type ---- */
.hero { padding: 48px 0 48px; }
.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 64px;
  align-items: stretch;
}
.hero-content { position: relative; display: flex; flex-direction: column; justify-content: center; }
.hero-tag { display: inline-block; margin-bottom: 24px; }
.hero h1 { 
  margin: 0 0 24px; 
  font-size: var(--display);
  line-height: 1.0;
  letter-spacing: -0.04em;
  font-weight: 400;
}
.hero-lead { 
  font-size: var(--lead); 
  line-height: 1.7; 
  max-width: 38ch; 
  color: var(--ink-soft); 
  font-weight: 300;
  margin: 0 0 32px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 48px; }
.hero-stats { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 40px; 
  margin-top: 0;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.hero-stat { 
  display: flex; 
  flex-direction: column; 
  gap: 6px; 
  min-width: 80px;
}
.hero-stats .stat-number {
  font-family: var(--font-head);
  font-size: var(--stat);
  line-height: 1.0;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--ink);
  background: linear-gradient(135deg, var(--ink) 0%, var(--copper) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-stats .stat-label { 
  font-size: var(--tiny); 
  color: var(--ink-muted); 
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero-figure { position: relative; height: 100%; }
.hero-figure img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 24% center;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  mask-image: 
    linear-gradient(180deg, transparent 0%, black 50%, black 100%);
  -webkit-mask-image: 
    linear-gradient(180deg, transparent 0%, black 50%, black 100%);
  transition: transform var(--duration-slow) var(--ease-out);
}
.hero-figure:hover img { transform: scale(1.02); }
.hero-figure .hero-seal {
  position: absolute;
  right: -20px;
  bottom: 10%;
  width: 120px;
  height: 120px;
  padding: 16px;
  background: var(--cream);
  border-radius: var(--radius-pill);
  object-fit: contain;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: float-gentle 6s ease-in-out infinite;
}
@keyframes float-gentle {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-figure .hero-seal { animation: none; }
  .hero-figure img { transition: none; }
}
.page-intro { padding: 56px 0 8px; }
.page-intro h1 { margin: 18px 0 16px; max-width: 16em; }
.page-intro p { font-size: 17px; color: var(--ink-soft); max-width: 40em; }
.page-intro .intro-note {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 4px; padding: 10px 18px;
  border: 1px solid var(--accent-200); border-radius: var(--radius-pill);
  background: var(--accent-50); color: var(--copper-dark);
  font-size: 15px; font-weight: 600;
}
.page-intro .intro-note .ic { width: 1.2em; height: 1.2em; flex-shrink: 0; }

/* ---- buttons: premium, tactile ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: 
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--copper);
  color: var(--cream);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { 
  background: var(--copper-dark); 
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.btn-primary:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }

.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { 
  background: var(--cream); 
  border-color: var(--copper-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-dark {
  background: var(--ink);
  color: var(--cream);
  box-shadow: var(--shadow-sm);
}
.btn-dark:hover {
  background: var(--ink-soft);
  color: var(--cream);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border-strong);
}
.btn-outline:hover { 
  background: var(--accent-50); 
  border-color: var(--copper);
  color: var(--copper-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--copper);
  border: 1px solid transparent;
  padding: 10px 20px;
}
.btn-ghost:hover { 
  background: var(--accent-50); 
  border-color: var(--accent-200);
  color: var(--copper-dark);
}

.btn-block { width: 100%; }

.btn-sm { padding: 10px 20px; font-size: 14px; }
.btn-lg { padding: 18px 36px; font-size: 16px; }

/* Icon in button */
.btn .ic { width: 1.1em; height: 1.1em; flex-shrink: 0; }

/* ---- sections ---- */
section.page-section { padding: 48px 0; }
.section-surface {
  background: var(--paper);
  margin-top: 48px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
}
.section-surface .container { padding-top: 64px; padding-bottom: 64px; }
.page-section h2 { margin: 0 0 8px; }
.section-alt { background: var(--paper); }

/* ---- cards: glassmorphism, elevated ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: 
    border-color var(--duration-base) var(--ease-out),
    background var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out),
    transform var(--duration-base) var(--ease-out);
}
.card:hover { 
  border-color: var(--copper-light); 
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.card h3 { margin-top: 0; }

/* Card variants */
.card-elevated {
  background: var(--paper);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.card-elevated:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--copper-light);
}
.card-tinted { background: var(--accent-50); border-color: var(--accent-100); }
.card-tinted:hover { background: var(--accent-100); border-color: var(--accent-200); }

.contact-block { text-align: center; }

/* ---- forms / auth ---- */
.form-page {
  max-width: 440px;
  margin: 64px auto;
  padding: 40px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
.form-page h1 { margin-top: 0; text-align: center; font-size: var(--h2); }
.form-page-platform { text-align: center; }
.form-page-platform form, .form-page-platform .errorlist { text-align: left; }
.platform-badge { width: 240px; height: 240px; margin: 0 auto 20px; display: block; }
form p { margin-bottom: 20px; }
label { 
  display: block; 
  margin-bottom: 8px; 
  font-weight: 600; 
  font-size: var(--small); 
  color: var(--ink);
  letter-spacing: 0.02em;
}
input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=hidden]),
select, textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--body);
  background: var(--paper);
  color: var(--ink);
  transition: 
    border-color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out);
}
textarea { 
  border-radius: var(--radius-md); 
  min-height: 120px;
  resize: vertical;
}
input:hover, select:hover, textarea:hover {
  border-color: var(--copper-light);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--copper);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--copper) 15%, transparent);
  background: var(--cream);
}
::placeholder { color: var(--ink-muted); opacity: 0.6; }
.errorlist { color: var(--red); list-style: none; padding: 0; margin: 8px 0 0; font-size: var(--small); }

/* ---- картки «Про мене» ---- */
/* Портрет: фото в колі, а поки його немає — ініціали в кільці логотипа. */
.avatar {
    width: 56px;
    height: 56px;
    flex: none;
    border-radius: var(--radius-pill);
    object-fit: cover;
    background: var(--cream);
    border: 1px solid var(--border-strong);
}
.avatar-empty {
    display: grid;
    place-items: center;
    font-family: var(--font-head);
    font-size: 19px;
    color: var(--accent-600);
    letter-spacing: 0.02em;
}
.avatar-lg { width: 128px; height: 128px; }
.avatar-lg.avatar-empty { font-size: 42px; }

.person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
    margin-bottom: 56px;
}
.person-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--paper);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease;
}
.person-card:hover { border-color: var(--copper-light); }
.person-card-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.person-card-body strong { font-family: var(--font-head); font-size: 17px; }
.person-card-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.person-card-lead { font-size: 14px; line-height: 1.45; color: var(--ink-soft); }

.person-page {
    max-width: 760px;
    margin-bottom: 56px;
    padding: 30px 34px 34px;
    background: var(--paper);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.person-page-head { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.person-page-head h2 { margin: 0 0 8px; }
.person-page-roles { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.person-page-contact { margin: 0; font-size: 14px; }
.person-page-fact { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border); }
.person-page-fact h3 { margin: 0 0 6px; }
.person-page-fact p { margin: 0; max-width: 60em; }

/* Поле фото: сам портрет поруч із вибором файлу. */
.photo-field { display: flex; align-items: start; gap: 18px; }
.photo-field p { flex: 1; min-width: 0; }
.photo-field input[type=file] { border-radius: var(--radius-sm); padding: 8px 12px; font-size: 0.9rem; }

/* — налаштування акаунту: своя картка поруч із довідкою про запис — */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    align-items: start;
    margin-bottom: 56px;
}
/* Картка тут не посилання — не піднімаємо її під курсором. */
.settings-grid .card:hover { border-color: var(--border-strong); }
.settings-facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 16px;
    margin: 0 0 22px;
}
.settings-facts dt { font-weight: 600; font-size: 0.92rem; }
.settings-facts dd { margin: 0; }
/* .card — щоб перебити `.card h3 { margin-top: 0 }`: без відступу лінія липне до кнопки. */
.card .settings-subtitle { margin: 28px 0 6px; padding-top: 22px; border-top: 1px solid var(--border); }
.settings-note { margin: 0; font-size: 14px; }

.checkbox-list { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 4px 0; }
.checkbox-list label { display: flex; align-items: center; gap: 6px; font-weight: normal; margin: 0; }
.checkbox-list input[type=checkbox] { width: auto; }

/* ---- page headers ---- */
.page-header { padding: 40px 0 20px; }
.page-header h1 { margin-bottom: 4px; }
.page-header-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.page-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--copper);
    color: var(--cream);
}
.role-super_admin { background: var(--charcoal); }
.role-manager { background: var(--blue); }
.role-teacher { background: var(--green); }
.role-student { background: var(--copper); }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-active { background: var(--green); }
.status-inactive { background: var(--red); }

.chip {
    display: inline-block;
    background: var(--cream);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    padding: 3px 11px;
    font-size: 0.8rem;
    margin: 2px 4px 2px 0;
    color: var(--ink);
}

/* ---- tiles ---- */
/* Тайли зібрано в групи; групи стають у колонки, тайли в групі — стовпчиком. */
.tile-groups {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    align-items: start;
    gap: 28px 24px;
    padding-bottom: 48px;
}
.tile-group-title {
    margin: 0 0 10px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}
.tile-group-list { display: grid; gap: 10px; }
/* Тайл — рядок: піктограма, назва з підписом, число праворуч. */
.tile {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    text-decoration: none;
    color: var(--ink);
    transition: background 0.15s ease, border-color 0.15s ease;
}
.tile:hover { border-color: var(--copper); background: var(--cream); }
.tile h3 { color: var(--copper-dark); margin: 0; font-size: 1.05rem; line-height: 1.25; }
.tile-body { flex: 1; min-width: 0; }
/* Кругла плашка під піктограмою — те саме кільце, що й .icon-badge, лише дрібніше. */
.tile-icon {
    flex: none;
    width: 40px;
    height: 40px;
    font-size: 20px;
    display: grid;
    place-items: center;
    color: var(--charcoal);
    background: var(--cream);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-pill);
}
.tile-count { flex: none; margin: 0 0 0 auto; color: var(--muted); white-space: nowrap; }
.tile-count strong { font-size: 1.6rem; font-weight: 700; color: var(--ink); line-height: 1; }
.tile-meta { margin: 2px 0 0; font-size: 0.82rem; line-height: 1.35; color: var(--muted); }
/* Новина в тайлі — єдине, що на дашборді має тягнути око. */
.tile-news {
    margin: 4px 0 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--copper-dark);
}
.row-news { background: color-mix(in srgb, var(--copper) 8%, transparent); }
.news-badge {
    display: inline-block;
    background: var(--copper);
    color: var(--cream);
    border-radius: var(--radius-sm);
    padding: 0 7px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-left: 6px;
}
.tile-lead { margin: 2px 0 0; font-size: 0.82rem; line-height: 1.35; color: var(--muted); }

/* ---- період і його статус ---- */
/* Три стани дат однакові для групи, предмета в групі та студента в групі. */
.period { white-space: nowrap; }
.status-planned { background: var(--copper-light); }
.status-finished { background: var(--muted); }
/* Стани пропозиції — ті самі сигнали, що й у календарі. */
.status-proposed { background: var(--green); }
.status-accepted { background: var(--blue); }
.status-rejected { background: var(--muted); }

.btn-small { padding: 7px 18px; font-size: 0.85rem; }
/* Форма-рядок під таблицею: додати запис, не йдучи зі сторінки. */
.inline-add-form {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-top: 14px;
}
.inline-add-form label { font-size: 0.82rem; }
.inline-add-form .form-row { align-items: flex-end; margin-bottom: 12px; }
/* Заголовок секції в середині сторінки — сусідній щабель шкали, не новий розмір. */
.section-title { font-size: var(--h3); margin: 34px 0 14px; color: var(--copper-dark); }

/* ---- filter bar ---- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 20px;
}
.filter-label { margin: 0; font-weight: 600; font-size: 0.9rem; }
.filter-bar select { width: auto; min-width: 200px; }

/* ---- tables ---- */
.table-card {
    background: var(--paper);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 48px;
}
table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    text-align: left;
}
th:last-child, td:last-child { border-right: none; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: rgba(181, 101, 29, 0.03); }
tbody tr:hover { background: var(--copper-light); background: rgba(181, 101, 29, 0.09); }
th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--cream);
    border-bottom: 2px solid var(--border-strong);
}
/* ---- сортування й фільтрація в таблицях (static/js/table.js) ---- */
th.is-sortable { cursor: pointer; user-select: none; }
th.is-sortable:hover { color: var(--ink); }
th.is-sortable::after {
    content: '\2195';           /* ↕ — колонку можна впорядкувати */
    margin-left: 6px;
    font-size: 0.7rem;
    opacity: 0.35;
}
th[aria-sort="ascending"]::after { content: '\25B2'; opacity: 1; color: var(--copper); }
th[aria-sort="descending"]::after { content: '\25BC'; opacity: 1; color: var(--copper); }
th.is-sorted { color: var(--ink); }
th.is-sortable:focus-visible { outline: 2px solid var(--copper); outline-offset: -2px; }

.filter-row th, .filter-row td {
    padding: 8px 10px;
    background: var(--cream);
    border-bottom: 1px solid var(--border-strong);
}
/* Довгий ланцюжок :not — щоб перебити загальне правило для полів форм
   (воно теж із :not і інакше роздуває поля в рядку фільтрів). */
.filter-row input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=hidden]),
.filter-row select {
    width: 100%;
    min-width: 0;
    padding: 5px 8px;
    font-size: 0.82rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--paper);
    color: var(--ink);
}
.filter-row input::placeholder { color: var(--muted); }
/* Клітинка лишається клітинкою (не flex): інакше вона випадає з рядка
   таблиці — її межа й тло не збігаються з сусідніми. */
.row-actions { white-space: nowrap; }
.row-actions > * + * { margin-left: 12px; }
.inline-form { display: inline; }
.danger-link { color: var(--red); text-decoration-color: var(--red); }

/* ---- alerts ---- */
.alert { padding: 12px 18px; border-radius: var(--radius-sm); margin: 18px 0; font-size: 0.94rem; }
.alert-success { background: var(--green-bg); color: var(--green); }
.alert-error { background: var(--red-bg); color: var(--red); }

/* ---- schedule toolbar & legend ---- */
.schedule-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 28px;
}
.month-nav { display: flex; gap: 14px; align-items: center; }
.month-label { font-family: var(--font-head); font-size: 1.2rem; min-width: 160px; text-align: center; }
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--paper);
    border: 1px solid var(--border-strong);
    color: var(--ink);
    text-decoration: none;
    transition: background 0.15s ease;
}
.icon-btn:hover { background: var(--cream); }
.teacher-select-form select { min-width: 200px; }
.legend { display: flex; gap: 18px; font-size: 0.85rem; flex-wrap: wrap; color: var(--muted); }
.legend-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.swatch-sky { background: var(--sky); }
.swatch-blue { background: var(--blue); }
.swatch-green { background: var(--green); }

/* ---- month calendar ---- */
.month-grid {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 40px;
}
.month-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--cream);
    border-bottom: 1px solid var(--border);
}
.month-grid-header div {
    padding: 10px 0;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.month-grid-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.day-cell {
    display: flex;
    flex-direction: column;
    min-height: 170px;
    padding: 10px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.12s ease;
    position: relative;
    /* Contains the bar track's z-index stacking so it can never paint over
       page-level elements like the open day modal (z-index: 100+). */
    isolation: isolate;
}
.month-grid-row .day-cell:nth-child(7n) { border-right: none; }
.day-cell:hover { background: var(--cream); }
.day-cell:focus-visible { outline: 2px solid var(--copper); outline-offset: -2px; }
.day-cell-out { cursor: default; background: repeating-linear-gradient(135deg, transparent, transparent 8px, rgba(0,0,0,0.015) 8px, rgba(0,0,0,0.015) 16px); }
.day-cell-out:hover { background-color: transparent; }
.day-cell-out .day-number { color: var(--border-strong); }
.day-cell-today { background: rgba(181, 101, 29, 0.06); }
.day-cell-today .day-number {
    background: var(--copper);
    color: var(--cream);
    border-radius: 50%;
}
.day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink);
}
.day-bar-track {
    position: relative;
    flex: 1;
    min-height: 110px;
    margin-top: 10px;
    background: var(--cream);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.day-bar-segment {
    position: absolute;
    left: 3px; right: 3px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.day-bar-segment.color-sky { background: var(--sky); }
.day-bar-segment.color-blue { background: var(--blue); }
.day-bar-segment.color-green { background: var(--green); }
/* Відхилена пропозиція лишається в історії, але не читається як розклад. */
.day-bar-segment.color-rejected { background: var(--neutral-300); opacity: 0.55; }
.segment-initials { color: #fff; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.02em; writing-mode: horizontal-tb; }
.empty-hint { color: var(--muted); font-style: italic; padding: 48px 0; text-align: center; }

/* ---- modal ---- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(36, 31, 27, 0.5);
    z-index: 100;
    padding: 20px;
}
.modal-backdrop:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-backdrop[hidden] { display: none; }
body.modal-open { overflow: hidden; }
.modal {
    background: var(--paper);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 24px 26px 28px;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.modal-header h3 { margin: 0; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
    padding: 4px;
}
.modal-close:hover { color: var(--ink); }
.modal-bookings { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.booking-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
}
.booking-row.color-sky { background: var(--sky-bg); color: var(--blue); }
.booking-row.color-blue { background: var(--blue-bg); color: var(--blue); }
.booking-row.color-green { background: var(--green-bg); color: var(--green); }
.booking-row.color-rejected { background: var(--cream); color: var(--muted); }
.booking-row .entry-initials {
    display: inline-block;
    background: rgba(0,0,0,0.12);
    border-radius: var(--radius-sm);
    padding: 0 7px;
    font-size: 0.75rem;
    margin-left: 4px;
}
.booking-row .link-button { color: inherit; opacity: 0.8; font-size: 0.82rem; white-space: nowrap; }
.booking-row .link-button:hover { opacity: 1; }
.booking-actions { display: flex; gap: 10px; flex-shrink: 0; }
.status-badge {
    display: inline-block;
    background: rgba(0,0,0,0.12);
    border-radius: var(--radius-sm);
    padding: 0 7px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-left: 4px;
}
.modal-add-form { border-top: 1px solid var(--border); padding-top: 16px; }
.modal-add-form .form-row { display: flex; gap: 12px; }
.modal-add-form .form-row > div { flex: 1; }

.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > div { flex: 1; min-width: 150px; }


/* ════════════════════════════════════════════════════════════════════
   Marketing pages — premium editorial layouts
   ════════════════════════════════════════════════════════════════════ */

/* — tags (pill kickers) — */
.tag {
  display: inline-flex;
  align-items: center;
  align-self: start;
  font-size: var(--tiny);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  width: fit-content;
  transition: all var(--duration-fast) var(--ease-out);
}
.tag-accent { background: var(--accent-100); color: var(--accent-800); }
.tag-accent:hover { background: var(--accent-200); transform: translateY(-1px); }
.tag-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--copper-dark); }
.tag-outline:hover { border-color: var(--copper); background: var(--accent-50); }
.tag-dark { background: var(--accent-900); color: var(--cream); }
.tag-lg { font-size: var(--small); padding: 8px 18px; }

/* — section headers: editorial — */
.section-header { margin-bottom: 48px; }
.section-header-top { 
  display: flex; 
  align-items: flex-end; 
  justify-content: space-between; 
  gap: 24px; 
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.section-kicker { 
  font-size: var(--tiny); 
  letter-spacing: 0.12em; 
  text-transform: uppercase; 
  font-weight: 600; 
  color: var(--contrast);
  margin-bottom: 12px;
  display: block;
}
.section-lead { 
  color: var(--ink-muted); 
  max-width: 42ch; 
  font-size: var(--lead); 
  line-height: 1.7;
  font-weight: 300;
  margin: 0; 
}
.section-bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.grid-cards { display: grid; gap: 24px; margin-top: 32px; }
.cols-230 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cols-250 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.cols-280 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cols-240 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }

/* — hero stats: animated counters — */
.hero-stats { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 48px; 
  margin-top: 0;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.hero-stat { 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
  min-width: 100px;
  position: relative;
}
.hero-stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--copper), var(--copper-light));
  border-radius: 2px;
  opacity: 0;
  transform: scaleY(0);
  transform-origin: top;
  transition: opacity var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
}
.hero-stats.is-visible .hero-stat::before {
  opacity: 1;
  transform: scaleY(1);
}
.hero-stats .stat-number {
  font-family: var(--font-head);
  font-size: var(--stat);
  line-height: 1.0;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--ink);
  background: linear-gradient(135deg, var(--ink) 0%, var(--copper) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-stats .stat-label { 
  font-size: var(--tiny); 
  color: var(--ink-muted); 
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* — audience cards: glassmorphism stack — */
.card-kicker { 
  font-size: var(--tiny); 
  letter-spacing: 0.1em; 
  text-transform: uppercase; 
  font-weight: 600; 
  color: var(--contrast);
}
.card-stack { 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
  align-items: start; 
  padding: 32px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: all var(--duration-base) var(--ease-out);
  height: 100%;
}
.card-stack:hover { 
  border-color: var(--copper-light); 
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.card-stack h3 { 
  margin: 0; 
  font-size: var(--h3);
  line-height: 1.3;
}
.card-body { 
  margin: 0; 
  font-size: var(--body); 
  line-height: 1.65; 
  color: var(--ink-soft); 
}
.icon-badge {
  width: 56px;
  height: 56px;
  font-size: 26px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--charcoal);
  background: var(--cream);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  transition: all var(--duration-base) var(--ease-out);
}
.card-stack:hover .icon-badge {
  border-color: var(--copper);
  background: var(--accent-50);
  color: var(--copper-dark);
  transform: scale(1.05);
}

/* — flagship programme: dark editorial panel with bleed video — */
.flagship {
  background: var(--accent-900);
  color: var(--neutral-100);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  min-height: 180px;
}
.flagship-body { 
  padding: 28px; 
  display: flex; 
  flex-direction: column; 
  justify-content: center;
  position: relative;
  z-index: 2;
}
.flagship-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 60% 80% at 100% 0%, rgba(166, 124, 82, 0.15), transparent 60%),
    radial-gradient(ellipse 50% 70% at 0% 100%, rgba(166, 124, 82, 0.1), transparent 50%);
  pointer-events: none;
}
.flagship .tag { background: var(--accent-400); color: var(--accent-900); }
.flagship h2 { margin: 16px 0 12px; color: var(--neutral-100); font-size: var(--h2); font-weight: 500; }
.flagship p.lead { font-size: var(--lead); line-height: 1.7; max-width: none; color: var(--neutral-200); margin: 0 0 24px; font-weight: 300; }
.flagship-facts { 
  display: grid; 
  grid-template-columns: repeat(2, 1fr); 
  gap: 16px; 
  margin: 20px 0;
  padding-top: 16px;
  border-top: 1px solid rgba(220, 200, 168, 0.3);
}
.flagship-facts > div { display: flex; flex-direction: column; gap: 4px; }
.flagship-facts .ic { font-size: 18px; color: var(--accent-400); }
.flagship-facts .label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-300); font-weight: 600; }
.flagship-facts .value { font-family: var(--font-head); font-size: 16px; font-weight: 500; color: var(--cream); }
.flagship-facts .value-note { font-size: 13px; color: var(--accent-300); }
.flagship-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.flagship-actions .btn-outline { border-color: var(--accent-400); color: var(--accent-200); }
.flagship-actions .btn-outline:hover { background: rgba(201, 176, 138, 0.15); border-color: var(--accent-300); color: var(--cream); }
.flagship-media { position: relative; height: 100%; }
.flagship-media video,
.flagship-media img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  display: block;
}
.flagship .video-card { background: transparent; border-radius: 0; box-shadow: none; height: 100%; }
.flagship .video-card .video-play { height: 100%; }
.flagship .video-card img { aspect-ratio: auto; height: 100%; }
.flagship .video-card iframe { flex: 1; height: 100%; aspect-ratio: auto; }
.fine-print { margin-top: 24px; font-size: var(--small); color: var(--ink-muted); opacity: 0.7; }

/* — вхід у конструктор курсів: текст і приклад результату кільцями — */
/* Єдина велика площина контрастної фарби на сайті: мідні кільця й кнопка
   на ній «горять». */
.builder {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: 48px;
  align-items: center;
  padding: 48px;
  background:
    radial-gradient(ellipse 60% 90% at 100% 0%, color-mix(in srgb, var(--contrast-light) 20%, transparent), transparent 60%),
    var(--contrast-deep);
  color: var(--neutral-100);
  border-radius: var(--radius-xl);
}
.builder-body { display: flex; flex-direction: column; align-items: start; gap: 16px; }
.builder .tag { background: var(--contrast-light); color: var(--contrast-deep); }
.builder h2 { margin: 0; color: var(--cream); }
.builder p.lead { margin: 0 0 8px; max-width: 34em; font-size: var(--lead); color: var(--contrast-100); }
.builder-art { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
/* Герой: виділена думка заголовка й цифри — тією ж контрастною фарбою. */
.hero h1 em { font-style: normal; color: var(--contrast); }
.hero-stats .stat-number { background-image: linear-gradient(135deg, var(--contrast-dark) 0%, var(--contrast) 100%); }
::selection { background: var(--contrast-100); color: var(--ink); }
.builder-art li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px 12px 12px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: var(--small);
  color: var(--ink-soft);
}
.builder-art li:nth-child(2) { margin-left: 28px; }
.builder-art li:nth-child(3) { margin-left: 56px; }
/* Кільце з відсотком: мідна дуга на пергаменті. */
.builder-art b {
  flex: none;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background:
    radial-gradient(closest-side, var(--cream) 80%, transparent 82%),
    conic-gradient(var(--copper) calc(var(--ring) * 1%), var(--accent-200) 0);
}
/* Рух: рядки виїжджають по черзі й далі ледь погойдуються, кільця
   заповнюються, стрілка на кнопці тягне вперед. --ring зареєстровано як
   число, інакше браузер не вміє його плавно міняти (тоді кільце просто
   одразу повне). */
@property --ring { syntax: "<number>"; inherits: true; initial-value: 0; }
.builder-art b { --ring: var(--p); }
.builder .btn-primary::after { content: "→"; display: inline-block; animation: builder-nudge 1.1s ease-in-out infinite; }
@keyframes builder-nudge { 50% { transform: translateX(7px); } }
@keyframes builder-in { from { opacity: 0; transform: translateX(40px); } }
@keyframes builder-float { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: no-preference) {
  .builder-art b { --ring: 0; transition: --ring 1400ms var(--ease-out); }
  .builder.is-revealed .builder-art b { --ring: var(--p); }
  .builder-art li { opacity: 0; }
  .builder.is-revealed .builder-art li {
    opacity: 1;
    animation: builder-in 700ms var(--ease-out) backwards, builder-float 5s ease-in-out infinite;
    animation-delay: calc(var(--i) * 180ms + 250ms), calc(var(--i) * 600ms + 1200ms);
  }
  .builder.is-revealed .builder-art li:nth-child(1) b { transition-delay: 500ms; }
  .builder.is-revealed .builder-art li:nth-child(2) b { transition-delay: 680ms; }
  .builder.is-revealed .builder-art li:nth-child(3) b { transition-delay: 860ms; }
}
@media (prefers-reduced-motion: reduce) {
  .builder .btn-primary::after { animation: none; }
}
@media (max-width: 860px) {
  .builder { grid-template-columns: 1fr; padding: 32px 24px; gap: 28px; }
  .builder-art li:nth-child(n) { margin-left: 0; }
}

/* — lecturers: circular portraits with hover bio overlay — */
.lecturer { position: relative; }
.lecturer-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--accent-100);
}
.lecturer-photo img { 
  position: absolute; 
  inset: 0; 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  transition: transform var(--duration-slow) var(--ease-out);
}
.lecturer:hover .lecturer-photo img { transform: scale(1.08); }
.lecturer-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(26, 22, 23, 0.85) 100%);
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-out);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  border-radius: var(--radius-pill);
}
.lecturer:hover .lecturer-overlay { opacity: 1; }
.lecturer-overlay .tag { 
  background: rgba(250, 246, 239, 0.9); 
  backdrop-filter: blur(10px);
  color: var(--copper-dark);
  border: 1px solid rgba(212, 192, 154, 0.5);
  transform: translateY(10px);
  transition: transform var(--duration-base) var(--ease-out), opacity var(--duration-base) var(--ease-out);
  opacity: 0;
}
.lecturer:hover .lecturer-overlay .tag { transform: translateY(0); opacity: 1; transition-delay: 50ms; }
.lecturer-overlay h3 { 
  color: var(--cream); 
  margin: 8px 0 4px; 
  transform: translateY(10px);
  transition: transform var(--duration-base) var(--ease-out), opacity var(--duration-base) var(--ease-out);
  opacity: 0;
}
.lecturer:hover .lecturer-overlay h3 { transform: translateY(0); opacity: 1; transition-delay: 100ms; }
.lecturer-overlay p { 
  color: rgba(250, 246, 239, 0.8); 
  font-size: var(--small); 
  margin: 0;
  transform: translateY(10px);
  transition: transform var(--duration-base) var(--ease-out), opacity var(--duration-base) var(--ease-out);
  opacity: 0;
}
.lecturer:hover .lecturer-overlay p { transform: translateY(0); opacity: 1; transition-delay: 150ms; }
.lecturer .tag { margin-top: 16px; }
.lecturer h3 { margin: 12px 0 6px; }
.lecturer p { font-size: var(--small); color: var(--ink-muted); margin: 0; }

/* — video cards: ambient autoplay on hover, premium play button — */
.video-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--border);
  transition: all var(--duration-base) var(--ease-out);
}
.video-card:hover {
  border-color: var(--copper-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.video-play {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  line-height: 0;
  cursor: pointer;
  overflow: hidden;
}
.video-play img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  transition: transform var(--duration-slow) var(--ease-out), filter var(--duration-base) var(--ease-out);
}
.video-play:hover img { 
  transform: scale(1.04); 
  filter: brightness(0.7);
}
.video-play:focus-visible { outline: 2px solid var(--copper); outline-offset: -2px; }
.video-card .play-badge {
  position: absolute;
  inset: auto auto 20px 20px;
  width: 64px; height: 64px;
  font-size: 28px;
  border-radius: var(--radius-pill);
  background: var(--cream);
  color: var(--charcoal);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--border);
  transition: all var(--duration-fast) var(--ease-spring);
  z-index: 2;
}
.video-play:hover .play-badge { 
  transform: scale(1.12); 
  background: var(--copper);
  color: var(--cream);
  border-color: var(--copper);
}
.video-play:focus-visible .play-badge { transform: scale(1.12); }
.video-card iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }
/* Portrait aspect for testimonials */
.video-card-portrait .video-play img,
.video-card-portrait iframe { aspect-ratio: 3 / 4; }
.video-meta { padding: 20px 24px 24px; }
.video-meta h3 { margin: 0 0 6px; font-size: var(--h3); }
.video-meta p { font-size: var(--small); color: var(--ink-muted); margin: 0; }

/* Ambient video preview on hover */
.video-card[data-ambient] .video-play::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.3) 100%);
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-out);
}
.video-card[data-ambient]:hover .video-play::after { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .video-play img, .video-card .play-badge { transition: none; }
  .video-play:hover img { transform: none; filter: none; }
  .video-play:hover .play-badge { transform: none; }
}

/* — partners: infinite marquee scroll, color reveal on hover — */
.partner-section { overflow: hidden; }
.partner-marquee {
  display: flex;
  animation: marquee 30s linear infinite;
  width: max-content;
}
.partner-marquee:hover { animation-play-state: paused; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.partner-grid {
  display: flex;
  gap: 48px;
  align-items: center;
  padding: 24px 0;
  min-width: 200%;
}
.partner-logo {
  display: grid;
  place-items: center;
  min-width: 160px;
  height: 100px;
  flex-shrink: 0;
}
.partner-logo img {
  max-height: 72px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: grayscale(1) contrast(1.1);
  opacity: 0.6;
  mix-blend-mode: multiply;
  transition: filter var(--duration-base) var(--ease-out), opacity var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
}
.partner-logo:hover img { 
  filter: grayscale(0) contrast(1); 
  opacity: 1; 
  transform: scale(1.05);
}

/* Fallback static grid */
.partner-grid-static {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 32px 24px;
  margin-top: 32px;
  align-items: center;
}
.partner-grid-static .partner-logo { min-height: 100px; }
.partner-grid-static .partner-logo img { max-height: 72px; }

/* — news: editorial cards with image bleed — */
.news-item { 
  text-decoration: none; 
  color: inherit; 
  display: block; 
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--duration-base) var(--ease-out);
}
.news-item:hover { 
  border-color: var(--copper-light); 
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.news-item img { 
  width: 100%; 
  aspect-ratio: 16 / 9; 
  object-fit: cover; 
  border-radius: 0;
  transition: transform var(--duration-slow) var(--ease-out);
}
.news-item:hover img { transform: scale(1.04); }
.news-item h3 { margin: 20px 24px 8px; font-size: var(--h3); }
.news-item p { font-size: var(--small); color: var(--ink-muted); margin: 0 24px 24px; line-height: 1.6; }

/* — consultation band: dark, split, cream form card — */
.consult-band { background: var(--accent-900); color: var(--neutral-100); margin-top: 56px; }
.consult-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 48px;
  padding: 64px 0;
}
.consult-band h2 { margin: 0 0 14px; color: var(--neutral-100); }
.consult-band > .container > .consult-grid > div > p { font-size: 17px; color: var(--neutral-200); max-width: 30em; }
.consult-contacts { display: grid; gap: 14px; margin-top: 36px; font-size: 16px; }
.consult-contacts .label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-300); }
.consult-contacts a { color: var(--neutral-100); text-decoration: none; }
.consult-contacts a:hover { text-decoration: underline; }
.consult-form {
  background: var(--cream);
  color: var(--ink);
  border-radius: var(--radius-xl);
  padding: 40px;
  display: grid;
  gap: 20px;
  align-content: start;
  border: 1px solid var(--border);
}
.consult-form h3 { margin: 0; }
.consult-form label { font-size: var(--small); margin-bottom: 6px; font-weight: 400; color: var(--ink-muted); }
.consult-form textarea { border-radius: var(--radius-md); min-height: 100px; }
.consent-row {
  display: flex;
  align-items: start;
  gap: 10px;
  cursor: pointer;
  font-size: var(--small);
  line-height: 1.5;
}
.consent-row input {
  width: 18px; height: 18px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--copper);
  cursor: pointer;
}
.consent-row label { font-size: var(--small); margin: 0; font-weight: 400; }
.btn-block { width: 100%; }
.thanks-box { padding: 26px 6px; }
.thanks-box h3 { margin: 0 0 8px; }
.thanks-box p { font-size: 15px; color: var(--ink-soft); margin: 0; }

@media (max-width: 900px) {
    /* Логотип зробив шапку вищою — на вузьких екранах ховаємо навігацію в другий рядок.
       Ширше за 900px меню з «Конструктором» стає в один рядок. */
    .header-row { flex-wrap: wrap; row-gap: 10px; padding: 12px 20px; }
    .main-nav { width: 100%; flex-wrap: wrap; gap: 16px; }
    .brand-mark { width: 40px; height: 40px; }
    .brand-name { font-size: 16px; }
}

@media (max-width: 860px) {
    .hero-split { grid-template-columns: 1fr; }
    .hero-figure { order: -1; max-width: 420px; }
    .flagship { grid-template-columns: 1fr; }
    .flagship-body { padding: 32px; }
    .flagship img { aspect-ratio: 16 / 9; }
    .flagship .video-card img,
    .flagship .video-card iframe { aspect-ratio: 16 / 9; height: auto; flex: none; }
    .hero-figure .hero-seal { width: 86px; height: 86px; right: 0; }
}

/* ---- icons: charcoal stroke + copper accent, logo style ---- */
.ic {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.125em;
  transition: stroke var(--duration-fast) var(--ease-out);
}

/* Icon badge — echoes logo ring */
.icon-badge {
  width: 56px;
  height: 56px;
  font-size: 26px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--charcoal);
  background: var(--cream);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-pill);
  transition: all var(--duration-base) var(--ease-out);
}
.icon-badge:hover,
.card:hover .icon-badge {
  border-color: var(--copper);
  background: var(--accent-50);
  color: var(--copper-dark);
  transform: scale(1.05);
}
.icon-badge-float {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 50px;
  height: 50px;
  font-size: 24px;
  border-color: transparent;
  box-shadow: var(--shadow);
  background: var(--cream);
}

/* ---- course cards: featured + masonry grid ---- */
.course-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--duration-base) var(--ease-out);
  height: 100%;
}
.course-card:hover {
  border-color: var(--copper-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.course-media { position: relative; width: 100%; overflow: hidden; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.course-media img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}
.course-card:hover .course-media img { transform: scale(1.05); }
.course-media .icon-badge-float {
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  transition: all var(--duration-base) var(--ease-out);
}
.course-card:hover .course-media .icon-badge-float {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.course-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 24px 24px;
  flex: 1;
}
.course-content .tag { margin-top: -4px; }
.course-content h3 { margin: 4px 0 0; font-size: var(--h3); }
.course-content .card-body { margin: 0; font-size: var(--small); color: var(--ink-soft); line-height: 1.6; }

/* Featured course card — larger, editorial */
.course-card--featured {
  grid-column: span 2;
  flex-direction: row;
  align-items: stretch;
  min-height: 320px;
}
.course-card--featured .course-media {
  width: 50%;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  min-width: 300px;
}
.course-card--featured .course-media img { aspect-ratio: auto; height: 100%; }
.course-card--featured .course-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
}
.course-card--featured h3 { font-size: var(--h2); margin: 8px 0 12px; }
.course-card--featured .card-body { font-size: var(--body); margin-bottom: 24px; max-width: 40ch; }

/* Course grid */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
@media (max-width: 900px) {
  .course-card--featured { grid-column: auto; flex-direction: column; }
  .course-card--featured .course-media { width: 100%; min-width: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .course-card--featured .course-content { padding: 32px; }
}

/* ---- service cards: photo + text block, glassmorphism ---- */
.service-card {
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--duration-base) var(--ease-out);
  height: 100%;
}
.service-card:hover {
  border-color: var(--copper-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.service-card > img { 
  display: block; 
  width: 100%; 
  aspect-ratio: 16 / 9; 
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}
.service-card:hover > img { transform: scale(1.03); }
.service-body {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 12px;
  padding: 32px;
  flex: 1;
}
.service-body .icon-badge { margin-bottom: 4px; }
.service-body h3 { margin: 0; font-size: var(--h3); }
.service-body .card-body { margin: 0; font-size: var(--body); color: var(--ink-soft); line-height: 1.65; }
.service-body .btn { margin-top: auto; }

/* ---- photo strip: masonry ---- */
.photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 32px;
}
.photo-strip img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-lg);
  transition: transform var(--duration-slow) var(--ease-out), box-shadow var(--duration-base) var(--ease-out);
}
.photo-strip img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}


/* ---- footer: розкладка спільна (footer.css), тут — відступ від сторінки
   й фарби та шрифти Академії дистиляції — */
.uf-footer { margin-top: 80px; }
.uf-footer.uf-footer--academy {
  --uf-bg: var(--accent-900);
  --uf-text: var(--neutral-300);
  --uf-muted: rgba(220, 200, 168, 0.6);
  --uf-strong: var(--cream);
  --uf-line: rgba(220, 200, 168, 0.18);
  --uf-accent: var(--accent-400);
  --uf-font: var(--font-body);
  --uf-font-big: var(--font-head);
}

@media (max-width: 900px) {
  .header-row { flex-wrap: wrap; row-gap: 10px; padding: 12px 20px; }
  .main-nav { width: 100%; flex-wrap: wrap; gap: 16px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-name { font-size: 16px; }
}

@media (max-width: 860px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-figure { order: -1; max-width: 480px; margin: 0 auto; }
  .hero-stats { justify-content: center; gap: 32px; }
  .flagship { grid-template-columns: 1fr; min-height: auto; }
  .flagship-body { padding: 40px; }
  .flagship-media { min-height: 280px; }
  .flagship-facts { grid-template-columns: repeat(2, 1fr); }
  .flagship .video-card img,
  .flagship .video-card iframe { aspect-ratio: 16 / 9; height: auto; flex: none; }
  .hero-figure .hero-seal { width: 96px; height: 96px; right: 0; }
}

@media (max-width: 640px) {
  .hero { padding: 48px 0 40px; }
  .hero-split { gap: 40px; }
  .hero-stats { flex-direction: column; gap: 24px; padding-top: 24px; }
  .hero-stat { flex-direction: row; align-items: baseline; gap: 16px; }
  .hero-stat::before { display: none; }
  .flagship-facts { grid-template-columns: 1fr; gap: 16px; }
  .section-surface .container { padding: 40px 20px; }
}

/* ---- modern image handling: blur-up, responsive ---- */
.img-wrapper {
  position: relative;
  overflow: hidden;
  background: var(--accent-100);
}
.img-wrapper img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--duration-slow) var(--ease-out), filter var(--duration-slow) var(--ease-out);
}
.img-wrapper img[loading="lazy"] {
  opacity: 0;
}
.img-wrapper img.loaded {
  opacity: 1;
}
.img-wrapper .img-placeholder {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(20px) saturate(1.2);
  transform: scale(1.1);
  transition: opacity var(--duration-slow) var(--ease-out), filter var(--duration-slow) var(--ease-out);
  z-index: 1;
}
.img-wrapper img.loaded + .img-placeholder,
.img-wrapper .img-placeholder.hidden {
  opacity: 0;
  filter: blur(0);
  pointer-events: none;
}

/* Picture element fallbacks */
picture { display: block; width: 100%; }
picture img { width: 100%; height: auto; display: block; }

/* Print styles */
/* ---- сендвіч-меню на вузькому екрані ----
   Діє лише зі скриптом (клас `js` на <html>): шапка лишається в один рядок,
   меню [data-nav] ховається під кнопку й відкривається панеллю під шапкою.
   Без скрипта працюють правила вище — меню просто переноситься рядком. */
@media (max-width: 900px) {
  .js .header-row { flex-wrap: nowrap; gap: 14px; }
  .js .nav-toggle { display: grid; }
  .js .main-nav[data-nav] { display: none; }
  .js .main-nav[data-nav].is-open {
    display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0;
    position: absolute; top: 100%; left: 0; right: 0; width: auto;
    max-height: calc(100vh - 130px); max-height: calc(100dvh - 130px); overflow-y: auto;
    padding: 4px 20px 20px;
    background: var(--cream); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
  }
  .js .main-nav[data-nav] a { padding: 15px 2px; font-size: 17px; border-bottom: 1px solid var(--border); }
  .js .main-nav[data-nav] a::after { content: none; }
  .js .main-nav[data-nav] .cta-link { justify-content: center; margin-top: 18px; padding: 13px 20px; border-bottom: 0; }

  /* Платформа після входу: сендвіч акаунту один на все, розділи — в його панелі. */
  .js .main-nav:not([data-nav]) { width: auto; flex-wrap: nowrap; margin-left: auto; }
  .js .main-nav .nav-wide { display: none; }
  .js .account-menu-sections { display: block; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
}

@media print {
  .site-header, .hero-figure, .video-card, .btn, .tag { display: none !important; }
  body { background: white; color: black; }
  .container { max-width: 100%; padding: 0; }
  a { text-decoration: underline; color: black !important; }
}

/* ---- «+ ще один рядок» у формах (static/js/repeat.js) ---- */
.repeat-rows { display: grid; gap: 8px; }
.repeat-row { display: flex; align-items: center; gap: 8px; }
.repeat-row > select, .repeat-row > input, .repeat-row > .repeat-field { flex: 1; min-width: 0; }
.repeat-row > .repeat-code { flex: 0 0 110px; }
.repeat-row[hidden] { display: none; }
.repeat-remove {
    flex: none;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: var(--paper);
    color: var(--muted);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}
.repeat-remove:hover { color: var(--red); border-color: var(--red); }
.repeat-add { margin-top: 10px; }
.repeat-delete { display: none; }
html:not(.js) .repeat-remove { display: none; }

/* Фільтр періоду в рядку фільтрів: дві дати «з» і «по» одна під одною. */
.period-filter { display: grid; gap: 4px; }
.period-filter label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--muted);
}
.period-filter span { flex: 0 0 18px; }
/* Колонка, якій ще не придумали змісту: видно, що вона є, але нічого не обіцяє. */
th.is-inactive, td.is-inactive { color: var(--muted); opacity: 0.55; }

/* ---- форми платформи ---- */
.form-field { margin-bottom: 20px; }
.form-field > small { display: block; margin-top: 6px; }
.form-page-wide { max-width: 680px; }
.form-section-title { margin: 30px 0 6px; font-size: 1.05rem; }
.form-section-lead { margin: 0 0 14px; font-size: 0.9rem; }
/* Перемикач «новий / уже є» — два радіо, що виглядають як вкладки. */
.mode-switch { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 20px; padding: 0; border: 0; }
.mode-switch label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 9px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    font-weight: 600;
    cursor: pointer;
}
.mode-switch input { width: auto; margin: 0; }
.mode-switch label:has(input:checked) { border-color: var(--copper); background: var(--cream); }
.danger-button { color: var(--red); border-color: var(--red); }

/* ---- картка курсу ---- */
.course-kicker { margin: 0 0 4px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.course-summary {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 26px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px 40px;
}
.course-description { margin: 0; max-width: 62ch; flex: 1 1 320px; }
.course-summary > p { flex: 1 1 320px; margin: 0; }
.course-facts { display: flex; gap: 32px; margin: 0; }
.course-facts dt { font-size: 0.78rem; color: var(--muted); }
.course-facts dd { margin: 2px 0 0; font-size: 1.6rem; font-weight: 600; line-height: 1.1; }
.repeat-row { flex-wrap: wrap; }
.repeat-row > .errorlist { flex-basis: 100%; margin: 0; }
.taught-in { margin: 0 0 8px; padding-left: 18px; }
.taught-in li { margin-bottom: 4px; }
.filter-bar-wrap { flex-wrap: wrap; }
a.chip { white-space: nowrap; }

/* ---- програма з годинами й вартістю ---- */
.repeat-row > .repeat-hours { flex: 0 0 90px; }
/* Колонки «за змістом»: ширина 1% + без переносу стискає їх до найширшої
   комірки, решту ширини забирає назва предмета. */
.program-table .fit { width: 1%; white-space: nowrap; }
.program-table .num { text-align: right; font-variant-numeric: tabular-nums; }
/* Кілька викладачів — одне під одним: колонка завширшки з найдовше ім'я,
   а не з усі імена в ряд, і назві предмета лишається місце. */
.program-table .teacher-stack .chip { display: table; margin: 2px 0; }
.program-table tfoot th { border-top: 2px solid var(--border-strong); font-weight: 600; }

.module-block { margin: 14px 0 0; }
.module-block > .table-card { margin-top: 8px; }
.module-heading {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
    padding: 10px 4px; cursor: pointer; list-style: none;
    border-bottom: 1px solid var(--border);
}
.module-heading::-webkit-details-marker { display: none; }
.module-heading::before {
    content: ''; width: 8px; height: 8px; flex: none;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(-45deg); transition: transform .15s; opacity: .6;
}
.module-block[open] > .module-heading::before { transform: rotate(45deg); }
.module-heading h3 { margin: 0; font-size: 1.05rem; }
.module-price { margin-left: auto; display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.module-price .money-uah { font-weight: 600; font-variant-numeric: tabular-nums; }
html:not(.js) [data-modules-toggle] { display: none; }

/* гривні, під ними дрібно — євро */
.money { display: inline-flex; flex-direction: column; line-height: 1.15; }
.money-uah { font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.money-eur { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.module-price .money-uah { font-size: 1rem; }

.cost-summary {
    margin-top: 16px;
    padding: 18px 22px 14px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
}
.cost-summary-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 20px; }
.cost-summary-head h2 { margin: 0; font-size: 1.15rem; }
.euro-rate { margin: 0; font-size: 0.88rem; }
.price-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 14px; }
.price-card { padding: 14px 16px; background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.price-card h3 { margin: 0 0 8px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.price-card p { margin: 8px 0 0; font-size: 0.82rem; }
.price-card-accent { border-color: var(--border-strong); }
.price-card-accent .money-uah { color: var(--green); }
.cost-summary-note { margin: 10px 0 0; font-size: 0.8rem; }
@media (max-width: 640px) {
    .table-card:has(.program-table) { overflow-x: auto; }
    .repeat-row > .repeat-hours { flex-basis: 70px; }
    .module-price { margin-left: 0; align-items: flex-start; }
}
.pricing-note { margin: 0 0 10px; font-size: 0.85rem; }
.repeat-row > .repeat-teachers { flex-basis: 100%; display: grid; gap: 4px; font-size: 0.85rem; }
.repeat-teachers select { width: 100%; }
