:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #74706a;
  --paper: #f6f2ec;
  --surface: #fffdf9;
  --line: #e5ded4;
  --accent: #bc4b36;
  --accent-dark: #813222;
  --soft: #ece4d8;
  --shadow: 0 14px 38px rgba(31, 26, 20, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.82), rgba(246, 242, 236, 0.96)),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-weight: 700;
  padding: 0 18px;
}

button:hover {
  background: var(--accent-dark);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 850;
  letter-spacing: 0;
}

.brand img {
  width: 30px;
  height: 30px;
}

.admin-toggle {
  min-height: 38px;
  background: rgba(255, 253, 249, 0.72);
  border: 1px solid var(--line);
  color: var(--ink);
  padding-inline: 15px;
}

.hero {
  min-height: 42vh;
  display: flex;
  align-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(188, 75, 54, 0.13), transparent 32%),
    linear-gradient(135deg, #fffdf9 0%, #ede3d7 100%);
  color: var(--ink);
}

.hero-inner {
  width: min(780px, calc(100% - 36px));
  margin: 0 auto;
  padding: 56px 0 48px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: var(--accent);
}

h1,
h2 {
  margin: 0;
  line-height: 1;
  letter-spacing: 0;
}

h1 {
  max-width: 11ch;
  font-size: clamp(3.6rem, 13vw, 7.8rem);
  overflow-wrap: anywhere;
  font-weight: 900;
}

h2 {
  font-size: clamp(1.55rem, 4vw, 2.55rem);
  font-weight: 850;
}

.tagline {
  width: min(520px, 100%);
  margin: 18px 0 0;
  font-size: clamp(1.04rem, 2.1vw, 1.35rem);
  color: var(--muted);
}

.admin-panel,
.posts-section {
  width: min(780px, calc(100% - 36px));
  margin: 0 auto;
}

.admin-panel {
  padding: 28px 0 0;
}

.login-form,
.post-form {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.inline-controls {
  display: flex;
  gap: 10px;
}

.inline-controls input {
  flex: 1;
}

label {
  color: var(--muted);
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--ink);
  padding: 12px 14px;
}

input[type="file"] {
  padding: 10px;
}

textarea {
  resize: vertical;
}

.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ghost-button {
  background: white;
  border: 1px solid var(--line);
  color: var(--ink);
}

.form-message {
  min-height: 1.5em;
  margin: 0;
  color: var(--muted);
}

.posts-section {
  padding: 34px 0 72px;
}

.section-heading {
  margin-bottom: 16px;
}

.posts {
  display: grid;
  gap: 18px;
}

.post {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.post-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.post h3 {
  margin: 0;
  font-size: clamp(1.22rem, 3vw, 1.75rem);
  line-height: 1.16;
  font-weight: 850;
}

.post time {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.post-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
}

.post-actions button {
  min-height: 36px;
  padding: 0 14px;
}

.edit-date-form {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.edit-date-form label {
  font-size: 0.88rem;
}

.post-body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 1.02rem;
}

.attachments {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.attachment {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #151515;
}

.attachment img,
.attachment video {
  display: block;
  width: 100%;
  max-height: 640px;
  object-fit: contain;
}

.delete-button {
  flex: 0 0 auto;
  min-height: 36px;
  background: var(--accent);
  padding: 0 14px;
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.66);
}

.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .site-header {
    padding: 12px 14px;
  }

  .brand {
    font-size: 0.98rem;
  }

  .brand img {
    width: 28px;
    height: 28px;
  }

  .admin-toggle {
    min-height: 36px;
    padding-inline: 12px;
    font-size: 0.92rem;
  }

  .hero {
    min-height: auto;
  }

  .hero-inner {
    width: min(100% - 28px, 780px);
    padding: 42px 0 32px;
  }

  h1 {
    font-size: clamp(3rem, 18vw, 4.7rem);
  }

  .tagline {
    margin-top: 14px;
  }

  .admin-panel,
  .posts-section {
    width: min(100% - 24px, 780px);
  }

  .inline-controls,
  .admin-bar,
  .post-header {
    align-items: stretch;
    flex-direction: column;
  }

  .post-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .login-form,
  .post-form,
  .post {
    border-radius: 16px;
  }

  .post {
    padding: 16px;
  }

  .attachment img,
  .attachment video {
    max-height: 72vh;
  }
}
