/* ============================================================
   PhotoApp — дизайн-система в стиле SOPICO VIZ (sopicoviz.ru)
   Светлый фон, оранжевые акцентные полосы, пилюльные кнопки,
   крупная дисплейная типографика, липкий хедер.
   ============================================================ */

/* ===== CSS Variables ===== */
:root {
  --bg: #FFFFFF;
  --card: #FFFFFF;
  --text: #000000;
  --text-secondary: #4D4D4D;
  --text-muted: #767676;
  --accent: #E87034;          /* фирменный оранжевый SOPICO */
  --accent-dark: #C75A24;
  --blue: #1B49C3;            /* вторичный синий */
  --blue-soft: #B8C7EC;
  --border: #C2C2C2;
  --black: #000000;
  --success: #16A34A;
  --error: #DC2626;
  --shadow-btn: 0 4px 14px rgba(232, 112, 52, 0.35);
  --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.08);
  --shadow-sticky: 0 1px 3px rgba(0, 0, 0, 0.08);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', 'Monaco', monospace;

  --container: 1100px;
  --gap: 24px;

  --radius-pill: 500px;
  --radius-card: 28px;
  --radius-faq: 20px;

  --section-py: 80px;
  --section-py-mobile: 56px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ===== Container ===== */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* ===== Typography ===== */
h1, h2, h3 { color: var(--text); font-family: var(--font-head); font-weight: 700; letter-spacing: -0.02em; }

