/* ==========================================================================
   Forgenox Test Zone — светлая тема «пляж и кинетика»
   ========================================================================== */
:root {
  --paper: #f6f1e7;
  --paper-2: #ede5d4;
  --card: #fffcf6;
  --sand: #e8dcc1;
  --sand-deep: #d8c6a0;
  --ink: #1d2327;
  --ink-2: #4a5459;
  --ink-3: #7c8582;
  --line: rgba(29, 35, 39, 0.12);
  --line-2: rgba(29, 35, 39, 0.22);
  --tube: #efd27c;
  --tube-edge: #b48a2c;
  --sky: #2e6c9e;
  --sky-soft: #dde8ee;
  --coral: #e0623f;
  --sail: #fffaf0;

  --f-display: "Unbounded", "Manrope", system-ui, sans-serif;
  --f-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1240px;
  --pad: clamp(20px, 4vw, 48px);
  --r: 18px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --shadow: 0 1px 0 rgba(29, 35, 39, .04), 0 18px 40px -24px rgba(60, 44, 10, .28);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
code {
  font: 500 0.86em var(--f-mono);
  background: rgba(180, 138, 44, .12);
  padding: .1em .38em;
  border-radius: 6px;
  white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--tube); color: var(--ink); }

/* ── Кнопки ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  min-height: 46px; padding: 0 22px;
  border-radius: 999px; border: 1.5px solid var(--ink);
  font: 600 15px/1 var(--f-body); letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
  transition: transform .35s var(--ease), background .25s, color .25s, box-shadow .35s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { box-shadow: 0 10px 24px -12px rgba(29, 35, 39, .55); }
.btn--line { background: transparent; color: var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--paper); }
.btn--sm { min-height: 38px; padding: 0 16px; font-size: 14px; }

/* ── Навигация ──────────────────────────────────────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  height: 68px; padding: 0 var(--pad);
  transition: background .3s, box-shadow .3s, height .3s;
}
.nav.is-stuck {
  background: rgba(246, 241, 231, .86);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 var(--line);
  height: 60px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; color: var(--ink); }
.brand-crank { transform-origin: 20px 15px; animation: crank 4s linear infinite; }
@keyframes crank { to { transform: rotate(360deg); } }
.brand-name { font: 600 15px/1 var(--f-display); letter-spacing: -.01em; }
.brand-slash { color: var(--coral); margin: 0 1px; }
.nav-links { display: flex; gap: 6px; margin-left: auto; }
.nav-links a {
  position: relative; padding: 8px 14px; border-radius: 999px;
  font-weight: 600; font-size: 14.5px; text-decoration: none; color: var(--ink-2);
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--ink); background: rgba(29, 35, 39, .06); }
.nav-links a.is-active { color: var(--ink); background: rgba(239, 210, 124, .55); }
.nav-side { display: flex; align-items: center; gap: 10px; }
.lang {
  height: 38px; min-width: 44px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink);
  font: 500 12.5px var(--f-mono); cursor: pointer;
}
.lang:hover { background: rgba(29, 35, 39, .06); }

/* ── Общие секции ───────────────────────────────────────────────────────── */
.sec { padding: clamp(72px, 10vw, 128px) var(--pad); }
.sec > * { max-width: var(--wrap); margin-left: auto; margin-right: auto; }
.sec-head { margin-bottom: clamp(32px, 5vw, 56px); max-width: var(--wrap); }
.kicker {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px;
  font: 500 12.5px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
}
.kicker-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px rgba(224, 98, 63, .16); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(224, 98, 63, .04); } }
.kicker--plain::before { content: ""; width: 22px; height: 1.5px; background: var(--tube-edge); }
.h2 {
  margin: 0 0 16px; max-width: 22ch;
  font: 600 clamp(26px, 3.6vw, 46px)/1.1 var(--f-display); letter-spacing: -.03em;
}
.lead { margin: 0; max-width: 60ch; color: var(--ink-2); font-size: clamp(16px, 1.4vw, 18.5px); line-height: 1.6; }

