/*
  ProAgro Group - сайт подій сезону (MaxICo Labs).
  Світ: чотири фото-світи подій + бурштинове семисегментне LED-табло з ghost-сегментами.
  Шкала: rem від дошки 1440 (root 16px), на 1536 root 16.5px (motion.js).
*/

@font-face {
  font-family: 'DSEG7';
  src: url('https://cdn.jsdelivr.net/npm/dseg@0.46.0/fonts/DSEG7-Modern/DSEG7Modern-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

:root {
  --ground: #0f0f0e;
  --ground-2: #151513;
  --ground-3: #1c1c19;
  --ink: #f6f6f4;
  --ink-2: #bdbab3;
  --ink-3: #8d8a84;
  --rule: rgba(246, 246, 244, 0.12);
  --rule-2: rgba(246, 246, 244, 0.2);
  --amber: #f5b31f;
  --amber-ink: #120d02;
  --amber-ghost: rgba(245, 179, 31, 0.085);
  --led-dim: #767471;
  --led-dim-ghost: rgba(246, 246, 244, 0.05);

  /* події розрізняються фото-світом (мініатюра), не кольором: увесь світ бурштиновий */
  --ev-livestock: var(--amber);
  --ev-grain: var(--amber);
  --ev-week: var(--amber);
  --ev-afs: var(--amber);

  /* Antonio - лише для латинських назв подій; усе з кирилицею - Oswald, щоб рядок був в одному шрифті */
  --f-display: 'Antonio', 'Arial Narrow', sans-serif;
  --f-head: 'Oswald', 'Arial Narrow', sans-serif;
  --f-ui: 'Oswald', 'Arial Narrow', sans-serif;
  --f-body: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-led: 'DSEG7', ui-monospace, monospace;

  --hu: clamp(14px, 1.0742vw, 18px);
  --gutter: calc(3.45 * var(--hu));
  --nav-h: calc(4.85 * var(--hu));
  --strip-h: calc(3.76 * var(--hu));
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  color-scheme: dark;
}

html { background: var(--ground); }

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.55;
}

::selection { background: var(--amber); color: var(--amber-ink); }

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

html { scrollbar-color: #3a3935 var(--ground); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ground); }
::-webkit-scrollbar-thumb { background: #34332f; border: 2px solid var(--ground); border-radius: 6px; }

a { text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a, button, [role="tab"] { touch-action: manipulation; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip {
  position: fixed; left: 1rem; top: -4rem; z-index: 200;
  background: var(--amber); color: var(--amber-ink);
  padding: 0.7rem 1rem; font-family: var(--f-ui); font-weight: 600;
  text-decoration: none; border-radius: 0.3rem;
  transition: top 0.2s var(--ease-out);
}
.skip:focus { top: 1rem; }

/* ------------------------------------------------------------------ */
/* LED: семисегментне табло з ghost-клітинками (одна маска на все)     */
/* ------------------------------------------------------------------ */

.led {
  position: relative;
  display: inline-block;
  font-family: var(--f-led);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  color: var(--amber);
  letter-spacing: 0.02em;
  font-variant-numeric: normal;
}
.led__ghost { color: var(--amber-ghost); }
.led__lit { position: absolute; left: 0; top: 0; }
.led--dim { color: var(--led-dim); }
.led--dim .led__ghost { color: var(--led-dim-ghost); }
.led--off .led__lit { opacity: 0; }

/* ------------------------------------------------------------------ */
/* Кнопки                                                             */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.35rem;
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: 0.3rem;
  white-space: nowrap;
  transition: background-color 0.25s var(--ease-out), color 0.25s var(--ease-out), transform 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}
.btn--amber { background: #f7b633; color: var(--amber-ink); }
.btn--amber:hover { background: #ffc33d; }
.btn--amber:active { transform: translateY(1px); }
.btn--line { border: 1px solid var(--rule-2); color: var(--ink); }
.btn--line:hover { border-color: var(--ink); }
.btn--lg { min-height: 4rem; padding: 0 2.4rem; font-size: 1.75rem; }

/* ------------------------------------------------------------------ */
/* Навігація                                                          */
/* ------------------------------------------------------------------ */

.nav {
  position: relative;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 calc(2.67 * var(--hu)) 0 calc(2.42 * var(--hu));
  background: #0a0909;
  border-bottom: 1px solid rgba(246, 246, 244, 0.07);
}
.nav__mark {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: calc(1.72 * var(--hu));
  letter-spacing: 0.005em;
  line-height: 1;
  text-decoration: none;
  color: var(--ink);
}
.nav__links {
  display: flex;
  gap: calc(3.62 * var(--hu));
  margin-left: calc(16.25 * var(--hu));
}
.nav__links a {
  position: relative;
  font-family: var(--f-ui);
  font-weight: 500;
  font-size: calc(1.3 * var(--hu));
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  padding: calc(0.7 * var(--hu)) 0;
}
.nav__links a::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: calc(0.2 * var(--hu));
  height: 1px; background: var(--amber);
  transform: scaleX(0); transform-origin: right center;
  transition: transform 0.35s var(--ease-out);
}
.nav__links a:hover::after,
.nav__links a[aria-current]::after { transform: scaleX(1); transform-origin: left center; }
.nav__cta {
  margin-left: auto;
  height: calc(2.95 * var(--hu));
  padding: 0 calc(1.2 * var(--hu));
  font-size: calc(1.4 * var(--hu));
}
.nav__toggle {
  display: none;
  margin-left: calc(0.75 * var(--hu));
  min-width: 44px; min-height: 44px;
  padding: 0 calc(0.75 * var(--hu));
  font-family: var(--f-ui); font-weight: 500; font-size: calc(1.05 * var(--hu));
  color: var(--ink);
  border: 1px solid var(--rule-2);
  border-radius: calc(0.3 * var(--hu));
}

.menu {
  position: fixed; inset: 0; z-index: 60;
  display: none;
  flex-direction: column;
  padding: 5.5rem 1.25rem 2rem;
  background: rgba(10, 9, 9, 0.98);
}
.menu.is-open { display: flex; }
.menu a {
  font-family: var(--f-ui); font-weight: 500;
  font-size: 2.2rem; line-height: 1.1;
  color: var(--ink); text-decoration: none;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
}
.menu__close {
  position: absolute; top: 0.75rem; right: 1rem;
  min-width: 44px; min-height: 44px; padding: 0 0.75rem;
  font-family: var(--f-ui); font-size: 1.05rem;
  border: 1px solid var(--rule-2); border-radius: 0.3rem;
}

/* ------------------------------------------------------------------ */
/* Головна: чотири колонки-акордеон                                   */
/* ------------------------------------------------------------------ */

.season-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100svh - var(--nav-h));
  min-height: calc(38 * var(--hu));
  max-height: calc(64 * var(--hu));
}

.cols {
  position: relative;
  flex: 1;
  display: flex;
  gap: 2px;
  background: #0a0909;
  min-height: 0;
}

.col {
  --grow: 276;
  position: relative;
  flex: var(--grow) 1 0;
  min-width: 0;
  overflow: hidden;
  background: var(--ground);
  container-type: inline-size;
  transition: flex-grow 0.85s var(--ease-in-out);
}
.col.is-open { --grow: 701; }
.col--grain { --grow: 256; }
.col--week { --grow: 268; }
.col--afs { --grow: 305; }
.col--grain.is-open, .col--week.is-open, .col--afs.is-open { --grow: 701; }

.col__media {
  position: absolute; inset: 0;
  overflow: hidden;
}
.col__photo {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 116%;
  object-fit: cover;
  object-position: var(--pos-closed, 50%) 50%;
  transition: object-position 0.85s var(--ease-in-out), transform 1.2s var(--ease-out), filter 0.6s var(--ease-out);
  filter: saturate(0.94);
}
.col.is-open .col__photo {
  object-position: var(--pos-open, 50%) 50%;
  filter: none;
}
.col--livestock { --pos-closed: 50%; --pos-open: 60%; }
.col--grain { --pos-closed: 45%; --pos-open: 44%; }
.col--week { --pos-closed: 50%; --pos-open: 50%; }
.col--afs { --pos-closed: 57%; --pos-open: 62%; }
.col--week .col__photo { top: -16%; }
.col--afs .col__photo { top: 0; height: 104%; }
.col--grain .col__photo { height: 104%; top: -6%; }

.col__shade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10, 9, 9, 0.94) 0%, rgba(10, 9, 9, 0.78) 11%, rgba(10, 9, 9, 0.25) 20%, rgba(10, 9, 9, 0) 30%);
  pointer-events: none;
}
.col__shade::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10, 9, 9, 0.97) 0%, rgba(10, 9, 9, 0.93) 30%, rgba(10, 9, 9, 0.6) 44%, rgba(10, 9, 9, 0) 60%);
  opacity: 0;
  transition: opacity 0.8s var(--ease-out);
}
.col.is-open .col__shade::after { opacity: 1; }

