.about-layout {
  display: grid;
  gap: clamp(1.35rem, 4vw, 2.25rem);
  align-items: start;
}

@media (min-width: 768px) {
  .about-layout {
    grid-template-columns: minmax(0, 1fr) minmax(168px, min(22vw, 228px));
    gap: clamp(1.75rem, 4.5vw, 2.75rem);
  }
}

.about-copy {
  min-width: 0;
}

.about .content {
  max-width: 42rem;
  color: var(--text-muted-2);
  font-size: clamp(0.875rem, 2vw, 0.9375rem);
}

.about .content p {
  margin: 0 0 0.85rem;
}

.about .content p:first-of-type {
  color: var(--text);
  font-size: clamp(0.9375rem, 2.1vw, 1.02rem);
  line-height: 1.55;
}

.about .content p:last-child {
  margin-bottom: 0;
}

.about-photo {
  margin: 0;
  justify-self: center;
  width: min(100%, 200px);
}

.about-photo picture {
  display: block;
  width: 100%;
}

@media (min-width: 768px) {
  .about-photo {
    justify-self: end;
    width: 100%;
    position: sticky;
    top: calc(var(--scroll-offset, 64px) + 12px);
  }
}

.about-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center center;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border);
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--accent) 12%, transparent),
    0 20px 48px -12px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .about-photo img {
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--accent) 18%, transparent),
    0 16px 40px -8px rgba(15, 23, 42, 0.12);
}

/* Таймлайн */
.timeline {
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-left: clamp(24px, 4vw, 32px);
  padding-bottom: clamp(20px, 4vw, 28px);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 10px var(--accent-glow);
}

.timeline-company {
  font-weight: 600;
  font-size: clamp(0.9375rem, 2.2vw, 1rem);
  margin-bottom: 2px;
}

.timeline-role {
  color: var(--text-muted);
  font-size: clamp(0.8125rem, 2vw, 0.875rem);
  margin-bottom: 4px;
}

.timeline-period {
  color: var(--text-muted-2);
  font-size: 0.8125rem;
  margin-bottom: 8px;
}

.timeline-achievements {
  color: var(--text-muted-2);
  font-size: clamp(0.8125rem, 2vw, 0.875rem);
}

.timeline-achievements ul {
  margin: 0;
  padding-left: 1.2rem;
}

.timeline-achievements li {
  margin-bottom: 0.35em;
}

/* Bento: проекты — 1 / 2 колонки */
.bento {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.bento--projects {
  gap: 14px;
}

@media (min-width: 640px) {
  .bento--projects {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
}

.bento-card.panel-2 {
  grid-column: span 1;
}

@media (min-width: 640px) {
  .bento-card.panel-2 {
    grid-column: span 2;
  }
}

.bento-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-card);
}

.bento-card:hover {
  background: var(--card-hover);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  box-shadow: var(--shadow-card), 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
}

/* Пет-проект: на всю ширину сетки, пунктир, бейдж */
.bento-card--pet {
  position: relative;
  border-style: dashed;
  border-color: color-mix(in srgb, var(--accent) 32%, var(--border));
  background: linear-gradient(
    165deg,
    color-mix(in srgb, var(--accent-dim) 45%, var(--card)) 0%,
    var(--card) 55%
  );
}

.bento-card--pet:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
}

.pet-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 3;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-dim) 90%, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  padding: 4px 10px;
  border-radius: 999px;
  pointer-events: none;
}

.bento-preview {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--preview-bg);
  border-bottom: 1px solid var(--border);
}

.bento-preview svg {
  width: 44px;
  height: 44px;
  opacity: 0.55;
  color: var(--text-muted);
}

.bento-body {
  padding: 14px 16px 16px;
}

.bento-title {
  font-weight: 600;
  font-size: clamp(0.9375rem, 2.2vw, 1rem);
  margin-bottom: 6px;
}

.bento-desc {
  color: var(--text-muted);
  font-size: clamp(0.75rem, 2vw, 0.8125rem);
  line-height: 1.45;
  margin: 0;
}

.bento-desc-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: clamp(0.75rem, 2vw, 0.8125rem);
  line-height: 1.4;
}

.bento-desc-list li {
  margin-bottom: 0.3em;
}

.bento-card-detail .bento-preview {
  min-height: 200px;
  height: auto;
  position: relative;
  background: var(--preview-bg);
}

.bento-card-detail .bento-preview.im-preview {
  min-height: 240px;
  height: auto;
}

.bento-card-detail .bento-preview img {
  width: 100%;
  height: auto;
  max-height: min(52vh, 360px);
  object-fit: contain;
  object-position: center top;
  display: block;
}

.bento-card-detail .bento-preview .bento-preview-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--preview-bg);
}

