/* ==============================================
   Mello — modern editorial therapy, 2026
   Broken grid, motion, dark navy + cream + gold
   ============================================== */

:root {
  --bg:           #0d1424;
  --bg-deep:      #080d1a;
  --bg-elev:      #16213a;
  --bg-elev-2:    #1f2c48;
  --bg-line:      #1d2942;
  --bg-line-2:    #2a3a58;

  --paper:        #f5e9cd;
  --paper-soft:   #ede0c2;
  --paper-mute:   #a8b2c8;
  --paper-deep:   #8693ad;
  --paper-faint:  #6b7a98;
  --paper-dim:    #4d5d7a;

  --gold:         #c79a4a;
  --gold-soft:    #d8b169;
  --wine:         #b03b4f;

  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-script:  'Caveat', cursive;

  --pad-x:        clamp(20px, 4vw, 36px);
  --max:          1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--paper-soft);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--gold); color: var(--bg-deep); }

/* ============= Custom cursor ============= */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  will-change: transform;
  opacity: 0;
  transition: opacity 0.25s ease;
  --x: 50vw;
  --y: 50vh;
  --s: 1;
  transform: translate3d(var(--x), var(--y), 0) scale(var(--s));
}
.has-custom-cursor.cursor-ready .cursor-dot,
.has-custom-cursor.cursor-ready .cursor-ring { opacity: 1; }

.cursor-dot {
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--gold);
  transition: opacity 0.2s ease;
}
.cursor-ring {
  width: 32px; height: 32px;
  margin: -16px 0 0 -16px;
  border: 1px solid var(--paper-deep);
  transition: width 0.25s cubic-bezier(.2,.7,.2,1),
              height 0.25s cubic-bezier(.2,.7,.2,1),
              margin 0.25s cubic-bezier(.2,.7,.2,1),
              border-color 0.25s ease,
              background-color 0.25s ease,
              opacity 0.25s ease,
              transform 0.15s ease;
}
.has-custom-cursor.cursor-hover .cursor-ring {
  width: 56px; height: 56px;
  margin: -28px 0 0 -28px;
  border-color: var(--gold);
  background: rgba(199, 154, 74, 0.08);
}
.has-custom-cursor.cursor-hover .cursor-dot { opacity: 0; }
.has-custom-cursor.cursor-down  .cursor-ring { --s: 0.85; }

.has-custom-cursor.cursor-ready,
.has-custom-cursor.cursor-ready * { cursor: none; }
.has-custom-cursor.cursor-ready input,
.has-custom-cursor.cursor-ready textarea,
.has-custom-cursor.cursor-ready select { cursor: text; }

@media (prefers-reduced-motion: reduce) {
  .cursor-ring { transition: none; }
}

/* ============= Custom cursor ============= */
/* Активируется только если JS поставит .has-custom-cursor на html.
   На тач-устройствах и при prefers-reduced-motion остаётся системный курсор. */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  will-change: transform;
  opacity: 0;
  transition: opacity 0.25s ease;
  /* Позиция задаётся через CSS-переменные из JS, scale — отдельно через --s */
  --x: 50vw;
  --y: 50vh;
  --s: 1;
  transform: translate3d(var(--x), var(--y), 0) scale(var(--s));
}
.has-custom-cursor.cursor-ready .cursor-dot,
.has-custom-cursor.cursor-ready .cursor-ring { opacity: 1; }

.cursor-dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--gold);
  transition: opacity 0.2s ease;
}
.cursor-ring {
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 1px solid var(--paper-deep);
  transition: width 0.25s cubic-bezier(.2,.7,.2,1),
              height 0.25s cubic-bezier(.2,.7,.2,1),
              margin 0.25s cubic-bezier(.2,.7,.2,1),
              border-color 0.25s ease,
              background-color 0.25s ease,
              opacity 0.25s ease,
              transform 0.15s ease;
}

/* Hover на интерактивных элементах: обводка увеличивается, подсвечивается. */
.has-custom-cursor.cursor-hover .cursor-ring {
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-color: var(--gold);
  background: rgba(199, 154, 74, 0.08);
}
.has-custom-cursor.cursor-hover .cursor-dot {
  opacity: 0;
}