/* ── HERO ───────────────────────────────────────────────────────────────── */
.hero {
  position: relative; isolation: isolate;
  min-height: max(640px, 100svh);
  display: flex; align-items: flex-start;
  padding: clamp(118px, 15vh, 168px) var(--pad) 0;
  overflow: hidden;
  touch-action: pan-y;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
.hero-copy { position: relative; width: 100%; max-width: var(--wrap); margin: 0 auto; }
.hero-copy > * { max-width: 600px; }
.hero-copy > .hero-title { max-width: 760px; }
.hero-title {
  margin: 0 0 22px;
  font: 700 clamp(34px, 5.2vw, 74px)/1.02 var(--f-display); letter-spacing: -.04em;
}
.hero-title .line { display: block; }
.hero-title em {
  font-style: normal; position: relative; white-space: nowrap;
  background: linear-gradient(transparent 62%, rgba(239, 210, 124, .85) 62%, rgba(239, 210, 124, .85) 90%, transparent 90%);
}
.hero-lead { margin: 0 0 30px; font-size: clamp(16.5px, 1.5vw, 19px); color: var(--ink-2); max-width: 52ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }
.hero-stats { display: flex; gap: clamp(20px, 3.4vw, 44px); margin: 0; padding: 0; }
.stat { display: flex; flex-direction: column-reverse; gap: 6px; }
.stat dd { margin: 0; font: 600 clamp(22px, 2.3vw, 30px)/1 var(--f-display); letter-spacing: -.03em; }
.stat dt { font: 500 11.5px/1.3 var(--f-mono); color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; }
.hero-note {
  position: absolute; left: var(--pad); bottom: 18px; margin: 0; max-width: 520px;
  font: 500 11.5px/1.45 var(--f-mono); color: var(--ink-2); opacity: .75;
}

/* ── Реестр сайтов ──────────────────────────────────────────────────────── */
.sec--sites { background: var(--paper); position: relative; }
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: clamp(28px, 4vw, 44px);
  padding-bottom: 18px; border-bottom: 1px solid var(--line);
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--card);
  font: 600 14px/1 var(--f-body); color: var(--ink-2); cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .3s var(--ease);
}
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip-n { font: 500 11.5px var(--f-mono); opacity: .65; }
.toolbar-count { margin: 0; font: 500 12.5px var(--f-mono); color: var(--ink-3); }

/* Список: зигзаг «картинка — описание», связанный общим «хребтом» */
.sites { position: relative; display: grid; gap: clamp(40px, 6vw, 84px); }
.sites::before {
  content: ""; position: absolute; top: 10px; bottom: 10px; left: 50%; width: 2px; margin-left: -1px;
  background: repeating-linear-gradient(to bottom, var(--tube-edge) 0 6px, transparent 6px 14px);
  opacity: .35;
}
.site {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px); align-items: center;
}
.site::after { /* шарнир на хребте */
  content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; background: var(--paper); border: 3px solid var(--ink);
  box-shadow: 0 0 0 5px var(--paper);
}
.site:nth-child(even) .site-shot { order: 2; }

.site-shot {
  position: relative; display: block; text-decoration: none;
  border-radius: var(--r); background: var(--card);
  border: 1px solid var(--line-2); box-shadow: var(--shadow);
  overflow: hidden;
  transform: perspective(1200px) rotateY(0deg) translateZ(0);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}
.site:nth-child(odd) .site-shot:hover { transform: perspective(1200px) rotateY(4deg) translateY(-4px); }
.site:nth-child(even) .site-shot:hover { transform: perspective(1200px) rotateY(-4deg) translateY(-4px); }
.site-shot:hover { box-shadow: 0 1px 0 rgba(29, 35, 39, .04), 0 34px 60px -30px rgba(60, 44, 10, .45); }
.shot-bar {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border-bottom: 1px solid var(--line); background: var(--paper);
}
.shot-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.shot-bar i:first-child { background: var(--coral); opacity: .7; }
.shot-url {
  margin-left: 10px; flex: 1; min-width: 0;
  font: 500 11.5px/1 var(--f-mono); color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.shot-frame { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-2); }