.col__link {
  position: absolute; inset: 0; z-index: 2;
  text-decoration: none;
  color: inherit;
}
.col__link:focus-visible { outline-offset: -4px; }

/* закритий стан: вертикальна назва + LED-дата */
.col__closed {
  position: absolute; left: 0; right: 0; bottom: 0; top: 0;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.45s var(--ease-out) 0.25s;
}
.col.is-open .col__closed { opacity: 0; transition-delay: 0s; transition-duration: 0.2s; }

.col__label {
  position: absolute;
  left: calc(1.4 * var(--hu));
  bottom: calc(8.1 * var(--hu));
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: min(calc(2.62 * var(--hu)), 16.8cqi);
  line-height: 1;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
}
.col__date {
  position: absolute;
  left: calc(1.82 * var(--hu));
  bottom: calc(3.3 * var(--hu));
  font-size: min(calc(3 * var(--hu)), 19cqi);
  letter-spacing: 0.04em;
}
.col--afs .col__date { font-size: min(calc(2.76 * var(--hu)), 15cqi); bottom: calc(3.95 * var(--hu)); left: calc(1.3 * var(--hu)); }
.col__past {
  position: absolute;
  left: calc(2.5 * var(--hu));
  bottom: calc(1.2 * var(--hu));
  font-family: var(--f-body);
  font-weight: 500;
  font-size: min(calc(1.62 * var(--hu)), 11cqi);
  line-height: 1;
  color: var(--led-dim);
}

