:root {
  --page-bg: #eef1f5;
  --card: #ffffff;
  --card-soft: #f8faff;
  --text: #111827;
  --muted: #647084;
  --faint: #8b95a7;
  --line: #dce2ec;
  --line-strong: #c9d1df;
  --blue: #0f4fd7;
  --blue-dark: #0b3ca7;
  --blue-soft: #eaf1ff;
  --shadow: 0 22px 60px rgba(30, 41, 59, 0.18);
  --radius: 12px;
  --inner-radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 16% 6%, rgba(255, 255, 255, 0.9), transparent 28%),
    radial-gradient(circle at 84% 26%, rgba(255, 255, 255, 0.85), transparent 30%),
    var(--page-bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}

button,
input {
  font: inherit;
}

select,
textarea {
  font: inherit;
}

button,
a {
  color: inherit;
}

a {
  text-decoration: none;
}

.skip-link,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.skip-link:focus {
  z-index: 100;
  width: auto;
  height: auto;
  clip: auto;
  top: 16px;
  left: 16px;
  border-radius: var(--inner-radius);
  background: var(--blue);
  color: #fff;
  padding: 8px 12px;
}

.stage {
  width: min(1280px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 56px;
}

.view {
  display: grid;
  justify-items: center;
}

.site-card,
.private-card,
.preview-content {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.home-card {
  max-width: 1080px;
}

.cv-card {
  max-width: 1120px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  padding: 0 44px;
}

.wordmark {
  justify-self: start;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 700;
}

.desktop-nav {
  display: flex;
  align-self: stretch;
  align-items: center;
  gap: 56px;
}

.desktop-nav a,
.desktop-nav button {
  position: relative;
  border: 0;
  background: transparent;
  color: #192233;
  cursor: pointer;
  font-weight: 650;
  padding: 0;
}

.desktop-nav a.active,
.desktop-nav button:hover,
.desktop-nav a:hover {
  color: var(--blue);
}

.desktop-nav a.active::after {
  position: absolute;
  right: 0;
  bottom: -28px;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--blue);
  content: "";
}

.topbar-actions {
  display: inline-flex;
  justify-self: end;
  align-items: center;
  gap: 14px;
}

.language-toggle {
  display: inline-flex;
  justify-self: end;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: #111827;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.language-toggle .is-current {
  color: var(--blue);
}

.lang-divider {
  color: var(--line-strong);
}

.mobile-menu {
  position: relative;
  display: none;
}

.mobile-menu-trigger {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--inner-radius);
  background: #fff;
  color: #1f2937;
  cursor: pointer;
  list-style: none;
}

.mobile-menu-trigger::-webkit-details-marker {
  display: none;
}

.mobile-menu-trigger::marker {
  content: "";
}

.mobile-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  width: 188px;
  border: 1px solid var(--line);
  border-radius: var(--inner-radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 36px rgba(30, 41, 59, 0.18);
  padding: 6px;
}

.mobile-menu-panel a,
.mobile-menu-panel button {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #263247;
  cursor: pointer;
  font-weight: 750;
  padding: 0 10px;
  text-align: left;
}

.mobile-menu-panel a.active,
.mobile-menu-panel a:hover,
.mobile-menu-panel button:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.home-hero {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  min-height: 430px;
  padding: 64px 58px 42px;
}

.portrait-frame {
  position: relative;
  display: grid;
  width: 248px;
  height: 248px;
  place-items: center;
  margin: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #eef1f7, #e5e9f0);
  overflow: hidden;
}

.portrait {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-frame.is-carousel .portrait {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: portrait-fade var(--portrait-duration, 8s) infinite;
  animation-delay: calc(var(--portrait-index, 0) * var(--portrait-duration, 8s) / var(--portrait-count, 1));
}

.portrait-frame.is-carousel .portrait:first-child {
  opacity: 1;
}

@keyframes portrait-fade {
  0%,
  100% {
    opacity: 0;
  }

  8%,
  45% {
    opacity: 1;
  }

  53% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portrait-frame.is-carousel .portrait {
    animation: none;
    opacity: 0;
  }

  .portrait-frame.is-carousel .portrait:first-child {
    opacity: 1;
  }
}

.hero-content h1 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 48px;
  line-height: 1.14;
  letter-spacing: 0;
}

