@import url("../fonts/fonts.css");

:root {
  color-scheme: light;
  --bg: #f7f9f8;
  --surface: #ebf0ee;
  --line: #c9d8d6;
  --ink: #06525c;
  --muted: #2f737d;
  --accent: #06525c;
  --accent-ink: #f7f9f8;
  --stamp: #d6453d;
  --tint-1: #06525c;
  --tint-2: #1b6670;
  --tint-3: #367f88;
  --tint-4: #67a2a8;
  --tint-5: #a9cbcd;

  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-text: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.5rem, 1.2rem + 5vw, 5.5rem);

  --radius: 14px;
  --margin: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: var(--iv-title-case, uppercase);
  line-height: var(--iv-title-leading, 0.95);
  letter-spacing: var(--iv-title-tracking, -0.005em);
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

:focus-visible { outline: 3px solid var(--stamp); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--bg); }

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

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

.btn {
  --b-bg: var(--accent);
  --b-ink: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 52px; padding: 0 26px;
  border: 3px solid var(--b-border, var(--ink)); border-radius: var(--iv-btn-radius, var(--radius));
  background: var(--b-bg); color: var(--b-ink);
  font-family: var(--font-display); font-weight: 600; font-size: 1.15rem;
  letter-spacing: var(--btn-tracking, .04em); text-transform: var(--iv-title-case, uppercase); text-decoration: none;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .18s var(--ease), background-color .18s, color .18s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; }
.btn--ghost { --b-bg: transparent; --b-ink: var(--ink); }
.btn--paper { --b-bg: var(--bg); --b-ink: var(--ink); border-color: var(--bg); }
.btn--block { width: 100%; }
.btn--small { min-height: 42px; padding: 0 16px; font-size: 1rem; border-width: 2px; }

/* ---------- билет ---------- */

.ticket {
  --notch: 14px;
  --stub-h: 92px;
  position: relative;
  background: var(--bg);
  color: var(--ink);
  border-radius: 18px;
  /* выемки по бокам на линии отрыва */
  -webkit-mask:
    radial-gradient(circle var(--notch) at 0 calc(100% - var(--stub-h)), #0000 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle var(--notch) at 100% calc(100% - var(--stub-h)), #0000 98%, #000) right / 51% 100% no-repeat;
          mask:
    radial-gradient(circle var(--notch) at 0 calc(100% - var(--stub-h)), #0000 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle var(--notch) at 100% calc(100% - var(--stub-h)), #0000 98%, #000) right / 51% 100% no-repeat;
}

.ticket__stub {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--stub-h);
  display: grid; grid-template-columns: 1.2fr 1fr 1.3fr; align-items: center;
  padding: 0 22px;
  background-image: linear-gradient(90deg, var(--ink) 50%, transparent 0);
  background-size: 12px 3px; background-repeat: repeat-x; background-position: 0 0;
}
.ticket__field { min-width: 0; padding-right: 8px; }
.ticket__label {
  display: block; font-family: var(--font-display); font-weight: 500;
  font-size: var(--step-small); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.ticket__value {
  display: block; min-height: 1.6em; margin-top: 2px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  text-transform: uppercase; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-bottom: 2px solid var(--line);
}
.ticket__value:not(:empty) { border-bottom-color: transparent; }

.stamp {
  position: absolute; z-index: 3; pointer-events: none;
  display: grid; place-items: center;
  width: 128px; height: 128px; border-radius: 50%;
  border: 5px solid var(--stamp); color: var(--stamp);
  font-family: var(--font-display); font-weight: 700; font-size: 3rem; letter-spacing: .04em;
  box-shadow: inset 0 0 0 4px var(--bg), inset 0 0 0 7px var(--stamp);
  transform: rotate(-16deg);
  opacity: .92;
}
.stamp[hidden] { display: none; }
.stamp.is-hit { animation: stamp .45s var(--ease) both; }
@keyframes stamp {
  0% { transform: rotate(-16deg) scale(2.4); opacity: 0; }
  60% { transform: rotate(-16deg) scale(.92); opacity: 1; }
  100% { transform: rotate(-16deg) scale(1); opacity: .92; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
