:root {
  --bg: #101010;
  --panel: #1b1b1b;
  --panel-2: #242424;
  --text: #f4f4f4;
  --muted: #9a9a9a;
  --line: #3b3b3b;
  --accent: #ff7400;
  --accent-2: #ff3d24;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Tahoma, Arial, sans-serif;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 28px 7vw;
  background: rgba(16, 16, 16, 0.86);
  backdrop-filter: blur(12px);
}

.logo {
  color: var(--accent-2);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0;
}

.nav,
.footer-nav {
  display: flex;
  justify-content: center;
  gap: 42px;
  color: var(--muted);
  font-weight: 700;
}

.nav a:hover,
.footer-nav a:hover {
  color: var(--accent);
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 28px;
  border-radius: 7px;
  border: 2px solid var(--muted);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn.ghost {
  background: transparent;
}

.btn.small {
  min-height: 42px;
}

.section {
  padding: 86px 7vw;
}

.compact {
  padding-top: 60px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 24vw);
  min-height: 0;
  align-items: center;
  gap: 32px;
  padding-block: 48px;
  direction: ltr;
}

.hero-copy {
  min-width: 0;
  direction: rtl;
}

.eyebrow,
.hero h2,
.lead,
.section-title p,
.service-card p,
.about-text,
.project-card p,
.footer {
  color: var(--muted);
}

.hero h1 {
  margin: 14px 0;
  color: var(--accent);
  max-width: 100%;
  font-size: clamp(20px, 2vw, 32px);
  line-height: 1.25;
  letter-spacing: 0;
  white-space: nowrap;
  direction: ltr;
  text-align: right;
}

.hero h2 {
  margin: 0;
  font-size: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
}

.lead {
  max-width: 620px;
  font-size: 18px;
  line-height: 2;
}

.socials {
  display: flex;
  gap: 16px;
  margin: 28px 0;
}

.socials a {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
}

.socials a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 24px 0 28px;
}

.hero .socials {
  margin-block: 20px;
}

.stats {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 0;
  padding: 24px;
  background: var(--panel);
  border-radius: 7px;
}

.stats div {
  min-width: 135px;
  padding: 0 22px;
  border-left: 1px solid #666;
}

.stats div:first-child {
  border-left: 0;
}

.stats strong {
  display: block;
  color: var(--accent);
  font-size: 24px;
}

.stats span {
  display: block;
  margin-top: 10px;
  color: #ddd;
  font-weight: 800;
}

.portrait-wrap,
.about-image {
  position: relative;
  display: grid;
  min-height: 570px;
  place-items: end center;
}

.portrait-bg {
  position: absolute;
  bottom: 0;
  width: min(92%, 560px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #202020;
}

.portrait-wrap img,
.about-image img {
  position: relative;
  z-index: 1;
  width: min(92%, 540px);
  max-height: 650px;
  object-fit: contain;
  filter: grayscale(1);
}

.hero .portrait-wrap {
  min-height: 285px;
}

.hero .portrait-bg {
  width: min(92%, 280px);
}

.hero .portrait-wrap img {
  width: min(92%, 270px);
  max-height: 325px;
}

.section-title {
  margin-bottom: 46px;
  text-align: center;
}

.section-title h2 {
  margin: 0 0 16px;
  font-size: 36px;
}

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

.service-card {
  min-height: 255px;
  padding: 42px 30px;
  border-radius: 8px;
  background: var(--panel);
  text-align: center;
}

.service-card svg {
  width: 44px;
  height: 44px;
  color: var(--accent);
}

.service-card h3 {
  color: var(--accent);
}

.service-card p {
  line-height: 1.9;
}

.service-card--backend {
  grid-column: 1 / -1;
}

.service-card--backend p {
  max-width: 900px;
  margin-inline: auto;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(320px, 45%) 1fr;
  align-items: center;
  gap: 72px;
}

.about-text p {
  font-size: 18px;
  line-height: 2.2;
  text-align: justify;
}

.skills {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 36px;
  margin-top: 82px;
}

.skill-card {
  text-align: center;
}

.ring {
  position: relative;
  display: grid;
  width: 118px;
  height: 118px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--value) * 1%), #3a3a3a 0);
}

