/* «Зільник» - стилі головної (лендінг «нічний ботанічний сад») + сторінки входу. */

html { scroll-behavior: smooth; }
.landing { overflow-x: hidden; }

/* ================= HERO ================= */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 120px 24px 90px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 130% 90% at 50% 108%, rgba(24, 74, 44, .8), transparent 62%),
    radial-gradient(ellipse 70% 50% at 50% 112%, rgba(47, 157, 99, .28), transparent 60%),
    radial-gradient(ellipse 90% 70% at 12% -8%, rgba(15, 36, 24, .9), transparent 55%),
    linear-gradient(180deg, #071009 0%, #081410 55%, #0a1611 100%);
}
/* зерно */
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .05;
}
/* віньєтка */
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: radial-gradient(ellipse 95% 95% at 50% 45%, transparent 52%, rgba(3, 8, 5, .55) 100%);
}

/* ---- Ботанічні силуети ---- */
.flora {
  position: absolute; z-index: 1; pointer-events: none;
  transition: transform .35s ease-out;
  will-change: transform;
}
.flora svg { display: block; width: 100%; height: auto; }
.flora-left  { left: -70px;  bottom: -40px; width: min(340px, 40vw); color: var(--gold);       opacity: .17; }
.flora-right { right: -50px; bottom: -30px; width: min(380px, 44vw); color: var(--green-soft); opacity: .14; }
.flora-top   { right: -40px; top: -16px;    width: min(430px, 46vw); color: var(--gold-soft);  opacity: .11; }
.flora-left svg  { transform-origin: 50% 100%; animation: sway 9s ease-in-out infinite alternate; }
.flora-right svg { transform-origin: 50% 100%; animation: sway 12s ease-in-out infinite alternate-reverse; }
.flora-top svg   { transform-origin: 100% 0;   animation: sway-soft 11s ease-in-out infinite alternate; }
@keyframes sway      { from { transform: rotate(-1.5deg); } to { transform: rotate(1.5deg); } }
@keyframes sway-soft { from { transform: rotate(-.8deg); }  to { transform: rotate(1deg); } }

/* ---- Світлячки / спори ---- */
.particles { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
.particle {
  position: absolute; bottom: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(169, 223, 192, .95) 0%, rgba(87, 185, 129, .35) 65%, transparent 100%);
  box-shadow: 0 0 6px rgba(87, 185, 129, .5);
  filter: blur(.6px);
  opacity: 0;
  animation-name: rise;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.particle-gold {
  background: radial-gradient(circle, rgba(224, 201, 141, .95) 0%, rgba(201, 169, 97, .35) 65%, transparent 100%);
  box-shadow: 0 0 6px rgba(201, 169, 97, .55);
}
@keyframes rise {
  0%   { transform: translate3d(0, 0, 0); opacity: 0; }
  8%   { opacity: var(--o, .6); }
  85%  { opacity: var(--o, .6); }
  100% { transform: translate3d(var(--dx, 30px), -108vh, 0); opacity: 0; }
}

/* ---- Навігація лендінгу ---- */
.landing-nav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; gap: 26px;
  padding: 20px clamp(20px, 4vw, 40px);
}
.landing-nav .brand {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 700; letter-spacing: .04em;
  color: var(--gold-soft);
  display: flex; align-items: center; gap: 10px;
}
.landing-nav .brand svg { width: 26px; height: 26px; }
.landing-nav nav { display: flex; gap: 22px; flex: 1; }
.landing-nav nav a { color: var(--text-dim); font-size: 15px; font-weight: 500; transition: color .2s; }
.landing-nav nav a:hover { color: var(--gold-soft); }
.landing-nav .auth-zone { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--text-dim); }

/* ---- Центр героя ---- */
.hero-inner { position: relative; z-index: 5; max-width: 880px; }
.hero-overline {
  display: block;
  font-size: 12px; font-weight: 600;
  letter-spacing: .35em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 24px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(64px, 12vw, 150px);
  font-weight: 600; line-height: .95;
  margin: 0 0 6px;
  color: var(--text);
  text-shadow: 0 0 90px rgba(201, 169, 97, .35), 0 6px 40px rgba(0, 0, 0, .4);
}
.hero-sub {
  font-size: clamp(15.5px, 2vw, 19px);
  color: var(--text-dim);
  max-width: 600px; margin: 20px auto 38px;
  line-height: 1.65;
}
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn-lg { padding: 13px 32px; font-size: 16px; }

.hero-stats {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(14px, 3vw, 34px);
  margin-top: 56px; flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.stat-num {
  font-family: var(--font-display);
  font-size: 34px; font-weight: 600; line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 12px; color: var(--text-faint); letter-spacing: .1em; text-transform: uppercase; }
.stat-sep { color: var(--line); font-size: 22px; user-select: none; }

.hero-planets {
  margin-top: 36px;
  font-size: 17px;
  letter-spacing: .9em; padding-left: .9em; /* компенсація хвоста letter-spacing */
  color: rgba(201, 169, 97, .38);
  user-select: none;
}

/* ---- Підказка прокрутки ---- */
.scroll-hint {
  position: absolute; bottom: 24px; left: 50%; z-index: 6;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint);
  animation: bob 2.2s ease-in-out infinite;
  transition: color .2s;
}
.scroll-hint:hover { color: var(--gold-soft); }
.scroll-hint svg { width: 26px; height: 26px; }
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 8px); }
}

