/* Lion Heart Quintet. Values come from the Figma frames on the "lionheart form" page. */

:root {
  --ink: #2e2828;
  --ink-rgb: 46, 40, 40;
  --error: #9e221b;
  --gap: 12px;

  /* Dark glass on the light pods. Stronger than the 0.49 dark pods, which sit on a
     darker background, so white text stays readable here. */
  --glass-dark: rgba(var(--ink-rgb), 0.64);
  --glass-dark-border: rgba(119, 118, 118, 0.85);
  --slide-solid: #6a6563;
  --slide-track: #aca7a0;

  /* Bounce used by every control */
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-time: 0.55s;
  --pill-spring: cubic-bezier(0.3, 1.12, 0.6, 1);
  --pill-spring-wide: cubic-bezier(0.3, 1.06, 0.6, 1);

  /* Page background */
  --bg-from: #f6f0e7;
  --bg-to: #2e2828;
  --circle-center: #000000;
  --circle-edge: #ebd2b6;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", "Noto Sans Armenian", sans-serif;
  --font-display: "Anton", "Oswald", "Noto Sans Armenian", Impact, sans-serif;
}

/* Alternate look from the Figma tests. Turn on in assets/js/config.js. */
:root[data-theme="orange"] {
  --bg-from: #2e2828;
  --bg-to: #2c2a76;
  --circle-center: #dd9e11;
  --circle-edge: #b8700a;
  --slide-solid: #6b6355;
  --slide-track: #b3a892;
}

