/* ============================================================
   author-prof — Minimalist Glass Author Page
   2 themes · t-4 Лаванда (light) · t-5 Тёмная лаванда (dark)
   Стилистика унаследована от General-template-v7_8_5
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Lora:ital,wght@0,400;0,500;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --dur: 0.28s;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --hdr-h: 60px;
  --r: 14px;
  --r-sm: 8px;
  --max-w: 860px;
  --glass-blur: 18px;
  --glass-sat: 160%;
}

/* ─── THEME: Лаванда (t-4) — soft blue-lavender ─── */
html[data-theme="t-4"] {
  --bg: #e2e2f4;
  --bg-grad:
    radial-gradient(ellipse 60% 50% at 18% 10%, rgba(150,150,222,0.42) 0%, transparent 70%),
    radial-gradient(ellipse 50% 55% at 84% 22%, rgba(190,190,235,0.40) 0%, transparent 70%),
    radial-gradient(ellipse 65% 45% at 50% 90%, rgba(120,120,200,0.24) 0%, transparent 70%),
    #e2e2f4;
  --text: #2a2950;
  --muted: rgba(42,41,80,0.52);
  --glass: rgba(255,255,255,0.46);
  --glass-b: rgba(255,255,255,0.76);
  --shadow: 0 4px 20px rgba(40,40,100,0.07), 0 1px 3px rgba(40,40,100,0.04);
  --hdr: rgba(226,226,244,0.82);
  --hdr-b: rgba(255,255,255,0.68);
  --menu: rgba(238,238,250,0.95);
  --div: rgba(40,40,100,0.09);
  --hov: rgba(70,70,160,0.07);
  --btn: linear-gradient(135deg,#4f4d99,#7f7dc9);
  --btn-t: #f6f6ff;
  --sb: rgba(79,77,153,0.24);
  --hb: #2f2d5e;
  --hb-h: #5a58a8;
  --rp-fill: #6664b8;
  --rp-track: rgba(42,41,80,0.12);
}

/* ─── THEME: Тёмная лаванда (t-5) — dark lavender ─── */
html[data-theme="t-5"] {
  --bg: #201d3a;
  --bg-grad:
    radial-gradient(ellipse 60% 50% at 18% 10%, rgba(130,120,220,0.30) 0%, transparent 70%),
    radial-gradient(ellipse 50% 55% at 84% 22%, rgba(150,140,230,0.26) 0%, transparent 70%),
    radial-gradient(ellipse 65% 45% at 50% 90%, rgba(90,80,180,0.22) 0%, transparent 70%),
    #201d3a;
  --text: #ece9fb;
  --muted: rgba(236,233,251,0.55);
  --glass: rgba(255,255,255,0.06);
  --glass-b: rgba(255,255,255,0.12);
  --shadow: 0 4px 20px rgba(0,0,0,0.45), 0 1px 3px rgba(0,0,0,0.3);
  --hdr: rgba(32,29,58,0.82);
  --hdr-b: rgba(255,255,255,0.09);
  --menu: rgba(40,37,68,0.95);
  --div: rgba(255,255,255,0.10);
  --hov: rgba(255,255,255,0.06);
  --btn: linear-gradient(135deg,#7f7dc9,#4f4d99);
  --btn-t: #f6f6ff;
  --sb: rgba(150,145,222,0.35);
  --hb: #cfcdf5;
  --hb-h: #a6a3e0;
  --rp-fill: #9997e0;
  --rp-track: rgba(255,255,255,0.14);
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Lora', Georgia, serif;
  min-height: 100vh;
  padding-top: var(--hdr-h);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  transition: color var(--dur) var(--ease);
  scrollbar-width: thin;
  scrollbar-color: var(--sb) transparent;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg-grad);
  opacity: 1;
  transition: opacity 0.18s var(--ease);
  contain: layout paint style;
  will-change: opacity;
}

body.theme-switching::before { opacity: 0; }

body::-webkit-scrollbar { width: 5px; }
body::-webkit-scrollbar-track { background: transparent; }
body::-webkit-scrollbar-thumb { background: var(--sb); border-radius: 6px; }

/* ============================================================
   HEADER
   ============================================================ */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--hdr-h);
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 18px;
  background: var(--hdr);
  border-bottom: 1px solid var(--hdr-b);
  backdrop-filter: blur(12px) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(12px) saturate(var(--glass-sat));
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.site-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2px;
  cursor: default;
  user-select: none;
  color: var(--text);
  transition: opacity 0.15s;
}
.site-title:hover { opacity: 0.6; }

/* ============================================================
   MENU
   ============================================================ */
.menu-container { position: relative; display: flex; align-items: center; }