.bento-card-detail .bento-body {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--border);
}

.bento-card-detail .bento-title {
  font-size: clamp(1rem, 2.4vw, 1.125rem);
  margin-bottom: 10px;
}

.bento-context {
  color: var(--text-muted-2);
  font-size: clamp(0.8125rem, 2vw, 0.875rem);
  line-height: 1.5;
  margin-bottom: 12px;
}

.bento-context--tight {
  margin-bottom: 0;
}

.bento--projects .bento-card-detail .bento-preview {
  min-height: 0;
}

.bento--projects .bento-card-detail .bento-preview img {
  max-height: min(32vh, 200px);
}

.bento--projects .bento-card-detail .tvs-preview {
  min-height: 180px;
  max-height: min(38vh, 240px);
  overflow: hidden;
}

.bento--projects .bento-card-detail .tvs-pane {
  max-height: min(38vh, 240px);
}

/* Вертикальная колонка на узком экране: не душим высоту — иначе min-height:auto у grid
   раздувает панели и превью наезжает на текст карточки */
@media (max-width: 479px) {
  .bento--projects .bento-card-detail .tvs-preview {
    max-height: none;
    overflow: visible;
  }

  .bento--projects .bento-card-detail .tvs-pane {
    max-height: none;
  }
}

.bento--projects .bento-detail ul {
  margin-bottom: 10px;
}

.bento--projects .bento-detail h4 {
  margin-top: 10px;
}

.bento--projects .bento-detail h4:first-of-type {
  margin-top: 0;
}

.bento-detail h4 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bento-detail ul {
  margin: 0 0 12px;
  padding-left: 1.15rem;
  color: var(--text-muted-2);
  font-size: clamp(0.75rem, 2vw, 0.8125rem);
  line-height: 1.45;
}

.bento-detail ul:last-child {
  margin-bottom: 0;
}

.bento-func-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px 12px;
  margin-bottom: 12px;
}

.bento-func-list span {
  font-size: clamp(0.75rem, 2vw, 0.8125rem);
  color: var(--text-muted-2);
}

.bento-role {
  font-size: clamp(0.75rem, 2vw, 0.8125rem);
  color: var(--text-muted-2);
  line-height: 1.45;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ТВС превью */
.tvs-preview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  min-height: 200px;
  min-width: 0;
  background: var(--preview-bg);
}

@media (min-width: 480px) {
  .tvs-preview {
    grid-template-columns: 1fr 1fr;
    min-height: 260px;
  }

  .tvs-pane {
    border-right: 1px solid var(--border);
    border-bottom: none;
  }

  .tvs-pane:last-child {
    border-right: none;
  }
}

.tvs-pane {
  padding: 10px 12px;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  font-size: 0.65rem;
  line-height: 1.35;
  border-bottom: 1px solid var(--border);
  max-height: min(45vh, 320px);
}

.tvs-pane:last-child {
  border-bottom: none;
}

.tvs-intro-title {
  font-weight: 700;
  font-size: 0.72rem;
  margin-bottom: 6px;
  color: var(--text);
}

.tvs-intro-block {
  margin-bottom: 8px;
}

.tvs-intro-block h4 {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tvs-intro-block p,
.tvs-intro-block ul {
  margin: 0;
  color: var(--text-muted-2);
}

.tvs-intro-block ul {
  padding-left: 14px;
}

.tvs-process-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 6px;
}

.tvs-process-plate {
  background: var(--skill-tag-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 7px;
}

.tvs-process-plate .name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.62rem;
}

.tvs-process-plate .sub {
  font-size: 0.55rem;
  color: var(--text-muted);
}

.tvs-dash-title {
  font-weight: 600;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.tvs-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  margin-bottom: 8px;
}

