/* convy.ru — портфель продуктов. Токены из дизайна «Convy Landing». */

:root {
  color-scheme: light;
  --bg: #fcfcfb;
  --panel: #f7f7f4;
  --fg: #16181c;
  --muted: #5c6068;
  --faint: #a3a6a1;
  --line: #16181c;
  --soft: #e8e8e4;
  --hair: #f0f0ec;
  --chip: #e0e0dc;
  --shot-bg: #f4f4f0;
  --stripe: rgba(0, 0, 0, .045);
  --nav-bg: rgba(252, 252, 251, .9);
  --arrow-bg: rgba(252, 252, 251, .94);
  --dot-on: #16181c;
  --dot-off: #dcdcd7;
  --accent: oklch(0.62 0.14 145);
  --shadow: rgba(0, 0, 0, .18);

  --pad: 64px;
  --font-head: 'Onest', 'Manrope', system-ui, -apple-system, sans-serif;
  --font-body: 'Manrope', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #162428;
    --panel: #1d2c2f;
    --fg: #eceae3;
    --muted: #9aabb0;
    --faint: #79898e;
    --line: #485f65;
    --soft: #273639;
    --hair: #212f33;
    --chip: #344346;
    --shot-bg: #202e32;
    --stripe: rgba(255, 255, 255, .055);
    --nav-bg: rgba(22, 36, 40, .9);
    --arrow-bg: rgba(22, 36, 40, .8);
    --dot-on: #eceae3;
    --dot-off: #3a494c;
    --accent: oklch(0.75 0.15 150);
    --shadow: rgba(0, 0, 0, .5);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #162428;
  --panel: #1d2c2f;
  --fg: #eceae3;
  --muted: #9aabb0;
  --faint: #79898e;
  --line: #485f65;
  --soft: #273639;
  --hair: #212f33;
  --chip: #344346;
  --shot-bg: #202e32;
  --stripe: rgba(255, 255, 255, .055);
  --nav-bg: rgba(22, 36, 40, .9);
  --arrow-bg: rgba(22, 36, 40, .8);
  --dot-on: #eceae3;
  --dot-off: #3a494c;
  --accent: oklch(0.75 0.15 150);
  --shadow: rgba(0, 0, 0, .5);
}

/* ---------- base ---------- */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.6 var(--font-body);
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: var(--font-head); }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}
.label {
  font: 400 11px/1 var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}
.btn {
  display: inline-block;
  background: var(--fg);
  color: var(--bg);
  padding: 13px 20px;
  border: 0;
  border-radius: 9px;
  font: 500 14px/1 var(--font-head);
  white-space: nowrap;
  cursor: pointer;
  transition: opacity .2s;
}
.btn:hover { opacity: .85; }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--soft);
}
.nav-in {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.mark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--fg);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 500 11px/1 var(--font-mono);
}
/* Fallback optical alignment for browsers without text-box trimming. */
.mark > span { transform: translateY(-1px); }
.brand-name {
  font: 700 17px/1 var(--font-head);
  letter-spacing: -.02em;
  transform: translateY(-1px);
}
.brand-sub {
  font: 400 11px/1 var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  padding-left: 6px;
  /* Optical adjustment against the heavier lowercase wordmark. */
  transform: translateY(1px);
}
/* Center lowercase bodies and uppercase capitals; descenders don't shift the center. */
@supports (text-box-trim: trim-both) and (text-box-edge: ex alphabetic) {
  .mark > span, .brand-name, .brand-sub {
    text-box-trim: trim-both;
  }
  .mark > span, .brand-name {
    text-box-edge: ex alphabetic;
    transform: none;
  }
  .brand-sub { text-box-edge: cap alphabetic; }
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 26px;
  font: 500 14px/1 var(--font-head);
  color: var(--muted);
}
.nav-link { color: var(--muted); transition: color .2s; }
.nav-link:hover { color: var(--fg); }
.theme {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--chip);
  border-radius: 100px;
}
.theme button {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 100px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 400 12px/1 var(--font-head);
  transition: background .2s, color .2s;
}
.theme button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.btn-nav { padding: 10px 16px; border-radius: 8px; }

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 56px;
  align-items: end;
  padding-top: 88px;
  padding-bottom: 88px;
}
.hero h1 { font: 700 66px/1.02 var(--font-head); letter-spacing: -.04em; }
.hero-side { display: flex; flex-direction: column; gap: 16px; padding-bottom: 8px; }
.hero-side p { margin: 0; font: 400 17px/1.7 var(--font-body); color: var(--muted); }
.link-ul {
  align-self: flex-start;
  font: 500 15px/1 var(--font-head);
  color: var(--fg);
  border-bottom: 1px solid var(--fg);
  padding-bottom: 4px;
}

