:root {
  --bg: #050607;
  --bg-soft: #080a0c;
  --panel: rgba(10, 12, 14, 0.88);
  --panel-strong: rgba(12, 14, 16, 0.96);
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.055);
  --text: #f4f5f6;
  --muted: #8e949b;
  --dim: #5c6269;
  --silver: #aeb4bb;
  --green: #23c86b;
  --yellow: #e6b94b;
  --red: #ef5d67;
  --gray: #747b84;
  --blue: #83b8e8;
  --orange: #ef9d63;
  --code-green: #98b875;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 72% 7%, rgba(90, 99, 108, 0.08), transparent 25rem),
    radial-gradient(circle at 12% 34%, rgba(65, 72, 79, 0.05), transparent 23rem),
    linear-gradient(180deg, #07090a 0%, #040506 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font: inherit;
}

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

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid #d8dadd;
  outline-offset: 4px;
}

.page-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 84%);
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 20;
  padding: 28px 0 20px;
}

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

.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-bottom: 10px;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
}

.brand::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, #f3f4f5, #62686f 70%, transparent);
}

.brand span {
  color: #fafafa;
}

.brand strong {
  color: #91979e;
  font-weight: 800;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  color: #a8adb3;
  font-size: 0.9rem;
}

.main-nav a,
.main-nav button {
  position: relative;
  padding: 8px 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: color 160ms ease;
}

.main-nav a::after,
.main-nav button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: #f1f2f3;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 160ms ease;
}

.main-nav a:hover,
.main-nav button:hover,
.main-nav .active {
  color: #f6f7f8;
}

.main-nav a:hover::after,
.main-nav button:hover::after,
.main-nav .active::after {
  transform: scaleX(1);
}

.hero {
  display: grid;
  grid-template-columns: minmax(310px, 0.82fr) minmax(480px, 1.42fr);
  gap: 28px;
  align-items: stretch;
  padding-top: 18px;
}

.panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 15, 17, 0.93), rgba(7, 9, 11, 0.9));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.profile-card,
.code-card {
  min-height: 410px;
  border-radius: 16px;
}

.profile-card {
  padding: 26px;
}

.profile-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 22px;
}

.avatar-wrap {
  position: relative;
}

.avatar-wrap img {
  display: block;
  width: 116px;
  height: 116px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(220, 223, 226, 0.34);
  box-shadow:
    0 0 0 7px rgba(255, 255, 255, 0.018),
    0 0 34px rgba(159, 167, 175, 0.1);
}

.status-dot {
  position: absolute;
  right: 4px;
  bottom: 8px;
  width: 24px;
  height: 24px;
  border: 5px solid #0a0c0e;
  border-radius: 50%;
}

.profile-copy h1 {
  margin: 0 0 7px;
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  letter-spacing: -0.045em;
}

.status-line,
.country {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.country {
  margin-top: 18px;
}

.mini-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.contact-button {
  width: 100%;
  min-height: 46px;
  margin-top: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.035));
  color: #f6f6f6;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.contact-button svg {
  width: 18px;
  fill: currentColor;
}

.contact-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255,255,255,.08);
}

.profile-details {
  display: grid;
  gap: 10px;
  margin-top: 13px;
}

.detail-row {
  min-height: 66px;
  padding: 14px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}

.detail-row span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.72rem;
}

.detail-row strong {
  font-size: 0.94rem;
  font-weight: 600;
}

.detail-icon {
  width: 24px;
  fill: #949ba3;
}

.detail-status-dot {
  width: 14px;
  height: 14px;
  margin: 0 !important;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255,255,255,.025);
}

.social-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

.social-row a,
.social-row button {
  width: 28px;
  height: 28px;
  padding: 3px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  color: #9ca2a9;
  cursor: pointer;
  transition: color 160ms ease, transform 160ms ease;
}

.social-row a:hover,
.social-row button:hover {
  color: #fff;
  transform: translateY(-1px);
}

.social-row svg {
  width: 22px;
  fill: currentColor;
}

.code-card {
  overflow: hidden;
}

.code-topbar {
  position: relative;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line-soft);
  color: #6f757c;
  font: 500 0.76rem/1 JetBrains Mono, monospace;
}

.window-dots {
  position: absolute;
  left: 22px;
  display: flex;
  gap: 8px;
}

