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

:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --surface: #181822;
  --border: #222536;
  --accent: #22d3ee;
  --accent2: #38bdf8;
  --accent-dim: #06b6d4;
  --accent-faint: rgba(34, 211, 238, 0.08);
  --accent-glow: rgba(34, 211, 238, 0.18);
  --ok: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --white: #f4f4f5;
  --text: #e4e4e7;
  --muted: #71717a;
  --muted2: #52525b;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Outfit", system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.grid-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(34, 211, 238, 0.07), transparent 70%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(10, 10, 15, 0.08) 2px,
    rgba(10, 10, 15, 0.08) 4px
  );
}

#matrix-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.18;
  pointer-events: none;
}

.cursor,
.cursor-ring {
  display: none;
}

@media (pointer: fine) {
  body {
    cursor: none;
  }

  a,
  button,
  input,
  textarea,
  .btn {
    cursor: none;
  }

  .cursor {
    display: block;
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 12px var(--accent);
  }

  .cursor-ring {
    display: block;
    position: fixed;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(34, 211, 238, 0.4);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
  }
}

#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.boot-container {
  width: min(640px, 100%);
  font-size: 12px;
  line-height: 1.8;
}

.boot-line {
  opacity: 0;
  animation: fadeIn 0.2s forwards;
}

.boot-line.ok::before {
  content: "[  OK  ] ";
  color: var(--ok);
}

.boot-line.info {
  color: var(--accent);
}

.boot-line.warn {
  color: var(--amber);
}

.boot-bar {
  margin-top: 16px;
  height: 4px;
  background: var(--border);
  overflow: hidden;
}

.boot-bar-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: fillBar 1.2s ease forwards;
}

@keyframes fillBar {
  to {
    width: 100%;
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  backdrop-filter: blur(12px);
  background: rgba(10, 10, 15, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.nav-brand {
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  text-transform: none;
}

.nav-brand span {
  color: var(--muted);
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: transparent;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 12px;
}

main {
  position: relative;
  z-index: 1;
  padding-top: 52px;
}

section {
  min-height: 100vh;
  padding: 80px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 12px;
}

#hero {
  display: flex;
  align-items: center;
  padding-top: 120px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  width: 100%;
}

.hero-terminal,
.contact-terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(34, 211, 238, 0.05), 0 20px 80px rgba(0, 0, 0, 0.5);
}

.terminal-header {
  background: #1a1a28;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

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

.dot.red {
  background: #ff5f57;
}

.dot.yellow {
  background: #febc2e;
}

.dot.green-d {
  background: #28c840;
}

.terminal-title {
  font-size: 11px;
  color: var(--muted);
  margin-left: 8px;
  letter-spacing: 1px;
}

.terminal-body {
  padding: 24px;
  min-height: 320px;
}

.term-line {
  margin-bottom: 6px;
  font-size: 13px;
}

.prompt {
  color: var(--ok);
  margin-right: 8px;
  white-space: nowrap;
  font-weight: 700;
}

.prompt-user {
  color: var(--accent2);
}

.prompt-host {
  color: var(--accent);
}

.prompt-path {
  color: var(--amber);
}

.term-output {
  color: var(--white);
  opacity: 0.85;
  font-size: 12px;
  margin-bottom: 4px;
  white-space: pre;
}

.term-output.cyan {
  color: var(--accent2);
  opacity: 1;
}

.term-output.hdr {
  color: var(--muted);
  opacity: 1;
}

.term-output.ok {
  color: var(--ok);
  opacity: 1;
}

.term-flag {
  color: var(--amber);
}

.term-val {
  color: var(--muted);
}

.term-status {
  color: var(--ok);
}

.blink {
  animation: blink 1s step-end infinite;
}

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

.hero-title {
  font-family: var(--sans);
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 22px;
}

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

.hero-title .dim {
  color: var(--muted);
  font-weight: 300;
  font-size: 0.42em;
  letter-spacing: 0.04em;
}

.hero-role {
  font-size: 13px;
  color: var(--accent2);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 4px;
  margin-bottom: 24px;
}

.hero-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 32px;
  max-width: 440px;
  border-left: 2px solid var(--border);
  padding-left: 16px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}

.tag {
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  letter-spacing: 1px;
}

.tag.highlight {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-faint);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--mono);
  font-size: 12px;
  padding: 10px 24px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: transparent;
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn:hover {
  background: var(--accent);
  color: var(--bg);
}

.btn.secondary {
  border-color: var(--border);
  color: var(--muted);
}

.btn.secondary:hover {
  border-color: var(--muted);
  color: var(--white);
  background: transparent;
}

.btn:disabled {
  opacity: 0.55;
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 80px;
}

.stat-item {
  background: var(--surface);
  padding: 24px;
  text-align: center;
}

.stat-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 4px;
}

#about {
  padding-top: 100px;
}

.about-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 60px;
  align-items: start;
  margin-top: 48px;
}

.profile-block {
  position: sticky;
  top: 80px;
  width: 260px;
  max-width: 100%;
}

.profile-img-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  max-width: 100%;
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--accent);
  border-radius: 14px;
}

.profile-img-wrap::before {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid var(--accent);
  border-radius: 16px;
  opacity: 0.35;
  transform: translate(6px, 6px);
  pointer-events: none;
  z-index: 1;
}

.profile-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 12%;
  display: block;
}

.profile-avatar {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.meta-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.meta-key {
  color: var(--muted);
  min-width: 88px;
}

.meta-val {
  color: var(--white);
}

.about-content h2 {
  font-family: var(--sans);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  line-height: 1.25;
}

.about-content h2 em {
  color: var(--accent);
  font-style: normal;
}

.about-content p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
  margin-bottom: 14px;
}

