:root {
  color-scheme: dark;
  --bg: #080a0f;
  --bg-soft: #0d111a;
  --ink: #f4f7fb;
  --muted: #98a3b7;
  --muted-strong: #c5ccda;
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(148, 163, 184, 0.32);
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --danger: #ef4444;
  --success-bg: rgba(34, 197, 94, 0.12);
  --error-bg: rgba(239, 68, 68, 0.12);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius-lg: 28px;
  --radius-md: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100%;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% -10%, rgba(139, 92, 246, 0.24), transparent 36rem),
    radial-gradient(circle at 88% 5%, rgba(34, 211, 238, 0.16), transparent 30rem),
    linear-gradient(180deg, #0b0f18 0%, var(--bg) 46%, #06070b 100%);
  color: var(--ink);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.72), transparent 72%);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3.2rem, 8vw, 6rem) 1.25rem clamp(2.4rem, 6vw, 4.2rem);
  border-bottom: 1px solid var(--line);
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 8% -35% auto;
  width: 22rem;
  height: 22rem;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.18);
  filter: blur(54px);
}
.hero > div,
.container {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
}

h1,
h2 {
  color: var(--ink);
  letter-spacing: -0.045em;
}
h1 {
  max-width: 940px;
  margin: 0;
  font-size: clamp(2.8rem, 8vw, 6.4rem);
  line-height: 0.9;
}
h2 {
  margin: 0.25rem 0 0.65rem;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  line-height: 1.08;
}
p { line-height: 1.7; }
.intro {
  max-width: 760px;
  margin: 1.35rem 0 0;
  color: var(--muted-strong);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.75;
}
.site-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.15rem;
  color: var(--muted-strong);
}
.site-meta span,
.site-meta a {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  background: rgba(3, 7, 18, 0.32);
  backdrop-filter: blur(10px);
}
.site-meta a {
  color: var(--ink);
  text-decoration: none;
}
.site-meta a:hover {
  border-color: var(--accent-2);
  color: white;
}
.container { padding: clamp(1.5rem, 4vw, 3rem) 1.25rem 5rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  align-items: start;
  gap: 1.2rem;
}
.wide_story { grid-template-columns: 1fr; }

.card,
.form-card,
.empty,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.035));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.card {
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
}
.media-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: zoom-in;
}
.media-open:hover {
  transform: none;
  filter: none;
  box-shadow: none;
}
.media-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 9rem;
  background: var(--bg-soft);
}
.video-badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(3, 7, 18, 0.76);
  border: 1px solid var(--line-strong);
  color: white;
  font-weight: 850;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.36);
}
.card img,
.card video {
  width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: contain;
  display: block;
  background: var(--bg-soft);
}
.wide_story .card img,
.wide_story .card video { max-height: 86vh; }
.empty {
  padding: clamp(2rem, 6vw, 4rem);
  text-align: center;
}
.card p,
.empty p,
.admin-panel p { color: var(--muted-strong); }
.form-note { margin: 0; }

.media-lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.94);
  color: white;
}
.media-lightbox::backdrop { background: rgba(0, 0, 0, 0.86); }
.lightbox-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 3rem);
}
.lightbox-content img,
.lightbox-content video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
}
.lightbox-close {
  position: fixed;
  z-index: 3;
  top: 1rem;
  right: 1rem;
  width: 3rem;
  height: 3rem;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 2rem;
  line-height: 1;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line-strong);
}

.admin-panel {
  padding: clamp(1.1rem, 3vw, 1.6rem);
  margin-bottom: 1.25rem;
}
.form-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  background: rgba(12, 17, 28, 0.72);
  box-shadow: none;
}
label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted-strong);
  font-weight: 750;
}
input,
textarea,
select {
  width: 100%;
  padding: 0.9rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  font: inherit;
  color: var(--ink);
  background: rgba(3, 7, 18, 0.68);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
  background: rgba(3, 7, 18, 0.88);
}
input[type="file"] { color: var(--muted-strong); }
button {
  justify-self: start;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #6d5dfc 58%, var(--accent-2));
  color: white;
  padding: 0.88rem 1.25rem;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(139, 92, 246, 0.28);
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}
button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 16px 42px rgba(139, 92, 246, 0.38);
}
button.danger {
  background: linear-gradient(135deg, #dc2626, var(--danger));
  box-shadow: 0 12px 28px rgba(239, 68, 68, 0.2);
}
.admin-list { display: grid; gap: 0.75rem; }
.admin-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(3, 7, 18, 0.42);
}
.admin-item span { color: var(--muted); }
.messages { margin-bottom: 1rem; }
.message {
  margin: 0 0 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: var(--radius-md);
  background: var(--success-bg);
  color: #bbf7d0;
}
.message.error {
  border-color: rgba(239, 68, 68, 0.28);
  background: var(--error-bg);
  color: #fecaca;
}
::selection { background: rgba(34, 211, 238, 0.28); }
@media (max-width: 720px) {
  .hero { padding-top: 3rem; }
  .admin-item {
    align-items: flex-start;
    flex-direction: column;
  }
}