.window-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.window-dots i:nth-child(1) { background: #ed605c; }
.window-dots i:nth-child(2) { background: #eab84f; }
.window-dots i:nth-child(3) { background: #58c667; }

.code-area {
  padding: 25px 24px 30px;
  overflow: hidden;
  font: 500 clamp(0.75rem, 1.25vw, 0.92rem)/1.72 JetBrains Mono, monospace;
}

.code-line {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 25px;
  color: #dce0e4;
  white-space: nowrap;
}

.code-line .number {
  color: #50565d;
  user-select: none;
}

.code-line code {
  overflow: hidden;
  text-overflow: clip;
}

.code-line em {
  color: var(--code-green);
  font-style: normal;
}

.blue { color: var(--blue); font-weight: 500; }
.orange { color: var(--orange); font-weight: 500; }
.muted-code code { color: #6c737a; }
.spacer { min-height: 18px; }

.cursor {
  display: inline-block;
  color: #f5f6f7;
  animation: blink 850ms steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.status-dot.online,
.mini-dot.online,
.detail-status-dot.online { background: var(--green); }
.status-dot.idle,
.mini-dot.idle,
.detail-status-dot.idle { background: var(--yellow); }
.status-dot.dnd,
.mini-dot.dnd,
.detail-status-dot.dnd { background: var(--red); }
.status-dot.offline,
.mini-dot.offline,
.detail-status-dot.offline { background: var(--gray); }

.hidden {
  display: none !important;
}

.now-panel {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-radius: 15px;
  overflow: hidden;
}

.now-panel.single {
  grid-template-columns: 1fr;
}

.now-item {
  min-width: 0;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.now-item + .now-item {
  border-left: 1px solid var(--line);
}

.now-panel.single .now-item + .now-item {
  border-left: 0;
}

.now-art {
  width: 72px;
  height: 72px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #090b0d;
}

.now-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.activity-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #d8dbde;
  font: 700 1.55rem/1 JetBrains Mono, monospace;
  background: radial-gradient(circle at center, rgba(255,255,255,.08), transparent 68%);
}

.now-copy {
  min-width: 0;
}

.now-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9ca2a8;
  font: 600 0.66rem/1.2 JetBrains Mono, monospace;
  letter-spacing: 0.14em;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.activity-live { background: var(--red); }
.spotify-live { background: var(--green); }

.now-copy h2 {
  margin: 7px 0 5px;
  overflow: hidden;
  color: #f2f3f4;
  font-size: 1.13rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.now-copy p {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.83rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.now-item time {
  color: #6f757c;
  font: 500 0.72rem/1 JetBrains Mono, monospace;
}

.spotify-mark {
  width: 32px;
  fill: #1ed760;
}

.spotify-progress {
  height: 3px;
  margin-top: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
}

.spotify-progress div {
  width: 0;
  height: 100%;
  background: #d7d9dc;
  transition: width 450ms linear;
}

.spotify-times {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  color: #636970;
  font: 500 0.65rem/1 JetBrains Mono, monospace;
}

.projects-section {
  padding: 34px 0 44px;
  scroll-margin-top: 20px;
}

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

.section-heading span:first-child {
  color: #71777e;
  font: 600 0.67rem/1 JetBrains Mono, monospace;
  letter-spacing: 0.19em;
}

.section-heading h2 {
  margin: 9px 0 0;
  font: 500 clamp(1.35rem, 2.2vw, 1.75rem)/1.2 JetBrains Mono, monospace;
  letter-spacing: -0.045em;
}

.section-heading > a {
  padding-bottom: 4px;
  color: #9da3aa;
  font: 500 0.76rem/1 JetBrains Mono, monospace;
  transition: color 160ms ease;
}

.section-heading > a:hover {
  color: #fff;
}

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

.project-card {
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 20px 55px rgba(0,0,0,.3);
  transition: transform 180ms ease, border-color 180ms ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,.16);
}

.project-preview {
  position: relative;
  min-height: 164px;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}

.project-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 28%, rgba(4,5,6,.82) 100%);
}

.project-preview-label {
  position: absolute;
  z-index: 3;
  left: 20px;
  bottom: 18px;
  display: grid;
  justify-items: start;
  gap: 7px;
}

.project-preview-label strong {
  font: 600 1.05rem/1.08 JetBrains Mono, monospace;
  letter-spacing: -0.035em;
}

.project-preview-label small {
  padding: 3px 5px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 4px;
  color: #9ea4aa;
  font: 500 0.58rem/1 JetBrains Mono, monospace;
}

.sentinel-preview {
  background:
    radial-gradient(circle at 72% 36%, rgba(137,145,153,.17), transparent 31%),
    linear-gradient(135deg, #080a0b, #0d1012 58%, #050607);
}

.camera-shape {
  position: absolute;
  right: 28px;
  top: 41px;
  width: 150px;
  height: 54px;
  border-radius: 8px 16px 16px 8px;
  background: linear-gradient(165deg, #3b4147 0%, #15191d 45%, #050607 100%);
  transform: rotate(-12deg);
  box-shadow: 0 25px 35px rgba(0,0,0,.65);
}

.camera-shape::before {
  content: "";
  position: absolute;
  right: -18px;
  top: 11px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 7px solid #1b2024;
  background: radial-gradient(circle, #07090a 0 36%, #3e464d 38% 45%, #0b0e10 48%);
}

.camera-shape span {
  position: absolute;
  left: 38px;
  bottom: -24px;
  width: 42px;
  height: 30px;
  background: #121518;
  clip-path: polygon(28% 0, 100% 0, 78% 100%, 0 100%);
}

.lfm-preview {
  background: radial-gradient(circle at 72% 42%, rgba(184,120,50,.12), transparent 34%), #080a0b;
}

.fake-list {
  position: absolute;
  right: 24px;
  top: 36px;
  width: 58%;
  display: grid;
  gap: 11px;
}

.fake-list i {
  position: relative;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,.055);
  background: linear-gradient(90deg, rgba(255,255,255,.04), transparent);
}

.fake-list i::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 7px;
  width: 46%;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, #b87531, #7d4e21, transparent);
}

.firearms-preview {
  background: radial-gradient(circle at 82% 30%, rgba(169,79,53,.11), transparent 30%), #07090a;
}

.fake-dashboard {
  position: absolute;
  right: 24px;
  top: 26px;
  width: 58%;
  height: 104px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 7px;
  background: rgba(255,255,255,.018);
}

.fake-dashboard i {
  border: 1px solid rgba(255,255,255,.045);
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(255,255,255,.04), transparent);
}

.fake-dashboard i:first-child {
  grid-column: 1 / -1;
}

.project-body {
  padding: 20px;
}

.project-body h3 {
  margin: 0 0 8px;
  font: 600 1rem/1.2 JetBrains Mono, monospace;
}

.project-body p {
  min-height: 58px;
  margin: 0;
  color: var(--muted);
  font: 400 0.77rem/1.55 JetBrains Mono, monospace;
}

.project-meta {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #a6abb1;
  font: 500 0.72rem/1 JetBrains Mono, monospace;
}

.project-meta b {
  font-size: 0.9rem;
  font-weight: 500;
}

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 25px 0 34px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.footer-clock {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #878d94;
  font: 500 0.77rem/1 JetBrains Mono, monospace;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
  color: #8e949a;
  font: 500 0.76rem/1 JetBrains Mono, monospace;
}

.footer-links button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.footer-links a:hover,
.footer-links button:hover {
  color: #fff;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 99;
  padding: 11px 15px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 10px;
  background: #111417;
  color: #eef0f2;
  font-size: 0.79rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
  box-shadow: 0 15px 35px rgba(0,0,0,.4);
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

  .profile-card,
  .code-card {
    min-height: auto;
  }

  .profile-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
    column-gap: 24px;
  }

  .profile-head,
  .social-row {
    grid-column: 1;
  }

  .contact-button,
  .profile-details {
    grid-column: 2;
  }

  .contact-button {
    margin-top: 0;
  }

  .profile-details {
    align-self: start;
  }

  .projects-grid {
    grid-template-columns: 1fr 1fr;
  }

  .project-card:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 26px, 1180px);
  }

  .site-header {
    padding-top: 20px;
  }

  .main-nav {
    gap: 17px;
    font-size: 0.8rem;
  }

  .main-nav .nav-contact {
    display: none;
  }

  .hero {
    padding-top: 8px;
    gap: 16px;
  }

  .profile-card {
    display: block;
    padding: 21px;
  }

  .profile-head {
    gap: 17px;
  }

  .avatar-wrap img {
    width: 92px;
    height: 92px;
  }

  .contact-button {
    margin-top: 22px;
  }

  .code-area {
    padding: 20px 15px 24px;
    overflow-x: auto;
  }

  .code-line {
    min-width: 570px;
  }

  .now-panel {
    grid-template-columns: 1fr;
  }

  .now-item + .now-item {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-card:last-child {
    grid-column: auto;
  }

  .section-heading {
    align-items: start;
  }

  .section-heading > a {
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .brand {
    font-size: 1.25rem;
  }

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

  .profile-head {
    grid-template-columns: auto 1fr;
  }

  .profile-copy h1 {
    font-size: 1.55rem;
  }

  .now-item {
    grid-template-columns: 58px minmax(0, 1fr);
    padding: 18px;
  }

  .now-art {
    width: 58px;
    height: 58px;
  }

  .now-item time,
  .spotify-mark {
    display: none;
  }

  .section-heading {
    display: block;
  }

  .section-heading > a {
    display: inline-block;
    margin-top: 13px;
  }

  .footer-inner {
    align-items: flex-end;
  }

  .footer-links {
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}