h1 {
  font-size: 64px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

h2 {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

h3 { font-size: 20px; font-weight: 700; }

.section__title {
  display: inline-block;
  margin-bottom: 40px;
  font-size: 48px;
  text-transform: uppercase;
}
.section__title .accent {
  color: var(--accent);
}

.section__desc {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 720px;
  margin-bottom: 40px;
}

@media (max-width: 960px) {
  h1 { font-size: 44px; }
  h2, .section__title { font-size: 32px; }
}

/* ===== Accent word in headings ===== */
.accent { color: var(--accent); }

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.badge--success { background: var(--success); color: #fff; }

/* ===== Sticky Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sticky);
  transition: transform 0.3s linear;
}
.site-header[hidden] { display: none; }
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 70px;
}
.header__logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.header__logo .accent-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}
.header__nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}
.header__nav a { transition: color 0.2s ease; }
.header__nav a:hover { color: var(--accent); }

/* ===== Marquee Bar ===== */
.marquee {
  background: var(--accent);
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.marquee--top {
  margin-top: 70px; /* освобождаем место под фиксированным хедером */
}
.marquee__track {
  display: inline-flex;
  gap: 48px;
  padding: 14px 24px;
  animation: marquee-scroll 22s linear infinite;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ===== Dark Bar ===== */
.bar--dark {
  background: var(--black);
  color: #fff;
}

/* ===== Sections ===== */
section { padding: var(--section-py) 0; }
section.section--dark { background: var(--black); color: #fff; }
section.section--dark h1, section.section--dark h2, section.section--dark h3 { color: #fff; }

/* ===== Section header pattern ===== */
.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}
.sec-head .section__title { margin-bottom: 0; }
.sec-head__right { font-size: 14px; color: var(--text-muted); max-width: 420px; }

/* ===== Buttons (pill) ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 36px;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  text-align: center;
}
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.btn--primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-btn); }
.btn--primary:hover { background: var(--accent-dark); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(232,112,52,0.5); }
.btn--primary:active { transform: translateY(0); }
.btn--blue { background: var(--blue); color: #fff; }
.btn--blue:hover { background: #1340a8; transform: translateY(-2px); }
.btn--outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn--outline:hover { border-color: var(--text); }
.btn--outline-light { background: transparent; color: #fff; border-color: #fff; }
.btn--outline-light:hover { background: #fff; color: var(--black); }
.btn--dark { background: var(--black); color: #fff; }
.btn--dark:hover { background: #222; transform: translateY(-2px); }

/* ===== Cards ===== */
.card, .bento__item, .feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 32px 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover, .bento__item:hover, .feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

/* ===== Hero ===== */
.hero {
  padding: 96px 0 72px;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}
.hero__inner {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 900px;
}
.hero h1 { margin-top: 12px; }
.hero__subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 640px;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.hero__hint { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); }
.hero__hint-icon {
  width: 22px; height: 22px; flex-shrink: 0;
  background: var(--blue-soft); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--blue); font-weight: 700;
}

/* ===== Bento Grid ===== */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.bento__item--wide { grid-column: span 2; }
.bento__icon { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; font-size: 24px; line-height: 1; }
.bento__title { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.bento__text { font-size: 15px; color: var(--text-secondary); line-height: 1.6; }

/* ===== Timeline ===== */
.timeline { display: flex; flex-direction: column; gap: 28px; padding-left: 40px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline__item { position: relative; padding-left: 28px; }
.timeline__dot { position: absolute; left: -34px; top: 4px; width: 14px; height: 14px; background: var(--accent); border: 3px solid var(--bg); border-radius: 50%; z-index: 1; }
.section--dark .timeline__dot { border-color: var(--black); }
.timeline__title { font-size: 18px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.section--dark .timeline__title { color: #fff; }
.timeline__text { font-size: 15px; color: var(--text-secondary); line-height: 1.6; }
.section--dark .timeline__text { color: #ccc; }
.section--dark .timeline::before { background: #333; }

/* ===== Endpoint / Code cards ===== */
.endpoint { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 24px 28px; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.endpoint:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.endpoint__header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.endpoint__method { display: inline-block; padding: 5px 14px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 700; line-height: 1; }
.endpoint__method--post { background: var(--accent); color: #fff; }
.endpoint__path { font-family: var(--font-mono); font-size: 15px; font-weight: 600; background: #F1F5F9; padding: 4px 12px; border-radius: 6px; color: var(--text); }
.endpoint__desc { font-size: 15px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }
.endpoint__code { background: #0B0F19; border-radius: 16px; padding: 16px 20px; overflow-x: auto; }
.endpoint__code pre { font-family: var(--font-mono); font-size: 13.5px; line-height: 1.7; color: #E2E8F0; white-space: pre; }
.endpoint__code .hl-key { color: #F472B6; }
.endpoint__code .hl-str { color: #34D399; }
.endpoint__code .hl-num { color: #FBBF24; }
.endpoint__code .hl-com { color: #64748B; }
.endpoint__code .hl-op { color: #94A3B8; }
.endpoint + .endpoint { margin-top: 20px; }

/* ===== Grids ===== */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }

/* ===== Feature cards ===== */
.feature-card__icon { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; font-size: 24px; }
.feature-card__title { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.feature-card__text { font-size: 15px; color: var(--text-secondary); line-height: 1.6; }

/* ===== Checklist ===== */
.checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; list-style: none; max-width: 720px; margin: 32px auto 0; }
.checklist__item { display: flex; align-items: center; gap: 12px; font-size: 16px; color: var(--text); }
.section--dark .checklist__item { color: #fff; }
.checklist__check { width: 26px; height: 26px; flex-shrink: 0; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700; }

/* ===== Version display ===== */
.version-display { text-align: center; }
.version-display__number { font-size: 96px; font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -0.03em; margin-bottom: 16px; }
.section--dark .version-display__number { color: #fff; }
.version-display__text { font-size: 18px; color: var(--text-secondary); line-height: 1.7; max-width: 640px; margin: 0 auto 8px; }
.section--dark .version-display__text { color: #ccc; }

/* ===== FAQ ===== */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-faq); overflow: hidden; transition: border-color 0.3s ease; }
.faq-item[open] { border-color: var(--accent); }
.faq-item summary { padding: 18px 24px; font-size: 16px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; list-style: none; transition: color 0.3s ease; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 22px; font-weight: 400; color: var(--accent); transition: transform 0.3s ease; line-height: 1; flex-shrink: 0; margin-left: 12px; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item__answer { padding: 0 24px 18px; font-size: 15px; color: var(--text-secondary); line-height: 1.7; }

/* ===== CTA Section ===== */
.cta-section { text-align: center; background: var(--black); color: #fff; }
.cta-section h2 { color: #fff; margin-bottom: 16px; }
.cta-section p { font-size: 18px; color: #ccc; max-width: 560px; margin: 0 auto 32px; line-height: 1.7; border-left: none; }

/* ===== Footer ===== */
footer { background: var(--black); color: #fff; border-top: 1px solid #2a2a2a; padding: 32px 0; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 24px; font-size: 14px; color: #aaa; }
.footer__name { font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: 0.06em; }
.footer__email { color: var(--accent); text-decoration: underline; transition: color 0.2s ease; }
.footer__email:hover { color: #fff; }
.footer__sep { width: 4px; height: 4px; background: #555; border-radius: 50%; }

/* ===== Scroll Reveal ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal--visible { opacity: 1; transform: translateY(0); }
.reveal[data-delay] { transition-delay: var(--delay); }

/* ===== Hidden helper ===== */
.visually-hidden:not(:focus):not(:active) { position: absolute; width: 1px; height: 1px; margin: -1px; border: 0; padding: 0; white-space: nowrap; clip-path: inset(100%); clip: rect(0 0 0 0); overflow: hidden; }

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; transition-delay: 0s !important; }
  .reveal { opacity: 1; transform: translateY(0); }
}

/* ===== Tablet ===== */
@media (max-width: 1024px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento__item--wide { grid-column: span 2; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .header__nav { display: none; }
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  :root { --gap: 16px; --section-py: var(--section-py-mobile); }
  h1 { font-size: 32px; }
  h2, .section__title { font-size: 26px; }
  .hero { padding: 56px 0 48px; }
  .hero__subtitle { font-size: 17px; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .btn { padding: 14px 28px; font-size: 15px; width: 100%; justify-content: center; }
  .btn--gradient, .btn--primary, .btn--blue, .btn--outline, .btn--dark { width: 100%; justify-content: center; }
  .bento { grid-template-columns: 1fr; }
  .bento__item--wide { grid-column: span 1; }
  .bento__item, .card, .feature-card { padding: 24px 20px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .checklist { grid-template-columns: 1fr; }
  .version-display__number { font-size: 56px; }
  footer .footer__inner { flex-direction: column; text-align: center; }
  .footer__sep { display: none; }
  .endpoint { padding: 20px; }
  .endpoint__code pre { font-size: 12px; }
  .marquee__track { animation-duration: 14s; }
}

/* ===== Very small ===== */
@media (max-width: 420px) {
  h1 { font-size: 28px; }
  h2, .section__title { font-size: 22px; }
}
