/* ─────────────────────────────────────────────────────────────
   VIBECOBRA — Papercut design system
   Matisse paper-cut × contemporary poster
   ───────────────────────────────────────────────────────────── */

:root {
  --paper:   #EFEAE0;
  --paper2:  #E6DFCE;
  --paper3:  #DED5BF;
  --deep:    #2C4A3E;
  --terra:   #C97B3F;
  --brown:   #5F3A1F;
  --ink:     #1E1810;
  --mute:    rgba(30, 24, 16, 0.55);
  --rule:    rgba(30, 24, 16, 0.16);
  --sun:     #E8B23B;

  --shadow-stamp:  3px 3px 0 var(--ink);
  --shadow-stamp-lg: 6px 6px 0 var(--ink);
  --shadow-soft:   6px 8px 0 rgba(30, 24, 16, 0.12);
  --shadow-deep:   0 24px 48px -28px rgba(30, 24, 16, 0.4);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;

  --font-display: "Playfair Display", Georgia, serif;
  --font-body:    "Work Sans", system-ui, -apple-system, sans-serif;
  --font-mono:    "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --container: 1080px;
  --gutter: clamp(20px, 5vw, 48px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  position: relative;
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(201, 123, 63, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(44, 74, 62, 0.04) 0%, transparent 50%);
}

/* Subtle paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12 0 0 0 0 0.10 0 0 0 0 0.06 0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

a { color: inherit; }

/* ───────────── Decorative paper-cut shapes ───────────── */

.paper-shape {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.92;
}
.paper-shape--terra {
  top: -120px;
  right: -120px;
  width: 360px;
  height: 360px;
  background: var(--terra);
  box-shadow: -8px 10px 0 rgba(30, 24, 16, 0.06);
}
.paper-shape--deep {
  top: 720px;
  left: -180px;
  width: 420px;
  height: 420px;
  background: var(--deep);
  box-shadow: 8px -10px 0 rgba(30, 24, 16, 0.06);
}
.paper-shape--brown {
  top: 1500px;
  right: -140px;
  width: 280px;
  height: 280px;
  background: var(--brown);
  box-shadow: -6px 8px 0 rgba(30, 24, 16, 0.06);
}

@media (max-width: 768px) {
  .paper-shape--terra { width: 220px; height: 220px; top: -80px; right: -100px; }
  .paper-shape--deep  { width: 260px; height: 260px; top: 580px; left: -140px; }
  .paper-shape--brown { width: 180px; height: 180px; top: 1280px; right: -90px; }
}

/* ───────────── Header ───────────── */

.site-header {
  position: relative;
  z-index: 5;
  max-width: var(--container);
  margin: 0 auto;
  padding: 22px var(--gutter) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}
.brand__word {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: -0.03em;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
}
.brand__word--italic {
  font-style: italic;
  font-weight: 500;
  color: var(--terra);
}
.brand__word--bold {
  font-weight: 800;
  color: var(--ink);
}
.brand__word--dot {
  font-weight: 800;
  color: var(--terra);
}

.header-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}

/* ───────────── Hero ───────────── */

.hero {
  position: relative;
  z-index: 2;
  max-width: var(--container);
  margin: 0 auto;
  padding: 56px var(--gutter) 56px;
}

.hero__inner { max-width: 980px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 24px;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(40px, 7.6vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 28px;
  color: var(--ink);
}
.hero__title-italic,
.hero__title-bold {
  display: block;
}
.hero__title-italic {
  font-style: italic;
  font-weight: 500;
  color: var(--ink);
}
.hero__title-bold {
  font-weight: 800;
  color: var(--deep);
}

.hero__lede {
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.5;
  max-width: 580px;
  color: rgba(30, 24, 16, 0.78);
  margin: 0 0 28px;
}

.hero__cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 28px;
}

.hero__signal {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}

/* ───────────── Buttons ───────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 24px;
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  font-style: italic;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 80ms ease, background 120ms ease;
  background: var(--paper2);
  color: var(--ink);
  box-shadow: var(--shadow-stamp);
  user-select: none;
}
.btn:hover  { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px);  box-shadow: 1px 1px 0 var(--ink); }
.btn:focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
}

.btn--primary { background: var(--terra); color: var(--paper); }
.btn--ghost   { background: var(--paper); }
.btn--sm      { padding: 11px 16px; font-size: 15px; }

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.btn[hidden] {
  display: none !important;
}

/* When the survey is in the success state, hide nav + progress for a clean
   "all done" feel. */
