*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #090b10;
  --surface: #0e1117;
  --surface2: #151822;
  --border: rgba(255, 255, 255, 0.07);
  --border-bright: rgba(255, 255, 255, 0.15);
  --text: #e8eaf0;
  --muted: #6b7280;
  --accent: #7c6ff7;
  --accent2: #f97316;
  --accent3: #22d3ee;
  --green: #4ade80;
  --font-display: "Unbounded", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  overflow-x: hidden;
  max-width: 100vw;
  cursor: none;
}

/* Custom cursor */
#cursor {
  position: fixed;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s, width 0.2s, height 0.2s, background 0.2s;
  mix-blend-mode: screen;
}

#cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(124, 111, 247, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, width 0.2s, height 0.2s, opacity 0.2s;
}

body:hover #cursor-ring {
  opacity: 1;
}

/* Canvas */
#canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 3rem;
  background: rgba(9, 11, 16, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: none;
  padding: 0.5rem;
}

.nav-hamburger span {
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: all 0.3s;
}

.nav-hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Sections */
section {
  position: relative;
  z-index: 1;
}

/* Hero */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  padding: 6rem 3rem 0;
  position: relative;
  overflow: hidden;
}

.hero-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 1rem;
}

.hero-photo {
  flex-shrink: 0;
  position: relative;
  width: 320px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0 0;
  align-self: flex-start;
  margin-top: 3.5rem;
  opacity: 0;
  animation: fadeUp 0.8s 1.2s forwards;
}

.hero-photo img {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  position: relative;
  z-index: 2;
  filter: grayscale(20%);
  transition: filter 0.3s;
}

.hero-photo img:hover {
  filter: grayscale(0%);
}

.hero-photo-ring {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 1px dashed rgba(124, 111, 247, 0.4);
  animation: spin 12s linear infinite;
  z-index: 1;
}

.hero-photo-ring::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}

.hero-photo-tag {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 2px;
  white-space: nowrap;
  z-index: 3;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.hero-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  animation: fadeUp 0.6s 0.3s forwards;
}

.hero-tag::before {
  content: "";
  display: block;
  width: 2rem;
  height: 1px;
  background: var(--accent);
}

.hero-terminal {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  color: var(--muted);
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeUp 0.6s 0.5s forwards;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.hero-terminal .prompt {
  color: var(--green);
}

.hero-terminal .cmd {
  color: var(--accent3);
}

.hero-name {
  font-size: clamp(3rem, 9vw, 8rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.7s 0.7s forwards;
}

.hero-name span {
  color: var(--accent);
}

.hero-sub {
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  color: var(--muted);
  margin-bottom: 3rem;
  max-width: 500px;
  line-height: 1.8;
  opacity: 0;
  animation: fadeUp 0.6s 0.9s forwards;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 4rem;
  opacity: 0;
  animation: fadeUp 0.6s 1.1s forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.2s;
  cursor: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-bright);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-scroll {
  position: absolute;
  bottom: 1rem;
  left: 3rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 1rem;
  opacity: 0;
  animation: fadeUp 0.6s 1.5s forwards;
}

.hero-scroll::after {
  content: "";
  display: block;
  width: 60px;
  height: 1px;
  background: var(--muted);
  animation: scrollLine 2s infinite;
}

@keyframes scrollLine {
  0%,
  100% {
    transform: scaleX(1);
    opacity: 1;
  }

  50% {
    transform: scaleX(0.3);
    opacity: 0.3;
  }
}

.hero-counter {
  position: absolute;
  right: 3rem;
  bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  opacity: 0;
  animation: fadeUp 0.6s 1.5s forwards;
}

.hero-counter span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
}

.hero-counter strong {
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 600;
}

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.section-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.15em;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border-bright), transparent);
}

/* About */
#about {
  padding: 8rem 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: center;
}

.about-text {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 2;
}

.about-text p + p {
  margin-top: 1.25rem;
}

.about-text strong {
  color: var(--text);
  font-weight: 600;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.stat-box {
  background: var(--surface);
  padding: 2rem;
  transition: background 0.2s;
}

.stat-box:hover {
  background: var(--surface2);
}

.stat-num {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Skills */
#skills {
  padding: 8rem 3rem;
  background: var(--surface);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.skill-card {
  border: 1px solid var(--border);
  padding: 1.75rem;
  background: var(--bg);
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}

.skill-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-3px);
}

