:root {
  --bg: #090A0C;
  --card: #111318;
  --card-hover: #171A20;
  --text: #F4F4F5;
  --text-secondary: #9298A5;
  --border: #252932;
  --accent: #6C7CFF;
  --accent-light: #9AA5FF;
  --header-bg: rgba(9, 10, 12, 0.85);
  --rain-color: #FFFFFF;

  --font-display: 'Unbounded', sans-serif;
  --font-body: 'Golos Text', sans-serif;
}

[data-theme="light"] {
  --bg: #F5F5F7;
  --card: #FFFFFF;
  --card-hover: #ECEDF2;
  --text: #14161A;
  --text-secondary: #5B5F6A;
  --border: #DEE1E7;
  --header-bg: rgba(245, 245, 247, 0.85);
  --rain-color: #1A1D24;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F5F5F7;
    --card: #FFFFFF;
    --card-hover: #ECEDF2;
    --text: #14161A;
    --text-secondary: #5B5F6A;
    --border: #DEE1E7;
    --header-bg: rgba(245, 245, 247, 0.85);
    --rain-color: #1A1D24;
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s ease, color 0.4s ease;
}

#bgCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100svh;
  z-index: 0;
  pointer-events: none;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.03em;
  display: inline-block;
  transition: color 0.2s ease, letter-spacing 0.2s ease, transform 0.2s ease;
}

.logo:hover {
  color: var(--accent-light);
  letter-spacing: 0.06em;
  transform: translateY(-1px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.socials {
  display: flex;
  gap: 20px;
}

.social-link {
  position: relative;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  transition: color 0.2s ease, transform 0.2s ease;
}

.social-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: var(--accent-light);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.social-link:hover {
  color: var(--accent-light);
  transform: translateY(-1px);
}

.social-link:hover::after {
  transform: scaleX(1);
}

.theme-toggle {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, background-color 0.4s ease;
}

.theme-toggle:hover {
  color: var(--accent-light);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.theme-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-icon svg {
  width: 17px;
  height: 17px;
}

.theme-icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-icon-moon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

[data-theme="light"] .theme-icon-sun {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

[data-theme="light"] .theme-icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Hero */

.hero {
  padding: 100px 0 20px;
}

.hero-eyebrow {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(32px, 8vw, 64px);
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero-title .accent {
  color: var(--accent);
}

.hero-subtitle {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(16px, 2.6vw, 20px);
  color: var(--text);
  margin-bottom: 10px;
}

.hero-audience {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 520px;
}

.why {
  padding-top: 20px;
}

.why-eyebrow {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.hero-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.hero-points li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-points li {
  transition: transform 0.2s ease;
}

.hero-points li:hover {
  transform: translateX(4px);
}

.hero-point-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}

.hero-point-title::before {
  content: "→ ";
  color: var(--accent);
  display: inline-block;
  transition: transform 0.2s ease;
}

.hero-points li:hover .hero-point-title::before {
  transform: translateX(3px);
}

.hero-point-text {
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 22px;
}

.cta-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 28px;
}

.cta-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
}

@media (min-width: 620px) {
  .cta-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.cta-info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-info-card:hover {
  border-color: var(--accent);
  background: var(--card-hover);
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}

.cta-info-card h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 10px;
  transition: color 0.2s ease;
}

.cta-info-card:hover h4 {
  color: var(--accent-light);
}

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

.btn-primary {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  background: var(--accent);
  color: #090A0C;
  padding: 16px 32px;
  border-radius: 100px;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(108, 124, 255, 0.35);
}

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

/* Sections */

section {
  padding: 60px 0;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(24px, 5vw, 36px);
  margin-bottom: 12px;
}

.section-subtitle {
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 520px;
}

/* Project cards */

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 720px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .project-card.featured {
    grid-column: 1 / -1;
  }
}

.project-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
  background: var(--card-hover);
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.project-card:hover .project-title {
  color: var(--accent-light);
}

.project-media {
  height: 180px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.project-card.featured .project-media {
  height: 240px;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.project-card:hover .project-media img {
  transform: scale(1.04);
}

.project-media.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #111318 0%, #1a1d24 100%);
  color: var(--text-secondary);
  font-size: 13px;
}

.project-body {
  padding: 24px;
}

.project-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.project-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 12px;
  transition: color 0.2s ease;
}

.project-card.featured .project-title {
  font-size: 26px;
}

.project-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 18px;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-stack span {
  font-size: 12px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 12px;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.project-stack span:hover {
  color: var(--accent-light);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Circular skills gallery (auto-rotating) */

.gallery-section {
  padding: 20px 0 60px;
}

.gallery-stage {
  width: 100%;
  height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

@media (max-width: 479px) {
  .gallery-stage {
    height: 500px;
  }
}

.gallery-ring {
  position: relative;
  width: 1px;
  height: 1px;
  transform-style: preserve-3d;
  will-change: transform;
}

.gallery-item {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--gallery-card-w, 200px);
  height: var(--gallery-card-h, 130px);
  margin-left: calc(var(--gallery-card-w, 200px) / -2);
  margin-top: calc(var(--gallery-card-h, 130px) / -2);
}

.gallery-card {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.gallery-item:hover .gallery-card {
  border-color: var(--accent);
  background: var(--card-hover);
  transform: scale(1.04);
}

.gallery-card-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.56;
  transition: opacity 0.3s ease, transform 0.3s ease;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.gallery-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 10, 12, 0.48) 0%, rgba(9, 10, 12, 0.74) 55%, rgba(9, 10, 12, 0.92) 100%);
  z-index: 1;
  pointer-events: none;
}

.gallery-item:hover .gallery-card-photo {
  opacity: 0.65;
  transform: scale(1.05);
}

.gallery-skill-title,
.gallery-pain,
.gallery-tags {
  position: relative;
  z-index: 2;
}

.gallery-pain {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.4;
  color: rgba(244, 244, 245, 0.7);
  font-weight: 400;
}

.gallery-skill-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: break-word;
}

@media (max-width: 479px) {
  .gallery-card {
    padding: 16px;
    gap: 8px;
  }

  .gallery-skill-title {
    font-size: 14px;
    line-height: 1.2;
  }

  .gallery-pain {
    font-size: 11px;
  }

  .gallery-tags span {
    font-size: 9px;
    padding: 3px 7px;
  }
}

.gallery-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.gallery-tags span {
  font-size: 10px;
  color: rgba(244, 244, 245, 0.375);
  background: rgba(9, 10, 12, 0.55);
  border: 1px solid rgba(244, 244, 245, 0.35);
  border-radius: 100px;
  padding: 3px 8px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.gallery-item:hover .gallery-tags span {
  color: var(--accent-light);
  border-color: var(--accent);
}

[data-theme="light"] .gallery-card {
  box-shadow: 0 12px 32px rgba(20, 22, 26, 0.12);
}

[data-theme="light"] .gallery-card-photo,
[data-theme="light"] .gallery-card::after {
  display: none;
}

[data-theme="light"] .gallery-pain {
  color: var(--text-secondary);
}

[data-theme="light"] .gallery-tags span {
  color: var(--text-secondary);
  background: transparent;
  border-color: var(--border);
}

[data-theme="light"] .gallery-item:hover .gallery-tags span {
  color: var(--accent);
  border-color: var(--accent);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

@media (min-width: 620px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}
