@font-face {
  font-family: "Kiyosuna Sans";
  src: url("logo-fonts/kiyosuna-sans-bold.otf") format("opentype");
  font-weight: 700;
  font-display: swap;
}

.competition-home {
  --home-gutter: clamp(20px, 6vw, 112px);
  background: var(--paper);
}

.snow-section {
  position: relative;
  isolation: isolate;
  overflow: clip;
}

.snow-field {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  color: var(--blue);
  pointer-events: none;
}

.home-inner {
  width: min(100% - 2 * var(--home-gutter), 92rem);
  margin-inline: auto;
}

.competition-hero {
  --hero-control-border: color-mix(in srgb, var(--fog) 54%, transparent);
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: center;
  min-height: max(38rem, 100svh);
  color: var(--surface);
  background: var(--navy);
}

.competition-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 53%, color-mix(in srgb, var(--navy) 82%, transparent), color-mix(in srgb, var(--navy) 58%, transparent) 37%, transparent 77%),
    linear-gradient(180deg, color-mix(in srgb, var(--navy) 62%, transparent), color-mix(in srgb, var(--navy) 24%, transparent) 32%, color-mix(in srgb, var(--navy) 66%, transparent)),
    url("hero-wedo-new-year.jpg") center 53% / cover no-repeat;
}

.hero-body { padding-block: clamp(38px, 6vw, 86px); }
.hero-copy { max-width: 53rem; margin-inline: auto; text-align: center; }

.competition-hero h1 {
  margin: 0;
  font: 700 clamp(3.5rem, 8vw, 8.75rem)/1.05 "Kiyosuna Sans", var(--heading);
  font-kerning: normal;
  font-synthesis: none;
  text-shadow: 0 3px 28px color-mix(in srgb, var(--navy) 65%, transparent);
}

.hero-title-accent { color: var(--ice); }

.hero-description {
  max-width: 34ch;
  margin: clamp(14px, 1.8vw, 26px) auto clamp(24px, 2.6vw, 38px);
  color: var(--fog);
  font-size: clamp(1.15rem, 1.8vw, 1.6rem);
  line-height: 1.38;
  text-wrap: balance;
}

.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.hero-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 12px clamp(18px, 2vw, 28px);
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--surface);
  font-weight: 700;
  text-decoration: none;
  transition: background-color .2s, border-color .2s;
}

.hero-apply { background: var(--red); }
.hero-apply:hover { background: var(--red-hover); border-color: var(--red-tint); }
.hero-guide { border-color: var(--hero-control-border); }
.hero-guide:hover { border-color: var(--ice); background: color-mix(in srgb, var(--blue) 48%, transparent); }
.competition-hero a:focus-visible { outline-color: var(--ice); }

.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding-block-start: clamp(18px, 3vw, 38px);
}

.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--hero-control-border);
  border-radius: 99px;
  background: color-mix(in srgb, var(--navy) 78%, transparent);
  color: var(--surface);
  font-size: .93rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .2s, border-color .2s;
}

.hero-links a:hover { background: var(--navy); border-color: var(--ice); }
.hero-links svg { width: 18px; height: 18px; flex: none; color: var(--ice); }

.home-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: clamp(24px, 6vw, 100px);
  padding-block: clamp(44px, 6vw, 92px);
  border-bottom: 1px solid var(--rule);
}

.home-section > h2, .about-introduction h2, .competition-calendar h2, .participation h2 {
  margin: 0;
  font: 700 clamp(2.05rem, 4vw, 4rem)/1.08 var(--heading);
}

.home-content {
  min-width: 0;
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  line-height: 1.58;
}

.home-content p { max-width: 62ch; margin: 0; color: var(--muted); }

#about { background: var(--fog); color: var(--navy); }
#about .snow-field { color: var(--ice); }
.about-section { padding-block: clamp(42px, 6vw, 92px); }

.about-introduction {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
  align-items: start;
  gap: 12px clamp(26px, 5vw, 76px);
}

.about-introduction h2 {
  font-size: clamp(2.05rem, 5.35vw, 5rem);
  overflow-wrap: anywhere;
}

.about-intro {
  max-width: 40ch;
  margin: 0;
  font-size: clamp(1rem, 1.45vw, 1.25rem);
  line-height: 1.5;
}

.about-cards {
  --about-card-gap: clamp(12px, 2vw, 24px);
  display: grid;
  gap: var(--about-card-gap);
  margin-block-start: clamp(18px, 2.6vw, 30px);
}

.about-age-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--about-card-gap);
}

