/* ============================================================
   Маяк керамика — база
   1. Шрифты
   2. Токены
   3. Основа
   4. Сетка и утилиты
   5. Шапка и меню
   6. Фото
   7. Футер
   ============================================================ */

/* ---------- 1. Шрифты ---------- */

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/manrope-var.woff2') format('woff2-variations'),
       url('../fonts/manrope-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0400-045F, U+2013-2014, U+2116, U+2190-2193, U+20BD;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('../fonts/unbounded-var.woff2') format('woff2-variations'),
       url('../fonts/unbounded-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0400-045F, U+2013-2014, U+2116, U+2190-2193, U+20BD;
}

@font-face {
  font-family: 'Narezka';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/narezka.woff2') format('woff2');
}
/* Narezka has no ruble glyph; reuse the site's text face for that character. */
@font-face {
  font-family: 'Narezka';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/manrope-var.woff2') format('woff2');
  unicode-range: U+20BD;
}

/* ---------- 2. Токены ---------- */

:root {
  --paper: #f4f0e9;
  --ink: #24231f;
  --clay: #986649;
  --sand: #c9b79e;
  --ground-sand: #e9e0d2;
  --muted: #71695e;
  --line: #c6bdb0;

  --display: 'Narezka', sans-serif;
  --text: 'Manrope', sans-serif;
  --tracking-display: -.015em;
  --tracking-hero: .002em;
  --tracking-gallery: -.012em;
  --tracking-prices: -.005em;
  --workshop-word-ratio: .14;
  --footer-word-ratio: .12411;
  --type-section-compact: clamp(2rem, 1.25rem + 3.75vw, 2.5rem);
  --type-card-compact: 1.5rem;

  --gut: clamp(24px, 5vw, 96px);
  --header: 108px;
  --gap-action-note: 16px;
  --gap-hero-next: 72px;
  --ease: cubic-bezier(.22, 1, .36, 1);

  color-scheme: light;
  scrollbar-color: var(--sand) var(--paper);
  scrollbar-width: thin;
}

/* ---------- 3. Основа ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, figure, dl, dd { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; }
img { max-width: 100%; }
svg { display: block; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 5px;
  border-radius: 2px;
}

::selection { background: var(--clay); color: var(--paper); }

/* ---------- 4. Сетка и утилиты ---------- */

.wrap {
  width: calc(100% - var(--gut) * 2);
  max-width: 1728px;
  margin-inline: auto;
  min-width: 0;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 12px; left: 20px;
  z-index: 60;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-180%);
  transition: transform .2s var(--ease);
}
.skip-link:focus { transform: none; }

.lead {
  max-width: 40ch;
  font-size: 16px;
  line-height: 1.62;
  text-wrap: pretty;
}

.h2 {
  font: 700 clamp(30px, 3.3vw, 56px)/1.03 var(--display);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.btn {
  min-height: 48px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  transition: background .3s var(--ease), transform .18s var(--ease);
}
.btn:hover { background: var(--clay); }
.btn:active { transform: translateY(1px); }

/* ---------- 5. Шапка и меню ---------- */

.site-header { position: absolute; z-index: 20; top: 0; inset-inline: 0; }

.header-inner {
  min-height: var(--header);
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 48px);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  flex-shrink: 0;
}
.brand-logo { display: block; width: 42px; height: 42px; object-fit: contain; flex-shrink: 0; }
.brand-copy { display: flex; flex-direction: column; gap: 5px; }
.brand-name { font: 700 18px/1.1 var(--display); letter-spacing: var(--tracking-display); }
.brand-sub { font-size: 10px; line-height: 1.3; letter-spacing: .14em; color: var(--muted); }

.nav { margin-left: auto; display: flex; align-items: center; gap: clamp(18px, 2.2vw, 36px); }
.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  line-height: 1.3;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 11px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav a:hover::after,
.nav a[aria-current="true"]::after { transform: scaleX(1); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 14px;
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  margin-left: auto;
  cursor: pointer;
  padding: 10px;
  place-items: center;
  flex-shrink: 0;
}
.menu-toggle svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

.menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding-bottom: 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--paper);
  visibility: hidden;
  opacity: 0;
  transition: opacity .3s var(--ease), visibility .3s;
}
.menu[data-open="true"] { visibility: visible; opacity: 1; }

.menu-top {
  min-height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.menu-close { width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; margin-right: -8px; }
.menu-close svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.3; }

.menu-nav { display: flex; flex-direction: column; padding-top: 20px; }
.menu-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  font: 700 clamp(24px, 6.6vw, 32px)/1.2 var(--display);
  letter-spacing: var(--tracking-display);
}
.menu-nav a:last-child { border-bottom: 1px solid var(--line); }

.menu-foot { margin-top: 24px; font-size: 13px; color: var(--muted); }

/* ---------- 6. Фото ---------- */

.media { position: relative; overflow: hidden; }

.media > img,
.plate > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border: 1px solid var(--line);
  background: var(--ground-sand);
  transition: transform .8s var(--ease);
}

/* в галерее рамку заменяет глиняный шов между плитками,
   внутри карточки мероприятий — сама карточка */
