@import url("https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;600;700&family=JetBrains+Mono:wght@400;600&display=swap");

:root {
  --bg: #050316;
  --bg-secondary: rgba(12, 8, 30, 0.6);
  --panel: rgba(18, 10, 40, 0.88);
  --panel-border: rgba(137, 110, 255, 0.35);
  --text: #f6f7ff;
  --muted: #a8acff;
  --green: #2de8b5;
  --orange: #ffad5a;
  --red: #ff477e;
  --blue: #6cd1ff;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --glow: 0 0 30px rgba(120, 75, 255, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Chakra Petch", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at 15% 20%, rgba(120, 75, 255, 0.16), transparent 50%),
    radial-gradient(circle at 80% 0%, rgba(45, 232, 181, 0.18), transparent 42%), var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.background-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(148, 121, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 121, 255, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.65;
  filter: blur(0.4px);
  z-index: -2;
}

.background-orb {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120, 75, 255, 0.65), transparent 70%);
  top: -190px;
  right: -150px;
  filter: blur(5px);
  z-index: -3;
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-40px, 30px, 0);
  }
}

.hero {
  padding: 6rem clamp(2rem, 5vw, 6rem) 3rem;
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.35rem 0.9rem;
  background: linear-gradient(135deg, rgba(45, 232, 181, 0.45), rgba(81, 96, 255, 0.55));
  border: 1px solid rgba(79, 56, 255, 0.6);
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  box-shadow: var(--glow);
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  font-weight: 700;
  line-height: 1.05;
  margin: 1.5rem 0 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  max-width: 760px;
}

.hero__contact {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 0.8rem 1rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0.8rem;
}

.hero__hint {
  color: var(--muted);
  font-size: 0.95rem;
}

.accent-link {
  position: relative;
  display: inline-block;
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(120deg, #6cc4ff, #3f7cff, #8af9ff);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: accent-shimmer 7s linear infinite;
  text-shadow: 0 0 10px rgba(111, 189, 255, 0.55), 0 0 18px rgba(63, 124, 255, 0.35);
}

.accent-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 2px;
  background: linear-gradient(120deg, #6cc4ff, #3f7cff, #8af9ff);
  background-size: 220% 100%;
  animation: accent-shimmer 7s linear infinite;
  opacity: 0.95;
  transform-origin: left;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 0 12px rgba(108, 196, 255, 0.4);
}

.accent-link:hover::after {
  opacity: 1;
  transform: scaleX(1.04);
}

@keyframes accent-shimmer {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.95rem;
  color: var(--muted);
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 4rem) 5rem;
  display: grid;
  gap: 2.8rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 26px;
  padding: clamp(1.4rem, 3vw, 2.4rem);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 26px;
  border: 1px solid rgba(45, 232, 181, 0.05);
  pointer-events: none;
}

.panel h2 {
  margin: 0 0 0.6rem;
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel p {
  margin: 0;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.stat-card {
  padding: 1rem 1.2rem;
  border-radius: 18px;
  background: rgba(10, 6, 29, 0.82);
  border: 1px solid rgba(145, 115, 255, 0.25);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-card strong {
  display: block;
  font-size: 1.6rem;
  margin-top: 0.4rem;
}

.filters__header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.filter-chip {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(145, 115, 255, 0.35);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  font-family: "JetBrains Mono", monospace;
}

.filter-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(45, 232, 181, 0.6);
  box-shadow: var(--glow);
}

.filter-chip--active {
  background: linear-gradient(135deg, rgba(45, 232, 181, 0.18), rgba(81, 96, 255, 0.22));
  border-color: rgba(45, 232, 181, 0.8);
  box-shadow: var(--glow);
}

.tomb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.tombstone {
  position: relative;
  padding: 1.4rem 1.2rem 1.2rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(18, 10, 40, 0.92), rgba(10, 6, 29, 0.9));
  border: 1px solid rgba(137, 110, 255, 0.4);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  min-height: 210px;
}

.tombstone::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  border: 1px solid rgba(45, 232, 181, 0.04);
  pointer-events: none;
}

.tombstone__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}

.tombstone__name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tombstone__date {
  font-family: "JetBrains Mono", monospace;
  color: var(--muted);
  font-size: 0.9rem;
}

.tombstone__tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0.8rem 0 0.6rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(145, 115, 255, 0.3);
  font-size: 0.85rem;
  color: var(--muted);
}

.tombstone__motif {
  color: var(--text);
  margin: 0.3rem 0 0.8rem;
  font-size: 1rem;
}

.tombstone__note {
  color: var(--muted);
  font-size: 0.95rem;
}