/* відкритий стан: панель події */
.col__panel {
  position: absolute;
  left: var(--gutter);
  right: calc(1 * var(--hu));
  bottom: calc(2.3 * var(--hu));
  z-index: 3;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transform: translateY(calc(1.2 * var(--hu)));
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), visibility 0s linear 0.3s;
  min-width: calc(30 * var(--hu));
}
.col.is-open .col__panel {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity 0.6s var(--ease-out) 0.35s, transform 0.8s var(--ease-out) 0.35s, visibility 0s linear 0s;
}
.col.is-open .col__panel a { pointer-events: auto; }

.col__title {
  margin-top: calc(1 * var(--hu));
  font-family: var(--f-display);
  font-weight: 700;
  font-size: min(calc(3.7 * var(--hu)), calc((100cqi - calc(4.6 * var(--hu))) / 10.05));
  line-height: 1.02;
  letter-spacing: -0.035em;
  white-space: nowrap;
  color: var(--ink);
}
.col__meta {
  margin-top: calc(1.28 * var(--hu));
  font-family: var(--f-body);
  font-weight: 500;
  font-size: calc(1.42 * var(--hu));
  line-height: 1.3;
  color: var(--ink);
}
.col__count {
  display: flex;
  align-items: flex-end;
  gap: calc(1.5 * var(--hu));
  margin-top: calc(2 * var(--hu));
  margin-left: calc(0.72 * var(--hu));
  line-height: 1;
}
.col__count .led { font-size: calc(4.5 * var(--hu)); letter-spacing: 0.04em; }
.col__unit {
  font-family: var(--f-ui);
  font-weight: 400;
  font-size: calc(2.3 * var(--hu));
  line-height: 0.8;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
}
.col__count--past .col__unit { color: var(--led-dim); font-size: calc(1.6 * var(--hu)); letter-spacing: 0.02em; text-transform: none; }
@container (max-width: 540px) {
  .col__title { white-space: normal; font-size: calc(2.5 * var(--hu)); letter-spacing: -0.02em; }
}
.col__cta { margin-top: calc(1.76 * var(--hu)); height: calc(4 * var(--hu)); min-width: calc(18.9 * var(--hu)); font-size: calc(1.85 * var(--hu)); font-weight: 700; }