#keramika .media > img,
#meropriyatiya .media > img { border: 0; }

/* ---------- 7. Страница ---------- */

.site { position: relative; --gap-section: clamp(64px, 5vw, 96px); }

.site section[id], .class-studio-flow { position: relative; scroll-margin-top: calc(var(--header) + 12px); }
.site > section + section,
.site > .class-studio-flow,
.site > .class-studio-flow + section,
.class-studio-stage > section + section { margin-top: var(--gap-section); }

@media (max-width: 900px) {
  .site { --gap-section: clamp(48px, 6vw, 64px); }
}

/* ---------- 8. Футер ---------- */

.foot {
  container-type: inline-size;
  --foot-dim: #a8a29a;
  --foot-line: rgba(244, 240, 233, .14);
  margin-top: clamp(48px, 8vh, 112px);
  padding-top: clamp(32px, 4.6vh, 56px);
  background: #24231f;
  color: var(--paper);
}

.foot__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: clamp(28px, 4.2vh, 44px);
  border-bottom: 1px solid var(--foot-line);
}
.foot__addr { font-size: clamp(15px, 1.15vw, 17px); line-height: 1.4; letter-spacing: -.01em; }
.foot__meta {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  letter-spacing: 0;
  color: var(--foot-dim);
}
.foot__cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(244, 240, 233, .4);
  font-size: clamp(15px, 1.15vw, 17px);
  white-space: nowrap;
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
.foot__cta:hover { border-color: var(--paper); }

.foot__index { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.foot__index a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(22px, 3.2vh, 32px) 0;
  border-bottom: 1px solid var(--foot-line);
  font-size: clamp(15px, 1.35vw, 19px);
  letter-spacing: -.015em;
  color: var(--paper);
  transition: color .25s var(--ease);
}
.foot__label { position: relative; display: inline-block; line-height: 1.3; }
.foot__label::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.foot__index a:hover .foot__label::after,
.foot__index a:focus-visible .foot__label::after { transform: scaleX(1); }

.foot__word {
  margin: clamp(40px, 6.4vh, 72px) 0 0;
  font: 700 calc((100cqi - var(--gut) * 2) * var(--footer-word-ratio))/.86 var(--display);
  letter-spacing: var(--tracking-display);
  white-space: nowrap;
  color: var(--paper);
  padding-inline: var(--gut);
  margin-bottom: -.05em;
  /* clip не создаёт скролл-контейнер, а clip-margin выпускает инкремент
     наружу: иначе срезались верх и хвост «р» */
  overflow: clip;
  overflow-clip-margin: .4em;
}

.foot__base {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: clamp(20px, 2.8vh, 28px) clamp(24px, 3.4vh, 32px);
  font-size: 11.5px;
  letter-spacing: .01em;
  color: var(--foot-dim);
}
.foot__up {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease);
}
.foot__up:hover { border-color: var(--paper); }

.foot a:focus-visible { outline: 2px solid var(--paper); outline-offset: 4px; }

@media (max-width: 900px) {
  .foot { margin-top: clamp(48px, 6vw, 64px); padding-top: 24px; }
  .foot__top { flex-direction: column; align-items: stretch; gap: 20px; padding-bottom: 24px; }
  .foot__cta { align-self: flex-start; min-height: 44px; align-items: center; }
  .foot__index { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
  .foot__index a { font-size: 16px; padding-block: 18px; }
  .foot__word { margin-top: 40px; }
  .foot__base { flex-wrap: wrap; gap: 10px 18px; padding-block: 22px 28px; }
  .foot__up { margin-left: auto; display: inline-flex; align-items: center; min-height: 44px; padding-block: 10px; }
}

/* ---------- 9. Адаптив шапки ---------- */

@media (max-width: 1100px) {
  :root { --gut: 40px; --header: 94px; }
  .brand-name { font-size: 17px; }
  .nav, .nav-cta { display: none; }
  .menu-toggle { display: grid; }
}

@media (max-width: 700px) {
  :root { --gut: 24px; --header: 82px; }

  .brand-logo { width: 48px; height: 48px; }
  .brand-copy { display: none; }
  .site > .class-studio-flow { margin-top: var(--gap-hero-next); }
  .brand-name { font-size: 15px; }
  .brand-sub { font-size: 8.5px; letter-spacing: .1em; }
  .brand { min-height: 44px; }

  .btn { width: 100%; }
  .lead { font-size: 16px; line-height: 1.5; }
}

@media (min-width: 1101px) {
  .menu { display: none; }
}

@media (min-width: 701px) and (max-width: 900px) {
  .header-inner { gap: 16px; }
  .brand-name { font-size: 16px; }
}


/* большие экраны: мелкий текст не должен выглядеть набором для 13" */
@media (min-width: 1600px) {
  :root { --header: 116px; }
  .lead { font-size: 18px; }
  .nav a, .nav-cta { font-size: 15px; }
  .brand-name { font-size: 20px; }
  .brand-sub { font-size: 11px; }
  .btn { min-height: 54px; padding-inline: 28px; font-size: 15px; }
}

/* ---------- 10. Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
