/* ===========================================================
   РЯДОМ — психолог Влада
   Дизайн-система: тёплый минимализм. Беж + приглушённая
   бирюза (доверие) + медовый акцент. Тёплая антиква.
   =========================================================== */

/* ---------- Tokens ---------- */
:root {
  /* warm neutrals */
  --bg:        #F3ECE0;   /* page */
  --bg-2:      #ECE2D2;   /* warmer band */
  --surface:   #FBF6EE;   /* card */
  --surface-2: #F7F0E4;
  --ink:       #2B2823;   /* warm near-black */
  --ink-2:     #5C544A;   /* muted body */
  --ink-3:     #8C8375;   /* faint / captions */
  --line:      #E3D9C9;   /* hairline */
  --line-2:    #D8CCB8;

  /* accents — default: teal + honey */
  --accent:        #20706B;  /* приглушённая бирюза — доверие */
  --accent-deep:   #16524E;
  --accent-soft:   #4F938E;
  --accent-tint:   #DCE8E3;  /* teal wash section */
  --accent-tint-2: #CBDDD7;
  --honey:         #BF8540;  /* медовый */
  --honey-deep:    #9E6A2C;
  --honey-tint:    #F0E2C9;

  /* derived */
  --radius:    10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow:    0 1px 2px rgba(43,40,35,.04), 0 8px 30px -12px rgba(43,40,35,.14);
  --shadow-lg: 0 2px 6px rgba(43,40,35,.05), 0 30px 60px -24px rgba(43,40,35,.22);
  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 64px);

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Lora', Georgia, 'Times New Roman', serif;

  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---- Tweakable accent palettes ---- */
:root[data-accent="sage"] {
  --accent:#5E7257; --accent-deep:#45543F; --accent-soft:#88997E;
  --accent-tint:#E1E6DA; --accent-tint-2:#D2DAC8;
  --honey:#BD8B45; --honey-deep:#9c6f2f; --honey-tint:#F0E4CD;
}
:root[data-accent="clay"] {
  --accent:#B26A4A; --accent-deep:#8C4F33; --accent-soft:#C98E73;
  --accent-tint:#EFE0D6; --accent-tint-2:#E6D0C2;
  --honey:#C99A52; --honey-deep:#a87b39; --honey-tint:#F2E7D0;
}
:root[data-accent="dusk"] {
  --accent:#6C6385; --accent-deep:#4E4763; --accent-soft:#948CA9;
  --accent-tint:#E4E0EA; --accent-tint-2:#D6D0E0;
  --honey:#BD8B57; --honey-deep:#9c6f3d; --honey-tint:#F0E5D2;
}

/* ---- Tweakable font pairings ---- */
:root[data-font="lora"]     { --font-display:'Lora', Georgia, serif; --font-body:'Lora', Georgia, serif; }
:root[data-font="spectral"] { --font-display:'Spectral', Georgia, serif; --font-body:'Spectral', Georgia, serif; }
:root[data-font="ptserif"]  { --font-display:'PT Serif', Georgia, serif; --font-body:'PT Serif', Georgia, serif; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
ul { list-style: none; padding: 0; }
::selection { background: var(--accent-tint-2); color: var(--ink); }

/* paper grain on the whole page */
body::before {
  content:""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}
:root[data-grain="off"] body::before { display:none; }

/* calm drifting aura — gentle living background, site-wide */
body::after {
  content:""; position: fixed; inset: -15%; pointer-events: none; z-index: 0;
  background:
    radial-gradient(38% 38% at 18% 28%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 72%),
    radial-gradient(34% 34% at 82% 16%, color-mix(in srgb, var(--honey) 12%, transparent), transparent 72%),
    radial-gradient(42% 42% at 64% 82%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 72%);
  filter: blur(24px); opacity: .7;
  animation: auraDrift 42s ease-in-out infinite alternate;
}
@keyframes auraDrift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(2.5%, -2%, 0) scale(1.07); }
  100% { transform: translate3d(-2%, 2.5%, 0) scale(1.03); }
}

/* ---------- Typography ---------- */
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; letter-spacing: -.01em; color: var(--ink); }
.display { font-size: clamp(2.1rem, 4.6vw, 3.6rem); font-weight: 500; line-height: 1.06; letter-spacing: -.015em; }
.h-xl { font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 500; }
.h-lg { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
.h-md { font-size: clamp(1.35rem, 2.2vw, 1.7rem); font-weight: 600; }
p { text-wrap: pretty; }
em { font-style: italic; }
.lead { font-size: clamp(1.12rem, 1.7vw, 1.35rem); line-height: 1.6; color: var(--ink-2); }
.eyebrow {
  font-family: var(--font-body); font-size: .78rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: var(--accent-deep);
}
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.serif-accent { font-family: var(--font-display); font-style: italic; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); position: relative; z-index: 1; }
.wrap-narrow { max-width: 800px; margin-inline: auto; padding-inline: var(--gutter); position: relative; z-index: 1; }
section { position: relative; z-index: 1; }
section[id] { scroll-margin-top: 84px; }

