:root {
  color-scheme: dark;
  --bg: #0e0d0c;
  --bg-muted: #171513;
  --panel: #211d19;
  --text: #f0ece5;
  --muted: #b7aea2;
  --faint: #8b8174;
  --line: #3a3129;
  --accent: #c99a55;
  --accent-strong: #e0b268;
  --shadow: rgba(0, 0, 0, 0.65);
  --max: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
}

a {
  color: inherit;
}

.site-header {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 48px);
  background: rgba(14, 13, 12, 0.82);
  border-bottom: 1px solid rgba(240, 236, 229, 0.08);
  backdrop-filter: blur(16px);
}

.brand {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 18px;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
}

.nav a {
  text-decoration: none;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--accent-strong);
}

.hero {
  position: relative;
  min-height: 92svh;
  display: grid;
  align-items: end;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.82) contrast(1.08) brightness(0.78);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(14, 13, 12, 0.92), rgba(14, 13, 12, 0.64) 42%, rgba(14, 13, 12, 0.16)),
    linear-gradient(0deg, rgba(14, 13, 12, 0.88), rgba(14, 13, 12, 0.1) 54%);
}

.hero-content {
  position: relative;
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 160px clamp(20px, 5vw, 48px) 96px;
}

.kicker,
.section-label,
.book-status {
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(54px, 11vw, 136px);
  line-height: 0.9;
  letter-spacing: 0;
  text-shadow: 0 24px 50px var(--shadow);
}

.tagline {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--text);
  font-size: clamp(22px, 3.4vw, 40px);
  line-height: 1.12;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 34px;
  padding: 0 20px;
  background: var(--accent);
  color: #17110b;
  border: 1px solid var(--accent-strong);
  border-radius: 6px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.button:hover,
.button:focus-visible {
  background: var(--accent-strong);
}

.section {
  padding: 86px clamp(20px, 5vw, 48px);
  border-bottom: 1px solid var(--line);
}

.section-muted {
  background: var(--bg-muted);
}

.section-inner {
  width: min(var(--max), 100%);
  margin: 0 auto;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(32px, 7vw, 84px);
  align-items: start;
}

.section-heading {
  max-width: 680px;
  margin-bottom: 28px;
}

h2 {
  margin: 0;
  max-width: 680px;
  font-size: clamp(31px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}

.copy {
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
}

.copy p {
  margin: 0 0 18px;
}

.copy a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.book-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.book-card {
  min-height: 260px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.book-card h3 {
  margin: 0 0 16px;
  font-size: 26px;
  line-height: 1.08;
}

.book-card p:not(.book-status) {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.48;
}

.page-hero {
  padding: 150px clamp(20px, 5vw, 48px) 76px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(14, 13, 12, 0.52), var(--bg)),
    radial-gradient(circle at 78% 18%, rgba(201, 154, 85, 0.12), transparent 32%),
    var(--bg-muted);
}

.diary-hero {
  position: relative;
  background:
    linear-gradient(180deg, rgba(14, 13, 12, 0.32), var(--bg)),
    linear-gradient(90deg, rgba(33, 29, 25, 0.9), rgba(14, 13, 12, 0.72)),
    var(--bg-muted);
}

.diary-hero::after {
  position: absolute;
  inset: auto clamp(20px, 6vw, 72px) 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(224, 178, 104, 0.5), transparent);
  content: "";
}

.page-hero h1,
.entry-header h1,
.admin-intro h1 {
  margin: 0;
  max-width: 840px;
  font-size: clamp(48px, 8vw, 98px);
  line-height: 0.96;
}

.page-copy {
  max-width: 700px;
  margin-top: 28px;
}

.language-row,
.tag-row,
.entry-meta,
.archive-tools,
.admin-toolbar,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.language-row {
  margin-top: 26px;
}

