/* ============================================================================
   fieldnotes.study — площадка элиситации
   Палитра и типографика перенесены из мокапов Claude Design
   (design/sites/research-site/mockups/*.html), «бумажный» регистр.

   HARD RULE (валидность, не вкус): цвет = секция или тема, НИКОГДА не оценка.
   Четыре секции делят один lightness/chroma, меняется только hue.
   Ни один голос не ярче другого — non-valence держится механикой.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400;1,6..72,500&family=Hanken+Grotesk:wght@400;500;600&display=swap');

:root {
  --canvas: #ECE7DD;
  --surface: #F8F5EF;
  --field: #FDFBF6;
  --border: #DCD6C9;
  --border-soft: #E2DCCF;
  --dashed: #D2CCBE;
  --accent: #33312C;
  --checkoff: #B8B2A4;
  --text: #54514A;
  --muted: #6B6860;
  --hint: #8A8678;
  --rec-dot: #E7B0A0;
  --section: oklch(0.62 0.07 60);

  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  --shadow: 0 18px 48px rgba(60, 52, 38, 0.12);

  --scale: 1;          /* размер текста — участник меняет */
  --measure: 700px;
}

/* тёмная тема — та же тёплая бумага в ночном режиме, не чёрная */
[data-theme="dark"] {
  --canvas: #252118;
  --surface: #2D2920;
  --field: #342F25;
  --border: #443E33;
  --border-soft: #3B362C;
  --dashed: #4A4438;
  --accent: #ECE7DD;
  --checkoff: #5E5849;
  --text: #D4CDBF;
  --muted: #B0A999;
  --hint: #8E8878;
  --shadow: 0 18px 48px rgba(10, 8, 4, 0.5);
  --section: oklch(0.74 0.07 60);
}

/* повышенный контраст — отдельная ручка, не завязана на тему */
[data-contrast="high"] {
  --text: #201F1B;
  --muted: #33312C;
  --hint: #55524A;
  --border: #B8B2A4;
  --border-soft: #C6C0B2;
}
[data-theme="dark"][data-contrast="high"] {
  --text: #F5F1E8;
  --muted: #DED8CC;
  --hint: #B3ADA1;
  --border: #58544C;
  --border-soft: #4A463F;
}

* { box-sizing: border-box; }

html { font-size: calc(16px * var(--scale)); }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 22px 150px; }

button { font-family: var(--sans); }

:focus-visible { outline: 2px solid var(--section); outline-offset: 3px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ── шапка: этап + прогресс (без чисел и счётчиков) ───────────────────────── */

.topbar { display: flex; align-items: center; justify-content: space-between;
          gap: 14px; padding: 20px 2px 0; flex-wrap: wrap; }
.study { font-size: 0.6875rem; letter-spacing: .14em; text-transform: uppercase; color: var(--hint); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.prog { display: flex; gap: 6px; align-items: center; }
.seg { width: 20px; height: 4px; border-radius: 999px; background: var(--dashed); }
.seg.done { background: var(--accent); opacity: .30; }
.seg.on { background: var(--accent); }
.prog.field-prog .seg.on { background: var(--section); opacity: 1; }
.prog.field-prog .seg.done { background: var(--section); opacity: .35; }

.gear { background: none; border: none; padding: 6px; cursor: pointer;
        color: var(--hint); font-size: 0.75rem; letter-spacing: .1em; text-transform: uppercase; }
.gear:hover { color: var(--accent); }

/* ── типографика экрана ───────────────────────────────────────────────────── */

.stage, .section-label {
  margin-top: 38px; font-size: 0.6875rem; letter-spacing: .17em;
  text-transform: uppercase; color: var(--hint);
  display: flex; align-items: center; gap: 9px;
}
.dim-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--section); flex: 0 0 auto; }

h1 { font-family: var(--serif); font-weight: 500; font-size: 2.375rem; line-height: 1.08;
     color: var(--accent); margin: 10px 0 0; letter-spacing: -.01em; }
h1.grain { font-size: 2.3125rem; line-height: 1.1; margin-top: 9px; }
.read { margin: 14px 0 0; color: var(--muted); max-width: 54ch; }
.lede { margin: 18px 0 0; font-family: var(--serif); font-size: 1.25rem; line-height: 1.42;
        color: var(--accent); max-width: 40ch; }