/* ================= СЕКЦІЇ ================= */

.section { max-width: 1080px; margin: 0 auto; padding: 90px 24px 30px; }
.section-head { text-align: center; margin-bottom: 48px; }
.section-overline {
  display: block;
  font-size: 11.5px; font-weight: 600;
  letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 12px;
}
.section-head h2 { font-size: clamp(34px, 4.6vw, 46px); font-weight: 600; margin: 0 0 10px; }
.section-sub { color: var(--text-dim); margin: 0 auto; max-width: 520px; font-size: 15.5px; }

/* ---- Стихії ---- */
.el-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.el-card {
  --el: var(--green-soft);
  --el-glow: rgba(87, 185, 129, .16);
  position: relative; display: block; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 24px 28px;
  text-align: center; color: var(--text);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.el-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 85% 65% at 50% -10%, var(--el-glow), transparent 70%);
  opacity: 0; transition: opacity .2s ease;
}
.el-card:hover {
  transform: translateY(-5px);
  border-color: var(--el);
  box-shadow: 0 14px 44px rgba(0, 0, 0, .35), 0 0 44px var(--el-glow);
  color: var(--text);
}
.el-card:hover::before { opacity: 1; }
.el-card[data-el="water"] { --el: var(--el-water); --el-glow: rgba(90, 167, 209, .18); }
.el-card[data-el="fire"]  { --el: var(--el-fire);  --el-glow: rgba(217, 121, 82, .18); }
.el-card[data-el="air"]   { --el: var(--el-air);   --el-glow: rgba(168, 195, 217, .16); }
.el-card[data-el="earth"] { --el: var(--el-earth); --el-glow: rgba(176, 141, 87, .18); }
.el-glyph { position: relative; display: block; width: 38px; height: 38px; margin: 0 auto 16px; color: var(--el); transition: transform .2s ease; }
.el-card:hover .el-glyph { transform: scale(1.12); }
.el-card h3 { position: relative; font-size: 27px; margin: 0 0 6px; color: var(--text); }
.el-card p { position: relative; margin: 0; font-size: 13.5px; color: var(--text-dim); }

/* ---- Можливості ---- */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.feat-card {
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.feat-card:hover {
  transform: translateY(-4px);
  border-color: var(--green);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .3);
}
.feat-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--bg-deep); border: 1px solid var(--line-soft);
  font-size: 22px; margin-bottom: 16px;
}
.feat-card h3 { font-size: 22px; margin: 0 0 8px; }
.feat-card p { margin: 0; font-size: 14px; color: var(--text-dim); line-height: 1.6; }

.landing .site-footer { margin-top: 100px; }

/* ---- Поява при скролі ---- */
.reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity .7s ease var(--d, 0s), transform .7s ease var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* ================= AUTH (login.php) ================= */

.auth-wrap {
  max-width: 420px; margin: 0 auto; padding: 40px 20px 20px;
  min-height: calc(100vh - 320px);
  display: flex; flex-direction: column; justify-content: center;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 30px 28px;
  box-shadow: var(--shadow);
}
.auth-tabs {
  display: flex; gap: 6px;
  background: var(--bg-deep);
  padding: 5px; border-radius: 999px;
  margin-bottom: 26px;
}
.auth-tab {
  flex: 1; padding: 9px 10px;
  border: none; border-radius: 999px;
  background: transparent; color: var(--text-dim);
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .2s ease;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active { background: var(--surface-2); color: var(--gold-soft); }
.auth-form label { display: block; font-size: 13px; font-weight: 500; color: var(--text-dim); margin-bottom: 16px; }
.auth-form label .opt { color: var(--text-faint); font-weight: 400; }
.auth-form input { margin-top: 6px; }
.auth-error { color: #d97962; font-size: 13.5px; margin: -4px 0 14px; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-submit[disabled] { opacity: .65; cursor: wait; }
.auth-note { text-align: center; color: var(--text-faint); font-size: 12.5px; margin-top: 18px; }

/* ================= REDUCED MOTION ================= */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .flora svg { animation: none; }
  .flora { transition: none; }
  .particle { display: none; }
  .scroll-hint { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .el-card, .feat-card, .el-glyph { transition: none; }
  .el-card:hover, .feat-card:hover { transform: none; }
  .el-card:hover .el-glyph { transform: none; }
}

/* ================= АДАПТИВ ================= */

@media (max-width: 640px) {
  .landing-nav { gap: 14px; }
  .landing-nav nav { gap: 14px; }
  .landing-nav nav a { font-size: 14px; }
  .landing-nav .brand { font-size: 22px; }
  .hero { padding-top: 100px; padding-bottom: 76px; }
  .hero-stats { gap: 16px; margin-top: 44px; }
  .stat-num { font-size: 28px; }
  .stat-sep { display: none; }
  .flora-top { display: none; }
  .section { padding-top: 64px; }
}