.title-slash {
  margin: 0 8px;
  color: #111827;
  font-weight: 400;
}

.role-line {
  margin: 0 0 26px;
  color: var(--blue);
  font-size: 20px;
  font-weight: 700;
}

.hero-meta {
  display: grid;
  gap: 14px;
  margin: 0 0 28px;
  padding: 0;
  color: #3c4657;
  list-style: none;
}

.hero-meta li,
.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-meta a,
.hero-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.hero-meta svg,
.contact-item svg {
  color: #566176;
}

.hero-intro {
  max-width: 610px;
  margin: 0 0 30px;
  color: #313b4c;
  font-size: 17px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--inner-radius);
  cursor: pointer;
  font-weight: 800;
  padding: 0 28px;
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 20px rgba(15, 79, 215, 0.24);
}

.button.primary:hover {
  background: var(--blue-dark);
}

.button.outline {
  border-color: var(--blue);
  background: #fff;
  color: var(--blue);
}

.button.small {
  min-height: 42px;
  padding: 0 18px;
}

.button.full {
  width: 100%;
}

.back-to-top {
  position: fixed;
  right: max(24px, calc((100vw - 1280px) / 2 + 24px));
  bottom: 28px;
  z-index: 60;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(201, 209, 223, 0.9);
  border-radius: var(--inner-radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 36px rgba(30, 41, 59, 0.2);
  color: var(--blue);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: var(--blue);
  color: #fff;
}

.back-to-top:focus-visible {
  outline: 3px solid rgba(15, 79, 215, 0.24);
  outline-offset: 3px;
}

.home-section {
  border-top: 1px solid var(--line);
  margin: 0 44px;
  padding: 34px 0;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.section-heading.spread {
  justify-content: space-between;
}

.section-heading.spread > div {
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.section-icon,
.project-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #9bb8ff;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 34px;
  align-items: center;
}

.paragraph-stack {
  display: grid;
  gap: 10px;
}

.paragraph-stack p {
  margin: 0;
  color: #394457;
  line-height: 1.9;
}

.blueprint-illustration {
  position: relative;
  height: 150px;
}

.screen {
  position: absolute;
  right: 40px;
  bottom: 8px;
  width: 130px;
  height: 78px;
  border: 3px solid #2d5fde;
  border-radius: 4px;
  background: #fff;
  opacity: 0.34;
}

.screen::after {
  position: absolute;
  right: 22px;
  bottom: -16px;
  left: 22px;
  height: 4px;
  border-radius: 999px;
  background: #2d5fde;
  content: "";
}

.screen span,
.screen i {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #2d5fde;
  border-radius: 50%;
}

.screen span:nth-child(1) { top: 14px; left: 16px; }
.screen span:nth-child(2) { top: 34px; left: 16px; }
.screen span:nth-child(3) { top: 54px; left: 16px; }
.screen i:nth-child(4) { top: 16px; left: 44px; width: 44px; height: 2px; border: 0; background: #2d5fde; }
.screen i:nth-child(5) { top: 36px; left: 44px; width: 62px; height: 2px; border: 0; background: #2d5fde; }
.screen i:nth-child(6) { top: 56px; left: 44px; width: 52px; height: 2px; border: 0; background: #2d5fde; }

.chart {
  position: absolute;
  right: 0;
  top: 0;
  width: 104px;
  height: 86px;
  border: 3px solid #2d5fde;
  border-radius: 5px;
  background: #fff;
}

.chart::before {
  position: absolute;
  right: 16px;
  top: 18px;
  width: 52px;
  height: 30px;
  border-top: 3px solid #85a5ff;
  border-right: 3px solid #85a5ff;
  transform: skewY(-22deg);
  content: "";
}

.chart b {
  position: absolute;
  bottom: 14px;
  width: 10px;
  border: 2px solid #85a5ff;
  border-bottom-width: 6px;
}

.chart b:nth-child(1) { left: 18px; height: 18px; }
.chart b:nth-child(2) { left: 38px; height: 28px; }
.chart b:nth-child(3) { left: 58px; height: 22px; }
.chart b:nth-child(4) { left: 78px; height: 42px; }

.code-badge {
  position: absolute;
  right: -10px;
  bottom: 28px;
  display: grid;
  width: 54px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: #dbe5f5;
  color: #fff;
  font-weight: 900;
}

.skill-rows {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.skill-row {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 136px;
  border: 1px solid var(--line);
  border-radius: var(--inner-radius);
  background: #fbfcff;
  padding: 18px;
}

.skill-row strong {
  color: #14213a;
  font-size: 15px;
  line-height: 1.25;
}

.skill-row div,
.tag-cloud,
.tag-list,
.mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag,
.mini-tags span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #f8fafc;
  color: #20304a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  padding: 0 13px;
}

.brand-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.hero-meta .brand-icon,
.contact-item .brand-icon {
  width: 18px;
  height: 18px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-weight: 800;
}

.featured-grid {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.featured-grid::-webkit-scrollbar {
  display: none;
}

.featured-track {
  display: flex;
  width: max-content;
  gap: 20px;
}

.featured-grid.is-scrollable .featured-track {
  animation: featured-scroll 48s linear infinite;
}

.featured-grid.is-scrollable:hover .featured-track,
.featured-grid.is-scrollable:focus-within .featured-track {
  animation-play-state: paused;
}

.featured-card {
  flex: 0 0 320px;
  min-height: 166px;
  border: 1px solid var(--line);
  border-radius: var(--inner-radius);
  padding: 18px;
}

.featured-card h3 {
  margin: 10px 0 8px;
  font-size: 17px;
}

.featured-card p {
  display: -webkit-box;
  min-height: 48px;
  margin: 0 0 14px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #4c586b;
  line-height: 1.7;
}

@keyframes featured-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(-50% - 10px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .featured-grid.is-scrollable .featured-track {
    animation: none;
  }
}

.card-footer {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--line);
  color: #667085;
  padding: 0 44px;
}

.cv-actions {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 22px;
}

.cv-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
}

.cv-sidebar {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfcff, #ffffff);
  padding: 46px 36px;
}

.sidebar-avatar {
  display: block;
  width: 128px;
  height: 128px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #edf1f7;
  object-fit: cover;
}

.cv-sidebar h1 {
  margin: 0;
  text-align: center;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 27px;
  line-height: 1.15;
}

.preferred-name,
.sidebar-role {
  margin: 4px 0 0;
  text-align: center;
}

.preferred-name {
  color: #2e394b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.sidebar-role {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.contact-list {
  display: grid;
  gap: 13px;
  border-bottom: 1px solid var(--line);
  margin: 26px 0 24px;
  padding-bottom: 24px;
}

.contact-item {
  color: #4d596c;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.sidebar-skills,
.sidebar-block {
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  padding-bottom: 24px;
}

.sidebar-block:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.sidebar-skills h2,
.sidebar-block h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.tag-cloud .tag {
  color: var(--blue);
  font-size: 12px;
  padding: 0 10px;
}

.sidebar-skills .tag-cloud {
  gap: 7px;
}

.sidebar-skills .tag {
  min-height: 24px;
  font-size: 11px;
  padding: 0 8px;
}

.compact-list {
  gap: 14px;
}

.cv-document {
  padding: 36px 50px 46px;
}

.cv-projects-section {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding: 34px 50px 46px;
}

.cv-section + .cv-section {
  margin-top: 34px;
}

.cv-section h2 {
  margin: 0 0 18px;
  font-size: 21px;
  line-height: 1.2;
}

.experience-list {
  display: grid;
  gap: 18px;
}

.experience-item {
  border-left: 3px solid var(--blue);
  padding-left: 16px;
}

.experience-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.experience-header h3 {
  margin: 0;
  font-size: 16px;
}

.experience-header span {
  flex: 0 0 auto;
  color: #566176;
  font-size: 12px;
  font-weight: 700;
}

.experience-role {
  margin: 4px 0 7px;
  color: #37445a;
  font-weight: 700;
}

.experience-item ul {
  margin: 0;
  padding-left: 1.15em;
  color: #4b5568;
}

.experience-item li {
  margin: 4px 0;
}

.timeline {
  position: relative;
  display: grid;
  gap: 18px;
}

.timeline::before {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 126px;
  width: 1px;
  background: #ccd4e3;
  content: "";
}

.timeline-item {
  display: grid;
  grid-template-columns: 112px 18px minmax(0, 1fr);
  gap: 14px;
}

.timeline-date {
  color: #566176;
  font-size: 12px;
  font-weight: 700;
  padding-top: 2px;
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 10px;
  height: 10px;
  border: 2px solid #9fb2d4;
  border-radius: 50%;
  background: #fff;
  margin-top: 5px;
}

.timeline-body h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.project-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.timeline-subtitle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 6px;
  color: #37445a;
  font-weight: 700;
}

.category-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  background: #eef3ff;
  color: #36527c;
  font-size: 13px;
  line-height: 1;
  padding: 0 10px;
}

.category-pill.personal {
  background: #e9f8f1;
  color: #087443;
}

.category-pill.enterprise {
  background: #eef3ff;
  color: #3356a3;
}

.timeline-body p {
  margin: 0 0 8px;
  color: #586477;
}

.timeline-body ul {
  margin: 0;
  padding-left: 1.15em;
  color: #4b5568;
}

.timeline-body li {
  margin: 4px 0;
}

.stack-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.stack-line-under-category {
  margin-top: 8px;
  margin-bottom: 12px;
}

.cv-skill-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cv-skill-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}

.cv-skill-card h3 {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 15px;
}

.cv-skill-card ul {
  margin: 0;
  padding-left: 1.1em;
  color: #4b5568;
  font-size: 13px;
  line-height: 1.6;
}

.cv-skill-card li {
  margin: 4px 0;
}

.project-media {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.media-item {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--inner-radius);
  background: #f8fafc;
}

.media-item img,
.media-item video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.media-item figcaption {
  color: var(--muted);
  font-size: 12px;
  padding: 8px 10px;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
}

.plain-list {
  display: grid;
  gap: 10px;
}

.plain-item {
  border-left: 2px solid var(--line-strong);
  padding-left: 14px;
}

.plain-item strong,
.plain-item span,
.plain-item em {
  display: block;
}

.plain-item em {
  color: var(--muted);
  font-style: normal;
}

.preview-view {
  min-height: 78vh;
  align-items: center;
}

.private-card {
  width: min(520px, 100%);
  padding: 46px 56px;
  text-align: center;
}

.lock-orb {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
  margin: 0 auto 18px;
}

.private-card h1 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
}

.private-card p {
  color: #6b7484;
}

.password-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--inner-radius);
  padding: 0 14px;
}