.ring::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: var(--bg);
}

.ring svg {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  padding: 8px;
  border-radius: 12px;
  background: var(--panel);
  color: var(--muted);
  box-sizing: content-box;
}

.skill-card strong {
  display: block;
  color: var(--accent);
  font-size: 28px;
}

.skill-card span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 20px;
  font-weight: 800;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-bottom: 52px;
}

.filters button {
  min-width: 128px;
  min-height: 48px;
  border: 0;
  border-radius: 7px;
  background: var(--panel-2);
  color: #cfcfcf;
  font-weight: 800;
  cursor: pointer;
}

.filters .active {
  background: var(--accent);
  color: #fff;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  overflow: hidden;
  border-radius: 8px;
  background: var(--panel-2);
}

.project-image {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  background: linear-gradient(135deg, #303030, #181818);
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-image span {
  color: var(--accent);
}

.project-image svg {
  width: 76px;
  height: 76px;
}

.project-card div:not(.project-image) {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
}

.project-card strong,
.project-card span {
  font-size: 13px;
}

.project-card span {
  color: var(--muted);
}

.project-card p {
  min-height: 62px;
  margin: 0;
  padding: 0 12px 14px;
  font-size: 13px;
  line-height: 1.7;
}

.contact-socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  max-width: 760px;
  margin: 0 auto;
}

.contact-socials a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
}

.contact-socials a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.footer {
  display: grid;
  justify-items: center;
  gap: 24px;
  padding: 60px 7vw 34px;
  background: var(--panel);
}

.footer .socials {
  margin: 0;
}

.contact-lines {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
  font-weight: 800;
}

@media (max-width: 920px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
    padding: 24px;
  }

  .menu-button {
    display: block;
  }

  .nav {
    position: absolute;
    top: 82px;
    right: 24px;
    left: 24px;
    display: none;
    flex-direction: column;
    gap: 18px;
    padding: 22px;
    border-radius: 8px;
    background: var(--panel);
  }

  .nav.open {
    display: flex;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
    gap: 28px;
    padding-block: 36px;
    text-align: center;
  }

  .hero-copy {
    display: grid;
    justify-items: center;
  }

  .hero h1 {
    font-size: clamp(14px, 4.2vw, 30px);
    text-align: center;
  }

  .stats {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 18px 8px;
  }

  .stats div {
    min-width: 0;
    padding: 0 10px;
  }

  .portrait-wrap,
  .about-image {
    min-height: 430px;
  }

  .hero .portrait-wrap {
    min-height: 215px;
  }

  .hero .portrait-bg {
    width: min(46%, 280px);
  }

  .hero .portrait-wrap img {
    width: min(46%, 270px);
  }

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

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

  .about-layout {
    grid-template-columns: 1fr;
  }

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

  .footer-nav {
    flex-wrap: wrap;
    gap: 22px;
  }
}

@media (max-width: 560px) {
  .site-header {
    gap: 12px;
  }

  .site-header .logo {
    font-size: 20px;
  }

  .btn.small {
    padding: 0 12px;
    font-size: 14px;
  }

  .section {
    padding: 64px 24px;
  }

  .hero {
    padding-block: 32px;
  }

  .stats span {
    font-size: 14px;
  }

  .hero-actions {
    justify-content: center;
  }

  .service-grid {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

  .service-card {
    min-height: 210px;
    padding: 28px 18px;
  }

  .service-card h3 {
    font-size: 18px;
  }

  .filters button {
    min-width: 0;
    padding: 0 18px;
  }

  .portfolio-grid {
    display: flex;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
  }

  .project-card {
    min-width: 39vw;
    scroll-snap-align: center;
  }

  .project-card div:not(.project-image) {
    display: grid;
    gap: 6px;
  }

  .contact-socials {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .contact-socials a {
    justify-content: center;
    padding: 0 12px;
  }
}
