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

:root {
  --color-bg-start: #FFFAFF;
  --color-bg-end: #f0ecec;
  --color-text: #050401;
  --color-subtitle: #303036;
  --color-accent: #303036;
  --color-accent-hover: #050401;
  --color-ring: rgba(48, 188, 237, 0.12);
  --color-dot: #30BCED;
  --color-accent-alt: #FC5130;
  --color-cyan: #30BCED;
  --color-nav-bg: rgba(255, 255, 255, 0.75);
  --color-nav-border: rgba(5, 4, 1, 0.08);
  --color-nav-link: rgba(5, 4, 1, 0.5);
  --color-nav-link-hover: #050401;
  --color-nav-link-bg-hover: rgba(5, 4, 1, 0.06);
  --color-theme-btn: rgba(5, 4, 1, 0.4);
  --color-glow-cyan: rgba(48, 188, 237, 0.06);
  --color-glow-orange: rgba(252, 81, 48, 0.05);
  --color-text-3d: rgba(0, 0, 0, 0.06);
  --color-card-bg: rgba(48, 188, 237, 0.04);
  --color-card-border: rgba(48, 188, 237, 0.1);
  --color-card-shadow: rgba(0, 0, 0, 0.04);
  --color-btn-3d-inset: rgba(255, 255, 255, 0.3);
  --color-btn-3d-shade: rgba(0, 0, 0, 0.06);
}

body.dark {
  --color-bg-start: #0f0f12;
  --color-bg-end: #1a1a20;
  --color-text: #e8e8ed;
  --color-subtitle: #b0b0c0;
  --color-accent: #30BCED;
  --color-accent-hover: #50d0f0;
  --color-ring: rgba(48, 188, 237, 0.08);
  --color-dot: #30BCED;
  --color-accent-alt: #FC5130;
  --color-cyan: #30BCED;
  --color-nav-bg: rgba(20, 20, 28, 0.85);
  --color-nav-border: rgba(255, 255, 255, 0.08);
  --color-nav-link: rgba(255, 255, 255, 0.45);
  --color-nav-link-hover: #ffffff;
  --color-nav-link-bg-hover: rgba(255, 255, 255, 0.08);
  --color-theme-btn: rgba(255, 255, 255, 0.4);
  --color-glow-cyan: rgba(48, 188, 237, 0.04);
  --color-glow-orange: rgba(252, 81, 48, 0.03);
  --color-text-3d: rgba(0, 0, 0, 0.3);
  --color-card-bg: rgba(255, 255, 255, 0.03);
  --color-card-border: rgba(255, 255, 255, 0.06);
  --color-card-shadow: rgba(0, 0, 0, 0.15);
  --color-btn-3d-inset: rgba(255, 255, 255, 0.06);
  --color-btn-3d-shade: rgba(0, 0, 0, 0.2);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: 
    radial-gradient(ellipse at 15% 30%, var(--color-glow-cyan) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 20%, var(--color-glow-orange) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 85%, var(--color-glow-cyan) 0%, transparent 40%),
    linear-gradient(135deg, var(--color-bg-start), var(--color-bg-end));
  background-attachment: fixed;
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, text-shadow 0.4s ease;
  color: var(--color-text);
  text-shadow: 0 1px 2px var(--color-text-3d);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  perspective: 1200px;
}

.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 48px;
  overflow: hidden;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  gap: 20px;
}

.hero-left {
  flex: 1;
  max-width: 560px;
  text-align: left;
  padding-top: 60px;
}

.hero-photo {
  width: 400px;
  height: 400px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 20px var(--color-card-shadow);
  border: 3px solid var(--color-cyan);
  flex-shrink: 0;
}

.hero-title {
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 14px;
  cursor: default;
  text-shadow: 0 2px 6px var(--color-text-3d);
  transition: color 0.4s ease, text-shadow 0.4s ease;
}

.hero-name {
  display: inline-block;
  white-space: nowrap;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  color: var(--color-subtitle);
  font-weight: 400;
  margin-bottom: 32px;
  text-shadow: 0 1px 3px var(--color-text-3d);
  transition: color 0.4s ease, text-shadow 0.4s ease;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-contact {
  display: inline-flex;
  align-items: center;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-cyan);
  padding: 13px 32px;
  border-radius: 8px;
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.1),
    0 6px 16px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.btn-contact:hover {
  background: #28a8d4;
  transform: translateY(-3px);
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.12),
    0 12px 32px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.btn-contact:active {
  transform: translateY(0);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-cv {
  display: inline-flex;
  align-items: center;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  background: transparent;
  padding: 13px 32px;
  border-radius: 8px;
  text-decoration: none;
  border: 2px solid var(--color-text);
  text-shadow: 0 1px 2px var(--color-text-3d);
  transition: all 0.3s ease;
}

.btn-cv:hover {
  background: var(--color-text);
  color: var(--color-bg-start);
  transform: translateY(-3px);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.1);
}

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