.pill { display: inline-flex; align-items: center; gap: 9px; margin-top: 18px;
        background: var(--surface); border: 1px solid var(--border-soft);
        border-radius: 999px; padding: 9px 18px 9px 19px; }
.pill b { font-family: var(--serif); font-style: italic; font-weight: 500;
          color: var(--accent); font-size: 0.90625rem; }
.pill span { color: var(--hint); font-size: 0.8125rem; }

.ease { margin-top: 16px; border: 1px dashed var(--dashed); border-radius: 14px; padding: 15px 18px; }
.ease p { margin: 0; font-family: var(--serif); font-style: italic;
          font-size: 0.96875rem; color: var(--muted); }

.note-box { margin-top: 12px; border: 1px dashed var(--dashed); border-radius: 12px;
            padding: 13px 16px; font-size: 0.84375rem; color: var(--muted); }

/* ── голоса = отмечаемые карточки ─────────────────────────────────────────── */

.voices { margin-top: 22px; display: grid; gap: 14px; }

/* единая высота в свёрнутом виде: короткий голос не должен читаться
   как «менее настоящий» рядом с длинным. Текст не режем — сворачиваем. */
.voice { background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
         padding: 22px 24px; display: flex; gap: 16px; cursor: pointer;
         transition: box-shadow .15s; min-height: 136px; text-align: left; width: 100%;
         font: inherit; color: inherit; }
.voice.checked { border-color: transparent; box-shadow: inset 0 0 0 1.6px var(--accent); }
.box { flex: 0 0 auto; width: 23px; height: 23px; border-radius: 7px;
       border: 1.6px solid var(--checkoff); margin-top: 2px;
       display: flex; align-items: center; justify-content: center;
       background: transparent; transition: background .15s, border-color .15s; }
.voice.checked .box { background: var(--accent); border-color: var(--accent); }
.box svg { width: 13px; height: 13px; opacity: 0; }
.voice.checked .box svg { opacity: 1; }
.box svg path { stroke: var(--surface); }
.vbody { flex: 1; min-width: 0; }
.vlabel { font-family: var(--serif); font-style: italic; font-weight: 500;
          font-size: 1.25rem; color: var(--accent); line-height: 1.2; }
.vtext { margin-top: 8px; color: var(--text); line-height: 1.5; }
.voice:not(.open) .vtext { display: -webkit-box; -webkit-line-clamp: 3;
                           -webkit-box-orient: vertical; overflow: hidden; }
.vquotes { display: none; margin-top: 13px; padding-left: 18px;
           border-left: 2px solid var(--section); }
.voice.open .vquotes { display: block; }
.vquotes p { margin: 0 0 9px; font-family: var(--serif); font-style: italic;
             font-size: 0.90625rem; color: var(--muted); line-height: 1.45; }
.vquotes p:last-child { margin-bottom: 0; }
.more { margin-top: 10px; background: none; border: none; padding: 0; cursor: pointer;
        font-size: 0.78125rem; color: var(--hint);
        display: inline-flex; align-items: center; gap: 5px; }
.more:hover { color: var(--muted); }
.more svg { width: 11px; height: 11px; transition: transform .18s; }
.voice.open .more svg { transform: rotate(180deg); }

/* ── захват: свои слова ───────────────────────────────────────────────────── */

.capture { margin-top: 30px; background: var(--surface); border: 1px solid var(--border);
           border-radius: 14px; box-shadow: var(--shadow); padding: 26px 24px 22px; }
.capture.roomy { padding: 30px 26px 24px; }
.prompt { font-family: var(--serif); font-size: 1.25rem; line-height: 1.32;
          color: var(--accent); margin: 0; }
.capture.roomy .prompt { font-size: 1.4375rem; line-height: 1.3; }
.anchor, .sub { margin: 9px 0 0; font-size: 0.875rem; color: var(--muted); }
.sub { margin-top: 12px; font-size: 0.90625rem; }

textarea.field {
  display: block; width: 100%; margin-top: 18px; background: var(--field);
  border: 1px solid var(--border-soft); border-radius: 10px; min-height: 110px;
  padding: 15px 16px; color: var(--text); font-family: var(--serif);
  font-size: 0.96875rem; line-height: 1.5; resize: vertical;
  box-shadow: inset 0 1px 3px rgba(60, 52, 38, .05);
}
textarea.field::placeholder { color: var(--hint); }
textarea.field.tall { min-height: 170px; font-size: 1rem; }
textarea.field.short { min-height: 96px; }