.season-strip {
  height: var(--strip-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(1.1 * var(--hu));
  background: #0a0909;
  border-top: 1px solid rgba(246, 246, 244, 0.08);
  font-family: var(--f-ui);
  font-weight: 400;
  font-size: calc(1.45 * var(--hu));
  letter-spacing: 0.05em;
  color: #8f8e8c;
  white-space: nowrap;
  overflow: hidden;
}
.season-strip__dot { color: #5d5c5a; }

/* ------------------------------------------------------------------ */
/* Спільне для секцій                                                 */
/* ------------------------------------------------------------------ */

.wrap {
  width: 100%;
  max-width: 90rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sec {
  position: relative;
  padding: 9rem 0;
  border-top: 1px solid var(--rule);
}

.sec__head {
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
  margin-bottom: 4rem;
}
.sec__title {
  font-family: var(--f-head);
  font-weight: 600;
  font-size: clamp(2.1rem, 3.75vw, 3.9rem);
  line-height: 1.04;
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.sec__lede {
  max-width: 44rem;
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: pretty;
}

.note {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ink-3);
}

.star { color: var(--amber); }

/* ------------------------------------------------------------------ */
/* Футер                                                              */
/* ------------------------------------------------------------------ */

.foot {
  position: relative;
  padding: 6rem 0 2.5rem;
  overflow: hidden;
  background: #0a0909;
  border-top: 1px solid var(--rule);
}
.foot__mark {
  text-align: center;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: clamp(4rem, 18.8vw, 22.5rem);
  line-height: 0.8;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.foot__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
  color: var(--ink-2);
}
.foot__grid h3 {
  margin-bottom: 0.8rem;
  font-family: var(--f-ui);
  font-weight: 500;
  font-size: 1rem;
  color: var(--ink);
}
.foot__grid a { color: var(--ink-2); text-decoration: none; display: inline-block; padding: 0.2rem 0; }
.foot__grid a:hover { color: var(--ink); }
.foot__grid ul { list-style: none; margin: 0; padding: 0; }
.foot__concept {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.88rem;
  color: var(--ink-3);
}
.foot__concept a { color: var(--ink-2); }

/* ------------------------------------------------------------------ */
/* Прелоадер: LED-лічильник                                           */
/* ------------------------------------------------------------------ */

[data-preloader] {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.2rem var(--gutter) 2.4rem;
  background: #0a0909;
}
.pre__mark { font-family: var(--f-body); font-weight: 700; font-size: 1.87rem; line-height: 1; }
.pre__board { display: flex; align-items: flex-end; gap: 2rem; }
.pre__board .led { font-size: clamp(5rem, 14vw, 12rem); }
.pre__line {
  font-family: var(--f-ui); font-weight: 400; font-size: 1.3rem;
  letter-spacing: 0.035em; color: #8f8e8c;
  padding-bottom: 0.6rem;
}

/* ------------------------------------------------------------------ */
/* Адаптив першого екрана                                             */
/* ------------------------------------------------------------------ */

@media (max-width: 1180px) {
  .nav__links { margin-left: auto; gap: 2.2rem; }
  .nav__cta { margin-left: 2.2rem; }
}

@media (max-width: 1023.98px) {
  :root { --hu: 1rem; --gutter: 2rem; --nav-h: 4rem; --strip-h: 3rem; }
  .nav { padding: 0 1.25rem; }
  .nav__mark { font-size: 1.5rem; }
  .nav__links { display: none; }
  .nav__cta { height: 44px; font-size: 1.05rem; padding: 0 1rem; }
  .nav__toggle { display: inline-flex; align-items: center; }
  .col__panel { min-width: 22rem; }
  .season-strip { font-size: 1rem; gap: 0.6rem; }
  .sec { padding: 6rem 0; }
  .sec__head { gap: 1rem; margin-bottom: 3rem; }
}

@media (max-width: 760px) {
  :root { --gutter: 1.1rem; }
  .season-hero { height: auto; max-height: none; min-height: 0; }
  .cols { flex-direction: column; }
  .col { flex: none; height: 5.6rem; transition: height 0.7s var(--ease-in-out); }
  .col.is-open { height: 27rem; }
  .col__photo { object-position: 50% var(--pos-y, 45%); }
  .col.is-open .col__photo { object-position: 50% var(--pos-y, 45%); }
  .col--livestock { --pos-y: 30%; }
  .col--grain { --pos-y: 40%; }
  .col--week { --pos-y: 55%; }
  .col--afs { --pos-y: 50%; }
  .col__shade { background: linear-gradient(to right, rgba(10, 9, 9, 0.85) 0%, rgba(10, 9, 9, 0.45) 55%, rgba(10, 9, 9, 0.15) 100%); }
  .col.is-open .col__shade { background: linear-gradient(to top, rgba(10, 9, 9, 0.94) 0%, rgba(10, 9, 9, 0.6) 45%, rgba(10, 9, 9, 0.05) 80%); }
  .col__label {
    writing-mode: horizontal-tb; transform: none;
    left: var(--gutter); bottom: auto; top: 50%;
    translate: 0 -50%;
    font-size: 1.45rem;
    white-space: normal;
    max-width: 55%;
  }
  .col__date, .col--afs .col__date { left: auto; right: var(--gutter); bottom: auto; top: 50%; translate: 0 -50%; font-size: 1.9rem; }
  .col--afs .col__date { top: 42%; }
  .col__past { left: auto; right: var(--gutter); bottom: 0.7rem; font-size: 0.95rem; }
  .col__panel { left: var(--gutter); right: var(--gutter); bottom: 1.3rem; min-width: 0; }
    .col__title { font-size: min(2.35rem, calc((100cqi - 2.4rem) / 10.2)); margin-top: 0.4rem; }
  .col__meta { font-size: 0.98rem; margin-top: 0.5rem; }
  .col__count { margin-top: 0.9rem; margin-left: 0.2rem; gap: 0.9rem; }
  .col__count .led { font-size: 3rem; }
  .col__unit { font-size: 1.7rem; }
  .col__count--past .col__unit { font-size: 1.1rem; }
  .col__cta { margin-top: 1rem; height: 3.1rem; min-width: 0; width: 100%; font-size: 1.25rem; }
  .season-strip { height: auto; padding: 0.9rem var(--gutter); white-space: normal; flex-wrap: wrap; justify-content: flex-start; gap: 0.2rem 0.6rem; font-size: 0.92rem; }
  .sec { padding: 4.5rem 0; }
  .sec__title { font-size: 1.95rem; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .nav__cta { display: none; }
  .nav__toggle { margin-left: auto; }
}

/* ------------------------------------------------------------------ */
/* Мітка події: мініатюра її фото-світу замість кольорового квадрата   */
/* ------------------------------------------------------------------ */
.th-livestock { --thumb: url('../img/photo-livestock-720.webp'); --thumb-pos: 52% 30%; }
.th-grain { --thumb: url('../img/photo-grain-720.webp'); --thumb-pos: 45% 40%; }
.th-week { --thumb: url('../img/photo-field-720.webp'); --thumb-pos: 50% 55%; }
.th-afs { --thumb: url('../img/photo-port-720.webp'); --thumb-pos: 55% 50%; }

/* LED-слово: кириличні одиниці, зібрані з тих самих сегментів, що й цифри */
.ledw { display: inline-block; height: 1.12em; width: auto; overflow: visible; margin-bottom: -0.12em; vertical-align: bottom; }
.ledw .g { fill: var(--amber-ghost); }
.ledw .s { fill: currentColor; }
.led-star { font-family: var(--f-ui); font-size: 0.5em; vertical-align: top; margin-left: 0.15em; }