.skill-card:hover::before {
  transform: scaleX(1);
}

.skill-icon {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.skill-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.skill-level {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.skill-bar {
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Projects */
#projects {
  padding: 8rem 3rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.project-card {
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.project-card-top {
  padding: 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.project-type {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: rgba(124, 111, 247, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 2px;
}

.project-links {
  display: flex;
  gap: 0.75rem;
}

.project-links a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.project-links a:hover {
  color: var(--accent);
}

.project-body {
  padding: 2rem;
}

.project-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.project-desc {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.project-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: 2px;
}

/* Certifications */
#certifications {
  padding: 8rem 3rem;
  background: var(--surface);
}

.cert-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.cert-item {
  background: var(--bg);
  padding: 2rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  transition: background 0.2s;
  cursor: default;
}

.cert-item:hover {
  background: var(--surface2);
}

.cert-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.cert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.cert-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.cert-issuer {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.cert-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0;
}

.cert-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.cert-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.05em;
  border: 1px solid rgba(124, 111, 247, 0.3);
  padding: 0.4rem 1rem;
  border-radius: 2px;
  transition: all 0.2s;
  white-space: nowrap;
}

.cert-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Contact */
#contact {
  padding: 8rem 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: center;
}

.contact-heading {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 1.5rem;
}

.contact-heading em {
  font-style: normal;
  color: var(--accent);
}

.contact-sub {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.contact-email {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border-bright);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
  transition: color 0.2s, border-color 0.2s;
}

.contact-email:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.contact-right {
  position: relative;
}

.terminal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.terminal-bar {
  background: var(--surface2);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-r {
  background: #ff5f57;
}

.dot-y {
  background: #ffbd2e;
}

.dot-g {
  background: #28ca41;
}

.terminal-body {
  padding: 1.5rem;
  line-height: 2;
}

.t-green {
  color: var(--green);
}

.t-blue {
  color: var(--accent3);
}

.t-purple {
  color: var(--accent);
}

.t-muted {
  color: var(--muted);
}

.t-cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

/* Footer */
footer {
  padding: 2rem 3rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Typewriter */
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--accent3);
  width: 0;
  animation: typing 2s steps(40, end) 1s forwards,
    blink-caret 0.5s step-end infinite;
}

@keyframes typing {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

@keyframes blink-caret {
  from,
  to {
    border-color: transparent;
  }

  50% {
    border-color: var(--accent3);
  }
}

/* Responsive */
@media (max-width: 900px) {
  nav {
    padding: 1rem 1.5rem;
    width: 100%;
  }

  .nav-links {
    gap: 1.25rem;
  }

  #hero {
    flex-direction: column;
    justify-content: center;
    padding-top: 6rem;
    gap: 2rem;
    width: 100%;
    box-sizing: border-box;
  }

  .hero-photo {
    width: 200px;
    height: 200px;
  }

  .hero-photo img {
    width: 160px;
    height: 160px;
  }

  .hero-photo-ring {
    width: 185px;
    height: 185px;
  }

  #about,
  #skills,
  #projects,
  #certifications,
  #contact {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  #about,
  #contact {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero-scroll,
  .hero-counter {
    display: none;
  }

  .cert-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .cert-right {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 600px) {
  html,
  body {
    max-width: 100vw;
    overflow-x: hidden;
  }

  #cursor,
  #cursor-ring {
    display: none;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(9, 11, 16, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links li {
    text-align: center;
    padding: 0.5rem 0;
  }

  .nav-hamburger {
    display: flex;
  }

  #hero {
    padding: 7rem 1.5rem 2rem;
    width: 100%;
    box-sizing: border-box;
  }

  .hero-left {
    width: 100%;
    padding: 0;
  }

  .hero-terminal {
    width: 100%;
    max-width: 100%;
  }

  .typewriter {
    white-space: normal;
  }

  .hero-photo {
    margin: 0 auto;
  }

  .hero-name {
    font-size: 3rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  #about {
    padding: 5rem 1.5rem 4rem;
    grid-template-columns: 1fr;
  }

  .about-text {
    width: 100%;
    margin: 0 auto;
  }

  .about-stats {
    grid-template-columns: 1fr;
  }
}
