/* Шкура для чтения сетки: зоны, отступы, тёмная/светлая тема по системе */

:root {
  color-scheme: dark light;
  --bg: #0a0e14;
  --bg-elevated: #121922;
  --border: rgba(148, 163, 184, 0.2);
  --text: #e8edf4;
  --muted: #8b9cb3;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --accent-dim: rgba(34, 211, 238, 0.12);
  --radius: 14px;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --max: 46rem;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #eef2f8;
    --bg-elevated: #fff;
    --border: rgba(15, 23, 42, 0.1);
    --text: #0f172a;
    --muted: #475569;
    --accent: #0891b2;
    --accent-2: #6d28d9;
    --accent-dim: rgba(8, 145, 178, 0.12);
    --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background:
    linear-gradient(rgba(10, 14, 20, 0.7), rgba(10, 14, 20, 0.7)),
    url('/images/background.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

/* ——— шапка ——— */
.site-header {
  flex-shrink: 0;
  padding: 0.65rem 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(18, 25, 34, 0.65);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

@media (prefers-color-scheme: light) {
  .site-header {
    background: rgba(255, 255, 255, 0.82);
  }
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

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

.lang-switch {
  display: inline-flex;
  align-items: stretch;
}

/* Сегменты как «пилюля» под бейджем (GitHub-подобный контраст) */
.lang-switch--segmented {
  border-radius: 999px;
  border: 1px solid #30363d;
  background: #161b22;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.lang-switch__segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.72rem;
  border: 0;
  border-right: 1px solid #30363d;
  margin: 0;
  text-decoration: none;
  color: #c9d1d9;
  background: transparent;
  transition: background 0.12s ease, color 0.12s ease;
}

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

.lang-switch__segment:hover:not(.lang-switch__segment--active) {
  background: rgba(148, 163, 184, 0.1);
  color: #f0f6fc;
}

.lang-switch__segment--active {
  background: rgba(255, 255, 255, 0.07);
  color: #f0f6fc;
  pointer-events: none;
}

@media (prefers-color-scheme: light) {
  .lang-switch--segmented {
    border-color: var(--border);
    background: var(--bg-elevated);
  }

  .lang-switch__segment {
    border-right-color: var(--border);
    color: var(--muted);
  }

  .lang-switch__segment:hover:not(.lang-switch__segment--active) {
    color: var(--text);
    background: rgba(15, 23, 42, 0.06);
  }

  .lang-switch__segment--active {
    color: var(--text);
    background: var(--accent-dim);
  }
}

.site-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.site-title a {
  color: inherit;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.site-title a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.site-badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: linear-gradient(135deg, var(--accent-dim), rgba(167, 139, 250, 0.08));
}

/* ——— hero визитка ——— */
.hero {
  position: relative;
  padding: 1.5rem 1.35rem 1.75rem;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--border);
  background: rgba(18, 25, 34, 0.4);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero__glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 70%;
  background: radial-gradient(ellipse at 30% 0%, rgba(34, 211, 238, 0.2), transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(167, 139, 250, 0.15), transparent 50%);
  pointer-events: none;
}

.hero__top {
  position: relative;
  display: flex;
  gap: 1.35rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.hero__avatar {
  flex-shrink: 0;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
  color: var(--bg);
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 28px rgba(34, 211, 238, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero__lead {
  flex: 1;
  min-width: min(100%, 16rem);
}

.hero__role {
  margin: 0 0 0.35rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.hero__name {
  margin: 0 0 0.65rem;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero__tagline {
  margin: 0 0 1.15rem;
  font-size: 1.02rem;
  color: var(--muted);
  max-width: 36rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.hero__hint {
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 100%;
}

.hero__hint code {
  font-size: 0.78em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  color: #042f2e;
  background: linear-gradient(135deg, var(--accent), #5eead4);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.25);
}

.btn--primary:hover {
  box-shadow: 0 6px 22px rgba(34, 211, 238, 0.35);
}

.btn--ghost {
  color: var(--text);
  border-color: var(--border);
  background: rgba(148, 163, 184, 0.06);
}

.btn--ghost:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* ——— три колонки «чем полезен» ——— */
.pillars {
  margin: 0;
}

.pillars__grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
}

.pillar-card {
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.pillar-card:hover {
  border-color: rgba(34, 211, 238, 0.45);
  transform: translateY(-2px);
}

.pillar-card__title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.pillar-card__body {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
}

.section-heading {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.hero__comp {
  margin: -0.35rem 0 1rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent-2);
}

/* опыт — карточки ролей */
.cv-roles {
  margin: 0;
}

.cv-roles__grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
}

.role-card {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
}

.role-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.role-card__org {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}

.role-card__period {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
}

.role-card__title {
  margin: 0 0 0.2rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.role-card__place {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.role-card__line {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}

/* стек — чипы */
.skills {
  margin: 0;
}

.skills__chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.skills__chip {
  margin: 0;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-family: var(--mono);
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
}

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

/* ——— основной столбец ——— */
.site-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* карточка контента: видно границу блока */
.panel {
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.panel--intro :first-child {
  margin-top: 0;
}

.panel :last-child {
  margin-bottom: 0;
}

/* список постов: сетка «плиток» */
.post-roll__title {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.post-list__item {
  margin: 0;
}

.post-list__link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  align-items: baseline;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.04);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.post-list__link:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-1px);
}

.post-list__link-title {
  font-weight: 600;
}

.post-list__link-date {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

/* статья */
.article-panel .article-title {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.article-meta {
  margin: 0 0 1.25rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
}

.article-body :where(h2, h3) {
  margin-top: 1.5rem;
  letter-spacing: -0.02em;
}

.article-body :where(p, ul, ol) {
  margin: 0.75rem 0;
}

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

code,
.article-body code {
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 0.12em 0.35em;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.12);
}

/* секция /posts */
.section-title {
  margin: 0 0 1rem;
  font-size: 1.35rem;
}

/* подвал: зона видна */
.site-footer {
  flex-shrink: 0;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
  justify-content: space-between;
}

.site-footer kbd {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.site-footer__stack {
  font-family: var(--mono);
  font-size: 0.72rem;
  opacity: 0.85;
}
