:root {
  --bg-main: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --border-color: #e2e8f0;
  --accent: #3b82f6;
  --nav-text: #475569;
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.05);
  --shadow-medium: 0 12px 28px rgba(15, 23, 42, 0.08);
  --code-bg-1: #041133;
  --code-bg-2: #0a245b;
  --code-bg-3: #0b2f73;
  --curve-border: rgba(148, 163, 184, 0.28);
  --curve-shadow-1: rgba(148, 163, 184, 0.16);
  --curve-shadow-2: rgba(148, 163, 184, 0.13);
  --curve-shadow-3: rgba(148, 163, 184, 0.1);
  --dot-color: rgba(59, 130, 246, 0.28);
  --dot-color-soft: rgba(59, 130, 246, 0.18);
}

body[data-theme="dark"] {
  --bg-main: #0b1120;
  --bg-secondary: #111827;
  --bg-card: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --border-color: #334155;
  --accent: #60a5fa;
  --nav-text: #cbd5e1;
  --shadow-soft: 0 10px 26px rgba(2, 6, 23, 0.38);
  --shadow-medium: 0 14px 30px rgba(2, 6, 23, 0.46);
  --code-bg-1: #0b1735;
  --code-bg-2: #10264f;
  --code-bg-3: #17376a;
  --curve-border: rgba(125, 149, 184, 0.2);
  --curve-shadow-1: rgba(125, 149, 184, 0.12);
  --curve-shadow-2: rgba(125, 149, 184, 0.09);
  --curve-shadow-3: rgba(125, 149, 184, 0.06);
  --dot-color: rgba(125, 149, 184, 0.32);
  --dot-color-soft: rgba(125, 149, 184, 0.2);
}

* {
  box-sizing: border-box;
  transition:
    background-color 300ms ease,
    color 300ms ease,
    border-color 300ms ease,
    box-shadow 300ms ease,
    transform 300ms ease,
    opacity 300ms ease;
}
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg-main);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hero { order: 1; }
.tech { order: 2; }
.projects { order: 3; }
.bottom-info { order: 4; }

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  border: 1px solid transparent;
  background: transparent;
  padding: 10px 12px 0;
}