@media (min-width: 480px) {
  .tvs-kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tvs-kpi-plate {
  background: var(--skill-tag-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  text-align: center;
}

.tvs-kpi-plate .label {
  font-size: 0.5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}

.tvs-kpi-plate .value {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.tvs-kpi-plate .change {
  font-size: 0.55rem;
  margin-top: 2px;
}

.tvs-kpi-plate .change.up {
  color: #16a34a;
}

.tvs-kpi-plate .change.down {
  color: #dc2626;
}

.tvs-otif-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}

.tvs-otif-bar {
  flex: 1;
  background: var(--skill-tag-bg);
  border-radius: 4px;
  height: 18px;
  overflow: hidden;
}

.tvs-otif-bar-fill {
  height: 100%;
  border-radius: 4px;
}

.tvs-otif-bar-fill.ot {
  background: var(--accent);
  width: 91.2%;
}

.tvs-otif-bar-fill.if {
  background: #d97706;
  width: 96.8%;
}

.tvs-otif-label {
  font-size: 0.55rem;
  color: var(--text-muted);
  min-width: 44px;
}

.tvs-otif-pct {
  font-weight: 600;
  font-size: 0.6rem;
  color: var(--text);
  min-width: 32px;
  text-align: right;
}

.tvs-quality {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tvs-quality-plate {
  background: var(--skill-tag-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
}

.tvs-quality-plate .label {
  font-size: 0.5rem;
  color: var(--text-muted);
}

.tvs-quality-plate .num {
  font-weight: 600;
  color: var(--text);
  font-size: 0.75rem;
}

/* Интегрированная модель — превью */
.im-preview {
  min-height: 220px;
  padding: 16px 14px 18px;
  background: linear-gradient(180deg, var(--preview-bg) 0%, transparent 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

@media (min-width: 520px) {
  .im-preview {
    grid-template-columns: 1fr 1.15fr;
    min-height: 260px;
    padding: 18px 20px 22px;
  }
}

.im-preview .im-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.im-flow-title {
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.im-scheme-circle {
  position: relative;
  width: min(240px, 100%);
  height: min(240px, 70vw);
  max-height: 260px;
  margin: 0 auto;
  flex-shrink: 0;
}

.im-scheme-circle svg.im-circle-bg {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 160px;
  height: 160px;
  pointer-events: none;
  color: var(--text-muted);
}

.im-scheme-circle .im-node {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 96px;
  background: var(--skill-tag-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 7px;
  font-size: 0.58rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  box-sizing: border-box;
}

.im-scheme-circle .im-node.highlight {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.im-scheme-circle .im-node .im-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--preview-bg);
  color: var(--text-muted);
}

.im-scheme-circle .im-node.highlight .im-icon {
  background: var(--accent-dim);
  color: var(--accent);
}

.im-scheme-circle .im-node.pos-t {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.im-scheme-circle .im-node.pos-r {
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.im-scheme-circle .im-node.pos-b {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.im-scheme-circle .im-node.pos-l {
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.im-scheme-caption {
  font-size: 0.55rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.35;
  margin: 6px 0 0;
}

.im-effects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-content: start;
}

.im-effect {
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
  border: 1px solid transparent;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.im-effect .im-effect-num {
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.15;
  margin-bottom: 3px;
  letter-spacing: -0.02em;
}

.im-effect .im-effect-label {
  font-size: 0.58rem;
  color: var(--im-effect-label);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.im-effect.economy {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.28);
}

.im-effect.economy .im-effect-num {
  color: #16a34a;
}

[data-theme="light"] .im-effect.economy .im-effect-num {
  color: #15803d;
}

.im-effect.verify {
  background: var(--accent-dim);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.im-effect.verify .im-effect-num {
  color: var(--accent);
}

.im-effect.award {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.35);
}

.im-effect.award .im-effect-num {
  color: #d97706;
  font-size: 0.95rem;
}

.im-effect.capex {
  background: var(--skill-tag-bg);
  border-color: var(--border);
}

.im-effect.capex .im-effect-num {
  color: var(--text);
  font-size: 0.9rem;
}

/* SVG в схеме — адаптив к теме */
.im-svg-ring {
  stroke: var(--border-hover);
}

.im-svg-arc {
  stroke: color-mix(in srgb, var(--text-muted) 50%, var(--border));
}

/* Навыки */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 520px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.skill-category {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.25s;
  box-shadow: var(--shadow-card);
}

.skill-category::before {
  content: '';
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 2px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 55%, transparent), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}

.skill-category:hover {
  background: var(--card-hover);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
}

.skill-category:hover::before {
  opacity: 1;
}

.skill-category h3 {
  font-size: clamp(0.875rem, 2vw, 0.9375rem);
  font-weight: 600;
  margin: 0 0 8px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.skill-tag {
  font-size: clamp(0.75rem, 2vw, 0.8125rem);
  color: var(--text-muted-2);
  background: var(--skill-tag-bg);
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  line-height: 1.3;
}

/* Подвал */
footer {
  padding: clamp(28px, 5vw, 40px) 0;
  border-top: 1px solid var(--border);
}

.footer-contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 10px 14px;
}

.footer-contact-list li {
  margin: 0;
}

.footer-contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 48px;
  min-height: 48px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  color: var(--text-muted);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.footer-contact-link:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  background: var(--card-hover);
  color: var(--text);
}

.footer-contact-link:hover .footer-contact-icon {
  color: var(--accent);
}

.footer-contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--skill-tag-bg);
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
}

.footer-contact-link:hover .footer-contact-icon {
  background: color-mix(in srgb, var(--accent-dim) 55%, var(--skill-tag-bg));
}

.footer-contact-icon svg {
  display: block;
}