.hamburger {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; padding: 6px;
  cursor: pointer; flex-shrink: 0;
  color: var(--hb, var(--text));
  border-radius: var(--r-sm);
  transition: background 0.18s var(--ease), transform 0.15s var(--spring), color 0.28s var(--ease);
}
.hamburger:hover  { background: var(--hov); color: var(--hb-h, var(--text)); transform: scale(1.08); }
.hamburger:active { transform: scale(0.88); }

.burger-svg {
  width: 26px; height: 26px;
  overflow: visible;
  transition: transform 0.38s var(--spring);
}
.hamburger.open .burger-svg { transform: rotate(90deg); }

.burger-line {
  transform-origin: center;
  transition:
    transform  0.38s cubic-bezier(0.34,1.56,0.64,1),
    opacity    0.22s ease,
    stroke-dashoffset 0.38s cubic-bezier(0.34,1.56,0.64,1);
}
.burger-line-top    { transform-origin: 13px 7px;  }
.burger-line-mid    { transform-origin: 13px 13px; }
.burger-line-bottom { transform-origin: 13px 19px; }

.hamburger.open .burger-line-top    { transform: translateY(6px) rotate(45deg); }
.hamburger.open .burger-line-mid    { opacity: 0; transform: scaleX(0); }
.hamburger.open .burger-line-bottom { transform: translateY(-6px) rotate(-45deg); }

.menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  border-radius: var(--r);
  padding: 5px 0;
  list-style: none;
  overflow-y: auto;
  max-height: calc(100vh - var(--hdr-h) - 20px);
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--spring);
  z-index: 200;
  background: var(--menu);
  border: 1px solid var(--glass-b);
  backdrop-filter: blur(14px) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(14px) saturate(var(--glass-sat));
  box-shadow: var(--shadow);
  scrollbar-width: thin;
  scrollbar-color: var(--sb) transparent;
}

.menu-list.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.menu-list li a {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  font-family: 'Lora', serif;
  font-size: 13px;
  color: var(--text);
  transition: background 0.15s, padding-left 0.15s;
}
.menu-list li a::before { content: '§'; font-size: 9px; opacity: 0.3; flex-shrink: 0; }
.menu-list li a:hover { background: var(--hov); padding-left: 20px; }
.menu-list li a:hover::before { opacity: 0.6; }

.menu-list li:last-child {
  padding: 6px 10px;
  margin-top: 2px;
  border-top: 1px solid var(--div);
}

.menu-list.show li {
  animation: menuItemIn 0.32s var(--spring) both;
}
.menu-list.show li:nth-child(1) { animation-delay: 0.02s; }
.menu-list.show li:nth-child(2) { animation-delay: 0.06s; }
.menu-list.show li:nth-child(3) { animation-delay: 0.10s; }
.menu-list.show li:nth-child(4) { animation-delay: 0.14s; }
@keyframes menuItemIn {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.theme-button {
  width: 100%;
  padding: 8px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  border-radius: var(--r-sm);
  background: var(--btn);
  color: var(--btn-t);
  transition: opacity 0.15s, transform 0.15s var(--spring);
  letter-spacing: 0.1px;
}
.theme-button:hover  { opacity: 0.85; transform: translateY(-1px); }
.theme-button:active { transform: scale(0.96); opacity: 1; }

/* ─── Theme picker panel (2 swatches) ─── */
#themePicker {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 190px;
  padding: 10px;
  border-radius: 14px;
  background: var(--menu);
  border: 1px solid var(--div);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(20px) saturate(var(--glass-sat));
  z-index: 9999;
}
#themePicker.tp-open {
  display: block;
  animation: tpFadeIn 0.18s var(--spring) both;
}
@keyframes tpFadeIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
.tp-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  padding: 0 2px;
}
.tp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tp-swatch {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 6px 4px;
  background: none;
  border: none;
  border-radius: 10px;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.tp-swatch:hover { background: var(--hov); }
.tp-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  background: var(--tp-bg);
}
.tp-swatch:hover .tp-circle { transform: scale(1.1); }
.tp-swatch.tp-active .tp-circle {
  border-color: var(--tp-accent);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.35), 0 3px 10px rgba(0,0,0,0.22);
}
.tp-label {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.tp-swatch.tp-active .tp-label { color: var(--text); font-weight: 600; }

/* ============================================================
   BANNER + LOGO BADGE
   ============================================================ */
.banner-wrap {
  position: relative;
  max-width: 1100px;
  margin: 40px auto 0;
  padding: 0 20px;
  animation: fadeUp 0.55s var(--ease) both;
}

.banner-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.logo-badge {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 42%);
  width: 128px;
  height: 128px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--menu);
  border: 5px solid #191922;
  box-shadow: 0 14px 34px rgba(0,0,0,0.34), 0 4px 10px rgba(0,0,0,0.22);
  z-index: 5;
  transition: transform 0.35s var(--spring), box-shadow 0.35s var(--ease);
}
.logo-badge:hover {
  transform: translate(-50%, 42%) scale(1.05) rotate(-2deg);
  box-shadow: 0 20px 44px rgba(0,0,0,0.4), 0 6px 14px rgba(0,0,0,0.26);
}
.logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Spacer to accommodate the badge overlap under the banner */
.banner-spacer { height: 64px; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   TELEGRAM CARD — фото 16:9, затемнение сбоку, круглая эмблема
   ============================================================ */
.tg-card-wrap {
  max-width: 1100px;
  margin: 26px auto 0;
  padding: 0 20px;
  animation: fadeUp 0.6s 0.08s var(--ease) both;
}

.tg-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.3s var(--spring), box-shadow 0.3s var(--ease);
}
.tg-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(0,0,0,0.24), 0 4px 12px rgba(0,0,0,0.14); }
.tg-card:active { transform: translateY(0) scale(0.99); }