.site-header.is-scrolled {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.header-inner {
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
}

.site-header.is-scrolled .header-inner {
  background: color-mix(in srgb, var(--bg-secondary) 74%, transparent);
  border-color: color-mix(in srgb, var(--border-color) 75%, transparent);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.header-inner {
  max-width: 1150px;
  margin: 0 auto;
  padding: 10px 20px;
  position: relative;
  top: -8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 700;
}
.brand-icon { color: var(--accent); font-size: 18px; }
.brand-text { font-size: 17px; }

.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a {
  text-decoration: none;
  color: var(--nav-text);
  font-size: 16px;
  font-weight: 600;
  padding: 10px 0;
  position: relative;
}
.main-nav a.active { color: var(--accent); }
.main-nav a.active::after {
  content: none;
}

.header-actions { display: flex; align-items: center; gap: 12px; }
.icon-only { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; }
.icon-only i {
  font-size: 20px;
  line-height: 1;
  color: var(--text-secondary);
}
body[data-theme="dark"] .devicon-github-original {
  color: #f8fafc;
}
.icon-button {
  border: 1px solid transparent;
  background: transparent;
  width: 32px;
  height: 32px;
  cursor: pointer;
  border-radius: 8px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-button:hover {
  border-color: var(--border-color);
  background: color-mix(in srgb, var(--bg-card) 88%, transparent);
}
.theme-icon {
  width: 17px;
  height: 17px;
  position: absolute;
  fill: none;
  stroke: var(--text-secondary);
  stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.theme-icon-moon {
  opacity: 0;
  transform: rotate(-45deg) scale(.65);
}
body[data-theme="dark"] .theme-icon-sun {
  opacity: 0;
  transform: rotate(45deg) scale(.65);
}
body[data-theme="dark"] .theme-icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.menu-toggle {
  display: none;
}

.mobile-nav {
  display: none;
}

main {
  padding-top: 66px;
}

.hero {
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.hero::before,
.hero::after {
  content: none;
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  border: 1px solid var(--curve-border);
}

/* Top-right premium curved lines */
.hero::before {
  width: 760px;
  height: 760px;
  top: -540px;
  right: -320px;
  box-shadow:
    0 0 0 58px var(--curve-shadow-1),
    0 0 0 120px var(--curve-shadow-2),
    0 0 0 184px var(--curve-shadow-3);
}

/* Bottom-left premium curved lines */
.hero::after {
  width: 700px;
  height: 700px;
  bottom: -520px;
  left: -360px;
  box-shadow:
    0 0 0 54px var(--curve-shadow-1),
    0 0 0 116px var(--curve-shadow-2),
    0 0 0 178px var(--curve-shadow-3);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1150px;
  margin: 0 auto;
  padding: 70px 20px 62px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 44px;
  align-items: center;
}

.hero-left,
.hero-right {
  position: relative;
  isolation: isolate;
}

.hero-left::before,
.hero-left::after,
.hero-right::before,
.hero-right::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border-color));
  opacity: 0.38;
  z-index: -1;
}

.hero-left::before {
  width: 300px;
  height: 300px;
  top: -170px;
  left: -170px;
}

.hero-left::after {
  width: 220px;
  height: 220px;
  bottom: -120px;
  right: -70px;
  opacity: 0.32;
}

.hero-right::before {
  width: 260px;
  height: 260px;
  top: -90px;
  right: -120px;
}

.hero-right::after {
  width: 180px;
  height: 180px;
  bottom: -80px;
  left: -70px;
  opacity: 0.32;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--bg-card) 86%, var(--accent));
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  padding: 7px 12px;
  margin-bottom: 14px;
}
.hero-left h1 {
  margin: 0 0 22px;
  font-size: clamp(2.1rem, 4.6vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: .95;
  color: var(--text-primary);
}
.hero-left h2 {
  margin: 0 0 28px;
  font-size: clamp(1.4rem, 3vw, 2.06rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.hero-left h2 span { color: var(--accent); }
.hero-left p {
  margin: 0 0 9px;
  color: var(--text-secondary);
  font-size: clamp(1rem, 2.2vw, 1.375rem);
  line-height: 1.35;
}

.about-panel h1 {
  margin: 0 0 16px;
  font-size: clamp(2.4rem, 5vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: 0;
  color: var(--text-primary);
}

.about-intro {
  margin: 0 0 20px;
  max-width: 48ch;
  color: var(--text-secondary);
  font-size: clamp(1rem, 1.7vw, 1.15rem);
  line-height: 1.45;
}

.about-facts {
  display: grid;
  border-top: 1px solid var(--border-color);
}

.about-fact {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
}

.fact-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fact-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.about-fact small {
  display: block;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.15;
}

.about-fact strong {
  display: block;
  margin-top: 3px;
  color: var(--text-primary);
  font-size: 1.05rem;
  line-height: 1.2;
}

.about-cv-btn {
  margin-top: 0;
  width: 100%;
  min-height: 52px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.about-actions {
  margin-top: 18px;
  width: min(100%, 520px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.about-chat-btn {
  min-height: 52px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.about-actions .btn {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    background-color 220ms ease,
    border-color 220ms ease,
    color 220ms ease;
}

.about-actions .btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}

.about-actions .btn:hover {
  transform: translateY(-2px);
}

.about-actions .btn:active {
  transform: translateY(0);
}

.about-actions .btn.btn-primary {
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.about-actions .btn.btn-primary:hover {
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.16);
}

.about-actions .btn.btn-secondary {
  border-color: color-mix(in srgb, var(--border-color) 88%, var(--accent));
}

.about-actions .btn.btn-secondary:hover {
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.1);
}
.hero-cta {
  margin-top: 34px;
  display: flex;
  gap: 18px;
}
.btn {
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  border-radius: 10px;
  padding: 12px 20px;
  border: 1px solid var(--border-color);
}
.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
.btn-secondary { color: var(--text-primary); background: var(--bg-card); }

.hero-social {
  margin-top: 26px;
  display: flex;
  gap: 28px;
}
.hero-social a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.hero-social a svg {
  width: 18px;
  height: 18px;
  fill: var(--text-secondary);
}

.hero-social a i {
  font-size: 18px;
  line-height: 1;
}

.portrait-wrap {
  position: relative;
  width: min(100%, 470px);
  margin-left: auto;
  padding: 10px 18px 24px 0;
}

.portrait-wrap::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 8px;
  width: 108px;
  height: 165px;
  background-image: radial-gradient(rgba(59, 130, 246, 0.9) 2px, transparent 2px);
  background-size: 22px 22px;
  opacity: 0.95;
}

.projects,
.tech,
.bottom-info {
  position: relative;
  overflow: hidden;
}

.projects::before,
.bottom-info::after {
  content: "";
  position: absolute;
  pointer-events: none;
  width: 96px;
  height: 136px;
  background-image: radial-gradient(var(--dot-color) 2px, transparent 2px);
  background-size: 18px 18px;
  opacity: 0.45;
}

.projects::before {
  display: none;
}

.bottom-info::after {
  left: 12px;
  bottom: 14px;
  background-image: radial-gradient(var(--dot-color-soft) 2px, transparent 2px);
  opacity: 0.35;
}

.portrait-card {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(140deg, #0b2f73 0%, #1d4ed8 100%);
  box-shadow: var(--shadow-medium);
  z-index: 1;
}

.portrait-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portrait-badge {
  position: absolute;
  left: -26px;
  bottom: 18px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
}

.badge-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, #3b82f6, #2563eb);
}

.badge-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rocket-glyph {
  font-size: 18px;
  line-height: 1;
  transform: translateY(0.5px);
}

.badge-text strong {
  display: block;
  color: #0f172a;
  font-size: 17px;
  line-height: 1.2;
}

.badge-text small {
  display: block;
  color: #475569;
  font-size: 13px;
  margin-top: 2px;
}

body[data-theme="dark"] .portrait-badge {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(51, 65, 85, 0.9);
}

body[data-theme="dark"] .hero-left::before,
body[data-theme="dark"] .hero-left::after,
body[data-theme="dark"] .hero-right::before,
body[data-theme="dark"] .hero-right::after {
  border-color: color-mix(in srgb, #93c5fd 22%, #334155);
  opacity: 0.3;
}

body[data-theme="dark"] .badge-text strong {
  color: #f8fafc;
}

body[data-theme="dark"] .badge-text small {
  color: #cbd5e1;
}

.projects, .tech {
  max-width: 1150px;
  margin: 0 auto;
  padding: 30px 20px;
}
.section-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-top h3, .tech h3 {
  margin: 0;
  font-size: 20px;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.accent-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.more-link {
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
}
.more-link::after {
  content: " →";
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border-color));
  box-shadow: var(--shadow-medium);
}
.project-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.project-copy {
  min-width: 0;
  flex: 1;
}
.project-preview {
  width: 104px;
  height: 84px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--bg-secondary) 86%, var(--bg-card));
  overflow: hidden;
  flex-shrink: 0;
  padding: 10px 8px;
  display: grid;
  gap: 6px;
}
.project-preview span {
  display: block;
  height: 5px;
  border-radius: 99px;
  background: #cbd5e1;
}
.preview-task {
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-secondary) 92%, white) 0%, color-mix(in srgb, var(--bg-secondary) 70%, var(--bg-card)) 100%);
}
.preview-task span:nth-child(1) { width: 72%; background: #94a3b8; }
.preview-task span:nth-child(2) { width: 92%; }
.preview-task span:nth-child(3) { width: 66%; }
.preview-task span:nth-child(4) { width: 84%; }

.preview-notes {
  border-color: #1f2937;
  background: linear-gradient(180deg, #111827 0%, #1f2937 100%);
}
.preview-notes span {
  background: rgba(255,255,255,.3);
}
.preview-notes span:nth-child(1) { width: 68%; background: #60a5fa; }
.preview-notes span:nth-child(2) { width: 84%; }
.preview-notes span:nth-child(3) { width: 62%; background: #94a3b8; }
.preview-notes span:nth-child(4) { width: 75%; }

.preview-portfolio {
  background: var(--bg-card);
}
.preview-portfolio span:nth-child(1) { width: 85%; background: #0f172a; }
.preview-portfolio span:nth-child(2) { width: 62%; }
.preview-portfolio span:nth-child(3) { width: 74%; background: #1d4ed8; }
.preview-portfolio span:nth-child(4) { width: 56%; }

.project-card h4 {
  margin: 0 0 8px;
  font-size: clamp(1.2rem, 1.8vw, 1.8rem);
  color: var(--text-primary);
}
.project-card p {
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.45;
}
.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.tags span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 5px 10px;
}
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
}
.card-link svg {
  width: 15px;
  height: 15px;
  fill: var(--text-secondary);
}
.card-link i {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1;
}

.tech {
  padding-top: 22px;
  padding-bottom: 20px;
}
.tech-list {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  padding: 14px 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
  animation: tech-drift-right 16s linear infinite;
}

.tech-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  background: transparent;
  opacity: 0.72;
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}

.tech-item:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.tech-item i {
  font-size: 24px;
  flex-shrink: 0;
  line-height: 1;
}

body[data-theme="dark"] .tech-item .devicon-github-original {
  color: #f8fafc;
}

.tech-item span {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  opacity: 0.88;
}

@keyframes tech-drift-right {
  from { transform: translateX(-2.5%); }
  to { transform: translateX(2.5%); }
}

@media (max-width: 1024px) {
  .main-nav { display: none; }
  .menu-toggle {
    display: inline-flex;
  }

  .menu-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--text-secondary);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-nav {
    width: min(1150px, 100%);
    margin: 0 auto;
    padding: 0 20px 12px;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mobile-nav.is-open {
    display: grid;
  }

  .mobile-nav a {
    display: block;
    width: 100%;
    text-decoration: none;
    color: var(--nav-text);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 14px;
  }

  .mobile-nav a.active {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 40%, var(--border-color));
  }

  .hero-inner { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .btn { font-size: 16px; padding: 12px 18px; }
  .hero-social a { font-size: 16px; }
  .tech-list {
    gap: 14px;
  }
}

.bottom-info {
  max-width: 1150px;
  margin: 0 auto;
  padding: 14px 20px 48px;
}

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

.info-card {
  min-height: 208px;
  height: 100%;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: var(--shadow-soft);
  padding: 18px 18px;
  display: flex;
  flex-direction: column;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.info-about p,
.info-contact p {
  max-width: 96%;
}

.info-stats .stats-grid {
  margin-top: auto;
  margin-bottom: auto;
}

.info-contact .contact-row:first-of-type {
  margin-top: auto;
}

.info-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border-color));
  box-shadow: var(--shadow-medium);
}

.info-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.info-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.info-btn {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border-color));
  color: var(--accent);
  background: color-mix(in srgb, var(--bg-card) 82%, var(--accent));
  border-radius: 9px;
  height: 36px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  transition: background-color .2s ease, border-color .2s ease;
}