/* same look as the "Как участвовать" cards: ice-blue on top fading out downwards */
.about-age-card, .nomination-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 0;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--ice), transparent);
}
.about-age-card::before, .nomination-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(112deg, transparent 34%, var(--fog), transparent 66%);
  mask-image: linear-gradient(var(--navy), transparent 76%);
  opacity: 0;
  animation: card-shimmer 8s ease-in-out infinite;
}
.about-age-card-senior::before { animation-delay: 1.1s; }
.nomination-card:nth-child(1)::before { animation-delay: 2.2s; }
.nomination-card:nth-child(2)::before { animation-delay: 3.3s; }
.nomination-card:nth-child(3)::before { animation-delay: 4.4s; }
.nomination-card:nth-child(4)::before { animation-delay: 5.5s; }

.about-age-card {
  display: grid;
  gap: clamp(6px, 1vw, 12px);
  padding: clamp(20px, 2.8vw, 36px);
}
.about-age-card h3 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(.95rem, 1.3vw, 1.12rem);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.about-age-card .about-age { margin: 0; color: var(--red); font: 700 clamp(2.6rem, 6vw, 5.4rem)/.95 var(--heading); }
.about-age span { margin-left: .12em; color: var(--navy); font-size: .4em; }

.nominations-block { margin-top: clamp(8px, 1.4vw, 16px); color: var(--navy); }
.nominations-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 20px;
  margin-bottom: clamp(12px, 1.8vw, 20px);
}
.nominations-head h3 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2.3rem); line-height: 1.1; }
.nominations-head p { margin: 0; color: var(--blue); font-weight: 600; }
.nominations-empty { margin: 0; }

.nomination-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--about-card-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nomination-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: clamp(16px, 2vw, 24px);
}
.nomination-top { display: flex; align-items: center; justify-content: space-between; }
.nomination-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--ice);
  color: var(--navy);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--surface) 75%, transparent);
}
.nomination-icon svg { width: 22px; height: 22px; }
.nomination-no { color: color-mix(in srgb, var(--navy) 35%, transparent); font: 700 clamp(1.3rem, 2vw, 1.7rem)/1 var(--heading); }
.nomination-card h4 { margin: 4px 0 0; font-size: clamp(1.08rem, 1.5vw, 1.3rem); line-height: 1.2; overflow-wrap: anywhere; }
.nomination-card p { margin: 0; color: var(--muted); font-size: clamp(.9rem, 1.05vw, .98rem); line-height: 1.5; }

@media (max-width: 1100px) { .nomination-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }


.competition-calendar {
  padding-block: clamp(22px, 3vw, 42px);
  color: var(--fog);
  text-align: center;
  background: var(--navy);
}

.competition-dates {
  --dot-gap: 12.5%;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: clamp(15px, 2.4vw, 30px) 0 0;
  padding: 0;
  list-style: none;
}

/* grey track between the first and the last dot, filled up to today */
.competition-dates::before, .competition-dates::after {
  content: "";
  position: absolute;
  top: 5px;
  left: var(--dot-gap);
  height: 2px;
}
.competition-dates::before { right: var(--dot-gap); background: var(--date-future); }
.competition-dates::after {
  width: calc((100% - 2 * var(--dot-gap)) * var(--progress, 0));
  background: var(--ice);
  transition: width .4s ease;
}
/* blue line with a short red tip at today's end; the red never reaches back over a passed (blue) dot */
.competition-dates::after { background: linear-gradient(90deg, var(--ice) max(calc(100% - 140px), calc(100% * var(--tip-from, 1))), var(--red)); }

.competition-dates li {
  --date-accent: var(--date-future);
  position: relative;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 5px;
  padding: clamp(18px, 2vw, 26px) clamp(6px, 1.4vw, 20px) 0;
}
.competition-dates { --date-future: color-mix(in srgb, var(--fog) 30%, var(--navy)); }
.competition-dates li.is-done { --date-accent: var(--ice); }
.competition-dates li.is-current { --date-accent: var(--red); }
.competition-dates li.is-future p { color: color-mix(in srgb, var(--fog) 45%, var(--navy)); }

.competition-dates li::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 50%;
  transform: translateX(-50%);
  z-index: 1;
  width: 12px;
  height: 12px;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: var(--date-accent);
  outline: 1px solid var(--date-accent);
}
.competition-dates li.is-current::before { width: 16px; height: 16px; top: -2px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--red) 25%, transparent); }

.calendar-date { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0 5px; color: var(--date-accent); font-weight: 750; }
.calendar-date time { display: inline-flex; align-items: baseline; gap: .35em; padding-block: 3px; }
.calendar-date strong { font: 700 clamp(2.1rem, 3.9vw, 3.6rem)/.96 var(--heading); }
.competition-dates p { max-width: 24ch; margin: 0; color: var(--fog); font-size: clamp(.98rem, 1.45vw, 1.18rem); font-weight: 650; line-height: 1.4; }