.about-content strong {
  color: var(--text);
  font-weight: 500;
}

.skills-section {
  margin-top: 36px;
}

.skills-title {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.skills-title::before {
  content: "> ";
  color: var(--accent);
}

.skill-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
}

.skill-name {
  color: var(--white);
}

.skill-pct {
  color: var(--accent);
}

.skill-track {
  height: 3px;
  background: var(--border);
}

.skill-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-dim);
  transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 6px;
  background: transparent;
  border: none;
  box-shadow: none;
  text-align: center;
}

.badge-card:hover img,
.badge-card:hover svg,
.badge-card:hover .profile-avatar {
  transform: translateY(-4px);
}

.badge-card img,
.badge-card svg {
  width: 120px;
  height: 120px;
  object-fit: contain;
  transition: transform 0.25s;
}

.badge-card .profile-avatar {
  border: none;
  background: transparent;
  transition: transform 0.25s;
}

.badge-name {
  font-size: 11px;
  color: var(--white);
  letter-spacing: 0.4px;
  line-height: 1.4;
}

.badge-org {
  font-size: 10px;
  color: var(--muted);
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 48px;
}

.stack-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  transition: border-color 0.25s, transform 0.25s;
}

.stack-card:hover {
  border-color: rgba(34, 211, 238, 0.2);
  transform: translateY(-2px);
}

.stack-card h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
}

.stack-card h3 .dot-acc {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stack-tags span {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--accent-faint);
  color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.12);
}

.exp-timeline {
  margin-top: 48px;
  position: relative;
  padding-left: 32px;
}

.exp-timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.exp-item {
  position: relative;
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.exp-item:last-child {
  border-bottom: none;
}

.exp-item::before {
  content: "";
  position: absolute;
  left: -37px;
  top: 8px;
  width: 10px;
  height: 10px;
  border: 1px solid var(--accent);
  background: var(--bg);
  transform: rotate(45deg);
}

.exp-item:first-child::before,
.exp-item.exp-current::before {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.exp-role {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
}

.exp-company {
  color: var(--accent);
  font-size: 13px;
}

.exp-period {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 3px 10px;
  letter-spacing: 1px;
  white-space: nowrap;
}

.exp-current .exp-period {
  border-color: var(--accent);
  color: var(--accent);
}

.exp-desc {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  margin-top: 10px;
}

.exp-techs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.exp-techs span {
  font-size: 10px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-top: 48px;
}

.service-card {
  background: var(--surface);
  padding: 28px;
  transition: background 0.2s;
  position: relative;
  overflow: hidden;
}

.service-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s;
}

.service-card:hover {
  background: #1c1c2a;
}

.service-card:hover::after {
  transform: scaleX(1);
}

.service-icon {
  font-size: 1.2rem;
  margin-bottom: 14px;
}

.service-card h3 {
  color: var(--white);
  font-size: 14px;
  margin-bottom: 10px;
}

.service-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 28px;
  transition: border-color 0.25s, transform 0.25s;
}

.project-card:hover {
  border-color: rgba(34, 211, 238, 0.28);
  transform: translateY(-3px);
}

.project-num {
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.project-name {
  font-family: var(--sans);
  font-size: 1.15rem;
  color: var(--white);
  margin-bottom: 12px;
}

.project-desc {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  margin-bottom: 16px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tech-chip {
  font-size: 10px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.tech-chip.primary {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-faint);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-top: 48px;
}

.contact-info h3 {
  font-family: var(--sans);
  font-size: 1.6rem;
  color: var(--white);
  font-weight: 500;
  margin-bottom: 16px;
  line-height: 1.3;
}

.contact-info h3 em {
  color: var(--accent);
  font-style: normal;
}

.contact-info p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
  margin-bottom: 32px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  padding: 10px;
  border: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.contact-link:hover {
  color: var(--accent);
  border-color: var(--border);
  background: var(--accent-faint);
}

.form-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-prompt {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 1px;
}

.form-prompt::before {
  content: "$ ";
  color: var(--muted);
}

.form-input {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--white);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  outline: none;
}

.form-input:focus {
  border-bottom-color: var(--accent);
}

textarea.form-input {
  min-height: 90px;
  resize: vertical;
}

.form-status {
  font-size: 12px;
  min-height: 18px;
}

.form-status.ok {
  color: var(--ok);
}

.form-status.err {
  color: var(--rose);
}

footer {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 40px 40px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
}

footer span {
  color: var(--accent);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    right: 16px;
    flex-direction: column;
    background: var(--bg2);
    border: 1px solid var(--border);
    padding: 8px;
    min-width: 180px;
  }

  .nav-links.open {
    display: flex;
  }

  section {
    padding: 72px 20px;
    min-height: auto;
  }

  .section-label {
    white-space: normal;
  }

  #hero {
    padding-top: 100px;
  }

  .hero-grid,
  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .contact-grid,
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .stats-bar,
  .services-grid {
    grid-template-columns: 1fr 1fr;
  }

  .profile-block {
    position: static;
    width: 260px;
    margin-inline: auto;
  }

  .profile-img-wrap {
    margin-inline: auto;
  }

  .term-output {
    white-space: pre-wrap;
    word-break: break-word;
  }

  footer {
    flex-direction: column;
    gap: 8px;
    padding: 24px 20px 40px;
  }
}

@media (max-width: 560px) {
  .stats-bar,
  .services-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 2.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
