/* ============================================================
   PROFILE — главная (#/home):
   герой, Tux, био, стек, опыт, сертификаты, образование
   ============================================================ */

.profile-home {
  padding: 48px 56px 80px;
  max-width: 1180px;
  margin: 0 auto;
}

.profile-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  margin-bottom: 56px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-2);
}

.profile-hero-content {
  flex: 1;
  min-width: 0;
}

/* Контейнер иллюстрации Tux. */
.profile-hero-aside {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Плавное парение иллюстрации. */
.tux-floating {
  display: inline-block;
  animation: tux-float 4s ease-in-out infinite;
}

/* Размер и интерактивное состояние Tux. */
.tux-hover {
  width: 170px;
  height: auto;
  min-height: 130px;
  display: block;
  cursor: pointer;
  user-select: none;
  -webkit-user-drag: none;
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    filter 0.4s ease;
}

.tux-hover:hover {
  transform: scale(1.12) rotate(-5deg) translateY(-5px);
  filter: drop-shadow(0 15px 10px rgba(0, 0, 0, 0.5));
}

/* Анимация вращения при клике */
.tux-hover.is-spinning {
  animation: tux-spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none; /* Блокируем клики во время анимации */
}

@keyframes tux-spin {
  0% {
    transform: scale(1) rotate(0deg) translateY(0);
    filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0));
  }
  50% {
    transform: scale(1.15) rotate(180deg) translateY(-15px);
    filter: drop-shadow(0 20px 15px rgba(0, 0, 0, 0.6));
  }
  100% {
    transform: scale(1) rotate(360deg) translateY(0);
    filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0));
  }
}

@keyframes tux-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

.profile-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #007acc 0%, #7c3aed 100%);
  color: #fff;
  font-weight: 600;
  font-size: 22px;
  display: grid;
  place-items: center;
  letter-spacing: 1px;
  margin-bottom: 20px;
  box-shadow:
    0 6px 24px -8px rgba(0, 122, 204, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}
.profile-hero h1 {
  font-size: 42px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.8px;
  line-height: 1.08;
  margin-bottom: 8px;
}
.profile-hero h1:focus {
  outline: none;
}
.profile-role {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.2px;
  margin-bottom: 16px;
}
.profile-lead {
  font-size: 15.5px;
  color: #bdbdbd;
  max-width: 720px;
  line-height: 1.65;
  margin-bottom: 22px;
}
.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: #b5b5b5;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.profile-badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--comment);
  box-shadow: 0 0 6px rgba(106, 153, 85, 0.7);
}
.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--mono);
  font-size: 13px;
}
.profile-links a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted #5a5a5a;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.profile-links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.profile-section {
  margin-bottom: 60px;
}
.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 24px;
  font-weight: 600;
  font-family: var(--mono);
}
.section-num {
  font-size: 11.5px;
  color: var(--comment);
  letter-spacing: 1px;
  padding: 3px 8px;
  border: 1px solid rgba(106, 153, 85, 0.35);
  border-radius: 3px;
  background: rgba(106, 153, 85, 0.08);
}
.section-name {
  font-size: 12.5px;
  color: var(--text-bright);
  letter-spacing: 1.8px;
  text-transform: uppercase;
}
.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}
.profile-home .profile-bio {
  max-width: 780px;
  margin-bottom: 8px;
}
.profile-home .profile-bio p {
  line-height: 1.8;
  color: #bdbdbd;
  font-size: 14.5px;
  margin-bottom: 14px;
}

.profile-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 26px;
  margin-top: 40px;
  border-top: 1px solid var(--border-2);
  font-family: var(--mono);
  font-size: 12px;
  color: #7a7a7a;
}
.profile-footer-links {
  display: flex;
  gap: 14px;
}
.profile-footer-links a {
  color: #8c8c8c;
  text-decoration: none;
  transition: color 0.15s;
}
.profile-footer-links a:hover {
  color: var(--accent);
}

/* ============================================================
   EXPERIENCE
   ============================================================ */

.exp-timeline {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.exp-item {
  position: relative;
  padding: 22px 24px 22px 28px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  transition:
    border-color 0.18s,
    background 0.18s,
    box-shadow 0.18s;
}
.exp-item:hover {
  background: #26262a;
  border-color: var(--border);
  border-left-color: var(--accent);
  box-shadow: 0 8px 24px -14px rgba(0, 0, 0, 0.6);
}
.exp-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 6px;
}
.exp-company {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-bright);
  margin: 0;
  letter-spacing: -0.1px;
  line-height: 1.35;
}
.exp-company a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted #5a5a5a;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.exp-company a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.exp-period {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--comment);
  white-space: nowrap;
  flex-shrink: 0;
}
.exp-role {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.1px;
  margin-bottom: 14px;
}
.exp-group {
  margin-top: 14px;
}
.exp-group:first-of-type {
  margin-top: 8px;
}
.exp-group-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 8px;
  letter-spacing: 0.1px;
}
.exp-group-title::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(0, 122, 204, 0.7);
  flex-shrink: 0;
}
.exp-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.exp-list--flat {
  margin-top: 10px;
}
.exp-list li {
  position: relative;
  padding-left: 18px;
  font-size: 13.8px;
  line-height: 1.65;
  color: #bdbdbd;
}
.exp-list li::before {
  content: "›";
  position: absolute;
  left: 4px;
  top: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.5;
  font-family: var(--mono);
}

/* ---------- Стек ---------- */

