/*
  Yono Apps — design system
  Palette:  ink #12131A · paper #FFFFFF · surface #F6F5F0
            primary (forest) #1B4332 · accent (gold) #B8860B
  Type:     Fraunces (display) · Inter (body/UI) · IBM Plex Mono (numbers)
  Signature: numeric "stat chip" pairing bonus/withdrawal figures in mono type,
             echoed from the card grid through to the app detail page.
*/

:root {
  --ink: #14151d;
  --ink-soft: #5b5d68;
  --ink-faint: #8b8d97;
  --paper: #ffffff;
  --surface: #f6f5f0;
  --surface-alt: #f0eee6;
  --line: #e8e6de;
  --primary: #1b4332;
  --primary-dark: #10291f;
  --primary-tint: #e7efe9;
  --accent: #b8860b;
  --accent-tint: #f7ecd2;
  --danger: #b3261e;

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-soft: 0 1px 2px rgba(20, 21, 29, 0.05), 0 10px 28px -16px rgba(20, 21, 29, 0.18);
  --shadow-pop: 0 20px 60px -20px rgba(20, 21, 29, 0.35);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --container: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ink);
}
.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.05rem;
}
.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform 0.15s ease, background 0.15s ease;
}
.header-cta:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--ink-faint);
  padding: 16px 0 0;
}
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs .sep { margin: 0 6px; color: var(--line); }

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-tint);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero__title {
  font-size: clamp(2rem, 5vw, 3.1rem);
  max-width: 16ch;
}
.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0 0 0;
}
.hero__stats {
  display: flex;
  gap: 28px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.hero__stat-num {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  color: var(--ink);
  font-weight: 500;
}
.hero__stat-label {
  font-size: 0.8rem;
  color: var(--ink-faint);
}

/* ---------- Telegram banner ---------- */
.tg-banner {
  margin: 32px 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 26px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-soft);
}
.tg-banner__text h3 {
  font-size: 1.2rem;
  margin-bottom: 4px;
  color: #fff;
}
.tg-banner__text p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
}
.tg-banner__cta {
  background: var(--accent);
  color: #2a1e00;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 999px;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}
.tg-banner__cta:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -8px rgba(0,0,0,0.35); }

/* ---------- App grid ---------- */
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 44px 0 20px;
}
.section-heading h2 { font-size: 1.5rem; margin: 0; }
.section-heading span { color: var(--ink-faint); font-size: 0.9rem; }

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  padding-bottom: 60px;
}

.app-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
  border-color: transparent;
}
.app-card__top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.app-card__logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface);
  flex-shrink: 0;
}
.app-card__name {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  margin: 0;
}
.app-card__stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.stat-chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.stat-chip--bonus { background: var(--accent-tint); color: #7a5b06; border-color: transparent; }
.stat-chip--withdraw { background: var(--primary-tint); color: var(--primary-dark); border-color: transparent; }
.stat-chip b { font-weight: 700; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 12px 20px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn--primary {
  background: var(--primary);
  color: #fff;
}
.btn--primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.btn--block { width: 100%; margin-top: auto; }
.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn--ghost:hover { background: var(--surface-alt); }

/* ---------- App detail page ---------- */
.app-hero {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 40px 0 24px;
  flex-wrap: wrap;
}
.app-hero__logo {
  width: 112px;
  height: 112px;
  border-radius: 26px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.app-hero__meta { flex: 1; min-width: 240px; }
.app-hero__name { font-size: clamp(1.7rem, 4vw, 2.4rem); margin-bottom: 8px; }
.app-hero__stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 20px; }
.app-hero__stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  min-width: 130px;
}
.app-hero__stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); }
.app-hero__stat-value { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 500; color: var(--ink); margin-top: 2px; }

.app-body { max-width: 72ch; padding-bottom: 60px; }
.app-body h2 { font-size: 1.3rem; margin-top: 2em; }
.app-body p { color: var(--ink-soft); }

/* ---------- Popup ---------- */
.tg-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 16, 22, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.tg-popup-overlay.is-open { display: flex; }
.tg-popup {
  background: var(--paper);
  border-radius: var(--radius-lg);
  max-width: 380px;
  width: 100%;
  padding: 30px 26px 26px;
  position: relative;
  box-shadow: var(--shadow-pop);
  text-align: center;
  animation: pop-in 0.22s ease;
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.tg-popup__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 1.1rem;
  cursor: pointer;
}
.tg-popup__close:hover { background: var(--surface-alt); }
.tg-popup__icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: var(--primary-tint);
  color: var(--primary);
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  font-size: 1.4rem;
}
.tg-popup h3 { font-size: 1.2rem; margin-bottom: 6px; }
.tg-popup p { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 20px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  margin-top: 40px;
  color: var(--ink-faint);
  font-size: 0.85rem;
}
.site-footer__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer a:hover { color: var(--primary); }

/* ---------- 404 ---------- */
.error-page {
  text-align: center;
  padding: 100px 20px;
}
.error-page__code {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.error-page h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 10px 0 12px; }
.error-page p { color: var(--ink-soft); margin-bottom: 26px; }

/* ---------- Utility ---------- */
.mt-0 { margin-top: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .site-header__row { height: 60px; }
  .hero { padding: 40px 0 30px; }
  .tg-banner { padding: 20px; }
  .app-hero { padding: 28px 0 18px; }
}