.password-row input {
  min-height: 44px;
  border: 0;
  outline: 0;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: #c2410c !important;
}

.secure-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 14px 0 0;
  font-size: 13px;
}

.preview-content {
  max-width: 900px;
  padding: 34px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.section-block {
  border: 1px solid var(--line);
  border-radius: var(--inner-radius);
  padding: 18px;
}

.ai-card {
  max-width: 920px;
}

.ai-panel {
  display: grid;
  gap: 28px;
  justify-items: center;
  min-height: 520px;
  align-content: center;
  padding: 58px 52px;
  text-align: center;
}

.ai-panel-copy {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 620px;
}

.ai-panel-copy h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 34px;
  line-height: 1.2;
}

.ai-panel-copy p,
.ai-copy-status {
  margin: 0;
  color: #4b5568;
  font-size: 15px;
}

.ai-copy-grid {
  display: grid;
  width: min(620px, 100%);
  grid-template-columns: 1fr;
  gap: 12px;
}

.ai-platforms {
  display: grid;
  gap: 12px;
}

.ai-platforms h2 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.ai-platforms div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.ai-platform-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--inner-radius);
  background: #fff;
  color: #243149;
  font-weight: 800;
  padding: 0 14px;
}

.ai-platform-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

@media screen and (max-width: 1040px) {
  .skill-rows {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 820px) {
  .stage {
    width: min(390px, calc(100% - 24px));
    padding: 16px 0 32px;
  }

  .site-card,
  .private-card {
    border-radius: 14px;
  }

  .topbar {
    display: flex;
    min-height: 54px;
    justify-content: space-between;
    padding: 0 18px;
  }

  .wordmark {
    font-size: 14px;
  }

  .desktop-nav,
  .cv-actions .button {
    display: none;
  }

  .topbar-actions,
  .cv-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
  }

  .mobile-menu {
    display: block;
  }

  .mobile-menu-panel {
    position: fixed;
    top: 78px;
    right: max(12px, calc((100vw - 390px) / 2 + 12px));
    width: min(220px, calc(100vw - 24px));
  }

  .mobile-menu-panel a,
  .mobile-menu-panel button {
    min-width: 0;
  }

  .mobile-menu-panel span {
    min-width: 0;
    line-height: 1.25;
  }

  .language-toggle {
    font-size: 12px;
  }

  .home-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    justify-items: center;
    min-height: auto;
    padding: 28px 20px 18px;
    text-align: center;
  }

  .portrait-frame {
    width: 92px;
    height: 92px;
  }

  .hero-content h1 {
    font-size: 24px;
  }

  .role-line {
    margin-bottom: 8px;
    font-size: 13px;
  }

  .hero-meta {
    justify-items: center;
    gap: 7px;
    margin-bottom: 10px;
    font-size: 12px;
  }

  .hero-meta li {
    max-width: 100%;
    justify-content: center;
  }

  .hero-intro {
    display: -webkit-box;
    margin-bottom: 14px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-size: 12px;
    line-height: 1.6;
  }

  .hero-actions {
    width: 100%;
    gap: 8px;
  }

  .button {
    width: 100%;
    min-height: 38px;
    font-size: 12px;
  }

  .back-to-top {
    right: 18px;
    bottom: 18px;
    width: 42px;
    height: 42px;
  }

  .home-section {
    margin: 0;
    padding: 16px 20px;
  }

  .section-heading {
    gap: 8px;
    margin-bottom: 10px;
  }

  .section-icon {
    width: 24px;
    height: 24px;
  }

  .section-heading h2 {
    font-size: 14px;
  }

  .about-grid,
  .two-column,
  .preview-grid {
    grid-template-columns: 1fr;
  }

  .ai-panel {
    min-height: 560px;
    padding: 38px 20px;
  }

  .ai-panel-copy h1 {
    font-size: 24px;
  }

  .blueprint-illustration {
    display: none;
  }

  .featured-card {
    flex-basis: min(300px, calc(100vw - 72px));
  }

  .paragraph-stack p {
    font-size: 12px;
    line-height: 1.55;
  }

  .skill-rows {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .skill-row {
    min-height: auto;
    gap: 8px;
    padding: 12px;
  }

  .skill-row strong {
    font-size: 12px;
  }

  .tag,
  .mini-tags span {
    min-height: 24px;
    font-size: 11px;
    padding: 0 9px;
  }

  .card-footer {
    min-height: 52px;
    justify-content: center;
    text-align: center;
    font-size: 11px;
    line-height: 1.4;
    padding: 10px 20px;
  }

  .cv-grid {
    grid-template-columns: 1fr;
  }

  .cv-sidebar {
    border-right: 0;
    padding: 26px 20px 18px;
  }

  .sidebar-avatar {
    width: 82px;
    height: 82px;
  }

  .contact-list,
  .sidebar-skills,
  .sidebar-block {
    display: none;
  }

  .cv-document {
    padding: 18px 20px 24px;
  }

  .cv-projects-section {
    padding: 20px 20px 24px;
  }

  .cv-section + .cv-section {
    margin-top: 20px;
  }

  .cv-section h2 {
    font-size: 15px;
  }

  .experience-header {
    display: grid;
    gap: 2px;
  }

  .experience-header h3 {
    font-size: 14px;
  }

  .experience-role,
  .experience-item li {
    font-size: 12px;
  }

  .cv-skill-grid {
    grid-template-columns: 1fr;
  }

  .cv-skill-card {
    padding: 12px 14px;
  }

  .cv-skill-card h3 {
    font-size: 13px;
  }

  .cv-skill-card ul {
    font-size: 12px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .timeline::before {
    display: none;
  }

  .timeline-dot {
    display: none;
  }

  .timeline-date {
    color: var(--blue);
  }

  .timeline-body h3 {
    font-size: 14px;
  }

  .timeline-body p,
  .timeline-body li {
    font-size: 12px;
  }

  .project-media {
    grid-template-columns: 1fr;
  }

  .private-card {
    padding: 34px 28px;
  }
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  html,
  body {
    width: 210mm;
    min-height: 297mm;
    background: #fff;
    font-size: 10px;
    line-height: 1.42;
  }

  .stage {
    width: 210mm;
    min-height: auto;
    margin: 0;
    padding: 0;
  }

  .topbar,
  .home-card,
  .private-card,
  .preview-content,
  .back-to-top,
  .project-media {
    display: none !important;
  }

  .is-exporting-pdf [data-action="export-pdf"] {
    display: none !important;
  }

  .site-card,
  .cv-card {
    width: 210mm;
    max-width: none;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }

  .cv-grid {
    grid-template-columns: 48mm minmax(0, 1fr);
  }

  .sidebar-avatar {
    width: 24mm;
    height: 24mm;
    margin-bottom: 3mm;
  }

  .cv-sidebar h1 {
    font-size: 18px;
  }

  .preferred-name {
    font-size: 12px;
  }

  .sidebar-role,
  .contact-item {
    font-size: 9px;
  }

  .contact-list {
    gap: 6px;
    margin: 5mm 0 4mm;
    padding-bottom: 4mm;
  }

  .sidebar-skills,
  .sidebar-block {
    margin-bottom: 4mm;
    padding-bottom: 4mm;
  }

  .sidebar-skills h2,
  .sidebar-block h2 {
    margin-bottom: 8px;
    font-size: 12px;
  }

  .sidebar-skills .tag-cloud {
    gap: 3px;
  }

  .sidebar-skills .tag {
    min-height: 14px;
    font-size: 7px;
    padding: 0 4px;
  }

  .tag,
  .mini-tags span {
    min-height: 18px;
    font-size: 8px;
    padding: 0 6px;
  }

  .tag-cloud,
  .tag-list,
  .mini-tags,
  .stack-line {
    gap: 4px;
  }

  .cv-document {
    padding: 6mm 5mm 7mm;
  }

  .cv-projects-section {
    padding: 5mm 5mm 7mm;
  }

  .cv-section + .cv-section {
    margin-top: 5mm;
  }

  .cv-section h2 {
    margin-bottom: 3mm;
    font-size: 14px;
  }

  .paragraph-stack {
    gap: 5px;
  }

  .cv-skill-grid {
    gap: 7px;
  }

  .cv-skill-card {
    padding: 8px 10px;
  }

  .cv-skill-card h3,
  .experience-header h3,
  .timeline-body h3 {
    font-size: 11px;
  }

  .cv-skill-card ul,
  .experience-item ul,
  .timeline-body ul {
    line-height: 1.42;
  }

  .experience-list {
    gap: 8px;
  }

  .experience-item {
    padding-left: 8px;
  }

  .experience-header span,
  .experience-role {
    font-size: 8px;
  }

  .timeline {
    display: block;
  }

  .timeline::before {
    display: none;
  }

  .timeline-item {
    display: grid;
    grid-template-columns: 18mm minmax(0, 1fr);
    gap: 0 10px;
    padding-top: 4mm;
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .timeline-item:first-child {
    padding-top: 0;
  }

  .timeline-item + .timeline-item {
    margin-top: 4mm;
  }

  .timeline-date {
    font-size: 8px;
  }

  .timeline-dot {
    display: none;
  }

  .timeline-body p,
  .timeline-body li {
    margin-top: 2px;
    margin-bottom: 2px;
  }

  svg {
    width: 12px;
    height: 12px;
  }

  .cv-section,
  .timeline-item,
  .featured-card,
  .cv-skill-card,
  .plain-item {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }
}