.info-btn:hover {
  background: color-mix(in srgb, var(--bg-card) 75%, var(--accent));
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border-color));
}

.stats-grid {
  margin-top: 4px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.stat-item {
  text-align: center;
}

.stat-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 8px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg-card) 78%, var(--accent));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border-color));
  font-size: 18px;
}

.stat-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stat-icon i {
  font-size: 18px;
  line-height: 1;
}
body[data-theme="dark"] .stat-icon .devicon-github-original {
  color: #f8fafc;
}

.stat-item strong {
  display: block;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 3px;
}

.stat-item small {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.3;
}

.contact-row {
  margin-top: 10px;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  padding: 9px 10px;
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color .2s ease, background-color .2s ease, transform .2s ease;
}

.contact-row:hover {
  background: color-mix(in srgb, var(--bg-card) 82%, var(--accent));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border-color));
  transform: translateY(-1px);
}

.contact-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-card) 70%, var(--accent));
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-linkedin {
  background: #0a66c2;
  color: #ffffff;
}
.contact-linkedin i {
  font-size: 14px;
  line-height: 1;
}

.contact-text small {
  display: block;
  color: var(--text-secondary);
  font-size: 11px;
  margin-bottom: 2px;
}

.contact-text strong {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
}

.site-footer {
  margin-top: auto;
  padding: 22px 0 0;
  background: var(--bg-main);
}

