/* Self-hosted subsets. JetBrains Mono: cyrillic + latin, weights 400 and 600.
   Space Grotesk: latin, weights 600 and 700. SIL Open Font License, see assets/fonts/OFL.txt. */

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-400-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-600-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/space-grotesk-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --accent: #06b6d4;
  --border: #e2e8f0;
  --code-bg: #0f172a;
  --code-text: #f8fafc;
  --warn: #8c5000;
  --warn-bg: #ffdcbf;
  --chip: #0f172a;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --shell: 42.5rem;
  --dock: 4.25rem;
}

html[data-theme="dark"] {
  --bg: #05070a;
  --surface: #0b1016;
  --text: #eaf1ff;
  --muted: #94a3b8;
  --accent: #22d3ee;
  --border: #1e293b;
  --code-bg: #020617;
  --code-text: #eaf1ff;
  --warn: #ffb873;
  --warn-bg: #2d1600;
  --chip: #eaf1ff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body.bezsmi-body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  line-height: 24px;
}

a {
  color: inherit;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent);
}

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

button,
input {
  font: inherit;
  color: inherit;
  border-radius: 0;
}

.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  fill: currentColor;
  flex-shrink: 0;
}

.visually-hidden,
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--dock);
}

.shell {
  width: min(100%, calc(var(--shell) + 2rem));
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.site-header__row,
.dock__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4rem;
  gap: var(--space-sm);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand__logo {
  display: block;
  height: 3.25rem;
  width: auto;
  max-width: min(16.5rem, 100%);
}

html[data-theme="dark"] .brand__logo--light,
html:not([data-theme="dark"]) .brand__logo--dark {
  display: none;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: var(--text);
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--accent);
}

html[data-theme="dark"] .theme-toggle__icon--night,
html:not([data-theme="dark"]) .theme-toggle__icon--day {
  display: none;
}

.site-main {
  flex: 1;
  padding: var(--space-lg) 0 var(--space-xl);
}

.page-head {
  margin-bottom: var(--space-lg);
}

.kicker,
.article__author,
.article__meta,
.feed-item__time,
.feed-item__meta,
.hub__count,
.empty-state__code,
.search-count,
.page-stats,
.section-meta,
.chip-label {
  font-size: 10px;
  line-height: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-title,
.article__title,
.feed-item__title,
.hub__title,
.section-title {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.page-title {
  font-size: 32px;
  line-height: 38px;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.page-lead {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.page-stats {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-md);
  align-items: center;
}

.page-stats .icon,
.feed-item__time .icon,
.feed-item__meta .icon,
.article__meta .icon,
.article__author .icon,
.chip .icon,
.chip-label .icon,
.empty-state__code .icon,
.search-count .icon {
  width: 14px;
  height: 14px;
  margin-right: 0.2rem;
}

.chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-lg);
  scrollbar-width: none;
}

.chips--wrap {
  flex-wrap: wrap;
  overflow: visible;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  padding: 0.4rem 0.65rem;
  text-decoration: none;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.chip.is-active,
.chip:hover {
  background: var(--chip);
  border-color: var(--chip);
  color: var(--bg);
}

.feed-item {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--border);
}

.feed-item__top,
.feed-item__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.feed-item__time,
.feed-item__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.feed-item__title {
  font-size: 18px;
  line-height: 24px;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin: 0.7rem 0;
}

.feed-item__title a {
  display: inline;
  text-decoration: none;
}

.feed-item__excerpt {
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.feed-item__mark {
  color: var(--muted);
}

.tag {
  display: inline-flex;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 2px 6px;
  text-decoration: none;
  letter-spacing: 0.06em;
}

.tag:hover {
  background: var(--accent);
  color: #0f172a;
}

.search-form {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--text);
  background: var(--surface);
  margin-bottom: var(--space-md);
}

.search-form:focus-within {
  border-color: var(--accent);
  border-width: 2px;
}

.search-form__label {
  display: flex;
  align-items: center;
  padding: 0 var(--space-sm) 0 var(--space-md);
}

.search-form__prompt {
  color: var(--accent);
  font-weight: 600;
}

.search-form__input {
  flex: 1;
  border: 0;
  appearance: none;
  background: transparent;
  color: var(--text);
  padding: 0.85rem var(--space-sm);
  outline: none;
}

.search-form__submit {
  border: 0;
  border-left: 1px solid var(--text);
  background: var(--text);
  color: var(--bg);
  padding: 0 0.85rem;
  cursor: pointer;
}

.chip-label {
  display: flex;
  align-items: center;
  margin: 0 0 var(--space-sm);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-md);
  margin: var(--space-lg) 0 var(--space-sm);
}

.section-title {
  font-size: 18px;
  text-transform: uppercase;
}

.hubs {
  display: grid;
}

.hub {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  gap: 0.85rem;
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}

.hub:last-child {
  border-bottom: 1px solid var(--border);
}

.hub__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  color: var(--accent);
}

.hub__body {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.hub__title {
  font-size: 20px;
  line-height: 26px;
}

.hub__text {
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.hub__count {
  white-space: nowrap;
  padding-top: 0.15rem;
}

.hub:hover .hub__title {
  color: var(--accent);
}

.search-count {
  margin-bottom: var(--space-md);
}

.empty-state {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border);
}

.article__meta,
.article__author {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin-bottom: var(--space-md);
}

.article__meta a,
.feed-item__meta a {
  text-decoration: none;
}

.article__title {
  font-size: 32px;
  line-height: 38px;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-md);
}

.article__body > * + * {
  margin-top: var(--space-md);
}

.article__body h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  line-height: 30px;
  margin-top: var(--space-xl);
}

.article__body h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 18px;
  line-height: 24px;
  margin-top: var(--space-lg);
}

.article__body a {
  color: var(--accent);
}

.article__body ul,
.article__body ol {
  padding-left: 1.25rem;
}

.article__body code {
  font-family: inherit;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.1em 0.35em;
}

.bezsmi-warn {
  border: 1px solid var(--warn);
  background: var(--warn-bg);
  color: var(--warn);
  padding: var(--space-md);
}

.bezsmi-warn__label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.bezsmi-warn p {
  color: var(--text);
}

.bezsmi-code {
  background: var(--code-bg);
  color: var(--code-text);
}

.bezsmi-code__meta {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid #334155;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bezsmi-code pre,
.article__body pre {
  margin: 0;
  padding: var(--space-md);
  overflow-x: auto;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 13px;
  line-height: 20px;
}

.article__body pre code {
  background: transparent;
  padding: 0;
}

.bezsmi-steps {
  display: grid;
  gap: var(--space-lg);
}

.bezsmi-step__num {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.pager {
  margin-top: var(--space-xl);
}

.pager .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.pager a,
.pager span {
  display: inline-block;
  border: 1px solid var(--text);
  padding: 0.45rem 0.7rem;
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.05em;
}

.pager .current {
  background: var(--text);
  color: var(--bg);
}

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.dock__row {
  min-height: var(--dock);
}

.dock__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  text-decoration: none;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dock__item.is-active,
.dock__item:hover {
  color: var(--text);
}

@media (min-width: 720px) {
  .page-title,
  .article__title {
    font-size: 32px;
  }
}