.shot-frame img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform 1.2s var(--ease), opacity .5s; }
.site-shot:hover .shot-frame img { transform: scale(1.035); }
.shot-frame img.is-loading { opacity: 0; }
.shot-frame iframe {
  position: absolute; top: 0; left: 0; border: 0; pointer-events: none;
  width: 1440px; height: 900px; transform-origin: 0 0; background: #fff;
}
.shot-skel { position: absolute; inset: 0; background: linear-gradient(100deg, var(--paper-2) 30%, var(--paper) 50%, var(--paper-2) 70%); background-size: 300% 100%; animation: skel 1.6s linear infinite; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -200% 0; } }
.shot-open {
  position: absolute; right: 14px; bottom: 14px;
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font: 600 13px var(--f-body);
  opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .4s var(--ease);
}
.site-shot:hover .shot-open, .site-shot:focus-visible .shot-open { opacity: 1; transform: none; }

.site-body { position: relative; padding: 6px 0; }
.site-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.site-no { font: 600 13px/1 var(--f-display); color: var(--tube-edge); letter-spacing: .02em; }
.pill {
  display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px;
  font: 600 12px/1 var(--f-body); background: rgba(46, 108, 158, .1); color: var(--sky);
}
.pill--shop { background: rgba(224, 98, 63, .12); color: #b8472a; }
.pill--landing { background: rgba(180, 138, 44, .16); color: #7d5d14; }
.pill--site { background: rgba(29, 35, 39, .08); color: var(--ink); }
.pill--new { background: var(--coral); color: #fff; }
.site-date { font: 500 12px var(--f-mono); color: var(--ink-3); }
.site-title {
  margin: 0 0 10px; font: 600 clamp(22px, 2.1vw, 29px)/1.15 var(--f-display); letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
.site-title a { text-decoration: none; background: linear-gradient(var(--tube), var(--tube)) 0 92% / 0 30% no-repeat; transition: background-size .5s var(--ease); }
.site-title a:hover { background-size: 100% 30%; }
.site-tagline { margin: 0 0 14px; font-weight: 600; color: var(--ink); font-size: 16.5px; line-height: 1.45; }
.site-desc { margin: 0 0 22px; color: var(--ink-2); max-width: 52ch; }
.site-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.site-owner { margin: 16px 0 0; font: 500 12px var(--f-mono); color: var(--ink-3); }

/* пагинация */
.pager { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: clamp(48px, 7vw, 84px); }
.pager:empty { display: none; }
.pg {
  min-width: 44px; height: 44px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink);
  font: 600 14px var(--f-display); cursor: pointer;
  transition: background .2s, color .2s, transform .3s var(--ease), border-color .2s;
}
.pg:hover:not(:disabled) { border-color: var(--ink); transform: translateY(-2px); }
.pg[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pg:disabled { opacity: .35; cursor: default; }
.pg--wide { padding: 0 18px; font-family: var(--f-body); }
.pg-gap { color: var(--ink-3); padding: 0 4px; }

.sites-empty, .sites-error { text-align: center; padding: 48px 20px; color: var(--ink-2); border: 1.5px dashed var(--line-2); border-radius: var(--r); }
.sites.is-loading { min-height: 60vh; }

/* ── Как это работает ───────────────────────────────────────────────────── */
.sec--how { background: var(--paper-2); position: relative; }
.sec--how::before { /* мягкая дюна-переход */
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 48px; max-width: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 48' preserveAspectRatio='none'%3E%3Cpath d='M0 0h1440v14c-120 22-260 30-420 18S760 6 600 14 300 44 160 36 40 22 0 26z' fill='%23f6f1e7'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}
.how { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 28px); counter-reset: s; }
.how-step {
  position: relative; display: flex; flex-direction: column;
  padding: 16px 16px 26px; border-radius: calc(var(--r) + 4px);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.how-stage {
  position: relative; aspect-ratio: 5 / 4; border-radius: var(--r); overflow: hidden;
  background: var(--paper); margin-bottom: 22px; border: 1px solid var(--line);
}
.how-stage--grid { background: #f8f6f0; }
.how-stage--sand { background: linear-gradient(var(--paper) 0 72%, var(--sand) 72%); }
.how-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.how-no { font: 600 13px var(--f-display); color: var(--tube-edge); padding: 0 8px; }
.how-step h3 { margin: 8px 8px 8px; font: 600 19px/1.25 var(--f-display); letter-spacing: -.02em; }
.how-step p { margin: 0 8px; color: var(--ink-2); }

/* ── О зоне ─────────────────────────────────────────────────────────────── */
.zone { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(36px, 6vw, 96px); align-items: start; }
.zone-head { position: sticky; top: 110px; }
.zone-head .lead { margin-bottom: 30px; }
.facts { list-style: none; margin: 0; padding: 0 0 0 34px; position: relative; display: grid; gap: 34px; }
.facts::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--tube); box-shadow: inset 0 0 0 1px rgba(180, 138, 44, .5); }
.fact { position: relative; }
.fact-joint { position: absolute; left: -34px; top: 6px; width: 17px; height: 17px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px var(--paper); }
.fact-joint::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--paper); }
.fact h3 { margin: 0 0 6px; font: 600 18.5px/1.3 var(--f-display); letter-spacing: -.02em; }
.fact p { margin: 0; color: var(--ink-2); max-width: 54ch; }

/* ── Подвал ─────────────────────────────────────────────────────────────── */
.footer { background: var(--ink); color: var(--paper); }
.footer-track { position: relative; height: 150px; background: var(--paper); border-bottom: 1px solid var(--line); }
.footer-track::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background: var(--sand); }
.footer-track canvas { position: absolute; inset: 0; width: 100%; height: calc(100% - 4px); display: block; }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: clamp(48px, 7vw, 88px) var(--pad) 28px; }
.footer-mark { font: 700 clamp(30px, 6vw, 80px)/.95 var(--f-display); letter-spacing: -.045em; margin-bottom: 36px; }
.footer-mark em { font-style: normal; color: var(--tube); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; padding-bottom: 36px; border-bottom: 1px solid rgba(246, 241, 231, .16); }
.footer-tagline { margin: 0; max-width: 40ch; color: rgba(246, 241, 231, .75); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer-nav a { color: var(--paper); text-decoration: none; font-weight: 600; opacity: .85; }
.footer-nav a:hover { opacity: 1; color: var(--tube); }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding-top: 22px; font: 500 12px var(--f-mono); color: rgba(246, 241, 231, .55); }

/* ── Появление ──────────────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ── Адаптив ────────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .nav-links { display: none; }
  .nav-side { margin-left: auto; }
  .how { grid-template-columns: 1fr; max-width: 560px; }
  .zone { grid-template-columns: 1fr; }
  .zone-head { position: static; }
  .sites::before, .site::after { display: none; }
  .site, .site:nth-child(even) { grid-template-columns: 1fr; gap: 22px; }
  .site:nth-child(even) .site-shot { order: 0; }
  .sites { gap: 56px; }
}
@media (max-width: 760px) {
  .hero { min-height: 100svh; padding-top: 104px; padding-bottom: 230px; }
  .hero-copy > * { max-width: none; }
  .hero-stats { gap: 22px; }
  .hero-note { display: none; }
  .nav { height: 60px; }
  .nav-side .btn { display: none; }
  .site-shot:hover { transform: none !important; }
}
@media (max-width: 420px) {
  .hero-title { font-size: 31px; }
  .hero-cta .btn { flex: 1 1 auto; justify-content: center; }
  .stat dd { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