/* sticky mobile CTA */
.sticky-cta { display: none; }
@media (max-width: 880px) {
  .sticky-cta {
    display: inline-flex; align-items: center; gap: .5em;
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60;
    justify-content: center; padding: 1em 1.4em; border-radius: 12px;
    background: var(--accent); color: #FBF6EE; font-family: var(--font-body);
    font-weight: 600; font-size: 1.02rem; box-shadow: 0 8px 26px -8px rgba(32,112,107,.6);
    transform: translateY(160%); transition: transform .4s var(--ease);
  }
  .sticky-cta.show { transform: none; }
  .sticky-cta:active { transform: scale(.985); }
}
.section { padding-block: clamp(64px, 9vw, 130px); }
.section-sm { padding-block: clamp(48px, 6vw, 84px); }
.band-tint { background: var(--accent-tint); }
.band-warm { background: var(--bg-2); }
.band-surface { background: var(--surface); }
.band-honey { background: var(--honey-tint); }
.band-ink { background: var(--ink); color: var(--surface); }
.band-ink h1,.band-ink h2,.band-ink h3 { color: var(--surface); }

.divider { height: 1px; background: var(--line); border: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  padding: .92em 1.5em; border-radius: 10px; white-space: nowrap;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  letter-spacing: .005em; transition: transform .35s var(--ease), background .35s var(--ease), box-shadow .5s var(--ease), color .35s var(--ease);
  will-change: transform;
}
.btn-primary { background: var(--accent); color: #FBF6EE; box-shadow: 0 10px 24px -12px rgba(32,112,107,.7); }
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(32,112,107,.75); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-deep); transform: translateY(-2px); }
.btn-honey { background: var(--honey); color: #fff; }
.btn-honey:hover { background: var(--honey-deep); transform: translateY(-2px); }
.btn-lg { padding: 1.05em 1.9em; font-size: 1.08rem; }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.textlink { color: var(--accent-deep); border-bottom: 1px solid var(--accent-soft); padding-bottom: 1px; transition: color .2s, border-color .2s; }
.textlink:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.site-header.scrolled { border-color: var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 72px; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { font-size: .98rem; color: var(--ink-2); transition: color .2s; position: relative; white-space: nowrap; }
.nav-links a:hover { color: var(--ink); }
.nav-links a::after { content:""; position:absolute; left:0; right:100%; bottom:-5px; height:1.5px; background:var(--accent); transition: right .3s var(--ease); }
.nav-links a:hover::after { right: 0; }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-toggle { display: none; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: .56em; }
.logo-mark { width: 38px; height: 38px; flex: 0 0 auto; }
.logo-word { font-family: var(--font-display); font-size: 1.55rem; font-weight: 600; letter-spacing: .005em; color: var(--ink); line-height: 1; }
.logo-word .dot { color: var(--accent); }
/* breathing ring */
.logo-mark .ring { transform-origin: center; animation: breathe 5.2s var(--ease) infinite; }
.logo-mark .ring2 { transform-origin: center; animation: breathe 5.2s var(--ease) infinite; animation-delay: .5s; opacity: .55; }
.logo-mark .core { transform-origin: center; animation: breathe-core 5.2s var(--ease) infinite; }
@keyframes breathe { 0%,100%{ transform: scale(.84); } 50%{ transform: scale(1.04);} }
@keyframes breathe-core { 0%,100%{ transform: scale(.7); opacity:.85;} 50%{ transform: scale(1); opacity:1;} }

/* ---------- Image placeholders ---------- */
.ph {
  position: relative; overflow: hidden; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; isolation: isolate;
}
.ph::before {
  content:""; position: absolute; inset: 0; z-index: 0;
  background:
    repeating-linear-gradient(135deg, transparent 0 13px, color-mix(in srgb, var(--accent) 8%, transparent) 13px 14px),
    linear-gradient(160deg, var(--accent-tint) 0%, var(--surface-2) 60%, var(--honey-tint) 130%);
}
.ph .ph-label {
  position: relative; z-index: 1;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .72rem; letter-spacing: .06em;
  color: var(--ink-3); background: color-mix(in srgb, var(--surface) 80%, transparent);
  padding: .4em .7em; border-radius: 6px; text-transform: lowercase;
}
/* imagery variant: abstract soft shapes */
:root[data-imagery="abstract"] .ph::before {
  background:
    radial-gradient(60% 80% at 25% 20%, var(--accent-tint-2) 0%, transparent 60%),
    radial-gradient(70% 70% at 80% 75%, var(--honey-tint) 0%, transparent 65%),
    radial-gradient(50% 60% at 65% 25%, color-mix(in srgb, var(--accent) 22%, var(--surface)) 0%, transparent 60%),
    var(--surface-2);
  filter: blur(.3px);
}
:root[data-imagery="abstract"] .ph .ph-label { opacity: 0; }
/* imagery variant: minimal — quiet frame */
:root[data-imagery="minimal"] .ph { background: var(--surface); }
:root[data-imagery="minimal"] .ph::before {
  background: none;
  border: 1px solid var(--line); inset: 14px; border-radius: 8px;
  background-image: radial-gradient(var(--line-2) .8px, transparent .8px);
  background-size: 16px 16px;
}
:root[data-imagery="minimal"] .ph .ph-label { color: var(--ink-3); background: transparent; }

.ph-portrait { aspect-ratio: 4/5; }
.ph-wide { aspect-ratio: 16/10; }
.ph-square { aspect-ratio: 1/1; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(22px, 3vw, 34px);
  box-shadow: var(--shadow); transition: transform .4s var(--ease), box-shadow .5s var(--ease), border-color .4s var(--ease);
  min-width: 0;
}
.card.hoverable:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.card:not(.hoverable):hover { box-shadow: var(--shadow-lg); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.field input, .field textarea, .field select {
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px;
  padding: .85em 1em; transition: border-color .2s, box-shadow .2s; width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint);
}
.field textarea { resize: vertical; min-height: 110px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #D9D2C6; padding-block: clamp(48px,7vw,84px) 36px; }
.site-footer a { color: #D9D2C6; transition: color .2s; }
.site-footer a:hover { color: #fff; }
.site-footer .logo-word { color: #F3ECE0; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; }
.foot-col h4 { font-family: var(--font-body); font-size: .82rem; text-transform: uppercase; letter-spacing: .16em; color: #9B9488; font-weight: 700; margin-bottom: 16px; }
.foot-col ul { display: flex; flex-direction: column; gap: 11px; }
.foot-col li a { font-size: .98rem; }
.foot-bottom { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1); font-size: .85rem; color: #908A7E; }

/* ---------- Scroll reveal ----------
   Content is visible by default. The hidden→in animation is applied
   ONLY when JS adds html.anim, so no-JS / print / failed-observer all
   show content. site.js reveals via rect checks (robust offscreen). */
html.anim .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
html.anim .reveal.in { opacity: 1; transform: none; }
html.anim .reveal.d1 { transition-delay: .08s; }
html.anim .reveal.d2 { transition-delay: .16s; }
html.anim .reveal.d3 { transition-delay: .24s; }
html.anim .reveal.d4 { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
  html.anim .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ---------- Pills / tags ---------- */
.pill {
  display: inline-flex; align-items: center; gap: .5em; padding: .42em .9em;
  border-radius: var(--radius-pill); font-size: .82rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-2);
}
.pill .dotmark { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ---------- Mobile nav drawer ---------- */
.mobile-drawer { display: none; }

@media (max-width: 880px) {
  body { font-size: 17px; }
  .nav { height: 64px; gap: 12px; }
  .nav-links { display: none; }
  .nav-cta { gap: 10px; }
  .nav-cta .btn { padding: .62em 1.05em; font-size: .92rem; }
  .nav-toggle {
    display: inline-grid; place-items: center; width: 42px; height: 42px;
    border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface);
  }
  .nav-toggle span { display:block; width: 20px; height: 1.6px; background: var(--ink); position: relative; }
  .nav-toggle span::before, .nav-toggle span::after { content:""; position:absolute; left:0; width:20px; height:1.6px; background: var(--ink); transition: transform .3s var(--ease), top .3s; }
  .nav-toggle span::before { top: -6px; }
  .nav-toggle span::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] span { background: transparent; }
  .nav-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

  .mobile-drawer {
    display: block; position: fixed; inset: 64px 0 auto 0; z-index: 49;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 18px var(--gutter) 28px; box-shadow: var(--shadow-lg);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: transform .32s var(--ease), opacity .32s var(--ease);
  }
  .mobile-drawer.open { transform: none; opacity: 1; pointer-events: auto; }
  .mobile-drawer a { display: block; padding: 13px 4px; font-size: 1.15rem; font-family: var(--font-display); color: var(--ink); border-bottom: 1px solid var(--line); }
  .mobile-drawer a:last-of-type { border-bottom: 0; }
  .mobile-drawer .btn { display: inline-flex; margin-top: 18px; width: 100%; justify-content: center; }
}

/* ---------- Utility ---------- */
.grid { display: grid; gap: clamp(18px, 2.4vw, 30px); }
.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.flow > * + * { margin-top: 1.1em; }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.maxw-prose { max-width: 62ch; }
.maxw-sm { max-width: 540px; }
.mt-s{margin-top:14px;} .mt-m{margin-top:26px;} .mt-l{margin-top:44px;}
@media (max-width: 880px){ .cols-3,.cols-4 { grid-template-columns: minmax(0,1fr) minmax(0,1fr); } }
@media (max-width: 620px){ .cols-2,.cols-3,.cols-4 { grid-template-columns: minmax(0,1fr); } }
