:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #666;
  --card: #f4f4f5;
  --border: #e4e4e7;
  --link: #2563eb;

  --code-bg: #0f172a;
  --code-text: #e5e7eb;

  --quote-bg: #f8fafc;
  --quote-border: #3b82f6;
}

:root[data-theme="dark"] {
  --bg: #202020;
  --text: #e6e6e6;
  --muted: #b3b3b3;
  --card: #2c2c2c;
  --border: #3a3a3a;
  --link: #7bb6ff;

  --code-bg: #1f1f1f;
  --code-text: #e6e6e6;

  --quote-bg: #262626;
  --quote-border: #60a5fa;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font:
    16px/1.6 system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--text);
  text-decoration: none;
  transition: all 200ms ease;
}
a:hover {
  color: var(--link);
}

hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

blockquote {
  border-left: 4px solid var(--quote-border);
  background: var(--quote-bg);
  padding: 1rem 1.1rem;
  border-radius: 6px;
  margin: 18px 0;
}

blockquote p {
  margin-bottom: 0 !important;
}

.wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content {
  flex: 1;
}

.container {
  flex: 1;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 36px;
}

/* Header */
.header {
  width: 100%;
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
}

.logo {
  width: 24px;
  height: 24px;
  border-radius: 2px;
}

.nav__wrapper {
	display: flex;
	gap: 24px;
}

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

.nav__link {
  color: var(--text);
  font-weight: 500;
  opacity: 0.85;
}
.nav__link:hover {
  opacity: 1;
  text-decoration: none;
}

.theme-toggle {
  border: none;
  background: transparent;
  color: var(--text);
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 10px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  transition:
    background-color 200ms ease,
    border-color 200ms ease,
    color 200ms ease;
}

.theme-toggle:hover {
  background: var(--card);
}

.theme-toggle__icon svg {
  width: 20px;
  height: 20px;
}

.theme-toggle__icon--sun {
  display: none;
}
.theme-toggle__icon--moon {
  display: inline-flex;
}

:root[data-theme="dark"] .theme-toggle__icon--sun {
  display: inline-flex;
}
:root[data-theme="dark"] .theme-toggle__icon--moon {
  display: none;
}

/* Footer */
.footer {
  width: 100%;
}
.footer__inner {
  display: flex;
  justify-content: center;
  padding: 22px 0;
  color: var(--muted);
}

/* Home hero */
.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60vh;
  gap: 16px;
}

.home-name {
  font-size: 3rem;
  font-weight: 700;
  margin: 0;
}

.home-description {
  font-size: 1.25rem;
  color: var(--muted);
  margin: 0;
}

.home-socials {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

.home-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text); /* дефолтный цвет иконки */
  transition:
    color 200ms ease,
    transform 150ms ease;
}

.home-socials a:hover {
  color: var(--link); /* подсветка при наведении */
}

/* Иконки SVG */
.home-socials svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Post header */
.post__header {
  padding-bottom: 24px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border);
}

.post__title {
  font-size: 30px;
  line-height: 1.2;
}

.post__description {
  margin: 0 0 14px;
  color: var(--muted);
  max-width: 760px;
}

.post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Lucide icons (stroke-based) */
.icon,
.lucide {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--muted);
  flex: 0 0 auto;
}

/* Tags under meta with border */
.post__tags {
  margin-top: 14px;
  padding-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
}
.tag:hover {
  background: var(--card);
  color: var(--muted);
  text-decoration: none;
}

/* Prose (article content) */
.prose {
  max-width: 760px;
  font-size: 17px;
}

.prose p {
  margin: 0 0 14px;
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
  margin: 0 0 14px;
}

.prose code {
  font-family:
    SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  font-size: 0.95em;
  background: rgba(148, 163, 184, 0.14);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.prose pre {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--code-bg);
  color: var(--code-text);
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.prose pre code {
  background: none;
  padding: 0;
}

/* List (blog/projects list) */
.postlist {
  display: flex;
  flex-direction: column;
}

.postitem {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.postitem:last-child {
  border-bottom: none;
}

.postitem__title {
  font-weight: 500;
  color: var(--text);
}

.postitem__date {
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}

.postitem:hover .postitem__title {
  color: var(--link);
}

/* Desktop by default */
.nav--desktop {
  display: flex;
}
.burger {
  display: none;
}

/* burger button */
.burger__btn {
  list-style: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.burger__btn::-webkit-details-marker {
  display: none;
}
.burger__btn:hover {
  background: var(--card);
}

.burger__btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* panel (desktop/tablet dropdown default) */
.burger__panel {
  position: absolute;
  right: 20px;
  top: 64px;
  min-width: 220px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.burger__link {
  padding: 10px 10px;
  border-radius: 10px;
  color: var(--text);
}
.burger__link:hover {
  background: var(--card);
  color: var(--text);
}

/* header inside burger panel (for theme icon) */
.burger__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.burger__head div {
  display: flex;
}

.burger__title {
  font-weight: 600;
  color: var(--text);
}

/* Burger close button */
.burger__close {
  list-style: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--text); /* важно! чтобы SVG получил цвет темы */
  transition: background-color 200ms ease, color 200ms ease;
}

.burger__close:hover {
  background: var(--card);
}

.burger__close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor; /* теперь берёт цвет из родителя */
  fill: none;
  stroke-width: 2;
}

.burger__theme-iconbtn {
  flex: 0 0 auto;
}

/* Tablet <= 768px */
@media (max-width: 768px) {
  .header__inner {
    padding: 16px 0;
    gap: 12px;
  }

  .nav {
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .post__title {
    font-size: 26px;
  }

  .prose {
    font-size: 16px;
  }
  .prose pre {
    font-size: 13px;
  }
}

/* Mobile <= 520px */
@media (max-width: 520px) {
  .container {
    padding: 20px 14px;
  }

	.nav__wrapper {
		gap: 8px;
	}

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

  .postitem {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 0;
  }

  .postitem__date {
    font-size: 13px;
  }

  .post__meta {
    gap: 10px 12px;
  }

  .post__title {
    font-size: 24px;
  }

  .nav--desktop {
    display: none;
  }

  .burger {
    display: block;
  }

  /* panel becomes a top sheet */
  .burger__panel {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;

    margin: 0;
    min-width: 0;
    border-radius: 0 0 14px 14px;

    padding: 20px 14px 14px;
    background: var(--bg);
    border: none;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);

    transform: translateY(-110%);
    transition: transform 220ms ease;
    z-index: 1000;
  }

  .burger[open] .burger__panel {
    transform: translateY(0);
  }
}

/* Small mobile <= 360px */
@media (max-width: 360px) {
  .brand {
    letter-spacing: 0.02em;
  }
  .theme-toggle {
    width: 34px;
    height: 34px;
  }
  .theme-toggle__icon svg {
    width: 16px;
    height: 16px;
  }
}
