/* ============================================================
   СвойСофт — лендинг-эксперимент.
   Цифровой журнал + аналитическая панель: типографика задаёт
   характер, линии тонкие, поверхности плоские — без градиентов
   и теней. Одиночный акцент: бутылочно-зелёный.
   Шрифты: Unbounded (заголовки) / Inter (текст) / JetBrains Mono
   (цифры, индексы, лейблы).
   ============================================================ */

:root {
  --paper: #F7F5F1;
  --paper-deep: #F0EDE6;
  --ink: #191813;
  --muted: #6E6A60;
  --faint: #9C978B;
  --hairline: #E3E0D8;
  --hairline-dark: #CFCABD;
  --accent: #2E4638;
  --accent-deep: #22352A;
  --accent-tint: #DFE3D9;
  --ok: #2E4638;
  --danger: #8A3B2C;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

::selection { background: var(--accent); color: var(--paper); }

a { color: inherit; text-decoration: none; }

.mono {
  font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- обёртка ---------- */

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 56px);
}

/* ---------- верхняя строка ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
}

.top-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px clamp(20px, 5vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.wordmark:hover { color: var(--accent); }

.top-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 26px);
}

.top-nav a {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: color 0.15s ease;
}
.top-nav a:hover { color: var(--ink); }

.top-nav .top-cta {
  background: var(--ink);
  color: var(--paper);
  padding: 9px 16px;
  transition: background 0.15s ease, color 0.15s ease;
}

.top-nav .top-cta:hover { background: var(--accent); color: var(--paper); }

/* ---------- hero: обложка журнала ---------- */

.hero {
  padding: clamp(80px, 13vw, 150px) 0 clamp(64px, 9vw, 110px);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(24px, 3.5vw, 36px);
}

.kicker::before {
  content: '';
  flex: none;
  width: 28px;
  height: 1px;
  background: var(--ink);
}

.hero-title {
  font-family: 'Unbounded', sans-serif;
  font-weight: 500;
  font-size: clamp(34px, 5.8vw, 72px);
  line-height: 1.14;
  letter-spacing: -0.015em;
  max-width: 21ch;
}

.hl {
  background: var(--accent-tint);
  padding: 0.05em 0.09em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.lead {
  margin-top: clamp(24px, 3.5vw, 34px);
  max-width: 58ch;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: clamp(32px, 4.5vw, 48px);
}

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 16px 24px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-primary:disabled { opacity: 0.55; cursor: wait; }

.btn-ghost { border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

/* ---------- секции ---------- */

.section { padding: clamp(64px, 9vw, 110px) 0; }

.section + .section { border-top: 1px solid var(--hairline); }

.section-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(18px, 3vw, 32px);
  align-items: start;
  padding-bottom: clamp(24px, 3.5vw, 36px);
  border-bottom: 1px solid var(--hairline);
}

.section-index {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid var(--hairline-dark);
  padding: 7px 10px;
  margin-top: 4px;
}

.section-title {
  font-family: 'Unbounded', sans-serif;
  font-weight: 500;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.22;
  letter-spacing: -0.01em;
}

.section-note {
  margin-top: 10px;
  max-width: 52ch;
  font-size: 14px;
  color: var(--muted);
}

.section-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.total-num {
  font-size: clamp(42px, 5vw, 64px);
  font-weight: 500;
  line-height: 1;
}

.total-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- статистика: ведомость ---------- */

.ledger-row {
  display: grid;
  grid-template-columns: minmax(120px, 260px) minmax(0, 1fr) 56px 72px;
  gap: 18px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--hairline);
}

.ledger-sphere {
  font-size: 15px;
  color: var(--ink);
}

.ledger-count {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 14px;
  text-align: right;
}

.ledger-share {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

.ledger-bar {
  position: relative;
  height: 6px;
  background: var(--hairline);
}

.ledger-bar i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: var(--accent);
  transition: width 0.8s ease 0.1s;
}

.ledger-row.empty {
  padding: 28px 0;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline);
}

