@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=Source+Sans+3:wght@400;500;600&display=swap");

:root {
  --bg: #0a090b;
  --bg-elev: #141019;
  --panel: #17131c;
  --text: #f2efe9;
  --muted: #b3a79c;
  --accent: #d7b98a;
  --accent-strong: #caa46a;
  --danger: #d68a8a;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 18px;
  --font-serif: "Cormorant Garamond", serif;
  --font-sans: "Source Sans 3", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(900px circle at 15% -15%, rgba(215, 185, 138, 0.16) 0%, rgba(10, 9, 11, 0) 55%),
    radial-gradient(700px circle at 85% 0%, rgba(146, 109, 86, 0.12) 0%, rgba(10, 9, 11, 0) 60%),
    #0a090b;
  font-family: var(--font-serif);
}

.backdrop {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 35%),
    radial-gradient(1000px circle at 50% 10%, rgba(255, 236, 204, 0.06), rgba(0, 0, 0, 0) 70%);
  opacity: 0.6;
  pointer-events: none;
  z-index: -1;
}

.shell {
  max-width: 620px;
  margin: 0 auto;
  padding: 34px 22px 70px;
  animation: fadeIn 0.6s ease;
  position: relative;
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 2px 0 24px;
}

.panel {
  background: rgba(23, 19, 28, 0.7);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 22px 30px;
}

.panel h1 {
  margin: 0 0 6px;
  font-size: 1.9rem;
}

.panel-sub {
  margin: 0 0 18px;
  color: var(--muted);
}

.alert {
  background: rgba(227, 118, 118, 0.12);
  border: 1px solid rgba(227, 118, 118, 0.3);
  color: var(--danger);
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.flash {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.flash-item {
  padding: 10px 12px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

.flash-item.success {
  background: rgba(120, 198, 152, 0.12);
  color: #9fe5c1;
}

.flash-item.error {
  background: rgba(227, 118, 118, 0.12);
  color: var(--danger);
}

.login-form,
.composer form,
.edit-panel form {
  display: grid;
  gap: 12px;
}

label {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #0d0b10;
  color: var(--text);
  padding: 12px 14px;
  font-size: 1.06rem;
  font-family: var(--font-serif);
}

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

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(243, 179, 94, 0.6);
  box-shadow: 0 0 0 3px rgba(243, 179, 94, 0.2);
}

button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-family: var(--font-sans);
  font-weight: 600;
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  color: var(--text);
  border-color: rgba(215, 185, 138, 0.5);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.button.danger {
  background: rgba(214, 138, 138, 0.12);
  color: var(--danger);
  border: 1px solid rgba(214, 138, 138, 0.45);
}

.composer {
  margin-bottom: 30px;
}

.composer h2 {
  margin: 0 0 12px;
  font-size: 0.86rem;
  font-family: var(--font-sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(215, 185, 138, 0.2);
  background: rgba(215, 185, 138, 0.08);
}

.composer-actions {
  display: flex;
  justify-content: flex-end;
}

.posts {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post {
  padding: 18px 0 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0;
  transform: translateY(6px);
  animation: rise 0.5s ease forwards;
  animation-delay: calc(var(--i) * 70ms);
}

.post:last-child {
  border-bottom: none;
}

.post-meta {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.post-body {
  line-height: 1.75;
  font-size: 1.1rem;
}

.post-body p + p {
  text-indent: 1.2em;
}

.post-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(216, 183, 132, 0.4);
}

.post-body a:hover {
  color: #f2d3a2;
}

.post-body pre {
  background: #0a090b;
  padding: 14px;
  border-radius: 12px;
  overflow-x: auto;
  border: 1px solid var(--border);
}

.post-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.edit-panel summary {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 10px;
}

.edit-actions {
  display: flex;
  justify-content: flex-end;
}

.empty {
  color: var(--muted);
  font-family: var(--font-sans);
}

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

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 720px) {
  .shell {
    padding: 48px 32px 90px;
  }

  .post-actions {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }

  .edit-panel {
    flex: 1;
  }
}