.footer-inner {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  min-height: 88px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 35%, rgba(37, 99, 235, 0.2), transparent 38%),
    radial-gradient(circle at 80% 60%, rgba(59, 130, 246, 0.14), transparent 40%),
    linear-gradient(130deg, #111f3d 0%, #07142b 50%, #0b1f46 100%);
  border: 1px solid rgba(96, 165, 250, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.footer-inner p {
  margin: 0;
  font-size: 30px;
  color: rgba(226, 232, 240, 0.96);
  text-align: center;
}

.footer-mark {
  color: #3b82f6;
  margin-left: 10px;
  font-weight: 600;
}

.footer-inner p:first-child {
  display: none;
}

.cv-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
}

.cv-modal.is-open {
  display: block;
}

.cv-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.cv-modal-panel {
  position: relative;
  width: min(960px, calc(100% - 28px));
  max-height: calc(100vh - 40px);
  margin: 20px auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-medium);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.cv-modal-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cv-modal-header h3 {
  margin: 0;
  font-size: 17px;
  color: var(--text-primary);
}

.cv-close {
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.cv-modal-body {
  min-height: 60vh;
  background: var(--bg-secondary);
}

.cv-modal-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.cv-modal-actions {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}

.floating-support {
  position: fixed;
  right: 16px;
  bottom: 22px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.floating-availability {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  animation: availabilityFloat 2.6s ease-in-out infinite;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 220ms ease, transform 220ms ease;
}

.floating-support.is-open .floating-availability {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.availability-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.16);
}

.floating-card {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: min(92vw, 460px);
  height: min(76vh, 710px);
  background: var(--bg-card);
  border: 1px solid color-mix(in srgb, var(--border-color) 94%, #fff);
  border-radius: 24px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.2);
  padding: 20px 18px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 16px;
  opacity: 0;
  transform: translateY(20px) scale(0.97);
  transform-origin: right bottom;
  pointer-events: none;
  transition: opacity 300ms ease, transform 320ms ease;
}

.floating-support.is-open .floating-card {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.floating-head-online {
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--bg-secondary) 88%, white);
  display: flex;
  align-items: center;
  gap: 12px;
}

.floating-avatars {
  display: flex;
  align-items: center;
}

.floating-avatars img {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  object-fit: cover;
  object-position: center 20%;
  transform: scale(1.18);
  transform-origin: center;
  border: 2px solid #fff;
  margin-left: 0;
}

.floating-avatars img:first-child {
  margin-left: 0;
}

.floating-online-copy strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 16px;
  color: var(--text-primary);
}