.survey--submitted .survey__nav,
.survey--submitted .survey__progress {
  display: none !important;
}

/* ───────────── Sections ───────────── */

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 14px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5.5vw, 64px);
  line-height: 1.0;
  letter-spacing: -0.025em;
  margin: 0 0 36px;
  color: var(--ink);
}
.section-title em      { font-style: italic; font-weight: 500; }
.section-title strong  { font-weight: 800;   color: var(--deep); }

/* ───────────── About / Cards ───────────── */

.about {
  position: relative;
  z-index: 2;
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px var(--gutter) 64px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 860px) {
  .cards { grid-template-columns: 1fr; gap: 18px; }
}

.card {
  background: var(--paper2);
  border: 2px solid var(--ink);
  border-radius: var(--r-lg);
  padding: 26px 24px 28px;
  box-shadow: var(--shadow-stamp-lg);
  transform: rotate(-0.4deg);
  transition: transform 200ms ease;
}
.card:nth-child(2) { transform: rotate(0.5deg); }
.card:nth-child(3) { transform: rotate(-0.2deg); }
.card:hover        { transform: rotate(0deg) translateY(-2px); }

.card--accent {
  background: var(--terra);
  color: var(--paper);
}
.card--accent .card__num   { color: rgba(239, 234, 224, 0.7); }
.card--accent .card__title { color: var(--paper); }
.card--accent .card__text  { color: rgba(239, 234, 224, 0.92); }

.card__num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 14px;
}
.card__title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 10px;
  color: var(--deep);
}
.card--accent .card__title { color: var(--paper); }
.card__text {
  font-size: 15.5px;
  line-height: 1.5;
  color: rgba(30, 24, 16, 0.78);
  margin: 0;
}

/* ───────────── Join / Survey ───────────── */

.join {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
  padding: 40px var(--gutter) 100px;
}
.join__lede {
  font-size: 17px;
  line-height: 1.55;
  color: rgba(30, 24, 16, 0.78);
  max-width: 620px;
  margin: 0 0 36px;
}
.join__lede em { font-style: italic; color: var(--terra); font-weight: 600; }

.survey {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--r-xl);
  padding: 28px 28px 24px;
  box-shadow: var(--shadow-stamp-lg);
  position: relative;
}
@media (max-width: 600px) {
  .survey { padding: 22px 18px 18px; border-radius: var(--r-lg); }
}

.survey__progress {
  margin-bottom: 22px;
}
.survey__progress-bar {
  height: 8px;
  background: var(--paper3);
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.survey__progress-fill {
  height: 100%;
  width: 0%;
  background: var(--terra);
  border-right: 2px solid var(--ink);
  transition: width 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.survey__progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}

.survey__stage {
  min-height: 280px;
  position: relative;
}

.survey__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  gap: 12px;
}

/* Step transition */
.step {
  animation: stepIn 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes stepIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step__num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 12px;
}
.step__q {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 8px;
}
.step__q em { font-style: italic; font-weight: 500; color: var(--brown); }
.step__hint {
  font-size: 14.5px;
  color: var(--mute);
  margin: 0 0 22px;
  line-height: 1.45;
}

/* Inputs */
.field {
  width: 100%;
  background: var(--paper2);
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--ink);
  box-shadow: var(--shadow-stamp);
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.field:focus {
  outline: none;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}
.field::placeholder { color: var(--mute); }

textarea.field {
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
  font-family: var(--font-body);
}

/* Choice list */
.choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--paper2);
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 80ms ease, background 120ms ease;
  user-select: none;
  font-size: 16px;
}
.choice:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-stamp);
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice__dot {
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  flex-shrink: 0;
  position: relative;
  transition: background 120ms ease;
}
.choice--checkbox .choice__dot { border-radius: 6px; }
.choice__dot::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: inherit;
  background: var(--terra);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 120ms ease, transform 120ms ease;
}
.choice.is-selected {
  background: var(--paper);
  box-shadow: var(--shadow-stamp);
  transform: translate(-1px, -1px);
}
.choice.is-selected .choice__dot::after { opacity: 1; transform: scale(1); }
.choice.is-selected .choice__dot { background: var(--paper); }