@media (max-width: 600px) {
  .hero-actions {
    flex-direction: column;
  }
}

.hl {
  display: inline-block;
  transition: color 0.25s ease;
}

.hl:hover {
  color: var(--color-accent-alt);
  animation: letterBounce 0.55s ease;
}

@keyframes letterBounce {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-7px); }
  50% { transform: translateY(0); }
  70% { transform: translateY(-3px); }
  85% { transform: translateY(0); }
  93% { transform: translateY(-1.5px); }
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

.page-section {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transform-style: preserve-3d;
}

.section-content {
  text-align: center;
  max-width: 1100px;
  padding: 24px 48px;
  transform-style: preserve-3d;
}

#projects .section-content {
  width: 100%;
  max-width: none;
  padding: 40px 48px;
}

#projects .projects-grid {
  max-width: 1200px;
  margin: 0 auto;
}

.section-content h2 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  text-shadow:
    0 1px 0 var(--color-text-3d),
    0 2px 4px var(--color-text-3d),
    0 4px 8px var(--color-text-3d);
  transition: color 0.4s ease, text-shadow 0.4s ease;
  transform: translateZ(10px);
}

.section-content p {
  color: var(--color-subtitle);
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 10px;
  text-shadow: 0 1px 2px var(--color-text-3d);
  transition: color 0.4s ease, text-shadow 0.4s ease;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: left;
  max-width: 900px;
  margin: 0 auto;
}

.project-card {
  display: block;
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: 12px;
  padding: 20px 20px;
  text-decoration: none;
  color: inherit;
  box-shadow:
    0 1px 3px var(--color-card-shadow),
    0 4px 12px var(--color-card-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
  transform: translateZ(0);
}

.project-card:hover {
  transform: translateY(-4px) translateZ(12px) rotateX(1deg);
  border-color: rgba(48, 188, 237, 0.4);
  box-shadow:
    0 4px 8px var(--color-card-shadow),
    0 12px 32px var(--color-card-shadow),
    0 0 40px rgba(48, 188, 237, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.project-card-tall {
  grid-row: span 2;
}

.project-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
  text-shadow: 0 1px 3px var(--color-text-3d);
  transition: color 0.4s ease, text-shadow 0.4s ease;
}

.project-card p {
  font-size: 0.85rem;
  color: var(--color-subtitle);
  line-height: 1.4;
  margin-bottom: 10px;
  text-shadow: 0 1px 1px var(--color-text-3d);
  transition: color 0.4s ease, text-shadow 0.4s ease;
}

.project-lang {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(252, 81, 48, 0.1);
  color: #FC5130;
  padding: 4px 10px;
  border-radius: 100px;
  margin-right: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06);
}

.project-stars {
  font-size: 0.8rem;
  color: var(--color-subtitle);
  text-shadow: 0 1px 2px var(--color-text-3d);
  transition: color 0.4s ease, text-shadow 0.4s ease;
}

#about.page-section {
  height: auto;
  min-height: 70vh;
  padding: 40px 0;
}

.about-layout {
  display: flex;
  justify-content: flex-end;
  text-align: left;
}

.about-text {
  max-width: 600px;
  margin-left: auto;
}

.about-text h2 {
  margin-bottom: 24px;
}

.about-text p {
  max-width: 600px;
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .about-layout {
    display: block;
    text-align: center;
  }
  .about-text {
    margin-left: 0;
    max-width: 100%;
  }
  .about-text p {
    max-width: 100%;
  }
}

.contact-footer {
  background: #0f0f12;
  color: #e8e8ed;
  padding: 100px 48px 60px;
  margin-top: 90px;
  transition: background 0.4s ease, color 0.4s ease;
}

body:not(.dark) .contact-footer {
  background: #1a1a22;
}

.contact-divider {
  width: 100%;
  height: 2px;
  background: #2a2a35;
  margin-bottom: 80px;
}

.contact-footer-inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.contact-footer-inner h2 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.contact-desc {
  font-size: 1.05rem;
  color: #b0b0c0;
  margin-bottom: 16px;
  line-height: 1.6;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

#skills.page-section {
  height: auto;
  min-height: 70vh;
  padding: 40px 0;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  max-width: 700px;
  margin: 0 auto;
}