/* Зажатие — лёгкий «клик»: обводка чуть стягивается. */
.has-custom-cursor.cursor-down .cursor-ring { --s: 0.85; }

/* Скрываем системный курсор только когда кастомный действительно работает,
   и оставляем дефолт на полях ввода — там нужен I-beam. */
.has-custom-cursor.cursor-ready,
.has-custom-cursor.cursor-ready * { cursor: none; }
.has-custom-cursor.cursor-ready input,
.has-custom-cursor.cursor-ready textarea,
.has-custom-cursor.cursor-ready select { cursor: text; }

@media (prefers-reduced-motion: reduce) {
  .cursor-ring { transition: none; }
}

/* ============= Animations ============= */
@keyframes mq {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes rise {
  from { transform: translateY(110%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.025); }
}
@keyframes drift {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(20px,-12px) scale(1.05); }
  66%      { transform: translate(-15px,18px) scale(0.95); }
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Reveal on scroll: visible by default if JS not run, otherwise toggled */
.reveal { animation: fade-in 0.8s cubic-bezier(.2,.7,.2,1) both; }

/* ============= Marquee ============= */
.marquee {
  overflow: hidden;
  border-bottom: 1px solid var(--bg-line);
  padding: 14px 0;
  background: var(--bg);
  position: relative;
  z-index: 4;
}
.marquee__track {
  display: inline-flex;
  animation: mq 36s linear infinite;
  white-space: nowrap;
}
.marquee__track > span {
  padding: 0 32px;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 14px;
  color: var(--paper-faint);
}
.marquee__track > span::after {
  content: '✦';
  color: var(--gold);
  margin-left: 32px;
  font-style: normal;
}

/* ============= Top nav ============= */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px var(--pad-x);
  font-size: 13px;
  position: relative;
  z-index: 5;
  background: var(--bg);
  gap: 16px;
}
.topnav__links {
  display: flex;
  gap: 32px;
  color: var(--paper-deep);
  flex-wrap: wrap;
}
@media (max-width: 640px) {
  .topnav { padding: 18px var(--pad-x); flex-wrap: nowrap; }
  .topnav__links { gap: 14px; font-size: 12px; }
  .cta { padding: 10px 16px; font-size: 12px; flex-shrink: 0; }
}
@media (max-width: 420px) {
  .topnav__links a:nth-child(n+3) { display: none; }
}

/* Sweep underline link */
.swap {
  position: relative;
  display: inline-block;
  padding-bottom: 4px;
  cursor: pointer;
  color: inherit;
  letter-spacing: 0.02em;
}
.swap::before {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(1);
  transform-origin: right;
  transition: transform 0.45s cubic-bezier(.7,0,.3,1);
}
.swap:hover::before {
  transform: scaleX(0);
  transform-origin: left;
}

/* ============= CTA buttons ============= */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--gold);
  color: var(--bg-deep);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 999px;
  cursor: pointer;
  border: none;
  transition: transform 0.25s cubic-bezier(.2,.7,.2,1), background 0.2s;
  font-family: var(--font-body);
}
.cta:hover {
  background: var(--gold-soft);
  transform: translateY(-2px);
}
.cta__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--bg-deep);
  transition: transform 0.3s;
}
.cta:hover .cta__dot { transform: scale(1.5); }

/* ============= Hero — broken grid ============= */
.hero {
  position: relative;
  padding: clamp(40px, 6vh, 64px) var(--pad-x) clamp(60px, 10vh, 100px);
  min-height: 540px;
  max-width: var(--max);
  margin: 0 auto;
}

.hero__photo {
  position: absolute;
  top: 100px;
  right: var(--pad-x);
  width: clamp(260px, 32vw, 380px);
  z-index: 1;
}
@media (max-width: 860px) {
  .hero {
    display: flex;
    flex-direction: column;
    min-height: auto;
    padding-top: 24px;
  }
  .hero__photo {
    position: relative;
    top: auto;
    right: auto;
    margin: 0 auto 32px;
    width: min(280px, 70%);
    order: 2; /* фото между eyebrow и заголовком? нет — после нижней секции */
  }
  /* Порядок на мобилке: eyebrow → заголовок → фото → лид → CTA */
  .hero__text { order: 1; }
  .hero__photo { order: 3; }
  .hero__bottom { order: 4; }
}