.tools { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rec { display: inline-flex; align-items: center; gap: 9px; background: var(--accent);
       color: var(--canvas); border: none; border-radius: 999px; padding: 11px 18px;
       font-size: 0.84375rem; font-weight: 500; cursor: pointer; }
.rec.big { padding: 16px 26px; font-size: 0.9375rem; gap: 11px; }
.rec.recording { background: #8C3B2B; color: #FDFBF6; }
.rec .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rec-dot); }
.rec.recording .dot { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.rec-sm { display: inline-flex; align-items: center; gap: 8px; background: none;
          border: 1px solid var(--border); color: var(--accent); border-radius: 999px;
          padding: 9px 16px; font-size: 0.8125rem; cursor: pointer; }
.rec-sm .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rec-dot); }
.alt-tools, .rec-note { color: var(--hint); font-size: 0.78125rem; }
.rec-note { font-size: 0.8125rem; }

.or { margin: 20px 0 0; display: flex; align-items: center; gap: 12px;
      color: var(--hint); font-size: 0.78125rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border-soft); }

.takes { margin-top: 12px; display: grid; gap: 8px; }
.take { display: flex; align-items: center; gap: 10px; background: var(--field);
        border: 1px solid var(--border-soft); border-radius: 10px; padding: 9px 12px;
        font-size: 0.8125rem; color: var(--muted); }
.take audio { flex: 1; min-width: 0; height: 32px; }
.take .drop { background: none; border: none; color: var(--hint); cursor: pointer;
              font-size: 0.78125rem; }
.take .drop:hover { color: var(--accent); }

.addmore { margin-top: 16px; background: none; border: 1px dashed var(--dashed);
           border-radius: 999px; padding: 12px 20px; font-size: 0.84375rem;
           color: var(--muted); cursor: pointer; }
.addmore:hover { border-color: var(--border); color: var(--accent); }

/* необязательный блок — цена края (07-24) */
.optional { margin-top: 18px; border-top: 1px solid var(--border-soft); padding-top: 16px; }
.optional-label { font-size: 0.625rem; letter-spacing: .16em; text-transform: uppercase;
                  color: var(--hint); }

/* второй слой baseline и ⚠-вопрос */
.revisit { margin-top: 18px; background: var(--surface); border: 1px solid var(--border);
           border-radius: 14px; padding: 24px 24px 20px; }
.revisit .q { font-family: var(--serif); font-size: 1.1875rem; line-height: 1.32;
              color: var(--accent); margin: 0; }
.revisit .hint { margin: 8px 0 0; font-size: 0.84375rem; color: var(--hint); }

/* сцена виньетки */
.scene { margin-top: 20px; background: var(--surface); border: 1px solid var(--border);
         border-radius: 14px; padding: 26px 26px; box-shadow: var(--shadow); }
.scene p { margin: 0; font-family: var(--serif); font-size: 1.1875rem; line-height: 1.45;
           color: var(--accent); }

/* след диадического — тихо, без поля ввода */
.dyad { margin-top: 18px; border: 1px dashed var(--dashed); border-radius: 14px; padding: 15px 18px; }
.dyad .tag { font-size: 0.625rem; letter-spacing: .16em; text-transform: uppercase; color: var(--hint); }
.dyad p { margin: 6px 0 0; font-size: 0.875rem; color: var(--muted);
          font-style: italic; font-family: var(--serif); }

/* ── навигация ────────────────────────────────────────────────────────────── */

.nav { margin-top: 30px; display: flex; align-items: center; justify-content: space-between;
       gap: 12px; flex-wrap: wrap; }
.nav-left { display: flex; gap: 10px; flex-wrap: wrap; }
.skip { background: none; border: 1px solid var(--border); border-radius: 999px;
        padding: 12px 22px; font-size: 0.875rem; color: var(--muted); cursor: pointer; }
.skip:hover { border-color: var(--dashed); color: var(--accent); }
.next { background: var(--accent); color: var(--canvas); border: none; border-radius: 999px;
        padding: 12px 26px; font-size: 0.875rem; font-weight: 500; cursor: pointer; }
.next[disabled] { background: none; border: 1px dashed var(--dashed); color: var(--hint);
                  cursor: default; font-weight: 400; }
.back { background: none; border: none; color: var(--hint); font-size: 0.8125rem;
        cursor: pointer; padding: 12px 4px; }
