:root {
  --bg: #020812;
  --bg-2: #04101d;
  --panel: rgba(3, 12, 24, 0.82);
  --panel-2: rgba(5, 16, 31, 0.9);
  --cyan: #13d9ff;
  --cyan-soft: rgba(19, 217, 255, 0.58);
  --cyan-line: rgba(19, 217, 255, 0.38);
  --text: #f4f7fb;
  --muted: #a9b6c6;
  --muted-2: #718399;
  --green: #20f38c;
  --radius: 14px;
  --max: 1380px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(28, 137, 190, 0.14), transparent 35rem),
    linear-gradient(180deg, #020711 0%, #03101d 42%, #020711 100%);
  color: var(--text);
  font-family: Manrope, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -4;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(19, 217, 255, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(19, 217, 255, 0.025) 1px, transparent 1px);
  background-size: 92px 92px;
  mask-image: linear-gradient(180deg, black, transparent 86%);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 0% 40%, rgba(19, 217, 255, 0.14), transparent 19rem),
    radial-gradient(circle at 100% 43%, rgba(19, 217, 255, 0.14), transparent 20rem),
    linear-gradient(90deg, rgba(1, 5, 12, 0.86) 0%, transparent 20%, transparent 80%, rgba(1, 5, 12, 0.86) 100%);
}

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

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

.network-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  opacity: 0.82;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 210px 1fr auto;
  align-items: center;
  gap: 26px;
  min-height: 80px;
  padding: 0 clamp(26px, 4.2vw, 66px);
  border-bottom: 1px solid rgba(19, 217, 255, 0.1);
  background: rgba(2, 7, 15, 0.8);
  backdrop-filter: blur(18px);
}

.brand {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(24px, 2.2vw, 32px);
  font-weight: 700;
  letter-spacing: -0.06em;
}

.brand span {
  color: var(--cyan);
  text-shadow: 0 0 18px rgba(19, 217, 255, 0.5);
}

.brand b {
  color: #f8fbff;
  font-weight: 700;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(30px, 4vw, 58px);
  color: #f1f5fa;
  font: 600 15px/1 "IBM Plex Mono", monospace;
}

.main-nav a:first-child {
  color: var(--cyan);
}

.main-nav a,
.phone-link,
.action-link {
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--cyan);
}

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

.phone-link {
  color: var(--cyan);
  font: 600 17px/1 "IBM Plex Mono", monospace;
  white-space: nowrap;
}

.action-link {
  display: inline-flex;
  min-width: 134px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid var(--cyan-line);
  border-radius: 5px;
  background: rgba(3, 13, 25, 0.72);
  color: #f7fbff;
  font: 600 15px/1 "IBM Plex Mono", monospace;
  box-shadow: inset 0 0 24px rgba(19, 217, 255, 0.03);
}

.action-link svg {
  width: 20px;
  height: 20px;
  fill: var(--cyan);
}

.action-link:hover,
.action-link:focus-visible {
  border-color: rgba(19, 217, 255, 0.9);
  box-shadow: 0 0 24px rgba(19, 217, 255, 0.16), inset 0 0 28px rgba(19, 217, 255, 0.08);
  color: var(--cyan);
  transform: translateY(-1px);
}

main {
  position: relative;
  width: min(calc(100% - 84px), var(--max));
  margin: 0 auto;
  padding: 16px 0 44px;
}

.hero-shell {
  display: grid;
  grid-template-columns: 356px minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  width: min(100%, 1138px);
  margin: 0 0 0 clamp(0px, 10.85vw, 150px);
  padding-top: 0;
}

.portrait-card,
.profile-card,
.project-card,
.contact-strip {
  border: 1px solid var(--cyan-line);
  background:
    linear-gradient(180deg, rgba(6, 18, 34, 0.82), rgba(1, 8, 18, 0.84)),
    radial-gradient(circle at 50% 0%, rgba(19, 217, 255, 0.12), transparent 35rem);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.22),
    0 0 40px rgba(0, 128, 255, 0.08),
    inset 0 0 38px rgba(19, 217, 255, 0.035);
}

.portrait-card {
  min-height: 448px;
  padding: 8px 8px 20px;
  border-radius: 17px;
}

.portrait-frame {
  height: 370px;
  overflow: hidden;
  border-radius: 12px;
  background: #111;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
  transform: scale(1.11);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 22px 18px 0;
  color: #e7edf7;
  font: 500 13px/1 "IBM Plex Mono", monospace;
}

.status-line span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 18px rgba(32, 243, 140, 0.85);
}

.profile-card {
  position: relative;
  min-height: 448px;
  padding: 24px 28px 32px;
  border-radius: 14px;
}

.profile-card::before,
.project-card::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(19, 217, 255, 0.08), transparent 22%, transparent 75%, rgba(19, 217, 255, 0.08));
}

.code-tag {
  margin: 0;
  color: var(--cyan);
  font: 600 14px/1 "IBM Plex Mono", monospace;
}