/* Inline "Другое" custom-text input under a selected choice */
.choice__other {
  margin-top: -2px;
  margin-bottom: 4px;
  margin-left: 28px;
  width: calc(100% - 28px);
  padding: 11px 14px;
  font-size: 15.5px;
  background: var(--paper);
  animation: stepIn 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (max-width: 600px) {
  .choice__other { margin-left: 0; width: 100%; }
}

/* Scale 1–5 */
.scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.scale__btn {
  aspect-ratio: 1 / 1;
  background: var(--paper2);
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 80ms ease, background 120ms ease;
}
.scale__btn:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-stamp); }
.scale__btn.is-selected {
  background: var(--terra);
  color: var(--paper);
  box-shadow: var(--shadow-stamp);
  transform: translate(-1px, -1px);
}
.scale__legend {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}

/* Two-field combo (give/take) */
.combo {
  display: grid;
  gap: 14px;
}
.combo__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 6px;
  display: block;
}

/* ───────────── Review step ───────────── */

.review-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  background: var(--paper2);
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: 2px 2px 0 var(--ink);
}
@media (max-width: 600px) {
  .review-row {
    grid-template-columns: auto 1fr;
    gap: 10px 12px;
    padding: 12px 14px;
  }
}

.review-row__num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--mute);
  margin-top: 2px;
  min-width: 22px;
}

.review-row__body {
  min-width: 0;
}

.review-row__q {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 4px;
}

.review-row__a {
  font-size: 15.5px;
  line-height: 1.45;
  color: var(--ink);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.review-row__empty {
  color: var(--mute);
  font-style: italic;
}

.review-row__edit {
  all: unset;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 14px;
  color: var(--terra);
  cursor: pointer;
  padding: 6px 10px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 80ms ease, box-shadow 80ms ease;
  white-space: nowrap;
  align-self: start;
}
.review-row__edit:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}
.review-row__edit:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}
@media (max-width: 600px) {
  .review-row__edit {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

/* Error state */
.field-error {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--brown);
  font-weight: 600;
}

/* ───────────── Success state ───────────── */

.success {
  text-align: center;
  padding: 32px 8px 16px;
  animation: stepIn 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.success__stamp {
  display: inline-block;
  margin-bottom: 22px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--deep);
  padding: 9px 16px 10px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-2deg);
  animation: stampIn 460ms cubic-bezier(0.2, 0.8, 0.2, 1) 80ms both;
}
.success__mark {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--deep);
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-stamp-lg);
  position: relative;
  animation: popIn 480ms cubic-bezier(0.2, 1.2, 0.4, 1) 160ms both;
}
.success__mark svg { width: 54px; height: 54px; }
.success__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 14px;
}
.success__title em { font-style: italic; font-weight: 500; color: var(--terra); }
.success__text {
  font-size: 16.5px;
  line-height: 1.55;
  color: rgba(30, 24, 16, 0.78);
  max-width: 460px;
  margin: 0 auto;
}
.success__text strong {
  color: var(--ink);
  font-weight: 600;
  background: var(--paper2);
  padding: 1px 8px;
  border-radius: 6px;
}

@keyframes stampIn {
  0%   { opacity: 0; transform: rotate(-12deg) scale(0.7); }
  60%  { opacity: 1; transform: rotate(2deg)   scale(1.05); }
  100% { opacity: 1; transform: rotate(-2deg)  scale(1);    }
}
@keyframes popIn {
  0%   { opacity: 0; transform: scale(0.4); }
  100% { opacity: 1; transform: scale(1);   }
}

/* ───────────── Footer ───────────── */

.site-footer {
  position: relative;
  z-index: 3;
  background: var(--ink);
  color: var(--paper);
  padding: 60px var(--gutter) 40px;
  margin-top: 40px;
  border-top: 2px solid var(--ink);
  overflow: hidden;
}

.footer-row {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border-top: 1px solid rgba(239, 234, 224, 0.18);
  padding-top: 24px;
}
.footer-brand {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(239, 234, 224, 0.7);
  text-decoration: none;
  transition: color 120ms ease;
}
.footer-brand:hover { color: var(--terra); }
.footer-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(239, 234, 224, 0.6);
}

/* ───────────── Reduced motion ───────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