.tombstone__flowers {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(145, 115, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.flower-btn {
  padding: 0.55rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(45, 232, 181, 0.7);
  background: linear-gradient(135deg, rgba(45, 232, 181, 0.2), rgba(120, 75, 255, 0.24));
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: var(--glow);
  transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.flower-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(45, 232, 181, 0.2), var(--glow);
  border-color: rgba(45, 232, 181, 0.95);
}

.flower-btn:active {
  transform: translateY(0);
}

.flower-meta {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.92rem;
  text-align: right;
}

.comments {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(145, 115, 255, 0.18);
  display: grid;
  gap: 0.6rem;
}

.comment-btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px dashed rgba(108, 209, 255, 0.4);
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.comment-btn:hover {
  border-color: rgba(45, 232, 181, 0.7);
  transform: translateY(-1px);
}

.comment-carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  background: rgba(20, 12, 42, 0.7);
  border: 1px solid rgba(137, 110, 255, 0.25);
  border-radius: 14px;
}

.comment-text {
  color: var(--text);
}

.comment-nav {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(137, 110, 255, 0.35);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  cursor: pointer;
}

.comment-nav:disabled {
  opacity: 0.5;
}

.timeline__header p {
  margin: 0 0 0.8rem;
}

.timeline__list {
  display: grid;
  gap: 0.85rem;
}

.timeline__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(145, 115, 255, 0.25);
}

.timeline__name {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.timeline__meta {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
}

.empty-state {
  padding: 1rem;
  color: var(--muted);
  font-style: italic;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  padding: 0.9rem 1.2rem;
  background: rgba(15, 10, 30, 0.95);
  border-radius: 12px;
  border: 1px solid rgba(137, 110, 255, 0.45);
  color: var(--text);
  box-shadow: var(--shadow);
  font-family: "JetBrains Mono", monospace;
}

.form-grid {
  display: grid;
  gap: 0.75rem;
  margin: 0.6rem 0 0.2rem;
  width: 100%;
  grid-template-columns: 1fr;
}

.field {
  display: grid;
  gap: 0.35rem;
  width: 100%;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(145, 115, 255, 0.4);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  color: var(--text);
  font-family: inherit;
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.4) 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.4) 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position: calc(100% - 20px) calc(50% - 3px), calc(100% - 14px) calc(50% - 3px), 0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
}

.field {
  min-width: 0;
}

.field input,
.field textarea,
.field select {
  min-width: 0;
}

.field input[type="date"] {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.field small {
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 2, 10, 0.75);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal__dialog {
  background: radial-gradient(circle at 20% 20%, rgba(120, 75, 255, 0.14), transparent 60%), rgba(10, 6, 29, 0.92);
  border: 1px solid rgba(137, 110, 255, 0.5);
  box-shadow: var(--shadow);
  border-radius: 18px;
  padding: 1.2rem 1.4rem 1.4rem;
  position: relative;
  width: min(520px, 92vw);
}

.modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(145, 115, 255, 0.4);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
}

.modal h3 {
  margin: 0 0 0.4rem;
  letter-spacing: 0.04em;
}

.modal p {
  margin: 0 0 0.8rem;
  color: var(--muted);
}

.modal textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(145, 115, 255, 0.4);
  border-radius: 12px;
  padding: 0.8rem;
  color: var(--text);
  font-family: inherit;
  resize: vertical;
  min-height: 120px;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.moderation-notice {
  margin-top: 0.6rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(45, 232, 181, 0.45);
  background: linear-gradient(135deg, rgba(45, 232, 181, 0.08), rgba(120, 75, 255, 0.08));
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.moderation-notice strong {
  display: block;
  margin-bottom: 0.25rem;
}

.moderation-notice p {
  margin: 0;
}

.btn {
  padding: 0.55rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(145, 115, 255, 0.5);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(135deg, rgba(45, 232, 181, 0.35), rgba(120, 75, 255, 0.35));
  border-color: rgba(45, 232, 181, 0.7);
  box-shadow: var(--glow);
}

.btn.ghost {
  border-style: dashed;
}

.admin {
  display: grid;
  gap: 0.9rem;
}

.admin__header p {
  color: var(--muted);
}

.admin__login {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.admin__login input {
  flex: 1;
  min-width: 220px;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(145, 115, 255, 0.5);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.admin__settings {
  border-top: 1px solid rgba(145, 115, 255, 0.2);
  padding-top: 0.8rem;
  display: grid;
  gap: 0.75rem;
}

.admin__section {
  display: grid;
  gap: 0.4rem;
}

.admin__section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}

.admin__section-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(137, 110, 255, 0.3);
}

.setting-row__text p {
  margin: 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch__slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(145, 115, 255, 0.35);
}

.switch__slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.switch input:checked + .switch__slider {
  background: linear-gradient(135deg, rgba(45, 232, 181, 0.45), rgba(120, 75, 255, 0.4));
  border-color: rgba(45, 232, 181, 0.8);
  box-shadow: var(--glow);
}

.switch input:checked + .switch__slider::before {
  transform: translateX(22px);
}

.switch input:disabled + .switch__slider {
  opacity: 0.4;
  cursor: not-allowed;
}

.admin__list {
  display: grid;
  gap: 0.8rem;
}

.admin-card {
  border: 1px solid rgba(137, 110, 255, 0.35);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.03);
}

.admin-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: center;
  color: var(--muted);
}

.admin-card__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.6rem;
}

.muted {
  color: var(--muted);
}

@media (max-width: 720px) {
  .hero {
    padding-top: 4.5rem;
  }

  .timeline__item {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .tombstone__flowers {
    flex-direction: column;
    align-items: flex-start;
  }

  .flower-meta {
    text-align: left;
  }
}