@supports (transition-timing-function: linear(0, 1)) {
  :root {
    /* Sliding pills: a smaller bounce, tuned so they stay inside their track. */
    --pill-spring: linear(0.0, 0.0336, 0.118, 0.2322, 0.3598, 0.4886, 0.6101, 0.7189, 0.8119, 0.8882, 0.9481, 0.9928, 1.0242, 1.0444, 1.0556, 1.0598, 1.0589, 1.0546, 1.0482, 1.0406, 1.0329, 1.0254, 1.0186, 1.0128, 1.0079, 1.004, 1.0011, 0.999, 0.9976, 0.9968, 1);
    --pill-spring-wide: linear(0.0, 0.0276, 0.0974, 0.1928, 0.3008, 0.412, 0.5196, 0.6191, 0.7078, 0.7844, 0.8486, 0.901, 0.9424, 0.974, 0.9973, 1.0135, 1.024, 1.0301, 1.0327, 1.0328, 1.0312, 1.0284, 1.025, 1.0214, 1.0177, 1.0143, 1.0112, 1.0084, 1.0061, 1.0041, 1);
    --spring: linear(0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1.004 83.8%, 1);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

.menu, .toggle, .lang, .slide, .select__button, .button, .chip {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background: var(--bg-to);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, dl, dd, fieldset, legend { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
ul { list-style: none; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }

svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pod--dark :focus-visible { outline-color: #fff; }

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

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Background ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(to bottom right, var(--bg-from) 7%, var(--bg-to) 79%);
}

.bg__circle {
  position: absolute;
  left: -200px;
  bottom: -228px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(55.6% 55.6% at 55.6% 55.6%, var(--circle-center) 0%, var(--circle-edge) 100%);
}

/* ---------- Page shell ---------- */

.shell {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap);
  margin-top: var(--gap);
}

/* ---------- Glass ---------- */

.glass {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(48px);
  backdrop-filter: blur(48px);
}

.pod {
  min-width: 0;
  border-radius: 32px;
}

.pod--light {
  position: relative;
  z-index: 2; /* The weight class list may float over the pod below. */
  padding: 28px 24px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(48px);
  backdrop-filter: blur(48px);
}

.pod--dark {
  padding: 24px;
  color: #fff;
  background: rgba(var(--ink-rgb), 0.49);
  border: 1px solid rgba(119, 118, 118, 0.85);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.pod--cheat {
  padding: 24px;
  background: rgba(255, 255, 255, 0.83);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* ---------- Type ---------- */

.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 48px;
  line-height: 60px;
  text-wrap: balance;
}

.display:lang(ru) { font-family: "Oswald", "Anton", Impact, sans-serif; font-weight: 700; }
.display:lang(hy) { font-family: "Noto Sans Armenian", "Anton", sans-serif; font-weight: 800; font-stretch: 62.5%; }

.display--section { font-size: 40px; line-height: 48px; margin-bottom: 20px; }
.display--event { font-size: 40px; line-height: 48px; }

/* ---------- Top bar ---------- */

.topbar {
  position: relative;
  z-index: 5; /* The language list floats over the page. */
  display: flex;
  align-items: center;
  gap: var(--gap);
}

.chip {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.chip img { display: block; }

.chip--logo { overflow: hidden; }
.chip--logo img { width: 100%; height: 100%; }

.menu {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  height: 56px;
  padding: 5px;
  border-radius: 28px;
}

.menu__pill {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: var(--pill-width, 0);
  border-radius: 22px;
  background: rgba(var(--ink-rgb), 0.14);
  transform: translateX(var(--pill-x, 0));
  transition: transform var(--spring-time) var(--pill-spring), width var(--spring-time) var(--pill-spring);
  will-change: transform;
}

.menu__pill.no-motion { transition: none; }

.menu__item {
  position: relative;
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  padding: 0 12px;
  border-radius: 22px;
  color: rgba(var(--ink-rgb), 0.9);
  text-decoration: none;
  white-space: nowrap;
}

.menu__item[aria-current="page"], .menu__item.is-target { color: var(--ink); }

.lang { position: relative; flex: none; }

.lang__current {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(var(--ink-rgb), 0.14);
}

.lang__panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 56px;
  display: grid;
  gap: 4px;
  padding: 5px;
  border-radius: 28px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 12px 32px rgba(var(--ink-rgb), 0.18);
}

.lang__option {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: rgba(var(--ink-rgb), 0.9);
}

.lang__option:hover { background: rgba(var(--ink-rgb), 0.07); }
.lang__option[aria-current="true"] { background: rgba(var(--ink-rgb), 0.14); color: var(--ink); }

/* ---------- Form ---------- */

.form, .pod--info, .success { display: grid; gap: 24px; }
.pod--info .button--info { display: none; }

.pod__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.pill {
  flex: none;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.fields, .rows { display: grid; gap: var(--gap); }
.group { position: relative; min-width: 0; }

.field {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.5);
  text-align: left;
  text-decoration: none;
}

label.field { cursor: text; }

.field:focus-within:not(.select__button) { outline: 2px solid var(--ink); outline-offset: 2px; }

.group.is-invalid .field,
.group.is-invalid .slide { outline: 2px solid var(--error); outline-offset: 2px; }

.field__icon, .field__action {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.field__icon { background: rgba(255, 255, 255, 0.7); }
.field__action { background: #fff; }

.field__input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 16px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 18px;
}

.field__input::placeholder { color: var(--ink); opacity: 0.82; }

.error {
  margin: 6px 0 0 20px;
  color: var(--error);
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
}

.error--form {
  margin: -12px 0 0;
  text-align: center;
}

/* Gender */
.toggle {
  position: relative;
  display: flex;
  min-height: 64px;
  padding: 10px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.5);
}

.toggle__pill {
  position: absolute;
  top: 10px;
  left: 10px;
  width: calc(50% - 10px);
  height: 44px;
  border-radius: 22px;
  background: rgba(var(--ink-rgb), 0.14);
  transition: transform var(--spring-time) var(--pill-spring);
  will-change: transform;
}

.toggle[data-active="female"] .toggle__pill { transform: translateX(100%); }

.toggle__item { position: relative; flex: 1; min-width: 0; cursor: pointer; }

.toggle__item span {
  display: grid;
  place-items: center;
  height: 44px;
  border-radius: 22px;
  color: rgba(var(--ink-rgb), 0.9);
}

.toggle__item input:checked + span { color: var(--ink); }
.toggle__item input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Weight class */
.select__value {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select__value:not(.has-value) { opacity: 0.82; }
.select__value:lang(ru) { font-size: 16px; }
.select__value.has-value { font-weight: 500; }
.select__chevron { transition: transform var(--spring-time) var(--spring); }
.select__button[aria-expanded="true"] .select__chevron { transform: rotate(180deg); }

.select__panel {
  position: absolute;
  z-index: 10;
  top: 70px;
  left: 0;
  right: 0;
  padding: 8px;
  border-radius: 32px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 12px 32px rgba(var(--ink-rgb), 0.18);
}

.select__panel:focus { outline: 0; }

.select__option {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 16px;
  border-radius: 24px;
  font-weight: 500;
  cursor: pointer;
}

.select__option:hover, .select__option.is-active { background: rgba(var(--ink-rgb), 0.07); }
.select__option[aria-selected="true"] { background: rgba(var(--ink-rgb), 0.14); }

/* Consent */
.consent {
  display: flex;
  align-items: center;
  gap: 16px;
}

.small-print {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 18px;
}

.small-print a { text-underline-offset: 2px; }

.slide {
  --travel: 40px;
  position: relative;
  flex: none;
  width: 88px;
  height: 48px;
  border-radius: 24px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.slide:active { cursor: grabbing; }

/* The bars and circle are deliberately solid. They overlap, and phones may draw each one
   as its own layer, so any see-through colour here shows the overlap as a dark block.
   These match the Register button on the light pod. Only transforms animate, so sliding
   never triggers a layout. */
.slide__shape {
  position: absolute;
  inset: 0;
}

.slide__track {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  height: 24px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--slide-track);
}

/* Its right edge always stays hidden under the circle. */
.slide__fill {
  position: absolute;
  inset: 0;
  background: var(--slide-solid);
  transform: translateX(calc(var(--slide-x, 0px) - 64px));
  transition: transform var(--spring-time) var(--spring);
  will-change: transform;
}

.slide__thumb, .slide__icon {
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transform: translateX(var(--slide-x, 0px));
  transition: transform var(--spring-time) var(--spring);
  will-change: transform;
}

.slide__thumb { background: var(--slide-solid); }

.slide__icon {
  display: grid;
  place-items: center;
  color: #fff;
}

.slide.is-dragging .slide__fill,
.slide.is-dragging .slide__thumb,
.slide.is-dragging .slide__icon { transition: none; }

.slide[aria-checked="true"] { --slide-x: var(--travel); }

.slide__arrow, .slide__check { grid-area: 1 / 1; }
.slide__check { visibility: hidden; }
.slide[aria-checked="true"] .slide__check { visibility: visible; }
.slide[aria-checked="true"] .slide__arrow { visibility: hidden; }

/* Button */
.button {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  padding: 8px 28px;
  border-radius: 32px;
  color: #fff;
  background: var(--glass-dark);
  border: 1px solid var(--glass-dark-border);
  font-size: 18px;
  font-weight: 500;
  line-height: 24px;
  text-align: left;
  text-decoration: none;
  transition: opacity 0.15s ease, transform var(--spring-time) var(--spring);
}

.button:hover { opacity: 0.9; }
.button[disabled] { opacity: 0.6; cursor: progress; }

.success__text { font-size: 18px; line-height: 26px; }
.success:focus { outline: 0; }

/* ---------- Event pod ---------- */

.pod--event {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  min-height: 196px;
  padding: 24px 28px;
}

.event__type { margin-top: 4px; font-size: 18px; line-height: 22px; color: rgba(255, 255, 255, 0.8); }

.event__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
}

.event__meta { font-size: 14px; color: rgba(255, 255, 255, 0.8); }
.event__link { text-decoration: none; }
.event__link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Info ---------- */

.row__text { flex: 1; min-width: 0; }
.row__text dt { font-size: 13px; line-height: 16px; color: rgba(var(--ink-rgb), 0.82); }
.row__text dd { font-size: 18px; line-height: 22px; }
.row--link { transition: background-color 0.15s ease; }
.row--link:hover { background: rgba(255, 255, 255, 0.7); }

.bubbles { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }

.bubble {
  padding: 16px 20px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.1);
}

.pod--cheat .bubble { background: rgba(255, 255, 255, 0.5); }

.bubble h3 {
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  color: rgba(255, 255, 255, 0.85);
}

.pod--cheat .bubble h3 { color: rgba(var(--ink-rgb), 0.82); }
.bubble p { line-height: 24px; white-space: pre-line; }

#rules { scroll-margin-top: 16px; }

/* ---------- Desktop ---------- */

@media (min-width: 1088px) {
  .shell {
    max-width: none;
    width: 1104px;
    padding: 24px;
  }

  .bg__circle {
    left: -240px;
    bottom: -580px;
    width: 1100px;
    height: 1100px;
  }

  .menu { flex: none; width: 248px; }
  .toggle__pill { transition-timing-function: var(--pill-spring-wide); }
  .lang { margin-left: auto; }

  .display { font-size: 64px; line-height: 76px; }
  .display--section { font-size: 48px; line-height: 60px; margin-bottom: 20px; }
  .display--event { font-size: 72px; line-height: 84px; }

  .pod--light, .pod--dark, .pod--cheat { padding: 32px; }

  .layout--form {
    grid-template-columns: 620px minmax(0, 1fr);
    align-items: start;
  }

  .pod--event { min-height: 341px; }
  .event__type { font-size: 22px; line-height: 28px; }

  .layout--info { grid-template-columns: 392px minmax(0, 1fr); }
  .pod--cheat { grid-column: 1 / -1; }

  .pod--info {
    grid-template-rows: auto auto 1fr;
    align-content: start;
  }

  .pod--info .button--info { display: flex; align-self: end; }

  .bubbles--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bubbles--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Bounce ---------- */

/* Everything you can press squashes a little, then springs back. */
.chip, .lang__option, .select__option, .field__action, .slide, .row--link, .event__link {
  transition: transform var(--spring-time) var(--spring);
}

.chip:hover, .lang__option:hover, .field__action:hover { transform: scale(1.05); }
.select__button:hover .field__action, .row--link:hover .field__action { transform: scale(1.08); }

.chip:active, .lang__option:active { transform: scale(0.9); transition-duration: 0.1s; }
.button:active:not([disabled]) { transform: scale(0.97); transition-duration: 0.1s; }
.select__option:active { transform: scale(0.97); transition-duration: 0.1s; }
.select__button:active .field__action, .row--link:active .field__action { transform: scale(0.88); transition-duration: 0.1s; }
.row--link:active { transform: scale(0.985); transition-duration: 0.1s; }

.lang__panel:not([hidden]) { transform-origin: top right; animation: pop var(--spring-time) var(--spring) backwards; }
.select__panel:not([hidden]) { transform-origin: top center; animation: pop var(--spring-time) var(--spring) backwards; }

/* Each pod animates on its own: fading their parent would switch off their glass blur. */
.layout.is-entering > .pod { animation: page-in 0.5s var(--spring) backwards; }
.layout.is-entering > .pod:nth-child(2) { animation-delay: 0.04s; }
.layout.is-entering > .pod:nth-child(3) { animation-delay: 0.08s; }

@keyframes page-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

h1:focus { outline: 0; }

@keyframes pop {
  from { opacity: 0; transform: scale(0.88) translateY(-8px); }
  to { opacity: 1; transform: none; }
}

/* Reduce Motion: things still move so you can see what changed, but quickly and with no bounce. */
@media (prefers-reduced-motion: reduce) {
  :root { --spring: ease; --pill-spring: ease; --pill-spring-wide: ease; --spring-time: 0.15s; }
  *, *::before, *::after { animation: none !important; }
  .chip:hover, .chip:active, .lang__option:hover, .lang__option:active, .field__action:hover,
  .select__button:hover .field__action, .row--link:hover .field__action,
  .select__button:active .field__action, .row--link:active .field__action,
  .button:active:not([disabled]),
  .select__option:active, .row--link:active { transform: none; }
}