.tg-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Затемнение с левой стороны карточки */
.tg-card-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.58) 0%, rgba(0,0,0,0.30) 32%, transparent 58%);
  pointer-events: none;
}

.tg-card-label {
  position: absolute;
  left: 22px;
  bottom: 20px;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 20px;
  color: #f5f5fb;
  text-shadow: 0 2px 10px rgba(0,0,0,0.45);
  letter-spacing: 0.2px;
  max-width: 55%;
}

.tg-card-badge {
  position: absolute;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--menu);
  border: 5px solid #191922;
  box-shadow: 0 10px 26px rgba(0,0,0,0.32), 0 3px 8px rgba(0,0,0,0.2);
  transition: transform 0.3s var(--spring);
}
.tg-card:hover .tg-card-badge { transform: translateY(-50%) scale(1.08) rotate(-4deg); }

/* ============================================================
   GALLERY (auto-scrolling, non-interactive marquee)
   ============================================================ */
.gallery-section {
  max-width: 1100px;
  margin: 26px auto 0;
  padding: 0 20px;
  animation: fadeUp 0.6s 0.08s var(--ease) both;
}

.gallery-title {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  padding: 0 4px;
}

.auto-gallery-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--r);
  background: var(--glass);
  border: 1px solid var(--glass-b);
  box-shadow: var(--shadow);
  padding: 16px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 5%, #000 95%, transparent 100%);
}

.auto-gallery-track {
  display: flex;
  gap: 14px;
  width: max-content;
  animation: gallery-scroll linear infinite;
  animation-duration: var(--gallery-duration, 40s);
  will-change: transform;
}

.auto-gallery-viewport:hover .auto-gallery-track {
  animation-play-state: paused;
}

@keyframes gallery-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.auto-gallery-item {
  flex: 0 0 auto;
  width: 190px;
  height: 190px;
  border-radius: var(--r-sm);
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  user-select: none;
  -webkit-user-drag: none;
}

.auto-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* ============================================================
   ABOUT SECTION
   ============================================================ */
.about-section {
  max-width: var(--max-w);
  margin: 26px auto 0;
  padding: 28px 32px;
  border-radius: var(--r);
  background: var(--glass);
  border: 1px solid var(--glass-b);
  backdrop-filter: blur(14px) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(14px) saturate(var(--glass-sat));
  box-shadow: var(--shadow);
  animation: fadeUp 0.65s 0.12s var(--ease) both;
}

.about-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.about-heading {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}

.about-text p {
  font-family: 'Lora', serif;
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 14px;
}
.about-text p:last-child { margin-bottom: 0; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  max-width: 1100px;
  margin: 40px auto 0;
  padding: 30px 20px 46px;
  text-align: center;
  font-family: 'Lora', serif;
  font-size: 14px;
  color: var(--muted);
}

.footer-back-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dashed var(--div);
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
}
.footer-back-link:hover {
  color: var(--hb-h);
  border-color: var(--hb-h);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  header { padding: 0 16px; }

  .banner-wrap { margin: 24px auto 0; padding: 0 14px; }
  .logo-badge { width: 96px; height: 96px; border-width: 4px; transform: translate(-50%, 46%); }
  .logo-badge:hover { transform: translate(-50%, 46%) scale(1.05) rotate(-2deg); }
  .banner-spacer { height: 50px; }

  .tg-card-wrap { margin: 18px auto 0; padding: 0 14px; }
  .tg-card-badge { width: 62px; height: 62px; border-width: 4px; right: 16px; }
  .tg-card-badge svg { width: 26px; height: 26px; }
  .tg-card-label { left: 16px; bottom: 14px; font-size: 15px; max-width: 62%; }

  .gallery-section { margin: 18px auto 0; padding: 0 14px; }
  .auto-gallery-item { width: 140px; height: 140px; }
  .auto-gallery-viewport { padding: 12px; }

  .about-section { margin: 18px 12px 0; padding: 22px 20px; }
  .about-heading { font-size: 20px; }

  .site-footer { margin: 28px auto 0; padding: 24px 16px 36px; }

  .menu-list { width: 210px; }
}
