:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: rgba(15, 15, 15, 0.92);
  --surface-strong: rgba(25, 25, 25, 0.95);
  --text: #f7f7f7;
  --muted: #aaaaaa;
  --accent: #ffd700;
  --accent-soft: rgba(255, 215, 0, 0.18);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 24px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  background: #000;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

button,
a {
  font: inherit;
}

.page-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 215, 0, 0.3), transparent 20%),
    radial-gradient(circle at calc(var(--mouse-x, 50%) + 15%) calc(var(--mouse-y, 50%) + 10%), rgba(255, 255, 255, 0.2), transparent 18%),
    radial-gradient(circle at calc(var(--mouse-x, 50%) - 20%) calc(var(--mouse-y, 50%) - 15%), rgba(255, 215, 0, 0.15), transparent 25%),
    radial-gradient(circle at calc(var(--mouse-x, 50%) + 30%) calc(var(--mouse-y, 50%) - 20%), rgba(255, 255, 255, 0.1), transparent 22%);
  transition: background 0.3s ease-out;
  animation: backgroundGlow 8s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes backgroundGlow {
  0% {
    filter: brightness(1) contrast(1);
  }
  50% {
    filter: brightness(1.1) contrast(1.05);
  }
  100% {
    filter: brightness(0.95) contrast(0.98);
  }
}

.page-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.03), transparent 18%),
              radial-gradient(circle at bottom right, rgba(255, 215, 0, 0.05), transparent 20%);
  z-index: 1;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  width: 100%;
  backdrop-filter: blur(18px);
  background: rgba(0, 0, 0, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 76px;
}

.logo {
  color: var(--text);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.navigation {
  display: flex;
  gap: 1.5rem;
}

.navigation a {
  color: var(--muted);
  text-decoration: none;
  position: relative;
  transition: color 0.25s ease;
}

.navigation a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.28s ease;
}

.navigation a:hover,
.navigation a:focus-visible {
  color: var(--accent);
}

.navigation a:hover::after,
.navigation a:focus-visible::after {
  width: 100%;
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: 120px;
}

.hero-content {
  max-width: 720px;
}

.eyebrow {
  display: inline-block;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.78rem;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(3.8rem, 5vw, 5.6rem);
  line-height: 0.98;
  margin: 0;
}

.hero h1 span {
  color: var(--accent);
}

.hero-copy {
  margin-top: 1.6rem;
  max-width: 680px;
  line-height: 1.8;
  color: var(--muted);
  font-size: 1.02rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 1rem 1.9rem;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease), background-color 0.25s ease, box-shadow 0.25s ease;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.25), transparent 35%);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.btn:hover::after,
.btn:focus-visible::after {
  opacity: 1;
  transform: scale(1);
}

.primary-btn {
  margin-top: 2.2rem;
  background: var(--accent);
  color: #000;
  box-shadow: 0 14px 40px rgba(255, 215, 0, 0.2);
}

.primary-btn:hover,
.primary-btn:focus-visible {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 45px rgba(255, 215, 0, 0.3), 0 0 20px rgba(255, 215, 0, 0.2);
  filter: brightness(1.05);
}

.secondary-btn {
  background: rgba(255, 215, 0, 0.12);
  color: var(--text);
  border: 1px solid rgba(255, 215, 0, 0.25);
}

.secondary-btn:hover,
.secondary-btn:focus-visible,
.ghost-btn:hover,
.ghost-btn:focus-visible {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 35px rgba(255, 215, 0, 0.15);
  filter: brightness(1.02);
  background: rgba(255, 215, 0, 0.18);
}

.ghost-btn {
  margin-left: 1rem;
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.section-label {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  margin-bottom: 0.75rem;
}

.about,
.projects,
.contact {
  padding: 100px 0;
}

section {
  scroll-margin-top: 110px;
}

.section-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: center;
}

.section-text h2,
.section-header h2,
.contact-card h2 {
  font-size: clamp(2.2rem, 4vw, 3rem);
  margin: 0;
}

.section-text p,
.about-card p,
.contact-card p {
  color: var(--muted);
  line-height: 1.85;
}

.section-text ul {
  margin: 1.8rem 0 0;
  padding-left: 1.2rem;
  color: var(--text);
  line-height: 1.9;
}

.section-text ul li {
  margin-bottom: 0.85rem;
}

.about-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.about-highlight {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.8;
}

.section-header {
  margin-bottom: 2.5rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.8rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease), border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 215, 0, 0.08), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: -1;
}

.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 215, 0, 0.04));
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
  transform: scale(0.95);
  z-index: -2;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(255, 215, 0, 0.65);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 215, 0, 0.08);
  background: rgba(255, 255, 255, 0.015);
}

.project-card:hover::before,
.project-card:focus-visible::before {
  opacity: 1;
}

