/* Яг чи home. One motif: the 9:16 story card every test ends in. It is the shape of the hero deck,
   the test covers and the photo frames. Flat colour, no rules, no shadows at rest. */
:root {
  --bg: #ededea;
  --surface: #e0e0db;
  --ink: #121212;
  --muted: #45443f;
  --accent: #ff4b1f;
  --accent-ink: #121212;
  --lime: #d4f25a;
  --night: #121212;
  --night-ink: #ededea;
  --r: 22px;
  --m: clamp(16px, 3vw, 40px);
  --step-small: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --step-head: clamp(2.25rem, 1.4rem + 3.6vw, 4.5rem);
  --step-hero: clamp(3.25rem, 1.6rem + 7.4vw, 9.5rem);
  --display: "Montserrat", system-ui, sans-serif;
  --text: "Golos Text", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--step-body)/1.55 var(--text); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; line-height: 0.98; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--lime); color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 28px;
  border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 600 var(--step-body)/1 var(--text);
  text-decoration: none; transition: transform .25s var(--ease), background-color .25s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--bg); transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-small { min-height: 44px; padding: 0 20px; font-size: var(--step-small); }
.link { font-weight: 600; text-underline-offset: 5px; text-decoration-thickness: 2px; transition: color .2s; }
.link:hover { color: var(--accent); }
.btn-soft { background: var(--surface); color: var(--ink); }
.btn-soft:hover { background: var(--ink); color: var(--bg); }
.to-top {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 999px;
  background: var(--ink); color: var(--lime); font-weight: 600; text-decoration: none; transition: transform .25s var(--ease);
}
.to-top:hover { transform: translateY(-3px); }

/* ---------- nav ---------- */
.nav { display: flex; align-items: center; gap: 32px; padding: 8px var(--m) 8px calc(var(--m) - 12px); }
.mark { display: block; }
.mark img { height: 78px; width: auto; transition: transform .3s var(--ease); }
.mark:hover img { transform: rotate(4deg) scale(1.04); }
.nav nav { display: flex; gap: 28px; margin-left: auto; }
.nav nav a { text-decoration: none; font-weight: 600; font-size: var(--step-small); transition: color .2s; }
.nav nav a:hover { color: var(--accent); }

/* ---------- hero ---------- */
.hero {
  overflow-x: clip;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 4vw, 64px); align-items: center;
  padding: clamp(24px, 4vw, 56px) var(--m) clamp(80px, 10vw, 160px); min-height: calc(100svh - 84px);
}
.hero h1 { font-size: var(--step-hero); max-width: 8ch; }
.lead { font-size: var(--step-lead); line-height: 1.45; max-width: 30ch; margin-top: 40px; }
.hero-actions { display: flex; align-items: center; gap: 28px; margin-top: 40px; flex-wrap: wrap; }
.hero-art { position: relative; display: grid; grid-template-columns: 1fr 0.62fr; align-items: end; gap: 0; padding-top: 6%; }
.hero-photo { margin: 0; aspect-ratio: 3 / 4; border-radius: var(--r); overflow: hidden; background: var(--surface); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; animation: drift 18s var(--ease) infinite alternate; }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.1) translate(-1.5%, -1%); } }

/* the deck: three real result cards, tap to send the top one to the back */
.deck { position: relative; aspect-ratio: 9 / 16; margin: 0 4% -6% -40%; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; }
.story {
  position: absolute; inset: 0; border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .6s var(--ease), opacity .6s var(--ease); transform-origin: 50% 100%;
}
.story[data-pos="0"] { z-index: 3; transform: rotate(3deg); }
.story[data-pos="1"] { z-index: 2; transform: rotate(-4deg) translate(-12%, -3%); }
.story[data-pos="2"] { z-index: 1; transform: rotate(-10deg) translate(-22%, -6%); }
.deck:hover .story[data-pos="0"] { z-index: 3; transform: rotate(3deg); }
.deck.out .story[data-pos="0"] { z-index: 3; transform: rotate(3deg); }
.s-card { background: var(--ink); }
.s-card img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }

