:root {
  --bg: #f7f7f2;
  --ink: #171717;
  --muted: #666a70;
  --line: #d8d8d0;
  --panel: #ffffff;
  --accent: #0c6b58;
  --danger: #9d1f2e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #eef3ef;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  position: relative;
}

body::before {
  animation: drift-background 26s linear infinite;
  background:
    linear-gradient(120deg, rgba(12, 107, 88, 0.20), transparent 34%),
    linear-gradient(240deg, rgba(216, 88, 55, 0.15), transparent 32%),
    linear-gradient(0deg, rgba(21, 56, 76, 0.12), transparent 46%),
    repeating-linear-gradient(90deg, rgba(23, 23, 23, 0.035) 0 1px, transparent 1px 76px),
    repeating-linear-gradient(0deg, rgba(23, 23, 23, 0.03) 0 1px, transparent 1px 76px),
    #eef3ef;
  background-size: 160% 160%, 150% 150%, 140% 140%, 76px 76px, 76px 76px, auto;
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 18px clamp(18px, 5vw, 64px);
  background: rgba(255, 255, 255, 0.86);
  position: sticky;
  top: 0;
  backdrop-filter: blur(12px);
  z-index: 10;
}

@keyframes drift-background {
  0% {
    background-position: 0% 0%, 100% 0%, 50% 100%, 0 0, 0 0, 0 0;
  }
  50% {
    background-position: 100% 80%, 0% 90%, 60% 0%, 38px 20px, 20px 38px, 0 0;
  }
  100% {
    background-position: 0% 0%, 100% 0%, 50% 100%, 76px 76px, 76px 76px, 0 0;
  }
}

.brand {
  font-weight: 800;
  text-decoration: none;
}

main {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 80px;
}

.lead {
  max-width: 760px;
  margin-bottom: 40px;
}

h1 {
  font-size: clamp(2rem, 4vw, 4.5rem);
  line-height: 1;
  margin: 0 0 16px;
}

h2, h3 {
  line-height: 1.15;
  margin: 0 0 10px;
}

.article-list {
  display: grid;
  gap: 18px;
}

.article-card,
.admin-row,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.article-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 22px;
  padding: 16px;
}

.article-card img,
.hero-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px;
  background: #e4e4dc;
}

.meta,
.source,
.empty {
  color: var(--muted);
  font-size: 0.92rem;
}

.article-detail {
  max-width: 780px;
  margin: 0 auto;
}

.summary {
  font-size: 1.25rem;
  font-weight: 650;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 32px;
}

.panel,
.admin-row {
  padding: 18px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

form label:not(:first-child) {
  margin-top: 14px;
}

.notice {
  background: #e8f4ef;
  border: 1px solid #b7d9cd;
  border-radius: 8px;
  color: #164b3f;
  font-weight: 700;
  margin-bottom: 18px;
  padding: 12px 14px;
}

.notice.error {
  background: #fff0f1;
  border-color: #e4b6bc;
  color: var(--danger);
}

.notice.inline {
  margin: 12px 0 16px;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  margin-top: 12px;
  padding: 10px 14px;
}

button.danger {
  background: var(--danger);
}

.admin-list {
  display: grid;
  gap: 14px;
}

.admin-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
}

.actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .article-card,
  .admin-grid,
  .admin-row {
    grid-template-columns: 1fr;
  }
}