.photo-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev-2));
  aspect-ratio: 4/5;
}
.photo-wrap > .breathe {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--paper-dim);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  animation: breathe 7s ease-in-out infinite;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(199,154,74,0.10), transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(176,59,79,0.08), transparent 60%);
}
.photo-wrap > img { width: 100%; height: 100%; object-fit: cover; display: block; animation: breathe 7s ease-in-out infinite; }
.photo-wrap > .blob {
  position: absolute;
  width: 60%; height: 60%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(199,154,74,0.18), transparent 70%);
  filter: blur(40px);
  animation: drift 9s ease-in-out infinite;
  top: 10%; left: 50%;
  transform: translateX(-50%);
}

/* Hero text — наезжает на фото */
.hero__text {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 28px;
}
.hero__eyebrow-line {
  width: 36px;
  height: 1px;
  background: var(--gold);
}
.hero__eyebrow-text {
  font-family: var(--font-script);
  color: var(--gold);
  font-size: 22px;
  transform: rotate(-3deg);
  display: inline-block;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(40px, 9vw, 104px);
  line-height: 0.92;
  letter-spacing: -0.05em;
  margin: 0;
  color: var(--paper);
}
.hero__title em {
  font-style: italic;
  color: var(--gold);
  font-weight: 300;
}
.hero__title .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.04em;
}
.hero__title .word > span {
  display: inline-block;
  animation: rise 0.9s cubic-bezier(.2,.7,.2,1) both;
}

.hero__bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 56px;
  gap: 32px;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
  max-width: 720px;
}
@media (max-width: 860px) {
  .hero__bottom { margin-top: 24px; }
}
.hero__lede {
  font-size: 14px;
  color: var(--paper-deep);
  font-weight: 300;
  margin: 0;
  max-width: 380px;
  line-height: 1.55;
}

/* ============= Sections ============= */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 10vh, 120px) var(--pad-x);
  border-top: 1px solid var(--bg-line);
  position: relative;
}

.section__head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.section__roman {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 0.05em;
}
.section__line {
  width: 32px;
  height: 1px;
  background: var(--gold);
  display: inline-block;
}
.section__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(28px, 4.5vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0;
  color: var(--paper);
}
.section__title em {
  font-style: italic;
  color: var(--gold);
}

.section__grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}
@media (max-width: 720px) {
  .section__grid { grid-template-columns: 1fr; gap: 48px; }
}

/* Asymmetric: text left wide, photo/list right narrow */
.section__grid--asym {
  grid-template-columns: 1.4fr 1fr;
}
@media (max-width: 720px) {
  .section__grid--asym { grid-template-columns: 1fr; }
}

/* ============= Prose ============= */
.prose {
  font-size: 17px;
  line-height: 1.75;
  color: var(--paper-mute);
  font-weight: 300;
}
.prose p { margin: 0 0 1.2em; max-width: 56ch; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--paper-soft); font-weight: 500; }
.prose em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}
.prose ul { padding-left: 0; margin: 0 0 1.2em; list-style: none; }
.prose li {
  position: relative;
  padding-left: 22px;
  margin: 0.4em 0;
}
.prose li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--gold);
}
.prose--small { font-size: 14px; }
.prose--lead {
  font-size: clamp(17px, 1.8vw, 19px);
  color: var(--paper-soft);
  line-height: 1.65;
}

/* ============= Education list ============= */
.education__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 22px;
  margin: 0 0 24px;
  color: var(--paper);
  letter-spacing: -0.02em;
}
.education__list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  counter-reset: edu;
  border-top: 1px solid var(--bg-line);
}
.education__item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--bg-line);
  font-size: 14px;
  color: var(--paper-mute);
  line-height: 1.55;
  counter-increment: edu;
  align-items: flex-start;
}
.education__item::before {
  content: counter(edu, decimal-leading-zero);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  color: var(--gold);
  font-size: 13px;
  flex-shrink: 0;
  min-width: 28px;
}
.education__item-text {
  flex: 1;
  min-width: 0;
}
.education__item--hidden { display: none; }
.education__toggle {
  background: transparent;
  border: none;
  padding: 16px 0 0;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--paper-deep);
  cursor: pointer;
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.education__toggle:hover { color: var(--paper-soft); }
.education__toggle::after { content: '↓'; color: var(--gold); }