.back:hover { color: var(--accent); }

/* выбор роли / регистра — равный визуальный вес вариантов */
.choices { margin-top: 18px; display: grid; gap: 12px; }
.choice { background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
          padding: 18px 20px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.choice.on { border-color: transparent; box-shadow: inset 0 0 0 1.6px var(--accent); }
.choice b { display: block; font-family: var(--serif); font-style: italic; font-weight: 500;
            font-size: 1.125rem; color: var(--accent); }
.choice span { display: block; margin-top: 5px; font-size: 0.84375rem; color: var(--muted); }

.segmented { display: inline-flex; gap: 4px; background: var(--surface);
             border: 1px solid var(--border-soft); border-radius: 999px; padding: 4px; }
.segmented button { background: none; border: none; border-radius: 999px; padding: 8px 16px;
                    font-size: 0.8125rem; color: var(--muted); cursor: pointer; }
.segmented button.on { background: var(--accent); color: var(--canvas); font-weight: 500; }

/* ── слой поддержки: виден на каждой странице ─────────────────────────────── */

.safe { position: fixed; left: 0; right: 0; bottom: 0; background: var(--canvas);
        border-top: 1px solid var(--border); z-index: 20; }
@supports (backdrop-filter: blur(6px)) {
  .safe { background: color-mix(in srgb, var(--canvas) 92%, transparent);
          backdrop-filter: blur(6px); }
}
.safe-in { max-width: var(--measure); margin: 0 auto; padding: 11px 22px;
           display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.safe-note { font-size: 0.78125rem; color: var(--muted); flex: 1; min-width: 210px; }
.safe-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.safe-btn { background: var(--surface); border: 1px solid var(--border-soft);
            border-radius: 999px; padding: 7px 13px; font-size: 0.78125rem;
            color: var(--accent); cursor: pointer; }
.safe-btn:hover { border-color: var(--dashed); }

/* панели: заземление, контакт, настройки — раскрываются над слоем поддержки */
.panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
         background: var(--surface); border-top: 1px solid var(--border);
         box-shadow: 0 -18px 48px rgba(60, 52, 38, .14); max-height: 82vh; overflow: auto; }
.panel-in { max-width: var(--measure); margin: 0 auto; padding: 24px 22px 30px; }
.panel h2 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem;
            color: var(--accent); margin: 0 0 4px; }
.panel p { margin: 10px 0 0; font-size: 0.90625rem; color: var(--muted); }
.panel ul { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.panel li { background: var(--field); border: 1px solid var(--border-soft);
            border-radius: 12px; padding: 13px 16px; font-size: 0.90625rem; }
.panel li b { color: var(--accent); }
.panel a { color: var(--accent); }
.panel-close { position: absolute; right: 18px; top: 16px; background: none; border: none;
               color: var(--hint); cursor: pointer; font-size: 0.8125rem; }
.setting-row { display: flex; align-items: center; justify-content: space-between;
               gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.setting-row > span { font-size: 0.875rem; color: var(--muted); }

.scrim { position: fixed; inset: 0; background: rgba(30, 26, 20, .28); z-index: 25; }

/* ── пауза и финал ────────────────────────────────────────────────────────── */

.calm { min-height: 74vh; display: flex; flex-direction: column; justify-content: center; }
.calm h1 { font-size: 2.5rem; }
.calm p { margin: 18px 0 0; font-family: var(--serif); font-size: 1.1875rem;
          line-height: 1.5; color: var(--muted); max-width: 44ch; }
.calm .nav { margin-top: 34px; }

/* ── баннер прототипа: не путать со сбором данных ─────────────────────────── */

.proto { background: #8C3B2B; color: #FDFBF6; font-size: 0.78125rem; }
.proto-in { max-width: var(--measure); margin: 0 auto; padding: 8px 22px;
            display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.proto b { font-weight: 600; }
.proto button { background: none; border: 1px solid rgba(253, 251, 246, .45); color: inherit;
                border-radius: 999px; padding: 4px 11px; font-size: 0.75rem; cursor: pointer; }

@media (max-width: 520px) {
  h1 { font-size: 1.9375rem; }
  h1.grain { font-size: 1.875rem; }
  .capture.roomy .prompt { font-size: 1.25rem; }
  .safe-note { min-width: 100%; }
  .voice { padding: 18px 18px; }
}