.project-card:hover::after,
.project-card:focus-visible::after {
  opacity: 1;
  transform: scale(1);
}

.project-card:hover h3,
.project-card:focus-visible h3,
.project-card:hover p,
.project-card:focus-visible p,
.project-card:hover .project-meta span,
.project-card:focus-visible .project-meta span {
  color: #ffffff;
}

.project-card {
  outline: none;
}

.project-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.project-card h3 {
  margin: 1.4rem 0 0.9rem;
  font-size: 1.4rem;
  position: relative;
  z-index: 1;
}

.project-card p {
  color: var(--muted);
  line-height: 1.85;
  margin: 0;
  position: relative;
  z-index: 1;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

.project-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.project-tag.green { background: rgba(87, 166, 57, 0.16); color: #a7ff6d; box-shadow: inset 0 0 0 1px rgba(167, 255, 109, 0.12); }
.project-tag.yellow { background: rgba(255, 215, 0, 0.16); color: #ffd700; box-shadow: inset 0 0 0 1px rgba(255, 215, 0, 0.18); }
.project-tag.blue { background: rgba(46, 112, 255, 0.16); color: #81b4ff; box-shadow: inset 0 0 0 1px rgba(129, 180, 255, 0.16); }

.project-tag {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover .project-tag,
.project-card:focus-visible .project-tag {
  transform: translateY(-2px);
  box-shadow: 0 10px 35px rgba(255, 215, 0, 0.12);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
  position: relative;
  z-index: 1;
}

.project-meta span {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  font-size: 0.9rem;
}

.contact-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}

.contact-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer {
  padding: 2rem 0;
  text-align: center;
  color: var(--muted);
}

.footer-inner {
  position: relative;
  z-index: 2;
}

.social-floating {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  display: grid;
  gap: 0.75rem;
  z-index: 5;
}

.social-floating a {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  text-decoration: none;
  transition: transform 0.25s var(--ease), background-color 0.25s ease, color 0.25s ease;
}

.social-floating a:hover,
.social-floating a:focus-visible {
  transform: scale(1.1);
  background: var(--accent);
  color: #000;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 15;
}

.modal-overlay.open {
  display: flex;
}

.modal-window {
  position: relative;
  width: min(760px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(10, 10, 10, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  padding: 2.5rem;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55);
  transform: translateY(24px);
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.modal-overlay.open .modal-window {
  transform: translateY(0);
  opacity: 1;
}

.modal-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1.15rem;
  cursor: pointer;
}

.modal-tag {
  display: inline-block;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
}

.modal-window h3 {
  margin: 1rem 0 1rem;
  font-size: 2rem;
}

.modal-window p {
  color: var(--muted);
  line-height: 1.8;
}

.modal-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  margin-top: 1.75rem;
}

.modal-details h4 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.modal-details ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text);
  line-height: 1.9;
}

.modal-details ul li {
  margin-bottom: 0.9rem;
}

@media (max-width: 960px) {
  .section-grid,
  .modal-details {
    grid-template-columns: 1fr;
  }

  .project-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    padding: 1rem 0;
  }

  .navigation {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .hero {
    padding-top: 140px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .social-floating {
    right: 1rem;
    bottom: 1rem;
    grid-auto-flow: column;
    background: rgba(0, 0, 0, 0.15);
    padding: 0.75rem;
    border-radius: 999px;
  }
}

@media (max-width: 520px) {
  .hero {
    padding-top: 100px;
    padding-bottom: 2rem;
  }

  .hero h1 {
    font-size: 3rem;
  }

  .hero-copy {
    font-size: 0.98rem;
    max-width: 100%;
  }

  .section-label {
    font-size: 0.72rem;
  }

  .section-text ul {
    padding-left: 1rem;
  }

  .about-card,
  .project-card,
  .contact-card {
    padding: 1.6rem;
  }

  .project-card h3 {
    font-size: 1.2rem;
  }

  .project-meta span {
    font-size: 0.82rem;
    padding: 0.55rem 0.8rem;
  }

  .modal-window {
    border-radius: 22px;
    padding: 1.8rem;
  }

  .modal-window h3 {
    font-size: 1.6rem;
  }

  .modal-details {
    gap: 1rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .contact-actions {
    flex-direction: column;
  }

  .social-floating {
    right: 0.85rem;
    bottom: 0.85rem;
    padding: 0.5rem;
  }

  .social-floating a {
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 420px) {
  .container {
    width: calc(100% - 1rem);
  }

  .header-inner {
    padding: 0.75rem 0;
  }

  .navigation {
    gap: 0.75rem;
  }

  .hero h1 {
    font-size: 2.4rem;
  }

  .hero-copy {
    font-size: 0.94rem;
  }

  .section-text p,
  .contact-card p,
  .about-highlight {
    font-size: 0.96rem;
  }

  .section-grid {
    gap: 1.5rem;
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
