:root {
  color-scheme: light;
  --bg: #f6f2ea;
  --ink: #17211f;
  --muted: #66706c;
  --line: #d8d0c2;
  --paper: #fffaf0;
  --paper-strong: #ffffff;
  --accent: #b85c38;
  --accent-dark: #1d4f4a;
  --gold: #d7a74f;
  --shadow: 0 24px 70px rgba(35, 41, 36, 0.11);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
}

.brand img {
  display: block;
  border-radius: 8px;
}

nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

nav a {
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  padding: 9px 12px;
}

nav a:hover {
  background: rgba(29, 79, 74, 0.08);
  color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: inline-flex;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.72);
}

.lang-switch button {
  min-width: 44px;
  min-height: 36px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 0 10px;
}

.lang-switch button:last-child {
  border-right: 0;
}

.lang-switch button.active {
  background: var(--accent-dark);
  color: #fffaf0;
}

main {
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 64px;
  align-items: center;
  width: min(1120px, calc(100% - 40px));
  min-height: 620px;
  margin: 0 auto;
  padding: 34px 0 76px;
}

.eyebrow,
.panel-label,
.tool-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 14px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 700px;
  font-size: 64px;
  line-height: 1.08;
  letter-spacing: 0;
  margin-bottom: 24px;
}

h1 span {
  display: block;
}

h2 {
  font-size: 40px;
  line-height: 1.14;
  margin-bottom: 0;
}

h3 {
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 10px;
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.78;
  margin-bottom: 32px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 750;
  padding: 0 18px;
  white-space: nowrap;
}

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

.button.primary {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fffaf0;
}

.hero-panel {
  border: 1px solid rgba(24, 33, 31, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 250, 240, 0.84)),
    repeating-linear-gradient(90deg, rgba(29, 79, 74, 0.08) 0 1px, transparent 1px 36px),
    repeating-linear-gradient(0deg, rgba(29, 79, 74, 0.08) 0 1px, transparent 1px 36px);
  box-shadow: var(--shadow);
  padding: 32px;
}

.hero-panel h2 {
  font-size: 34px;
  line-height: 1.18;
  margin-bottom: 28px;
}

.status-list {
  display: grid;
  gap: 12px;
}

.status-list span {
  border: 1px solid rgba(29, 79, 74, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.78);
  padding: 13px 14px;
}

.section {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 82px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.post-list {
  display: grid;
  gap: 0;
}

.post {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 28px;
  border-top: 1px solid rgba(216, 208, 194, 0.85);
  padding: 26px 0;
}

.post-list > div {
  display: grid;
  gap: 0;
}

.post:last-child {
  border-bottom: 1px solid rgba(216, 208, 194, 0.85);
}

.post time {
  color: var(--accent);
  font-size: 14px;
  font-weight: 750;
}

.post p,
.tool-card p,
.about p {
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 0;
}

.empty-state {
  color: var(--muted);
  line-height: 1.7;
}

.article-shell {
  width: min(860px, calc(100% - 40px));
  margin: 0 auto;
  padding: 80px 0 110px;
}

.article-page h1 {
  font-size: 56px;
  line-height: 1.12;
  margin-bottom: 16px;
}

.article-page time,
.back-link {
  color: var(--muted);
  display: inline-flex;
  margin-bottom: 34px;
}

.back-link {
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
  padding-bottom: 3px;
}

.article-body {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.86;
}

.article-body h1,
.article-body h2,
.article-body h3 {
  font-size: 28px;
  margin: 42px 0 14px;
}

.article-body a {
  border-bottom: 1px solid var(--accent);
  color: var(--accent-dark);
}

.article-body pre {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 18px;
}

.comments {
  border-top: 1px solid var(--line);
  margin-top: 62px;
  padding-top: 44px;
}

.comments-head {
  margin-bottom: 24px;
}

.comments-head h2 {
  font-size: 34px;
}

.comments-list {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.comment {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.62);
  padding: 18px;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 10px;
}

.comment-meta time,
.comment-status {
  color: var(--muted);
  font-size: 14px;
}

.comment p {
  color: var(--ink);
  line-height: 1.72;
  margin-bottom: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.comment-form {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  padding: 20px;
}

.comment-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 11px 12px;
}

.comment-form textarea {
  resize: vertical;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--accent-dark);
  outline: none;
}

.comment-trap {
  left: -9999px;
  position: absolute;
}

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

.comment-status {
  margin: 0;
}

.posts-page h1 {
  font-size: 54px;
  line-height: 1.12;
  margin-bottom: 0;
}

.admin-body {
  background: #f4f5f0;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0;
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.62fr) minmax(420px, 1.38fr);
  gap: 20px;
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 80px;
}

.admin-list,
.admin-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  padding: 22px;
}

.admin-section-head {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.admin-section-head h1,
.admin-section-head h2 {
  font-size: 28px;
}

.admin-section-head.compact {
  margin-bottom: 18px;
}

.admin-posts {
  display: grid;
  gap: 8px;
}

.admin-post-row {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 13px;
  text-align: left;
}

.admin-post-row:hover {
  border-color: var(--accent-dark);
}

.admin-post-row span {
  font-weight: 750;
}

.admin-post-row small,
.admin-status {
  color: var(--muted);
}

.admin-editor form,
.admin-editor label {
  display: grid;
  gap: 8px;
}

.admin-editor form {
  gap: 16px;
}

.admin-editor input,
.admin-editor textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 11px 12px;
}

.admin-editor textarea {
  resize: vertical;
}

.check-row {
  align-items: center;
  display: flex !important;
  gap: 10px !important;
}

.check-row input {
  width: auto;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button.danger {
  color: #8d332c;
}

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

.tool-card {
  grid-column: span 2;
}

.tool-card {
  display: flex;
  min-height: 238px;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.66);
  padding: 24px;
}

.tool-card.featured {
  background: var(--paper-strong);
  box-shadow: 0 16px 42px rgba(35, 41, 36, 0.08);
}

.about {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 40px;
  padding-bottom: 110px;
}

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

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    min-height: auto;
    padding-top: 42px;
  }

  h1 {
    font-size: 48px;
  }

  h2 {
    font-size: 34px;
  }

  .hero-panel h2 {
    font-size: 30px;
  }

  .article-page h1,
  .posts-page h1 {
    font-size: 44px;
  }

  .comments-head h2 {
    font-size: 30px;
  }

  .tools-grid,
  .about {
    grid-template-columns: 1fr;
  }

  .tool-card {
    grid-column: auto;
  }

  .post {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .site-header,
  .hero,
  .section {
    width: min(100% - 28px, 1120px);
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  nav a {
    padding: 8px 7px;
  }

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

  .lang-switch {
    width: fit-content;
  }

  .lead {
    font-size: 17px;
  }

  h1 {
    font-size: 40px;
  }

  h2,
  .hero-panel h2 {
    font-size: 28px;
  }

  .article-page h1,
  .posts-page h1 {
    font-size: 36px;
  }

  .comments-head h2 {
    font-size: 28px;
  }

  .actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .hero-panel {
    padding: 24px;
  }
}
