:root {
  --bg: #0f0f0f;
  --panel: #171717;
  --panel-2: #202020;
  --text: #f3f0ea;
  --muted: #b7b0a6;
  --line: #34312d;
  --accent: #f2f0ea;
  --danger: #c14b4b;
  --success: #6fbf73;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }

a:hover { opacity: .8; }

.site-header {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 22px 12px;
}

.site-title {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  letter-spacing: .02em;
}

.hero {
  max-width: 920px;
  margin: 0 auto;
  padding: 64px 22px 24px;
}

.hero h1 {
  font-size: clamp(2.4rem, 8vw, 5rem);
  line-height: .98;
  margin: 0 0 18px;
  letter-spacing: -.05em;
}

.hero p:not(.eyebrow) {
  max-width: 640px;
  color: var(--muted);
  font-size: 1.15rem;
}

.page-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 22px 72px;
}

.article {
  max-width: 760px;
}

.article h1 {
  font-size: clamp(2.25rem, 6vw, 4.25rem);
  line-height: 1;
  margin: 0 0 18px;
  letter-spacing: -.04em;
}

.description {
  font-size: 1.2rem;
  color: var(--muted);
  margin: 0 0 16px;
}

.meta, .eyebrow {
  color: var(--muted);
  font-size: .9rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
  margin: 0 0 12px;
}

.content {
  margin-top: 42px;
}

.content h2 {
  font-size: 2rem;
  line-height: 1.15;
  margin: 44px 0 12px;
}

.content h3 {
  font-size: 1.45rem;
  margin: 34px 0 10px;
}

.content p, .content li {
  font-size: 1.06rem;
}

.content blockquote {
  border-left: 4px solid var(--accent);
  margin: 32px 0;
  padding: 6px 0 6px 22px;
  color: var(--muted);
}

.content pre {
  overflow-x: auto;
  background: #080808;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
}

.content code {
  background: #080808;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

.content pre code {
  border: 0;
  padding: 0;
}

.content table, .admin-table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin: 18px 0;
}

.card h2 {
  margin: 0 0 8px;
  line-height: 1.1;
}

.card h2 a {
  text-decoration: none;
}

.admin-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 22px 80px;
}

.admin-wrap.narrow {
  max-width: 520px;
  padding-top: 15vh;
}

.admin-nav {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  margin-bottom: 28px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  margin: 20px 0;
}

label {
  display: block;
  font-weight: 700;
  margin: 12px 0 6px;
}

input[type="password"], input[type="file"] {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}

button {
  background: var(--accent);
  color: #090909;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 12px;
}

button:hover { opacity: .85; }
button.danger { background: var(--danger); color: #fff; }

.inline-form {
  display: inline;
}

.inline-form button {
  margin: 0;
  padding: 6px 10px;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.flash {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  margin: 14px 0;
}

.flash.success { border-color: var(--success); }
.flash.error { border-color: var(--danger); }

.preview-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.preview-frame {
  width: 100%;
  min-height: 780px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 720px) {
  .admin-table, .admin-table thead, .admin-table tbody, .admin-table th, .admin-table td, .admin-table tr {
    display: block;
  }

  .admin-table thead { display: none; }
  .admin-table tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    margin: 12px 0;
    padding: 10px;
  }

  .admin-table td { border: 0; padding: 6px 0; }
}

.admin-footer {
  color: var(--muted);
  font-size: .85rem;
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.editor-header {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.editor-header h2 {
  margin: 0 0 6px;
}

textarea {
  width: 100%;
  min-height: 640px;
  resize: vertical;
  background: #080808;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  font: 15px/1.6 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.publish-from-editor {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 20px;
}

@media (max-width: 720px) {
  .editor-header {
    display: block;
  }

  textarea {
    min-height: 520px;
  }
}

.dashboard-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.action-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
}

.action-card h3 {
  margin: 0 0 8px;
}

.button-link {
  display: inline-block;
  background: var(--accent);
  color: #090909;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 800;
  text-decoration: none;
  margin-top: 12px;
}

@media (max-width: 720px) {
  .dashboard-actions-grid {
    grid-template-columns: 1fr;
  }
}

.public-nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.public-nav a,
.terms a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  text-decoration: none;
  color: var(--text);
  background: var(--panel-2);
  font-size: .86rem;
}

.terms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
}

.terms.compact {
  margin-top: 12px;
}

.eyebrow a {
  color: var(--muted);
  text-decoration: none;
}

.taxonomy-heading {
  margin-bottom: 28px;
}

.taxonomy-heading h1,
.article > h1 {
  margin-top: 0;
}

.taxonomy-list,
.admin-term-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}

.taxonomy-list li,
.admin-term-list li {
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.admin-term-list {
  margin-top: 12px;
}

.admin-term-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* Bonumark editor */
.editor-panel {
  padding: 28px;
}

.editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.editor-header h2 {
  margin: 0 0 8px;
  line-height: 1.15;
}

.editor-form {
  margin-top: 20px;
}

textarea,
.editor-form textarea,
textarea#markdown {
  display: block;
  width: 100%;
  min-height: 68vh;
  background: #080808;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 1rem;
  line-height: 1.65;
  resize: vertical;
  tab-size: 2;
  outline: none;
}

textarea:focus,
.editor-form textarea:focus,
textarea#markdown:focus {
  border-color: var(--accent);
}

.editor-actions,
.publish-from-editor {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.editor-actions button,
.publish-from-editor button {
  margin-top: 0;
}

.publish-from-editor {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.admin-footer {
  color: var(--muted);
  margin-top: 26px;
}

.flash {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: var(--panel-2);
}

.flash.success {
  border-color: var(--success);
}

.flash.error {
  border-color: var(--danger);
}

@media (max-width: 760px) {
  .editor-header {
    display: block;
  }

  textarea,
  .editor-form textarea,
  textarea#markdown {
    min-height: 62vh;
    font-size: .95rem;
  }
}

/* Bonumark account area */
input[type="text"],
input[type="password"],
input[type="file"] {
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus {
  outline: none;
  border-color: var(--accent);
}

.settings-form {
  max-width: 720px;
}

.field-help {
  color: var(--muted);
  font-size: .88rem;
  margin: 4px 0 14px;
}

.admin-user {
  color: var(--muted);
  font-size: .9rem;
  text-align: right;
  margin-bottom: 8px;
}

.admin-user strong {
  color: var(--text);
}

.admin-user span {
  color: var(--muted);
}