.ledger-meta {
  margin-top: 18px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ---------- идеи: аккордеон ---------- */

.ideas { list-style: none; }

.idea { border-bottom: 1px solid var(--hairline); }

.idea-row {
  width: 100%;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 190px 220px 36px;
  gap: 16px;
  align-items: center;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 18px 0;
  font: inherit;
  color: inherit;
  transition: background 0.15s ease;
}

.idea-row:hover { background: var(--paper-deep); }

.idea-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.idea-num {
  font-size: 13px;
  color: var(--faint);
}

.idea-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
}

.idea-tags { display: contents; }

.idea-sphere {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--hairline-dark);
  padding: 4px 9px;
  justify-self: start;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idea-company {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idea-company.company-blur {
  filter: blur(3px);
  opacity: 0.7;
  user-select: none;
}

.idea-toggle {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  text-align: center;
}

.idea-toggle::before { content: '+'; }
.idea.open .idea-toggle::before { content: '–'; }

.idea-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
}

.idea.open .idea-body { grid-template-rows: 1fr; }

.idea-body-inner { overflow: hidden; min-height: 0; }

.idea-body-content {
  display: grid;
  gap: 18px;
  max-width: 72ch;
  padding: 2px 0 26px 68px;
}

.idea-desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}

.idea-effect {
  display: grid;
  gap: 6px;
  border-left: 2px solid var(--accent);
  padding-left: 14px;
}

.idea-effect-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.idea-effect p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}

.ideas-empty {
  padding: 28px 0;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline);
}

.ideas-meta {
  margin-top: 18px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ---------- форма ---------- */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px 36px;
  margin-top: clamp(32px, 4.5vw, 44px);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field-wide { grid-column: 1 / -1; }

.field-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-label em {
  font-style: normal;
  text-transform: none;
  letter-spacing: 0.04em;
  color: var(--faint);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--hairline-dark);
  border-radius: 0;
  padding: 10px 0;
  transition: border-color 0.15s ease;
}

.field textarea { resize: vertical; min-height: 96px; line-height: 1.55; }

.field input::placeholder,
.field textarea::placeholder { color: var(--faint); }

.field input:hover,
.field select:hover,
.field textarea:hover { border-bottom-color: var(--faint); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--ink);
}

.select-wrap { position: relative; display: block; }

.select-wrap::after {
  content: '▾';
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  line-height: 1;
  color: var(--muted);
  pointer-events: none;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: none;
  padding-right: 28px;
  cursor: pointer;
}

.field select:invalid { color: var(--faint); }

.field.error input,
.field.error select,
.field.error textarea { border-bottom-color: var(--danger); }

.form-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: clamp(30px, 4vw, 44px);
}

.form-status {
  font-size: 12px;
  letter-spacing: 0.04em;
}

.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--danger); }

/* ---------- футер ---------- */

.foot {
  border-top: 1px solid var(--hairline);
  padding: 30px 0;
}

.foot-inner { display: flex; justify-content: center; }

.foot .mono {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-align: center;
}

/* ---------- появление при скролле ---------- */

.ledger-row[data-reveal],
.idea[data-reveal] {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.ledger-row[data-reveal].in,
.idea[data-reveal].in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .ledger-row[data-reveal],
  .idea[data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ---------- адаптив ---------- */

@media (max-width: 820px) {
  .section-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .section-total {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: baseline;
    gap: 14px;
    margin-top: 6px;
  }

  .section-total .total-num { font-size: 36px; }

  .ledger-row {
    grid-template-columns: minmax(84px, 150px) minmax(0, 1fr) 40px 52px;
    gap: 10px;
  }

  .ledger-sphere { font-size: 14px; }
  .ledger-count { font-size: 13px; }
  .ledger-share { font-size: 11px; }

  .idea-row {
    grid-template-columns: 36px minmax(0, 1fr) 24px;
    grid-template-areas:
      'num title toggle'
      'num meta meta';
    row-gap: 12px;
  }

  .idea-num { grid-area: num; font-size: 12px; }
  .idea-title { grid-area: title; font-size: 15px; }
  .idea-toggle { grid-area: toggle; }

  .idea-tags {
    grid-area: meta;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  .idea-sphere { max-width: none; }
  .idea-company {
    text-align: left;
    font-size: 10px;
  }

  .idea-body-content { padding-left: 0; }

  .form-grid { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 600px) {
  .top-nav a:not(.top-cta) { display: none; }
}