/* ---------- stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--soft);
}
.stat { display: flex; flex-direction: column; gap: 6px; padding: 20px 24px 20px 0; }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--soft); }
.stat:last-child { padding-right: 0; }
.stat-v { font: 500 17px/1.3 var(--font-head); }

/* ---------- products ---------- */

.product { border-bottom: 1px solid var(--soft); }
.product-in {
  display: grid;
  grid-template-columns: 64px 1fr 1.1fr;
  gap: 40px;
  align-items: start;
  padding-top: 56px;
  padding-bottom: 56px;
}
.rail { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding-top: 6px; }
.rail-num { font: 500 13px/1 var(--font-mono); }
.rail-line { width: 1px; height: 52px; background: var(--chip); }
.rail-n { display: none; }
.info { display: flex; flex-direction: column; gap: 16px; padding-top: 2px; min-width: 0; }
.title { display: flex; align-items: center; gap: 12px; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 100px; background: var(--accent); }
.title h2 { font: 700 40px/1.05 var(--font-head); letter-spacing: -.035em; }
.long { margin: 0; font: 400 16px/1.7 var(--font-body); color: var(--muted); max-width: 440px; }
.features { list-style: none; margin: 4px 0 0; padding: 0; border-top: 1px solid var(--soft); }
.features li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--hair);
  font: 400 15px/1.5 var(--font-body);
}
.features li::before { content: "•"; font: 400 11px/1.6 var(--font-mono); color: var(--faint); }
.actions { display: flex; align-items: center; gap: 14px; padding-top: 12px; flex-wrap: wrap; }
.sub { font: 400 12px/1 var(--font-mono); color: var(--muted); white-space: nowrap; }
a.sub:hover { color: var(--fg); }
.chip {
  font: 400 10px/1 var(--font-mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--chip);
  border-radius: 100px;
  padding: 6px 10px;
  white-space: nowrap;
}

/* ---------- gallery ---------- */

.gallery { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.frame {
  position: relative;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--chip);
  border-radius: 14px;
  overflow: hidden;
  background: var(--shot-bg);
  touch-action: pan-y;
}
.track { display: flex; height: 100%; transition: transform .5s cubic-bezier(.4, 0, .2, 1); will-change: transform; }
.slide {
  flex: 0 0 100%;
  margin: 0;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background-image: repeating-linear-gradient(45deg, var(--stripe) 0 7px, transparent 7px 14px);
  user-select: none;
  -webkit-user-select: none;
}
.slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  -webkit-user-drag: none;
}
.slide.phone { justify-content: center; align-items: flex-start; padding: 24px 16px 0; }
.slide.phone img {
  width: auto;
  height: 135%;
  object-fit: contain;
  border: 1px solid var(--chip);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 12px 40px var(--shadow);
}
.slide.placeholder { padding: 16px; }
.slide.placeholder figcaption { font: 400 10px/1 var(--font-mono); color: var(--faint); letter-spacing: .08em; }
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 100px;
  background: var(--arrow-bg);
  border: 1px solid var(--chip);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: 400 15px/1 var(--font-head);
  transition: background .2s, color .2s;
}
.arrow:hover { background: var(--fg); color: var(--bg); }
.arrow.prev { left: 12px; }
.arrow.next { right: 12px; }
.gallery-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dots { display: flex; gap: 7px; }
.dots button {
  width: 28px;
  height: 3px;
  padding: 0;
  border: 0;
  border-radius: 100px;
  background: var(--dot-off);
  cursor: pointer;
  transition: background .25s;
}
.dots button[aria-current="true"] { background: var(--dot-on); }
.counter { letter-spacing: .06em; }
.gallery.single .arrow, .gallery.single .dots { display: none; }

