/* MuscleGoal — musclegoal.com. Colors and font follow the app (dark theme). */

@font-face { font-family: "Rubik"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/Rubik-Regular.woff2") format("woff2"); }
@font-face { font-family: "Rubik"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/Rubik-Medium.woff2") format("woff2"); }
@font-face { font-family: "Rubik"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/Rubik-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Rubik"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/Rubik-Bold.woff2") format("woff2"); }

:root {
  --bg: #111317;
  --surface: #1C2029;
  --surface-2: #2A3040;
  --accent: #8FA0FF;
  --accent-hover: #B5C0FF;
  --accent-soft: #2A3157;
  --button: #2733B8;
  --text: #F2F5FA;
  --text-2: #B9C2D9;
  --muted: #8A97B8;
  --strike: #F18343;
  --line: rgba(255, 255, 255, .08);
  --frame: rgba(255, 255, 255, .24); /* screenshot edge: shots share the page background */
  --gutter: 20px;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

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

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
.header { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; }


/* Hero */
.page { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "shots" "loop" "ftitle" "features"; }
.hero { grid-area: hero; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.app-id { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.app-id img { height: 60px; width: auto; } /* brand logo for dark backgrounds (same as the app's logo_dark.svg) */

.guesses { list-style: none; margin: -2px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 12px; font-size: 15px; font-weight: 400; color: var(--muted); }
.guesses li { text-decoration: line-through; text-decoration-color: rgba(241, 131, 67, .6); text-decoration-thickness: 1.5px; }

h1 { margin: 0; font-size: clamp(36px, 10vw, 68px); line-height: 1.06; font-weight: 700; letter-spacing: -.5px; }
h1 em { font-style: normal; color: var(--accent); }

.lead { margin: 0; font-size: 16px; color: var(--text-2); max-width: 540px; }

/* Official store badges (Apple / Google artwork) — keep both the same height */
.stores { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }
.badge { display: block; border-radius: 9px; }
.badge img { height: 50px; width: auto; }

.note { margin: 0; font-size: 14px; color: var(--muted); }

/* Screenshots: swipeable strip (finger, two-finger trackpad, or arrows) */
.shots { grid-area: shots; margin-top: 36px; }
.gallery {
  display: flex; gap: 12px; overflow-x: auto; padding: 0 var(--gutter) 8px;
  margin: 0 calc(-1 * var(--gutter));
  scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
  /* A sideways two-finger swipe at either end of the strip must not turn into browser Back/Forward */
  overscroll-behavior-x: contain;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery img {
  width: 200px; height: auto; aspect-ratio: 1320 / 2868; flex: none; scroll-snap-align: start;
  border-radius: 20px; border: 1.5px solid var(--frame); background: var(--surface);
}
/* Arrows: only for a mouse/trackpad pointer — a wheel can't scroll the strip sideways */
.shots { position: relative; }
.gallery-btn {
  display: none; position: absolute; top: calc(50% - 32px); z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; padding: 0; cursor: pointer;
  align-items: center; justify-content: center;
  background: rgba(28, 32, 41, .92); color: var(--text); border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}
.gallery-btn:hover { background: var(--accent-soft); }
.gallery-btn:disabled { opacity: 0; pointer-events: none; }
.gallery-btn--prev { left: 4px; }
.gallery-btn--next { right: 4px; }
@media (hover: hover) and (pointer: fine) {
  .gallery-btn { display: flex; transition: opacity .2s; }
}

.dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.dots span { width: 6px; height: 6px; border-radius: 3px; background: var(--surface-2); transition: width .2s, background .2s; }
.dots span.is-active { width: 18px; background: var(--accent); }

/* Cover carousel (main.js adds .is-cover): centred card full size, neighbours smaller and behind.
   --card is the card width; main.js sets --side so the first/last card can sit in the middle. */
.shots { --card: 220px; }
.shots.is-cover .gallery {
  gap: 0; scroll-padding: 0; padding: 4px var(--side, 0px) 10px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%);
}
.shots.is-cover .gallery img {
  width: var(--card); max-width: none; flex: 0 0 auto;
  margin: 0 calc(var(--card) * -.1); /* neighbours tuck behind the centred card */
  scroll-snap-align: center; position: relative; transform-origin: 50% 50%;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
}
.shots.is-cover .gallery-btn { z-index: 30; } /* arrows always above the cards */

/* Features */
.features { grid-area: features; list-style: none; margin: 44px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.feature { background: var(--surface); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.feature svg { width: 26px; height: 26px; flex: none; }
.feature h2 { margin: 0; font-size: 16px; line-height: 1.25; font-weight: 600; }
.feature p { margin: 0; font-size: 13px; line-height: 1.4; color: var(--text-2); }

/* Footer */
.footer { margin-top: 48px; border-top: 1px solid var(--line); }
.footer .wrap { display: flex; flex-direction: column; gap: 14px; padding-top: 24px; padding-bottom: 40px; font-size: 15px; }
.footer small { color: var(--muted); font-size: 13px; }

/* Sticky download bar — phones only, appears once the store buttons scroll away */
.sticky {
  /* 76px: sits above the "Powered by Netlify" badge (64px tall, bottom right) on the free plan */
  position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 10; height: 72px; padding: 0 10px;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid rgba(255, 255, 255, .1); border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  transform: translateY(140%); visibility: hidden;
  transition: transform .25s ease, visibility 0s linear .25s;
}
.sticky.is-visible { transform: none; visibility: visible; transition: transform .25s ease; }
.sticky img { width: 48px; height: 48px; border-radius: 12px; }
.sticky__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sticky__text b { font-size: 15px; font-weight: 600; }
.sticky__text span { font-size: 12px; color: var(--muted); }
.sticky__btn {
  height: 48px; padding: 0 18px; border-radius: 12px; background: var(--button); color: var(--text);
  font-size: 15px; font-weight: 600; display: flex; align-items: center;
}
.sticky__btn:hover { color: var(--text); background: #3440D0; }
.footer .wrap { padding-bottom: 80px; } /* room for the Netlify badge */
body.has-sticky .footer .wrap { padding-bottom: 170px; }

@media (prefers-reduced-motion: reduce) {
  .sticky, .dots span { transition: none; }
}

/* Tablet */
@media (min-width: 600px) {
  .badge img { height: 56px; }
  .gallery img { width: 240px; }
  .shots { --card: 240px; }
  .lead { font-size: 18px; }
  .features { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Desktop (from 900px, so most laptops get it even with a narrower window) */
@media (min-width: 900px) {
  :root { --gutter: 40px; }
  h1 { font-size: clamp(44px, 4.8vw, 68px); }
  /* RU/EN sits on the same line as the app icon (logo row centre = 40 + 72/2 = 76px; switch 44px tall → top 54px) */
  .header { position: absolute; top: 0; left: 0; right: 0; padding-top: 54px; padding-bottom: 0; pointer-events: none; z-index: 3; }

  .page {
    grid-template-columns: minmax(0, 1fr) 600px;
    grid-template-areas: "hero shots" "loop loop" "ftitle ftitle" "features features";
    grid-template-rows: auto auto auto auto;
    /* Top-aligned, not centred: EN and RU texts differ in height, centring made the page jump on language switch */
    column-gap: 40px; align-items: start; padding-top: 40px;
  }
  .hero { align-items: flex-start; text-align: left; gap: 22px; }
  .app-id { flex-direction: row; gap: 16px; }
  .app-id img { height: 72px; }
  .guesses { justify-content: flex-start; gap: 2px 18px; font-size: 18px; }
  .lead { font-size: 20px; }
  .stores { justify-content: flex-start; gap: 14px; }
  .note { font-size: 15px; }

  /* Same swipeable strip as on phones, in the right column: two screenshots and a peek of the third */
  .shots { margin-top: 96px; align-self: start; min-width: 0; } /* starts below the icon + RU/EN row */
  .gallery { margin: 0; padding: 0 0 8px; scroll-padding: 0; gap: 14px; }
  .gallery img { width: 270px; border-radius: 22px; }
  .shots { --card: 290px; }
  .gallery-btn--prev { left: -18px; }
  .gallery-btn--next { right: -18px; }

  .features { margin-top: 40px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; max-width: 980px; width: 100%; justify-self: center; }

  .footer { margin-top: 24px; }
  .footer .wrap { flex-direction: row; align-items: center; gap: 32px; padding-top: 24px; padding-bottom: 80px; }
  .footer small { margin-left: auto; font-size: 14px; }

  .sticky { display: none; }
  body.has-sticky .footer .wrap { padding-bottom: 80px; }
}

/* Narrow desktop / laptop: smaller screenshots so the text column keeps its room */
@media (min-width: 900px) and (max-width: 1199px) {
  .page { grid-template-columns: minmax(0, 1fr) 440px; column-gap: 32px; }
  .gallery img { width: 200px; }
  .shots { --card: 230px; }
}

/* Below the first screen: feature blocks, FAQ, final call to action */
.more, .faq, .cta { margin-top: 64px; }
.more h2, .faq h2 { margin: 0 0 24px; font-size: 28px; line-height: 1.15; text-align: center; }
.blocks { display: flex; flex-direction: column; gap: 40px; }
.block { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.block img { width: 240px; height: auto; border-radius: 22px; border: 1.5px solid var(--frame); box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.block h3 { margin: 0 0 8px; font-size: 22px; line-height: 1.2; }
.block p { margin: 0; color: var(--text-2); max-width: 460px; }
.faq__list { display: flex; flex-direction: column; gap: 10px; max-width: 760px; margin: 0 auto; }
.faq details { background: var(--surface); border-radius: 16px; padding: 0 18px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 28px 16px 0; font-weight: 500; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--accent); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0; padding: 0 0 16px; color: var(--text-2); }
.cta { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; background: var(--surface); border-radius: 24px; padding-top: 36px; padding-bottom: 36px; max-width: calc(1200px - 2 * var(--gutter)); }
.cta__free { margin: 0; font-size: 34px; font-weight: 700; line-height: 1.1; color: var(--accent); }
.cta h2 { margin: 0; font-size: 20px; font-weight: 500; color: var(--text); }
@media (max-width: 899px) { .cta { width: calc(100% - 2 * var(--gutter)); } }
@media (min-width: 900px) {
  .more, .faq, .cta { margin-top: 96px; }
  .more h2, .faq h2 { font-size: 40px; margin-bottom: 40px; }
  .blocks { gap: 64px; max-width: 980px; margin: 0 auto; }
  .block { flex-direction: row; text-align: left; gap: 64px; }
  .block:nth-child(even) { flex-direction: row-reverse; }
  .block img { width: 280px; flex: none; }
  .block h3 { font-size: 32px; }
  .block p { font-size: 18px; }
  .cta__free { font-size: 48px; }
  .cta h2 { font-size: 22px; }
}

/* Language menu: globe → dropdown (no JS needed; main.js only closes it on outside click / Esc) */
.lang-menu { position: relative; margin-left: auto; pointer-events: auto; }
.lang-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 600; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { color: var(--text); }
.lang-menu__list { position: absolute; right: 0; top: 52px; min-width: 180px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.5); z-index: 40; display: flex; flex-direction: column; }
.lang-menu__list a { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px; border-radius: 10px; color: var(--text); font-size: 16px; }
.lang-menu__list a:hover { background: var(--surface-2); color: var(--text); }
.lang-menu__list a[aria-current="page"] { color: var(--accent); }

/* The four hero features link to their blocks below */
.feature > a { display: flex; flex-direction: inherit; align-items: inherit; gap: inherit; color: inherit; text-decoration: none; }
.feature > a:hover h2 { color: var(--accent); }
.block { scroll-margin-top: 24px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Screen name above block title */
.screen { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 10px 20px 10px 16px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 20px; font-weight: 600; }
.screen svg { width: 26px; height: 26px; flex: none; }
@media (min-width: 900px) { .screen { font-size: 24px; padding: 12px 24px 12px 18px; } .screen svg { width: 30px; height: 30px; } }

/* Four-step loop */
.loop { grid-area: loop; margin-top: 48px; text-align: center; }
.loop h2 { margin: 0 0 24px; font-size: 28px; line-height: 1.15; }
.loop__steps { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 980px; counter-reset: none; }
.loop__steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.loop__n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--button); color: #fff; font-weight: 700; }
.loop__steps b { font-size: 16px; line-height: 1.25; }
.loop__steps small { color: var(--muted); font-size: 14px; }
.loop__more { margin: 18px auto 0; max-width: 560px; color: var(--text-2); }
.loop__more a { color: var(--accent); }
@media (min-width: 900px) {
  .loop { margin-top: 88px; }
  .loop h2 { font-size: 40px; margin-bottom: 36px; }
  .loop__steps { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .loop__steps li:not(:last-child)::after { content: "→"; position: absolute; right: -14px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 18px; z-index: 1; }
  .loop__steps b { font-size: 18px; }
}

/* Small heading above the four feature tiles: quieter than «Как это работает» */
.features-title { grid-area: ftitle; margin: 48px 0 0; text-align: center; font-size: 20px; line-height: 1.2; font-weight: 600; color: var(--text-2); }
.features-title + .features { margin-top: 16px; }
@media (min-width: 900px) { .features-title { margin-top: 64px; font-size: 24px; } .features-title + .features { margin-top: 20px; } }