.participation {
  --step-gap: clamp(12px, 2vw, 26px);
  padding-block: clamp(42px, 6vw, 88px);
  color: var(--fog);
  background: var(--navy);
}

.participation-layout {
  display: grid;
  row-gap: clamp(22px, 3vw, 40px);
}

.participation-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--step-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.participation-steps li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(46px, 26%, 106px);
  column-gap: clamp(10px, 1.4vw, 20px);
  min-height: clamp(10rem, 18vw, 16rem);
  padding: clamp(16px, 2.2vw, 32px);
}

.participation-steps li {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--blue), var(--navy));
}

.participation-steps li::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(112deg, transparent 34%, var(--card-shimmer, var(--ice)), transparent 66%);
  mask-image: linear-gradient(var(--navy), transparent 76%);
  opacity: 0;
  animation: card-shimmer 8s ease-in-out infinite;
}

.participation-steps li:nth-child(2)::before { animation-delay: 1.1s; }
.participation-steps li:nth-child(3)::before { animation-delay: 2.2s; }

@keyframes card-shimmer {
  0% { transform: translateX(-80%); opacity: 0; }
  17% { opacity: .13; }
  38%, 100% { transform: translateX(80%); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .participation-steps li::before, .about-age-card::before, .nomination-card::before { animation: none; }
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  overflow: hidden;
  container-type: size;
  color: var(--ice);
  opacity: .82;
  pointer-events: none;
}
.step-number span {
  font: 700 clamp(2.8rem, min(112cqh, 188cqw), 17rem)/.9 var(--heading);
  mask-image: linear-gradient(var(--navy) 22%, transparent 100%);
  transform: scaleX(.85);
  transform-origin: right center;
}
.participation-steps h3 { max-width: 21ch; margin: 0 0 10px; font-size: clamp(1.25rem, 2.1vw, 1.85rem); line-height: 1.14; }
.participation-steps p { max-width: 54ch; margin: 0; color: var(--fog); line-height: 1.55; }

.home-questions .home-section {
  align-items: start;
  column-gap: clamp(48px, 7vw, 112px);
  border-bottom: 0;
}

.faq-stack { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
.faq-list { grid-area: 1 / 1; }
.faq-measure { visibility: hidden; }
.faq-answer-space { display: grid; grid-template-columns: minmax(0, 1fr); }
.faq-answer-space .faq-answer { grid-area: 1 / 1; }
.faq-answer { overflow: clip; }

.home-questions details { border-top: 1px solid var(--rule); }
.home-questions details:last-of-type { border-bottom: 1px solid var(--rule); }
.home-questions summary { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding-block: 17px; cursor: pointer; font-weight: 720; list-style: none; }
.home-questions summary::-webkit-details-marker { display: none; }
.home-questions summary::after {
  content: "";
  flex: 0 0 24px;
  height: 24px;
  background: linear-gradient(var(--blue), var(--blue)) center / 14px 2px no-repeat,
              linear-gradient(var(--blue), var(--blue)) center / 2px 14px no-repeat;
}
.home-questions details[open] summary::after { background-size: 14px 2px, 0 0; }
.home-questions summary:hover { color: var(--blue); }
.home-questions summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.home-questions p { padding-bottom: 16px; }

@media (max-width: 860px) {
  .home-questions .home-section { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .about-introduction { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .competition-hero {
    grid-template-rows: auto auto;
    min-height: 0;
  }
  .competition-hero::before {
    background:
      linear-gradient(180deg,
        color-mix(in srgb, var(--navy) 48%, transparent),
        color-mix(in srgb, var(--navy) 35%, transparent) 31%,
        color-mix(in srgb, var(--navy) 76%, transparent) 57%,
        color-mix(in srgb, var(--navy) 87%, transparent)),
      url("hero-wedo-new-year.jpg") center 52% / cover no-repeat;
  }

  .hero-links { gap: 8px; }
  .hero-body { padding-block: clamp(148px, 43vw, 300px) clamp(22px, 5vw, 36px); }
  .competition-hero h1 { font-size: clamp(3.1rem, 12.7vw, 6rem); }
  .hero-description { margin: 10px auto 18px; }
  .nomination-cards { grid-template-columns: minmax(0, 1fr); }
  .about-age-card { padding: 16px; }
  .about-age-card h3 { font-size: .78rem; letter-spacing: .05em; }
  .about-age-card .about-age { font-size: clamp(2rem, 10vw, 2.8rem); white-space: nowrap; }
  .competition-dates { grid-template-columns: minmax(0, 1fr); width: min(100%, 28rem); margin: 10px auto 0; }
  .competition-dates::before, .competition-dates::after { display: none; }
  .competition-dates li {
    grid-template-columns: clamp(7.25rem, 28vw, 10.5rem) minmax(0, 1fr);
    align-items: baseline;
    justify-items: start;
    gap: 12px;
    padding: 7px 0 7px 24px;
    text-align: start;
  }
  .competition-dates li::before { inset: 17px auto auto 0; transform: none; }
  .competition-dates li:not(:last-child)::after {
    content: "";
    position: absolute;
    inset: 23px auto -23px 5px;
    width: 2px;
    background: var(--date-future);
  }
  .competition-dates li.is-done:not(:last-child)::after { background: var(--ice); }
  .competition-dates li.is-done:has(+ .is-current)::after { background: linear-gradient(180deg, var(--ice) 45%, var(--red)); }
  .competition-dates li.is-current::before { top: 15px; left: -2px; }
  .calendar-date { justify-content: flex-start; font-size: .93rem; }
  .calendar-date strong { font-size: clamp(1.9rem, 6vw, 2.9rem); }
  .home-section { grid-template-columns: minmax(0, 1fr); }
  .participation-steps { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .hero-links a { gap: 6px; padding-inline: 10px; font-size: .83rem; }
  .hero-links svg { width: 16px; height: 16px; }
  .hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 22rem; margin-inline: auto; }
  .hero-button { min-height: 48px; padding-inline: 9px; font-size: .91rem; }
}

/* Date picker for trying the contest stages */
.date-demo { position: fixed; top: 14px; right: 14px; z-index: 50; display: grid; justify-items: end; gap: 8px; font-family: inherit; }
.date-demo-toggle { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 10px; border: 1px solid color-mix(in srgb, var(--navy) 25%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--navy); font-weight: 700; font-size: .85rem; box-shadow: 0 6px 18px rgb(0 0 0 / .18); backdrop-filter: blur(6px); cursor: pointer; }
.date-demo-toggle svg { width: 18px; height: 18px; }
.date-demo-toggle:hover { background: var(--surface); }
.date-demo-panel { display: grid; gap: 8px; width: 300px; margin: 0; padding: 12px 14px 14px; border-radius: 16px; background: var(--surface); color: var(--navy); box-shadow: 0 14px 36px rgb(0 0 0 / .25); }
.date-demo.is-collapsed .date-demo-panel { display: none; }
.date-demo:not(.is-collapsed) .date-demo-toggle { display: none; }
.date-demo-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 2px; font-size: .85rem; }
.date-demo-hide { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.date-demo-hide:hover { background: var(--blue-wash); color: var(--navy); }
.date-demo-value { font: 700 1.15rem/1.2 var(--heading); }
.date-demo-slider { --thumb: 18px; position: relative; padding-bottom: 2px; }
.date-demo-slider input[type=range] { --fill: 0; width: 100%; min-height: 0; height: var(--thumb); margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; }
.date-demo-slider input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--red) calc(var(--fill) * 100%), var(--rule) 0); }
.date-demo-slider input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--red) calc(var(--fill) * 100%), var(--rule) 0); }
.date-demo-slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: var(--thumb); height: var(--thumb); margin-top: -6px; border: 3px solid var(--surface); border-radius: 50%; background: var(--navy); box-shadow: 0 1px 4px rgb(0 0 0 / .35); }
.date-demo-slider input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border: 3px solid var(--surface); border-radius: 50%; background: var(--navy); box-shadow: 0 1px 4px rgb(0 0 0 / .35); }
.date-demo-marks { position: relative; height: 40px; margin: 2px 0 0; }
.date-demo-mark:nth-child(even)::before { height: 23px; }
.date-demo-mark { position: absolute; top: 0; left: calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--at) / 100); transform: translateX(-50%); display: grid; justify-items: center; gap: 3px; padding: 0; border: 0; background: none; color: var(--red); font: 700 .74rem/1 inherit; cursor: pointer; }
.date-demo-mark::before { content: ""; width: 2px; height: 9px; border-radius: 1px; background: currentColor; }
.date-demo-mark:hover span { text-decoration: underline; }
.date-demo-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: .7rem; }
.date-demo-real { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); color: var(--navy); font: inherit; font-size: .82rem; cursor: pointer; }
.date-demo-real:hover { border-color: var(--border); background: var(--blue-wash); }
.date-demo-real.is-active { border-color: var(--navy); background: var(--navy); color: #fff; }
.date-demo button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 560px) {
  .date-demo { top: 8px; right: 8px; }
  .date-demo-panel { width: min(300px, calc(100vw - 16px)); }
}
