/* ============================================================
   @import MUST be the first rule in the file (CSS spec).
   Any rule before it silently discards the @import.
   NOTE: for faster, more reliable font loading you can delete
   this @import and instead paste the  tags (see notes)
   into Tilda → Site Settings → More → HTML code for HEAD.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&family=Source+Sans+3:wght@300;400;500;600&display=swap');

/* ============================================================
   PSYCHOANALYTIC PRACTICE — SINGLE SOURCE OF TRUTH
   Design tokens, reset, typography, layout, components.
   Scoped defensively so Tilda's own blocks are not disturbed.
   ============================================================ */

/* ---- Design tokens ---- */
:root {
  /* Color */
  --ivory: #F6F3EC;
  --stone: #EAE4D8;
  --stone-deep: #DED5C4;
  --charcoal: #2B2926;
  --charcoal-soft: #46433E;
  --forest: #3C4A3E;
  --forest-deep: #2C372E;
  --clay-muted: #8C7A68;
  --navy-whisper: #3A4250;
  --hairline: rgba(43, 41, 38, 0.12);
  --hairline-soft: rgba(43, 41, 38, 0.07);
  --hairline-light: rgba(43, 41, 38, 0.05);

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Measure */
  --measure: 620px;
  --measure-wide: 760px;

  /* Rhythm */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  --space-2xl: 9rem;
}

/* ---- Page background (Tilda body) ---- */
body.t-body {
  background: var(--ivory) !important;
  color: var(--charcoal);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.005em;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .psy *, .psy *::before, .psy *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Local reset (scoped to our wrapper, so Tilda blocks are untouched) ---- */
.psy, .psy *, .psy *::before, .psy *::after { box-sizing: border-box; }
.psy img { max-width: 100%; display: block; }
.psy a { color: inherit; text-decoration-thickness: 0.5px; text-underline-offset: 3px; }
.psy p, .psy h1, .psy h2, .psy h3, .psy ul, .psy dl, .psy dd, .psy figure {
  margin: 0; padding: 0;
}

::selection { background: var(--forest); color: var(--ivory); }

/* ---- Focus states (accessibility) ---- */
.psy a:focus-visible,
.psy button:focus-visible,
.psy input:focus-visible,
.psy textarea:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---- Skip link ---- */
.psy .skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  background: var(--charcoal);
  color: var(--ivory);
  padding: 0.75rem 1.5rem;
  z-index: 200;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}
.psy .skip-link:focus {
  left: var(--space-md);
  top: var(--space-md);
}

/* ============================================================
   HERO
   ============================================================ */
.psy .hero {
  position: relative;
  padding: var(--space-2xl) var(--space-md) var(--space-xl);
  overflow: hidden;
}
.psy .hero--opening { padding-bottom: var(--space-2xl); }
.psy .hero--subsequent {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--hairline-light);
}

/* Signature element: concentric rings suggesting depth beneath the surface */
.psy .hero__rings {
  position: absolute;
  top: 50%;
  right: -6%;
  transform: translateY(-50%);
  width: min(56vw, 720px);
  height: min(56vw, 720px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.42;
}
.psy .hero__rings circle { fill: none; stroke: var(--forest); }

.psy .hero__ornament {
  margin: 0 auto 0.75rem;
  width: 40px;
  height: 1px;
  background: var(--forest);
  opacity: 0.3;
}

.psy .hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--measure);
  margin: 0 auto;
  text-align: left;
}
.psy .hero--subsequent .hero__inner { text-align: center; }

.psy .hero__eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--forest-deep);
  margin-bottom: var(--space-sm);
  opacity: 0.85;
}

.psy .hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.13;
  letter-spacing: -0.015em;
  color: var(--charcoal);
  margin: 0;
  text-wrap: balance;
}
.psy .hero__title em { font-style: italic; font-weight: 400; color: var(--forest-deep); }

/* ============================================================
   CONTENT / TYPOGRAPHY
   ============================================================ */
.psy .content {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.psy .section { padding: 5rem 0; }
.psy .section--tinted { background: var(--stone); }
.psy .section--first { padding-top: 0; }

.psy h2.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.65rem, 3.2vw, 2.2rem);
  line-height: 1.25;
  color: var(--charcoal);
  margin: 0 0 var(--space-md);
  max-width: 24ch;
}

.psy h3.subhead {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.4rem;
  line-height: 1.35;
  color: var(--forest-deep);
  margin: var(--space-lg) 0 var(--space-sm);
  letter-spacing: -0.005em;
}
.psy .section > h3.subhead:first-child { margin-top: 0; }

.psy p {
  margin: 0 0 1.6em;
  max-width: 62ch;
}
.psy .content p:last-child { margin-bottom: 0; }

.psy strong { font-weight: 600; color: var(--charcoal); }

/* ---- Thematic soft divider ---- */
.psy .soft-divider {
  border: 0;
  height: 1px;
  background: none;
  border-top: 1px dotted var(--hairline);
  max-width: 200px;
  margin: var(--space-lg) auto;
}

/* ---- Pull-quote with raised quotation mark ---- */
.psy .pull-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  line-height: 1.45;
  color: var(--forest-deep);
  max-width: 28ch;
  margin: var(--space-lg) 0;
  padding-left: var(--space-md);
  border-left: 2px solid var(--forest);
  position: relative;
  text-wrap: balance;
  letter-spacing: -0.005em;
}
.psy .pull-quote::before {
  content: "\201C"; /* left double quotation mark */
  position: absolute;
  left: -0.3rem;
  top: -0.6rem;
  font-size: 4.5rem;
  line-height: 1;
  color: var(--forest);
  opacity: 0.12;
  font-family: var(--font-display);
  pointer-events: none;
}
.psy .pull-quote strong { font-weight: 500; color: var(--forest-deep); }

