:root {
  --bg: #0f1115;
  --bg-soft: #151922;
  --panel: #171b24;
  --panel-2: #1c212c;
  --border: #2a3040;
  --text: #e8e1d6;
  --text-soft: #b6b0a7;
  --text-faint: #8a857e;
  --accent: #b89567;
  --accent-soft: #8f7650;
  --danger: #cf7d7d;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --radius-sm: 12px;
  --content-width: 760px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(184, 149, 103, 0.08), transparent 25%),
    linear-gradient(180deg, #0d1015 0%, #10141b 100%);
  color: var(--text);
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  color: var(--accent);
}

.site-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(15, 17, 21, 0.72);
  border-bottom: 1px solid rgba(184, 149, 103, 0.10);
}

.site-header__inner {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand__link {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  color: var(--text);
}

.brand__subtitle {
  margin: 0.2rem 0 0;
  color: var(--text-faint);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav a,
.nav-button {
  color: var(--text-soft);
  font-size: 0.95rem;
}

.nav-button {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.logout-form {
  margin: 0;
}

.site-main {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 5rem;
}

.page-intro,
.post-detail,
.auth-card {
  width: min(var(--content-width), 100%);
}

.page-intro {
  margin: 0 auto 2.5rem;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.page-title,
.auth-title,
.post-detail__title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.page-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.auth-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
}

.post-detail__title {
  font-size: clamp(2.1rem, 4.2vw, 3.5rem);
}

.page-text,
.auth-text,
.post-detail__meta,
.post-card__meta,
.post-card__excerpt,
.empty-state,
.message {
  color: var(--text-soft);
}

.page-text,
.auth-text {
  margin-top: 0.85rem;
  max-width: 60ch;
}

.post-list {
  width: min(var(--content-width), 100%);
  margin: 0 auto;
  display: grid;
  gap: 1.25rem;
}

.post-card,
.auth-card,
.post-detail,
.empty-state {
  background: linear-gradient(180deg, rgba(23, 27, 36, 0.96), rgba(18, 22, 29, 0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.post-card {
  padding: 1.4rem 1.5rem;
}

.post-card__meta {
  font-size: 0.88rem;
  margin-bottom: 0.45rem;
}

.post-card__title {
  margin: 0 0 0.75rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  line-height: 1.2;
}

.post-card__title a {
  color: var(--text);
}

.post-card__excerpt {
  margin-bottom: 1rem;
}

.post-card__link {
  color: var(--accent);
  font-size: 0.95rem;
}

.post-detail {
  margin: 0 auto;
  padding: 2rem 2rem 2.4rem;
}

.post-detail__header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(184, 149, 103, 0.12);
}

.post-detail__meta {
  margin-top: 1rem;
  font-size: 0.95rem;
}

.post-detail__body {
  font-size: 1.06rem;
  color: var(--text);
}

.post-detail__body p {
  margin: 0 0 1.15rem;
}

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: auto auto 70% 50%;
  width: 420px;
  height: 420px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(184, 149, 103, 0.12), transparent 65%);
  pointer-events: none;
}

.auth-form {
  margin-top: 1.5rem;
  text-align: left;
}

.auth-form button {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.auth-form .button-primary {
  display: block;
  margin: 0.5rem auto 0;
}

.auth-text {
  margin: 0.85rem auto 0;
  max-width: 42ch;
}

.form-row {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.form-row label {
  color: var(--text-soft);
  font-size: 0.95rem;
}

.form-row input {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-row input:focus {
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(184, 149, 103, 0.14);
}

.button-primary {
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  padding: 0.9rem 1.2rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #111;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.button-primary:hover {
  transform: translateY(-1px);
  opacity: 0.96;
  color: #111;
}

.form-errors,
.message {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(207, 125, 125, 0.28);
  background: rgba(207, 125, 125, 0.10);
}

.form-errors p,
.message {
  margin: 0;
}

.messages {
  width: min(var(--content-width), 100%);
  margin: 0 auto 1rem;
}

.empty-state {
  width: min(var(--content-width), 100%);
  margin: 0 auto;
  padding: 1.5rem;
}

@media (max-width: 720px) {
  .site-header__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    flex-wrap: wrap;
  }

  .site-main {
    padding-top: 2rem;
  }

  .auth-card,
  .post-detail,
  .post-card {
    padding: 1.2rem;
  }
}

.post-detail__actions,
.delete-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.button-secondary,
.button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--border);
  cursor: pointer;
  font: inherit;
}

.button-secondary {
  background: transparent;
  color: var(--text);
}

.button-secondary:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
}

.button-danger {
  background: rgba(180, 72, 72, 0.16);
  color: #f2c3c3;
  border-color: rgba(180, 72, 72, 0.35);
}

.button-danger:hover {
  color: #ffd4d4;
  border-color: rgba(220, 100, 100, 0.55);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.2;
  margin: 1.6rem 0 0.8rem;
}

.markdown-body h1:first-child,
.markdown-body h2:first-child,
.markdown-body h3:first-child {
  margin-top: 0;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.4rem;
  margin: 0 0 1.1rem;
}

.markdown-body li {
  margin-bottom: 0.35rem;
}

.markdown-body blockquote {
  margin: 1.25rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 3px solid rgba(184, 149, 103, 0.45);
  color: var(--text-soft);
}

.markdown-body code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.92em;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
}

.markdown-body pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  margin: 1.2rem 0;
}

.markdown-body pre code {
  background: transparent;
  padding: 0;
}

.markdown-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(184, 149, 103, 0.35);
}

.markdown-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}