.profile-card h1 {
  margin: 16px 0 12px;
  font-size: clamp(42px, 4.8vw, 55px);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.profile-card h1 span {
  color: #51baff;
  text-shadow: 0 0 20px rgba(81, 186, 255, 0.35);
}

.profile-card p:not(.code-tag) {
  max-width: 760px;
  margin: 0;
  color: #b8c6d8;
  font: 500 16px/1.45 "IBM Plex Mono", monospace;
}

.profile-card .lead {
  max-width: 760px;
  margin-bottom: 18px;
  color: #f4f5f7;
  font-size: clamp(22px, 2.12vw, 25px);
  line-height: 1.35;
  letter-spacing: -0.04em;
}

.profile-card .lead + p {
  margin-bottom: 16px;
}

.tech-block {
  margin-top: 22px;
}

.tech-block strong {
  display: block;
  margin-bottom: 9px;
  color: var(--cyan);
  font: 600 14px/1 "IBM Plex Mono", monospace;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.tag-row span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(135, 154, 180, 0.34);
  border-radius: 4px;
  background: rgba(6, 9, 18, 0.72);
  color: #dce5f2;
  font: 500 13px/1 "IBM Plex Mono", monospace;
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.02);
}

.code-tag-end {
  position: absolute;
  right: 32px;
  bottom: 13px;
}

.projects-section {
  margin-top: 24px;
  padding: 10px 38px 0;
  border-top: 1px solid rgba(19, 217, 255, 0.14);
  border-bottom: 1px solid rgba(19, 217, 255, 0.06);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 8px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.section-head h2 {
  margin-top: 8px;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.section-head > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--cyan);
  font: 500 14px/1 "IBM Plex Mono", monospace;
}

.section-head svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

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

.project-card {
  position: relative;
  overflow: hidden;
  min-height: 354px;
  border-radius: 10px;
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.project-card:hover {
  border-color: rgba(19, 217, 255, 0.72);
  box-shadow:
    0 0 0 1px rgba(19, 217, 255, 0.08),
    0 18px 54px rgba(0, 122, 255, 0.14);
  transform: translateY(-3px);
}

.project-card img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 216px;
  object-fit: contain;
  padding: 11px 10px 0;
}

.project-copy {
  position: relative;
  z-index: 1;
  padding: 5px 18px 16px;
}

.project-copy h3 {
  margin-bottom: 9px;
  color: #f4f7fb;
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.project-copy p {
  min-height: 41px;
  margin-bottom: 13px;
  color: var(--muted);
  font: 500 13px/1.35 "IBM Plex Mono", monospace;
}

.project-copy .tag-row {
  gap: 8px;
}

.project-copy .tag-row span {
  min-height: 27px;
  padding-inline: 9px;
  font-size: 12px;
}

.project-close {
  margin: 13px 0 0 -10px;
}

.contact-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin: 28px auto 0;
  padding: 18px;
  border-radius: 10px;
  color: #dce7f5;
  font: 600 14px/1 "IBM Plex Mono", monospace;
}

.contact-strip span {
  width: 22px;
  height: 22px;
  border: 1px solid var(--cyan-line);
  transform: rotate(45deg);
  box-shadow: 0 0 18px rgba(19, 217, 255, 0.32);
}

.contact-strip a:hover,
.contact-strip a:focus-visible {
  color: var(--cyan);
}

@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-block: 18px;
  }

  .main-nav,
  .header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .hero-shell {
    grid-template-columns: 330px minmax(0, 1fr);
  }

  .profile-card h1 {
    font-size: clamp(38px, 5.5vw, 50px);
  }

  .profile-card .lead {
    font-size: clamp(20px, 2.6vw, 23px);
  }
}

@media (max-width: 920px) {
  main {
    width: min(calc(100% - 30px), var(--max));
  }

  .hero-shell,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .hero-shell {
    width: 100%;
    margin-inline: 0;
  }

  .portrait-card {
    max-width: 420px;
    margin: 0 auto;
  }

  .section-head {
    align-items: flex-start;
  }

  .project-card {
    min-height: 0;
  }

  .project-card img {
    height: auto;
    aspect-ratio: 16 / 7.4;
  }
}

@media (max-width: 640px) {
  .network-canvas {
    opacity: 0.46;
  }

  .site-header {
    min-height: 0;
    padding: 16px;
  }

  .main-nav {
    gap: 18px;
    font-size: 13px;
  }

  .header-actions {
    gap: 10px;
  }

  .phone-link {
    width: 100%;
    font-size: 14px;
  }

  .action-link {
    min-width: calc(50% - 5px);
    font-size: 13px;
  }

  .portrait-card {
    min-height: 0;
  }

  .portrait-frame {
    height: auto;
    aspect-ratio: 1 / 1.05;
  }

  .profile-card {
    min-height: 0;
    padding: 20px 18px 38px;
  }

  .profile-card h1 {
    font-size: clamp(34px, 12vw, 44px);
  }

  .profile-card .lead {
    font-size: 19px;
  }

  .profile-card p:not(.code-tag) {
    font-size: 14px;
  }

  .code-tag-end {
    right: 18px;
  }

  .projects-section {
    padding-inline: 0;
  }

  .section-head {
    display: block;
    margin-bottom: 14px;
  }

  .section-head > a {
    margin-top: 12px;
  }

  .project-card img {
    aspect-ratio: 16 / 9;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