.language-row a,
.text-link,
.diary-preview-card a,
.related-block a {
  color: var(--accent-strong);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 800;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.archive-tools {
  justify-content: flex-end;
  margin-bottom: 22px;
}

.archive-tools label {
  width: min(240px, 100%);
}

label {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

select,
input,
textarea {
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  padding: 9px 11px;
  background: #13110f;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  text-transform: none;
}

textarea {
  line-height: 1.45;
  resize: vertical;
}

.diary-list {
  display: grid;
  gap: 16px;
}

.diary-list-item,
.diary-preview-card,
.empty-state,
.admin-panel,
.admin-role-box {
  background: rgba(33, 29, 25, 0.74);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.diary-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  padding: 24px;
}

.diary-list-item:hover,
.diary-preview-card:hover {
  border-color: rgba(224, 178, 104, 0.42);
}

.diary-list-item time,
.diary-preview-card time,
.entry-meta,
.admin-table,
.status-pill,
.empty-line {
  color: var(--faint);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
}

.diary-list-item h2 {
  margin-top: 8px;
  font-size: clamp(28px, 4vw, 44px);
}

.diary-list-item p,
.diary-preview-card p,
.empty-state p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.52;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  background: rgba(240, 236, 229, 0.06);
  color: var(--muted);
  border: 1px solid rgba(240, 236, 229, 0.1);
  border-radius: 999px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
}

.quiet-button {
  margin-top: 24px;
  background: transparent;
  color: var(--accent-strong);
}

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

.diary-preview-card {
  padding: 20px;
}

.diary-preview-card h3 {
  margin: 8px 0 10px;
  font-size: 25px;
}

.empty-state {
  padding: 34px;
}

.empty-state h2 {
  font-size: clamp(28px, 4vw, 44px);
}

.entry-page {
  padding: 142px clamp(20px, 5vw, 48px) 80px;
}

.entry-shell {
  width: min(780px, 100%);
  margin: 0 auto;
}

.entry-header {
  padding: 32px 0 28px;
  border-bottom: 1px solid var(--line);
}

.entry-meta {
  margin: 18px 0 18px;
}

.entry-body {
  padding: 28px 0;
  color: var(--text);
  font-size: clamp(20px, 2.1vw, 24px);
  line-height: 1.72;
}

.entry-body p {
  margin: 0 0 26px;
}

.entry-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.entry-nav a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.related-block {
  display: grid;
  gap: 10px;
  margin-top: 30px;
}

.related-block h2 {
  font-size: 28px;
}

.admin-body {
  background: #11100f;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 48px);
  background: rgba(14, 13, 12, 0.92);
  border-bottom: 1px solid var(--line);
}

.admin-main {
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: 42px clamp(18px, 4vw, 48px) 80px;
}

.admin-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

.admin-intro p,
.admin-role-box p,
.audit-box p {
  color: var(--muted);
  line-height: 1.5;
}

.admin-role-box,
.admin-panel {
  padding: 22px;
}

.admin-panel {
  margin-bottom: 20px;
}

.admin-toolbar {
  justify-content: flex-end;
  margin-bottom: 18px;
}

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
}

.admin-table th,
.admin-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--text);
  font-size: 12px;
  text-transform: uppercase;
}

.table-note {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.row-button {
  padding: 0;
  background: transparent;
  color: var(--accent-strong);
  border: 0;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.status-pill {
  display: inline-flex;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
}

.status-needs-review {
  border-color: rgba(224, 178, 104, 0.6);
  color: var(--accent-strong);
}

.status-published,
.status-approved {
  border-color: rgba(112, 166, 126, 0.8);
  color: #a6d4b0;
}

.status-rejected,
.status-archived {
  color: #d5a2a2;
}

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

.admin-detail-header h2,
.admin-role-box h2 {
  margin: 0;
  font-size: 28px;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.admin-form .wide {
  grid-column: 1 / -1;
}

.admin-actions {
  margin-top: 18px;
}

.admin-actions button {
  min-height: 38px;
  padding: 0 12px;
  background: #181512;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 800;
}

[data-owner-only] {
  outline: 1px dashed rgba(224, 178, 104, 0.58);
}

.audit-box,
.code-block {
  margin-top: 20px;
  padding: 16px;
  background: #13110f;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.audit-box h3 {
  margin: 0 0 10px;
}

.code-block {
  overflow-x: auto;
  color: var(--muted);
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.route-grid span {
  padding: 12px;
  overflow-wrap: anywhere;
  background: #13110f;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.footer {
  padding: 26px clamp(20px, 5vw, 48px);
  color: var(--faint);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
}

.footer p {
  width: min(var(--max), 100%);
  margin: 0 auto;
}

@media (max-width: 820px) {
  .site-header {
    position: absolute;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero {
    min-height: 88svh;
  }

  .hero-shade {
    background:
      linear-gradient(90deg, rgba(14, 13, 12, 0.94), rgba(14, 13, 12, 0.62)),
      linear-gradient(0deg, rgba(14, 13, 12, 0.9), rgba(14, 13, 12, 0.22) 60%);
  }

  .split,
  .book-row,
  .diary-list-item,
  .admin-intro,
  .admin-form,
  .route-grid {
    grid-template-columns: 1fr;
  }

  .entry-nav {
    grid-template-columns: 1fr;
  }

  .section {
    padding-top: 66px;
    padding-bottom: 66px;
  }

  .book-card {
    min-height: 0;
  }
}