.psy .signature {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--clay-muted);
}

/* ---- Pattern list (editorial left border) ---- */
.psy .pattern-list {
  list-style: none;
  margin: var(--space-md) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.psy .pattern-list li {
  background: none;
  padding: 0 0 0 1.5rem;
  border-left: 2px solid var(--forest);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--charcoal-soft);
  max-width: 56ch;
  margin: 0;
}
.psy .pattern-list li strong { font-weight: 600; color: var(--charcoal); }

/* ---- Frame list (definition grid) — proper /// ---- */
.psy .frame-list {
  list-style: none;
  margin: var(--space-md) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.psy .frame-list > div {
  padding: var(--space-md) 0;
  border-top: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: minmax(150px, 210px) 1fr;
  gap: var(--space-md);
}
.psy .frame-list > div:last-child { border-bottom: 1px solid var(--hairline); }
.psy .frame-list dt {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  color: var(--forest-deep);
  font-size: 1.05rem;
}
.psy .frame-list dd { margin: 0; color: var(--charcoal-soft); max-width: 54ch; }
@media (max-width: 640px) {
  .psy .frame-list > div { grid-template-columns: 1fr; gap: 0.35rem; }
}

/* ============================================================
   AUTHOR / CREDENTIAL BLOCK
   ============================================================ */
.psy .author-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: var(--space-md) 0 var(--space-sm);
}
.psy .author-block__name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--charcoal);
}
.psy .author-block__role {
  font-size: 0.95rem;
  color: var(--clay-muted);
  letter-spacing: 0.01em;
  max-width: 56ch;
}

.psy .author-photo {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  margin: 0 auto 1.8rem;
  background: var(--stone);
  border: 1px solid var(--hairline);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
}

/* ============================================================
   CTA / CONTACT
   ============================================================ */
.psy .cta-block {
  background: var(--forest-deep);
  color: var(--ivory);
  border-radius: 20px;
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  margin: var(--space-lg) 0;
}
.psy .cta-block .price {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  font-weight: 400;
  margin-bottom: 0.4rem;
}
.psy .cta-block .price-note {
  font-size: 0.95rem;
  color: rgba(246, 243, 236, 0.7);
  margin-bottom: var(--space-md);
}
.psy .cta-button {
  display: inline-block;
  background: var(--ivory);
  color: var(--forest-deep);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  padding: 0.9rem 2.2rem;
  border-radius: 999px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.psy .cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.16);
}
.psy .telegram-note {
  margin-top: var(--space-md);
  font-size: 0.98rem;
  color: var(--charcoal-soft);
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
}
.psy .telegram-note a {
  color: var(--forest-deep);
  text-decoration: underline;
  text-decoration-color: var(--hairline);
  text-underline-offset: 4px;
}
.psy .telegram-note a:hover { text-decoration-color: var(--forest-deep); }

.psy .closing-line {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--forest-deep);
  text-align: center;
  margin: var(--space-lg) auto 0;
  max-width: 38ch;
  text-wrap: balance;
}

/* ---- Article separator ---- */
.psy .article-divider {
  border: 0;
  height: 1px;
  background: var(--hairline);
  max-width: var(--measure);
  margin: 0 auto;
}

/* ============================================================
   SITE FOOTER (within our block)
   ============================================================ */
.psy .site-footer {
  border-top: 1px solid var(--hairline);
  padding: var(--space-lg) var(--space-md) var(--space-md);
  text-align: center;
}
.psy .site-footer__nav {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-md);
  flex-wrap: wrap;
}
.psy .site-footer__nav a {
  text-decoration: none;
  color: var(--charcoal-soft);
  font-size: 0.9rem;
  transition: color 0.25s ease;
}
.psy .site-footer__nav a:hover { color: var(--forest-deep); }
.psy .site-footer__meta {
  font-size: 0.85rem;
  color: var(--clay-muted);
  text-align: center;
  margin: 0 auto;
  width: fit-content;
}

/* ============================================================
   GRAIN OVERLAY
   Scoped opacity kept low; pointer-events none so it never
   blocks Tilda pop-ups / menus. z-index kept below Tilda's
   own high-index UI (Tilda menus use ~999999).
   ============================================================ */
.psy-grain {
  content: '';
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 90;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ============================================================
   SCROLL REVEAL (motion-safe only)
   ============================================================ */
.psy .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s cubic-bezier(0.23, 1, 0.32, 1),
              transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}
.psy .reveal.visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   RESPONSIVE — mobile first priority
   ============================================================ */
@media (max-width: 640px) {
  :root {
    --space-lg: 3rem;
    --space-xl: 4rem;
    --space-2xl: 5rem;
  }
  body.t-body { font-size: 1.05rem; line-height: 1.72; }
  .psy .hero--opening { padding: var(--space-2xl) var(--space-sm) var(--space-xl); }
  .psy .hero__rings { width: 90vw; height: 90vw; right: -28%; opacity: 0.32; }
  .psy .content { padding: 0 var(--space-sm); }
  .psy .section { padding: 3.5rem 0; }
  .psy .pull-quote { padding-left: var(--space-sm); font-size: 1.2rem; margin: var(--space-lg) 0; }
  .psy .pull-quote::before { font-size: 3.5rem; left: -0.2rem; }
  .psy h3.subhead { font-size: 1.2rem; }
  .psy .cta-block { padding: var(--space-lg) var(--space-sm); border-radius: 12px; }
}