.s-ebarimt { background: var(--lime); padding: 9% 8%; justify-content: center; }
.s-receipt {
  display: flex; flex-direction: column; gap: 8px; background: #fff; padding: 14% 10% 18%; font-size: clamp(0.8125rem, 0.7rem + 0.3vw, 0.95rem);
  clip-path: polygon(0 0, 100% 0, 100% 96%, 92% 100%, 84% 96%, 76% 100%, 68% 96%, 60% 100%, 52% 96%, 44% 100%, 36% 96%, 28% 100%, 20% 96%, 12% 100%, 4% 96%, 0 100%);
}
.s-receipt b { font-family: var(--display); font-size: 1.05em; line-height: 1.15; margin-bottom: 8px; }
.s-receipt .row { display: flex; justify-content: space-between; gap: 8px; }
.s-receipt i { font-style: normal; }
.s-receipt .total { margin-top: 10px; padding: 10px; background: var(--ink); color: #fff; font-weight: 600; line-height: 1.2; }
.s-zuun13 { background: #0c1f3d; color: #f8f6f0; }
.s-zuun13.s-alt { background: #17407a; }
.s-zuun13 img { width: 100%; flex: 1; object-fit: cover; min-height: 0; }
.s-cap { padding: 7% 8% 9%; font-size: clamp(0.875rem, 0.75rem + 0.35vw, 1.05rem); line-height: 1.25; }
.s-cap b { font: 800 1.8em/1 var(--display); color: #d9a521; letter-spacing: -0.02em; }

/* ---------- tests shelf ---------- */
.tests { padding: 0 var(--m) clamp(120px, 12vw, 200px); }
.tests-head { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: end; margin-bottom: 56px; }
.tests h2 { font-size: var(--step-head); }
.tests-head p { max-width: 36ch; justify-self: end; }
.shelf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(12px, 1.6vw, 24px); }
.test { display: flex; }
.test > a, .test.t-soon { display: flex; flex-direction: column; width: 100%; text-decoration: none; border-radius: var(--r); overflow: hidden; }
.test > a { transition: transform .35s var(--ease); }
.test > a:hover { transform: translateY(-6px) rotate(-.6deg); }
.test > a:active { transform: translateY(-2px) scale(.99); }
.cover { display: block; aspect-ratio: 9 / 12; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.test > a:hover .cover img { transform: scale(1.05); }
.t-body { display: flex; flex-direction: column; gap: 12px; padding: 24px 22px 28px; flex: 1; }
.t-title { font: 800 var(--step-lead)/1.1 var(--display); letter-spacing: -0.02em; }
.t-desc { font-size: var(--step-body); line-height: 1.45; }
.t-meta { margin-top: auto; font-size: var(--step-small); font-weight: 600; }
.t-ebarimt > a { background: var(--lime); }
.t-zuun13 > a { background: #0c1f3d; color: #f8f6f0; }
.t-zuun13 .cover { background: #17407a; }
.t-soon { background: var(--surface); }
.cover-type { display: flex; align-items: flex-end; padding: 22px; font: 800 var(--step-lead)/1.1 var(--display); letter-spacing: -0.02em; }
.t-jor { background: #ffd9cc; }
.jor-cover { position: relative; background: var(--accent); }
.jor-cover img { filter: saturate(.92); }
.jor-soon {
  position: absolute; top: 16px; right: 14px; padding: 8px 14px; border-radius: 999px; background: var(--ink); color: var(--lime);
  font: 800 var(--step-small)/1 var(--display); transform: rotate(6deg); animation: wobble 3.2s var(--ease) infinite;
}
.jor-dx {
  position: absolute; left: 14px; bottom: 16px; padding: 10px 14px; border-radius: 14px; background: var(--lime); color: var(--ink);
  font: 800 var(--step-small)/1.1 var(--display); transform: rotate(-3deg);
}
@keyframes wobble { 0%, 80%, 100% { transform: rotate(6deg); } 88% { transform: rotate(-2deg) scale(1.06); } 94% { transform: rotate(9deg); } }
.t-chat > a { background: var(--ink); color: var(--night-ink); }
.t-chat .cover img { object-position: 50% 0; }

/* ---------- how ---------- */
.how { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(32px, 6vw, 96px); align-items: center; padding: 0 var(--m) clamp(120px, 12vw, 200px); }
.how-photo { margin: 0; aspect-ratio: 3 / 4; border-radius: var(--r); overflow: hidden; background: var(--surface); }
.how-photo img { width: 100%; height: 100%; object-fit: cover; }
.how h2 { font-size: var(--step-head); max-width: 12ch; }
.steps { margin: 48px 0 0; padding: 0; list-style: none; display: grid; gap: 28px; counter-reset: s; }
.steps li { font-size: var(--step-lead); line-height: 1.4; max-width: 34ch; padding-left: 64px; position: relative; }
.steps li::before {
  content: ""; position: absolute; left: 0; top: 0.1em; width: 34px; height: 60px; border-radius: 8px; background: var(--lime);
}
.steps li:nth-child(2)::before { background: var(--accent); }
.steps li:nth-child(3)::before { background: var(--ink); }
.how-note { margin-top: 40px; color: var(--muted); max-width: 40ch; }

/* ---------- friends ---------- */
.friends {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 6vw, 96px); align-items: center;
  background: var(--night); color: var(--night-ink); padding: clamp(80px, 10vw, 160px) var(--m);
}
.friends h2 { font-size: var(--step-head); max-width: 12ch; }
.friends-text > p { margin-top: 32px; max-width: 44ch; font-size: var(--step-lead); line-height: 1.45; }
.match { margin: 48px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.match div { padding: 24px; border-radius: var(--r); background: #24241f; }
.match div:first-child { background: var(--lime); color: var(--ink); }
.match dt { font: 800 var(--step-lead)/1.15 var(--display); margin-bottom: 12px; }
.match dd { margin: 0; }
.friends-photo { margin: 0; aspect-ratio: 3 / 4; border-radius: var(--r); overflow: hidden; }
.friends-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- footer ---------- */
.foot { background: var(--lime); padding: clamp(48px, 6vw, 96px) var(--m) 32px; overflow: hidden; }
.foot-mark { font: 800 clamp(5rem, 1rem + 22vw, 24rem)/0.8 var(--display); letter-spacing: -0.06em; white-space: nowrap; }
.foot-row { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 72px; }
.foot-tests { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot-tests a { font: 800 var(--step-lead)/1.2 var(--display); letter-spacing: -0.02em; text-decoration: none; transition: color .2s; }
.foot-tests a:hover { color: var(--accent); }
.foot-note { max-width: 40ch; justify-self: end; }
.foot-legal { display: flex; justify-content: space-between; align-items: center; margin-top: 96px; font-size: var(--step-small); }

/* ---------- entrance ---------- */
.js .rise { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--d, 0) * 80ms); }
.js .rise.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .nav { padding: 8px var(--m); }
  .mark img { height: 60px; }
  .hero-art { grid-template-columns: 1fr 0.62fr; }
  .nav nav { display: none; }
  .nav .btn-small { margin-left: auto; }
  .hero { grid-template-columns: 1fr; min-height: 0; padding-bottom: 120px; }
  .hero h1 { max-width: none; }
  .lead { margin-top: 32px; }
  .hero-art { margin-top: 16px; grid-template-columns: 1fr 0.72fr; }
  .tests-head { grid-template-columns: 1fr; }
  .tests-head p { justify-self: start; }
  .shelf { grid-template-columns: 1fr 1fr; }
  .how, .friends { grid-template-columns: 1fr; }
  .foot-row { grid-template-columns: 1fr; }
  .foot-note { justify-self: start; }
}
@media (max-width: 520px) {
  .shelf { grid-template-columns: 1fr; }
  .cover { aspect-ratio: 4 / 3; }
  .match { grid-template-columns: 1fr; }
  .steps li { padding-left: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js .rise { opacity: 1; transform: none; }
}

/* return visit: new friends on my E-Barimt Match board */
.friend-ping {
  display: block; max-width: 1040px; margin: 4px auto 18px; padding: 14px 18px; border-radius: 20px; background: #ff4b1f; color: #121212;
  font-weight: 800; font-size: 1.0625rem; line-height: 1.25; text-decoration: none; box-shadow: 0 5px 0 #121212;
}
@media (max-width: 1072px) { .friend-ping { margin-left: 16px; margin-right: 16px; } }