.online-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
}

.floating-online-copy p {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.floating-copy h3 {
  margin: 0 0 6px;
  font-size: 32px;
  color: var(--text-primary);
}

.floating-copy p {
  margin: 0;
  max-width: 30ch;
  font-size: 18px;
  line-height: 1.35;
  color: color-mix(in srgb, var(--text-primary) 90%, #334155);
}

.floating-start {
  align-self: end;
  text-decoration: none;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg-secondary) 94%, white);
  padding: 14px;
  display: grid;
  gap: 6px;
  color: var(--text-primary);
  transition: transform 220ms ease, box-shadow 220ms ease;
  cursor: pointer;
}

.floating-start strong {
  font-size: 19px;
  line-height: 1.2;
}

.floating-start small {
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-secondary);
}

.floating-start span {
  font-size: 15px;
  margin-top: 4px;
}

.floating-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.floating-composer {
  display: none;
  align-self: end;
  width: 100%;
  padding: 0;
  width: 100%;
}

.floating-support.is-composer .floating-start {
  display: none;
}

.floating-support.is-composer .floating-composer {
  display: block;
}

.wa-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: 999px;
  padding: 8px 8px 8px 14px;
}

.wa-input-row input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.2;
  outline: none;
}

.wa-input-row input::placeholder {
  color: var(--text-secondary);
}