/* ---------- subscribe ---------- */

.subscribe { background: var(--panel); border-bottom: 1px solid var(--soft); transition: background .3s ease; }
.subscribe-in {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  padding-top: 56px;
  padding-bottom: 56px;
}
.subscribe-text { display: flex; flex-direction: column; gap: 10px; }
.h-sub { font: 700 34px/1.15 var(--font-head); letter-spacing: -.03em; }
.subscribe-text p { margin: 0; font: 400 15px/1.65 var(--font-body); color: var(--muted); max-width: 460px; }
.subscribe-form { display: flex; flex-direction: column; gap: 10px; }
.form-row { display: flex; gap: 10px; }
.form-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--chip);
  background: var(--bg);
  color: var(--fg);
  padding: 14px 16px;
  border-radius: 9px;
  font: 400 14px/1 var(--font-body);
  outline: none;
  transition: border-color .2s;
}
.form-row input::placeholder { color: var(--faint); }
.form-row input:focus { border-color: var(--muted); }
.form-row .btn { padding: 14px 22px; }
.note { font: 400 11px/1.5 var(--font-mono); color: var(--faint); }
.note.is-ok { color: var(--fg); }
.note.is-err { color: var(--muted); }

/* ---------- about ---------- */

.about { border-bottom: 1px solid var(--soft); }
.about-in {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 56px;
  padding-top: 56px;
  padding-bottom: 56px;
}
.about-label { letter-spacing: .12em; }
.about-text { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.about-lead { margin: 0; font: 400 23px/1.5 var(--font-body); color: var(--fg); }
.about-text p { margin: 0; font: 400 16px/1.7 var(--font-body); color: var(--muted); }
.about-text a { color: var(--fg); border-bottom: 1px solid var(--chip); }

/* ---------- footer ---------- */

.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding-top: 26px;
  padding-bottom: 40px;
  font: 400 12px/1.6 var(--font-mono);
  letter-spacing: .04em;
  color: var(--muted);
}
.foot-links { display: flex; gap: 22px; }
.foot a { color: var(--muted); transition: color .2s; }
.foot a:hover { color: var(--fg); }

/* ---------- narrow ---------- */

@media (max-width: 899px) {
  :root { --pad: 20px; }
  .nav-right { gap: 10px; }
  .nav-link, .brand-sub { display: none; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 44px; padding-bottom: 44px; }
  .hero h1 { font-size: 38px; }
  .stats { grid-template-columns: 1fr; }
  .stat, .stat + .stat { padding: 20px 0; border-left: 0; }
  .stat + .stat { border-top: 1px solid var(--soft); }
  .product-in { grid-template-columns: 1fr; gap: 24px; padding-top: 36px; padding-bottom: 36px; }
  .rail { display: none; }
  .rail-n { display: inline; }
  .title h2 { font-size: 30px; }
  .slide.phone { padding: 0; justify-content: stretch; }
  .slide.phone img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .subscribe-in { grid-template-columns: 1fr; gap: 28px; }
  .h-sub { font-size: 26px; }
  .form-row { flex-direction: column; }
  .about-in { grid-template-columns: 1fr; gap: 28px; }
  .about-lead { font-size: 19px; }
  .foot { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .track, body, .subscribe { transition: none; }
}
