/* Тема «Книга писем для Вовы» — неоморфизм в оливково-шалфейной гамме */
:root {
  color-scheme: light;
  --bg: #E3E5DA;
  --bg-deep: #D9DCCD;
  --sh-dark: rgba(140, 147, 116, .55);
  --sh-light: rgba(255, 255, 255, .92);
  --text: #2A2F21;
  --text-2: #565C46;
  --olive: #3D4A2B;
  --olive-hi: #4C5A37;
  --on-olive: #F3F2E4;
  --honey: #C98A2B;
  --honey-ink: #7C4F0C;
  --danger: #9E3626;
  --ok: #3E6B33;
  --ring: #B9771A;
  --r-xl: 32px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --f-display: "Literata", "Georgia", "Times New Roman", serif;
  --f-body: "Golos Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --f-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --raise: 9px 9px 20px var(--sh-dark), -9px -9px 20px var(--sh-light);
  --raise-sm: 5px 5px 12px var(--sh-dark), -5px -5px 12px var(--sh-light);
  --press: inset 5px 5px 11px var(--sh-dark), inset -5px -5px 11px var(--sh-light);
  --press-sm: inset 3px 3px 7px var(--sh-dark), inset -3px -3px 7px var(--sh-light);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #262A20; --bg-deep: #20231B;
    --sh-dark: rgba(0, 0, 0, .55); --sh-light: rgba(72, 80, 58, .38);
    --text: #E9EBDA; --text-2: #B6BBA0;
    --olive: #C8D3A2; --olive-hi: #D6E0B2; --on-olive: #1F2418;
    --honey: #E2A74A; --honey-ink: #EDBB68; --danger: #F08A72; --ok: #9BCB86; --ring: #E2A74A;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #262A20; --bg-deep: #20231B;
  --sh-dark: rgba(0, 0, 0, .55); --sh-light: rgba(72, 80, 58, .38);
  --text: #E9EBDA; --text-2: #B6BBA0;
  --olive: #C8D3A2; --olive-hi: #D6E0B2; --on-olive: #1F2418;
  --honey: #E2A74A; --honey-ink: #EDBB68; --danger: #F08A72; --ok: #9BCB86; --ring: #E2A74A;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.6 var(--f-body); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }
::selection { background: var(--honey); color: #1c1a10; }

.raised { background: var(--bg); box-shadow: var(--raise); border-radius: var(--r-xl); }
.raised-sm { background: var(--bg); box-shadow: var(--raise-sm); border-radius: var(--r-md); }
.inset { background: var(--bg); box-shadow: var(--press); border-radius: var(--r-lg); }

/* кнопки */
.btn {
  -webkit-appearance: none; appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: 0 1.4em; border-radius: 999px;
  font: 600 16px/1 var(--f-body); color: var(--text); text-decoration: none;
  background: var(--bg); box-shadow: var(--raise-sm);
  transition: box-shadow .18s var(--ease), transform .18s var(--ease), background .18s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { box-shadow: var(--press-sm); transform: translateY(0); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--olive); color: var(--on-olive); box-shadow: 6px 6px 14px var(--sh-dark), -6px -6px 14px var(--sh-light); }
.btn-primary:hover { background: var(--olive-hi); }
.btn-primary:active { box-shadow: inset 3px 3px 8px rgba(0,0,0,.35), -2px -2px 6px var(--sh-light); }
.btn-sm { min-height: 40px; padding: 0 1em; font-size: 14px; }
.btn-icon { width: 44px; min-height: 44px; padding: 0; }
.btn-danger { color: var(--danger); }

/* поля */
.field { display: grid; gap: 8px; }
.field > label, .label { font-weight: 600; font-size: 15px; }
.hint { color: var(--text-2); font-size: 14px; line-height: 1.45; }
.input, .textarea, .select {
  width: 100%; border: 0; color: var(--text); font: 400 17px/1.5 var(--f-body);
  background: var(--bg); box-shadow: var(--press-sm); border-radius: var(--r-md);
  padding: 13px 16px; min-height: 50px; transition: box-shadow .18s;
}
.textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--text-2); opacity: .75; }
.input:focus-visible, .textarea:focus-visible, .select:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.field.has-error .input, .field.has-error .textarea { box-shadow: var(--press-sm), 0 0 0 2px var(--danger); }
.error-text { color: var(--danger); font-size: 14px; font-weight: 500; }

.chip {
  -webkit-appearance: none; appearance: none; border: 0; cursor: pointer;
  min-height: 40px; padding: 0 16px; border-radius: 999px; font: 500 15px/1 var(--f-body); color: var(--text);
  background: var(--bg); box-shadow: var(--raise-sm); transition: box-shadow .16s, color .16s;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-pressed="true"] { box-shadow: var(--press-sm); color: var(--honey-ink); font-weight: 600; }
.chip svg { width: 16px; height: 16px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