.wa-send {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 0;
  background: #2563eb;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease, background-color 200ms ease;
}

.wa-send svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wa-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.3);
}

.wa-send:active {
  transform: translateY(0);
}

.floating-toggle {
  border: 0;
  cursor: pointer;
  position: relative;
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.3);
  background: #2563eb;
  color: #fff;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 260ms ease, box-shadow 260ms ease, background-color 260ms ease;
  animation: floatingPulse 2.8s ease-in-out infinite;
}

.floating-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.34);
}

.floating-toggle:active {
  transform: scale(0.95);
}

.floating-support.is-open .floating-toggle {
  background: #0f172a;
  animation: none;
}

.floating-icon {
  position: absolute;
  font-size: 24px;
  line-height: 1;
  transition: opacity 180ms ease, transform 220ms ease;
}

.floating-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transform: scale(1.36);
  transform-origin: center;
  border-radius: 999px;
  display: block;
}

.floating-icon-close {
  opacity: 0;
  transform: scale(0.7);
  font-size: 34px;
}

.floating-support.is-open .floating-icon-chat {
  opacity: 0;
  transform: scale(0.7);
}

.floating-support.is-open .floating-icon-close {
  opacity: 1;
  transform: scale(1);
}

@keyframes floatingPulse {
  0%, 100% { box-shadow: 0 12px 28px rgba(15, 23, 42, 0.3); }
  50% { box-shadow: 0 16px 34px rgba(37, 99, 235, 0.36); }
}