.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 44px;
}
.stack-group {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 16px 18px;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.stack-group:hover {
  border-color: #3a3a3d;
  background: #282829;
}
.stack-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: #9a9a9a;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.stack-title::before {
  content: "";
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--accent);
}
.stack-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.stack-tag {
  font-family: var(--mono);
  font-size: 12px;
  color: #c8c8c8;
  background: #333;
  border: 1px solid #3a3a3d;
  padding: 3px 9px;
  border-radius: 4px;
  transition:
    color 0.15s,
    background 0.15s,
    border-color 0.15s;
}
.stack-tag:hover {
  color: #fff;
  background: #3a3a3d;
  border-color: var(--accent);
}

/* ---------- Сертификаты ---------- */

.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
  margin-bottom: 44px;
}
.cert {
  --c: #007acc;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 20px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.18s cubic-bezier(0.2, 0.8, 0.3, 1),
    border-color 0.18s,
    background 0.18s,
    box-shadow 0.18s;
}
.cert::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--c) 0%,
    color-mix(in srgb, var(--c) 40%, transparent) 100%
  );
  opacity: 0.9;
}
.cert::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    400px circle at var(--mx, 50%) var(--my, 0%),
    color-mix(in srgb, var(--c) 14%, transparent),
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.cert:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--c) 45%, transparent);
  background: #2a2a2c;
  box-shadow: 0 10px 28px -12px color-mix(in srgb, var(--c) 55%, transparent);
}
.cert:hover::after {
  opacity: 1;
}
.cert-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cert-badge {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 9px;
  background: color-mix(in srgb, var(--c) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  color: var(--c);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  letter-spacing: 0.4px;
}
.cert-meta {
  flex: 1;
  min-width: 0;
}
.cert-issuer {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-bright);
  line-height: 1.3;
}
.cert-date {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}
.cert-name {
  font-size: 14px;
  line-height: 1.5;
  color: #c8c8c8;
  font-weight: 500;
  flex: 1;
}
.cert-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border-2);
}
.cert-id {
  font-family: var(--mono);
  font-size: 12px;
  color: #8a8a8a;
}
.cert-grade {
  font-family: var(--mono);
  font-size: 12px;
  color: #68d391;
}
.cert-valid {
  font-family: var(--mono);
  font-size: 12px;
  color: #9a9a9a;
}
.cert-arrow {
  color: #5a5a5a;
  font-size: 14px;
  transition:
    transform 0.18s,
    color 0.18s;
}
.cert:hover .cert-arrow {
  color: var(--c);
  transform: translate(2px, -2px);
}
.cert--static {
  cursor: default;
}
.cert--static .cert-arrow {
  display: none;
}

/* ---------- Образование ---------- */

.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
  margin-bottom: 44px;
}
.edu-card {
  --c: #7c3aed;
  position: relative;
  overflow: hidden;
  padding: 20px 22px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  transition:
    transform 0.18s cubic-bezier(0.2, 0.8, 0.3, 1),
    border-color 0.18s,
    background 0.18s,
    box-shadow 0.18s;
}
.edu-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--c) 0%,
    color-mix(in srgb, var(--c) 40%, transparent) 100%
  );
  opacity: 0.9;
}
.edu-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    400px circle at var(--mx, 50%) var(--my, 0%),
    color-mix(in srgb, var(--c) 14%, transparent),
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.edu-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--c) 45%, transparent);
  background: #2a2a2c;
  box-shadow: 0 10px 28px -12px color-mix(in srgb, var(--c) 55%, transparent);
}
.edu-card:hover::after {
  opacity: 1;
}
.edu-year {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--c);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.edu-institution {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-bright);
  margin: 0 0 6px;
  line-height: 1.35;
}
.edu-degree {
  font-size: 13px;
  color: var(--comment);
  margin-bottom: 6px;
  font-weight: 500;
}
.edu-program {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}

/* ============================================================
   TUX — CSP-safe fallback (эмодзи вместо битой картинки)
   ============================================================ */

.tux-placeholder {
  width: 170px;
  min-height: 130px;
  display: grid;
  place-items: center;
  font-size: 100px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.5));
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tux-placeholder:hover {
  transform: scale(1.12) rotate(-5deg) translateY(-5px);
}

/* Адаптация главной страницы для узких экранов. */

@media (max-width: 820px) {
  .stack-grid,
  .certs-grid,
  .edu-grid {
    grid-template-columns: 1fr;
  }

  .exp-item {
    padding: 18px 18px 18px 20px;
  }
  .exp-company {
    font-size: 14.5px;
  }
  .exp-period {
    font-size: 11.5px;
  }
  .exp-role {
    font-size: 12.5px;
  }
  .exp-list li {
    font-size: 13.5px;
  }

  .profile-home {
    padding: 32px 22px 60px;
  }
  .profile-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 32px;
  }
  .profile-hero-aside {
    align-self: center; /* На мобильных пингвин будет по центру */
  }
  .tux-hover {
    width: 130px; /* Еще меньше на мобильных */
    min-height: 100px;
  }
  .tux-placeholder {
    width: 130px;
    min-height: 100px;
    font-size: 76px;
  }
  .profile-hero h1 {
    font-size: 30px;
  }
  .profile-section {
    margin-bottom: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tux-floating {
    animation: none;
  }
  .tux-hover,
  .tux-hover:hover,
  .tux-placeholder,
  .tux-placeholder:hover {
    transition: none;
    transform: none;
    animation: none;
  }
}