/* ============= Services / book menu ============= */
.services {
  margin: 0;
  border-top: 1px solid var(--bg-line);
}
.service {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 18px;
  align-items: baseline;
  padding: 20px 0;
  border-bottom: 1px solid var(--bg-line);
  transition: padding-left 0.3s;
}
.service:hover { padding-left: 12px; }
.service__num {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  color: var(--paper-faint);
  font-size: 14px;
}
.service__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(17px, 2vw, 21px);
  color: var(--paper-soft);
  letter-spacing: -0.015em;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.service__tag {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--paper-faint);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 400;
}
.service__price {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(17px, 2vw, 21px);
  color: var(--paper-soft);
  letter-spacing: -0.015em;
  white-space: nowrap;
}
.service__price em {
  font-style: italic;
  color: var(--paper-faint);
  font-size: 0.7em;
  margin-left: 2px;
}

/* ============= Contact ============= */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(40px, 6vw, 72px);
  align-items: start;
}
@media (max-width: 720px) {
  .contact__grid { grid-template-columns: 1fr; gap: 48px; }
}

.contact__links {
  border-top: 1px solid var(--bg-line);
}
.contact__link {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(20px, 2.4vw, 28px);
  color: var(--paper-soft);
  border-bottom: 1px solid var(--bg-line);
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: -0.02em;
  transition: color 0.25s, padding 0.25s;
}
.contact__link::after {
  content: '↗';
  font-size: 18px;
  color: var(--gold);
  transition: transform 0.25s;
}
.contact__link:hover {
  color: var(--gold);
  padding-left: 8px;
}
.contact__link:hover::after { transform: translate(3px, -3px); }

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field__label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-deep);
  font-weight: 500;
}
.field input, .field textarea {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 0;
  border: none;
  border-bottom: 1px solid var(--bg-line-2);
  background: transparent;
  color: var(--paper-soft);
  border-radius: 0;
  resize: vertical;
  font-weight: 300;
  transition: border-color 0.25s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--paper-faint); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-bottom-color: var(--gold);
}
.field textarea { min-height: 80px; line-height: 1.5; }

.form__msg {
  font-size: 13px;
  min-height: 1em;
  margin-top: 4px;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--paper-faint);
}
.form__msg--ok { color: var(--gold); }
.form__msg--err { color: var(--wine); }

/* ============= Footer ============= */
.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px var(--pad-x) 64px;
  border-top: 1px solid var(--bg-line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--paper-faint);
}
.footer em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--paper-deep);
}

/* ============= Announcements ============= */
.announcements {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  border-top: 1px solid var(--bg-line);
  padding-top: 32px;
}
.announce {
  position: relative;
  padding: 28px 28px 30px;
  background: var(--bg-elev);
  border: 1px solid var(--bg-line);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.3s cubic-bezier(.2,.7,.2,1), border-color 0.3s, background 0.3s;
}
.announce::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 36px;
  height: 1px;
  background: var(--gold);
  transition: width 0.4s cubic-bezier(.2,.7,.2,1);
}
.announce:hover {
  transform: translateY(-3px);
  border-color: var(--bg-line-2);
  background: var(--bg-elev-2);
}
.announce:hover::before { width: 100%; }
.announce__meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-faint);
  font-weight: 500;
}
.announce__date { color: var(--gold-soft); }
.announce__loc::before {
  content: '·';
  margin-right: 14px;
  color: var(--paper-dim);
}
.announce__meta .announce__loc:first-child::before { content: ''; margin: 0; }
.announce__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--paper);
  margin: 0;
}
.announce__body {
  color: var(--paper-mute);
  font-size: 15px;
  line-height: 1.65;
}
.announce__body p { margin: 0 0 8px; }
.announce__body p:last-child { margin-bottom: 0; }
.announce__link {
  margin-top: auto;
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  align-self: flex-start;
  transition: letter-spacing 0.25s, color 0.25s;
}
.announce__link:hover {
  color: var(--gold-soft);
  letter-spacing: 0.14em;
}

/* ============= Contact links — full-width variant (без формы) ============= */
.contact__links--full {
  max-width: 720px;
}