@keyframes availabilityFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@media (max-width: 1024px) {
  .info-grid {
    grid-template-columns: 1fr;
  }

  .info-card {
    min-height: auto;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .info-card h3 {
    font-size: 20px;
  }

  .info-card p {
    font-size: 16px;
  }

  .info-btn {
    font-size: 14px;
  }

  .stat-item strong {
    font-size: 24px;
  }

  .stat-item small {
    font-size: 13px;
  }

  .footer-inner { min-height: 78px; padding: 0 14px; }
  .footer-inner p { font-size: 14px; }

  .cv-modal-panel {
    width: calc(100% - 16px);
    max-height: calc(100vh - 16px);
    margin: 8px auto;
  }

  .cv-modal-body {
    min-height: 68vh;
  }
}

@media (max-width: 767px) {
  .site-header {
    padding: 8px 8px 0;
  }

  .header-inner {
    border-radius: 12px;
  }

  .header-inner {
    padding: 10px 14px;
    gap: 10px;
  }

  .brand-text {
    font-size: 15px;
  }

  .header-actions {
    gap: 8px;
  }

  .icon-only {
    width: 26px;
    height: 26px;
  }

  .hero-inner {
    padding: 40px 14px 36px;
    text-align: center;
    gap: 26px;
  }

  .hero-left {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-left::before,
  .hero-left::after,
  .hero-right::before,
  .hero-right::after {
    transform: scale(0.72);
    opacity: 0.16;
  }

  .hero-left h1 {
    margin-bottom: 14px;
    line-height: 1.02;
  }

  .hero-left h2 {
    margin-bottom: 16px;
  }

  .hero-left p {
    margin-bottom: 8px;
    max-width: 34ch;
  }

  .about-panel h1 {
    font-size: clamp(2rem, 11vw, 2.9rem);
    margin-bottom: 12px;
  }

  .about-intro {
    max-width: 100%;
    margin-bottom: 14px;
    font-size: 1rem;
  }

  .about-fact {
    padding: 11px 0;
    text-align: left;
  }

  .fact-icon {
    width: 40px;
    height: 40px;
  }

  .about-fact small {
    font-size: 0.86rem;
  }

  .about-fact strong {
    font-size: 0.95rem;
  }

  .about-cv-btn {
    margin-top: 0;
    width: 100%;
    font-size: 1rem;
  }

  .about-actions {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .hero-cta {
    margin-top: 18px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .btn {
    width: 100%;
    text-align: center;
    min-height: 44px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
  }

  .hero-social {
    margin-top: 18px;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px 18px;
  }

  .hero-right {
    width: 100%;
  }

  .portrait-wrap {
    width: min(100%, 360px);
    margin: 0 auto;
    padding-right: 0;
    padding-bottom: 18px;
  }

  .portrait-wrap::after {
    width: 84px;
    height: 120px;
    right: -6px;
    bottom: 6px;
    background-size: 18px 18px;
  }

  .portrait-badge {
    left: 10px;
    right: 10px;
    min-width: 0;
    bottom: 10px;
    padding: 10px 12px;
    border-radius: 12px;
  }

  .badge-icon {
    width: 36px;
    height: 36px;
  }

  .badge-text strong {
    font-size: 15px;
  }

  .badge-text small {
    font-size: 12px;
  }

  .projects,
  .tech,
  .bottom-info {
    padding-left: 14px;
    padding-right: 14px;
  }

  .section-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .project-card {
    padding: 14px;
  }

  .project-head {
    flex-direction: column;
  }

  .project-preview {
    width: 100%;
    height: 112px;
  }

  .tech-list {
    gap: 12px;
    padding: 10px 4px;
  }

  .tech-item {
    justify-content: center;
    padding: 8px 8px;
  }

  .info-card {
    padding: 14px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 6px;
    margin-top: 10px;
  }

  .contact-row {
    padding: 10px;
  }

  .contact-text strong {
    font-size: 11px;
    line-height: 1.3;
    word-break: break-word;
  }

  .footer-inner {
    min-height: 72px;
    padding: 0 12px;
  }

  .projects::before,
  .bottom-info::after {
    width: 64px;
    height: 94px;
    background-size: 16px 16px;
    opacity: 0.28;
  }

  .projects::before {
    right: 6px;
    top: 8px;
  }

  .bottom-info::after {
    left: 4px;
    bottom: 8px;
  }

  .floating-support {
    right: 12px;
    bottom: 14px;
  }

  .floating-availability {
    font-size: 11px;
    padding: 8px 11px;
  }

  .floating-toggle {
    width: 58px;
    height: 58px;
  }

  .floating-card {
    right: -4px;
    bottom: 72px;
    width: min(94vw, 360px);
    height: min(72vh, 620px);
    border-radius: 24px;
    padding: 18px 16px;
    gap: 14px;
  }

  .floating-online-copy strong {
    font-size: 12px;
  }

  .floating-online-copy p {
    font-size: 11px;
  }

  .floating-copy h3 {
    font-size: 42px;
  }

  .floating-copy p {
    font-size: 20px;
    max-width: 100%;
  }

  .floating-start strong {
    font-size: 17px;
  }

  .floating-start small {
    font-size: 14px;
  }

  .floating-start span {
    font-size: 22px;
  }
}

@media (max-width: 413px) {
  .hero-inner {
    padding-top: 34px;
  }

  .hero-badge {
    font-size: 12px;
  }

  .tech-item span {
    font-size: 12px;
  }
}

/* Chat Messages Simulation */
.floating-support.is-composer .floating-composer {
  display: flex !important;
  flex-direction: column;
  height: 100%;
  align-self: stretch;
}
.chat-messages {
  padding: 12px 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: transparent;
  border-bottom: 0;
}
.chat-message {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  animation: chatPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  transform-origin: bottom left;
}
.chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.chat-bubble {
  background: var(--bg-secondary);
  padding: 10px 14px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  font-size: 14px;
  color: var(--text-primary);
  max-width: 85%;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.chat-bubble p {
  margin: 0;
  line-height: 1.4;
}
.chat-message.typing .chat-bubble {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 14px 16px;
}
.chat-message.typing .dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  animation: typingDot 1.4s infinite ease-in-out;
  opacity: 0.6;
}
.chat-message.typing .dot:nth-child(1) { animation-delay: 0s; }
.chat-message.typing .dot:nth-child(2) { animation-delay: 0.2s; }
.chat-message.typing .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-4px); opacity: 1; }
}

@keyframes chatPop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.wa-quick-replies {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 4px 12px 4px;
}
.quick-reply-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.quick-reply-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent);
}