.skill-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: 16px;
  padding: 20px 28px;
  min-width: 120px;
  box-shadow:
    0 1px 3px var(--color-card-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
  transform: translateZ(0);
}

.skills-grid:hover .skill-card {
  filter: blur(3px);
  opacity: 0.6;
  transition: all 0.3s ease;
}

.skills-grid:hover .skill-card:hover {
  filter: blur(0);
  opacity: 1;
  transform: scale(1.08) translateY(-4px);
  border-color: rgba(48, 188, 237, 0.4);
  box-shadow:
    0 4px 12px var(--color-card-shadow),
    0 0 30px rgba(48, 188, 237, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.skill-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.skill-icon svg {
  width: 28px;
  height: 28px;
  display: block;
}

.skill-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  border-radius: 4px;
}

.skill-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  text-shadow: 0 1px 2px var(--color-text-3d);
  transition: color 0.4s ease;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
  max-width: 500px;
  margin: 0 auto;
}

.contact-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1rem;
  font-weight: 500;
  color: #e8e8ed;
  background: #1a1a22;
  padding: 16px 24px;
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid #2a2a35;
  transition: all 0.3s ease;
}

body:not(.dark) .contact-btn {
  background: #25252e;
  border-color: #353540;
}

.contact-btn small {
  margin-left: auto;
  font-size: 0.85rem;
  color: #888;
  font-weight: 400;
}

.contact-btn:hover {
  background: #2a2a35;
  border-color: #30BCED;
  transform: translateX(4px);
  box-shadow: 0 0 20px rgba(48, 188, 237, 0.08);
}

.contact-btn:active {
  transform: translateX(0);
}

.nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--color-nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-nav-border);
  border-radius: 9999px;
  z-index: 100;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.04),
    0 8px 20px rgba(0, 0, 0, 0.08),
    0 20px 60px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease, background 0.4s ease, border-color 0.4s ease;
}

.nav:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.04),
    0 12px 28px rgba(0, 0, 0, 0.1),
    0 28px 80px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

body.dark .nav {
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 8px 20px rgba(0, 0, 0, 0.3),
    0 20px 60px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.dark .nav:hover {
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.25),
    0 12px 28px rgba(0, 0, 0, 0.35),
    0 28px 80px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-nav-link);
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
  border-radius: 9999px;
  background: transparent;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.04);
  transition: all 0.25s ease;
}

.nav-link:hover {
  color: var(--color-nav-link-hover);
  background: var(--color-nav-link-bg-hover);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}

.nav-link:active {
  transform: scale(0.92);
  text-shadow: none;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.08);
}

body.dark .nav-link {
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

body.dark .nav-link:hover {
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

body.dark .nav-link:active {
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--color-theme-btn);
  border-radius: 9999px;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.04);
  transition: all 0.25s ease;
  margin-left: 6px;
}

.theme-toggle:hover {
  background: var(--color-nav-link-bg-hover);
  color: var(--color-nav-link-hover);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}

.theme-toggle:active {
  transform: scale(0.88);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.08);
}

body.dark .theme-toggle {
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

body.dark .theme-toggle:hover {
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

body.dark .theme-toggle:active {
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.theme-toggle .moon {
  display: none;
}

body.dark .theme-toggle .sun {
  display: none;
}

body.dark .theme-toggle .moon {
  display: block;
}

@media (max-width: 900px) {
  .hero {
    padding: 0 24px;
  }

  .hero-inner {
    flex-direction: column;
    text-align: center;
  }

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

  .skills-grid {
    gap: 12px;
  }

  .skill-card {
    min-width: 100px;
    padding: 16px 20px;
  }
}

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

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #2a2a35;
  background: #1a1a22;
  color: #e8e8ed;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  background: #2a2a35;
  border-color: #30BCED;
}
body.dark .back-to-top {
  background: #25252e;
  border-color: #353540;
}

.status-badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f0f12;
  background: #30BCED;
  padding: 6px 14px;
  border-radius: 9999px;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(48,188,237,0.25);
  white-space: nowrap;
}
@media (max-width: 600px) {
  .status-badge { margin-top: 8px; }
}

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #2a2a35;
  background: #1a1a22;
  color: #e8e8ed;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  background: #2a2a35;
  border-color: #30BCED;
}
body.dark .back-to-top {
  background: #25252e;
  border-color: #353540;
}

.status-badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f0f12;
  background: #30BCED;
  padding: 6px 14px;
  border-radius: 9999px;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(48,188,237,0.25);
  white-space: nowrap;
}
@media (max-width: 600px) {
  .status-badge { margin-top: 8px; }
}
