
:root {
  --ink: #07070d;
  --panel: #12121f;
  --panel-2: #0b0b16;
  --royal-deep: #2c3fb0;
  --royal: #5b74f2;
  --mist: #9195b3;
  --paper: #eef0fb;
  --line: rgba(255, 255, 255, 0.09);

  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --font-sans: 'IBM Plex Sans', 'Segoe UI', sans-serif;

  --radius-sm: 8px;
  --radius: 14px;
  --ease: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1080px;
}


*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  line-height: 1.65;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
::selection { background: var(--royal); color: #fff; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--royal);
  outline-offset: 3px;
}


.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 110px 24px;
  scroll-margin-top: 88px;
}

.section-header { margin-bottom: 44px; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--royal);
  margin-bottom: 10px;
}

.eyebrow::before { content: '// '; color: var(--mist); }

.section-title {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}


.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.9rem;
  transition: transform var(--ease), background var(--ease), border-color var(--ease), color var(--ease);
}

.btn-primary { background: var(--royal-deep); color: #fff; }
.btn-primary:hover { background: var(--royal); transform: translateY(-2px); }

.btn-outline { border: 1px solid var(--line); color: var(--paper); }
.btn-outline:hover { border-color: var(--royal); color: var(--royal); }

.btn-full { width: 100%; text-align: center; }


.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 22px 0;
  transition: background var(--ease), padding var(--ease), border-color var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: rgba(7, 7, 13, 0.88);
  backdrop-filter: blur(10px);
  padding: 15px 0;
  border-bottom-color: var(--line);
}

.navbar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
}

.logo-dot { color: var(--royal); }

.nav-links { display: flex; gap: 34px; }

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  position: relative;
  padding: 4px 0;
  color: var(--mist);
  transition: color var(--ease);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--royal);
  transition: width var(--ease);
}

.nav-link:hover, .nav-link.active { color: var(--paper); }
.nav-link.active::after, .nav-link:hover::after { width: 100%; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; z-index: 1001; }

.nav-toggle .bar {
  width: 24px; height: 2px;
  background: var(--paper);
  transition: transform var(--ease), opacity var(--ease);
}

.nav-toggle.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open .bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 140px 24px 80px;
  overflow: hidden;
}

.hero-texture {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.5;
}

.hero-glow {
  position: absolute;
  top: 50%; left: 50%;
  width: 620px; height: 620px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(91, 116, 242, 0.22), transparent 70%);
  pointer-events: none;
}

.terminal {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 620px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}

.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-r { background: #ff5f56; }
.dot-y { background: #ffbd2e; }
.dot-g { background: #27c93f; }

.terminal-path {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--mist);
}

.terminal-body {
  padding: 28px 26px 30px;
  font-family: var(--font-mono);
  font-size: 0.98rem;
}

.term-row { color: var(--mist); margin-bottom: 4px; }
.prompt { color: var(--royal); margin-right: 10px; }

.term-out {
  color: var(--paper);
  margin-bottom: 22px;
  min-height: 1.4em;
}
.term-out:last-child { margin-bottom: 0; }

.term-mission {
  color: var(--mist);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.6;
}

.typed-text { color: var(--royal); }
.cursor { color: var(--royal); animation: blink 1s step-end infinite; }

.terminal-actions {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 14px;
  margin-top: 34px;
  flex-wrap: wrap;
  justify-content: center;
}

.scroll-cue {
  position: relative;
  z-index: 2;
  margin-top: 56px;
  width: 24px; height: 38px;
  border: 2px solid var(--line);
  border-radius: 20px;
}

.scroll-cue span {
  position: absolute;
  top: 7px; left: 50%;
  width: 4px; height: 7px;
  background: var(--royal);
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scrollCue 1.6s ease infinite;
}


.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible { opacity: 1; transform: translateY(0); }


.about-inner { max-width: 640px; }
.about-inner p { color: var(--mist); margin-bottom: 16px; font-size: 1rem; }

.inline-link { color: var(--royal); text-decoration: underline; text-underline-offset: 3px; }
.inline-link:hover { color: var(--paper); }


.subhead {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--paper);
  margin: 30px 0 12px;
}

.stats {
  display: flex;
  gap: 40px;
  margin: 32px 0;
  flex-wrap: wrap;
}

.stat-box { display: flex; flex-direction: column; }

.stat-num {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--royal);
}

.stat-label { font-size: 0.8rem; color: var(--mist); margin-top: 2px; }

.skills { display: flex; flex-wrap: wrap; gap: 10px; }

.skill-pill {
  padding: 7px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--mist);
  transition: border-color var(--ease), color var(--ease);
}

.skill-pill:hover { border-color: var(--royal); color: var(--paper); }

.gallery { margin: 0 auto 44px; }

.gallery-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--panel-2);
  overflow: hidden;
}

.gallery-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.gallery-img.active { opacity: 1; }

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(7, 7, 13, 0.55);
  color: var(--paper);
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background var(--ease);
}

.gallery-nav:hover { background: var(--royal-deep); }
.gallery-prev { left: 14px; }
.gallery-next { right: 14px; }

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: var(--panel);
}

.gallery-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  background: var(--line);
  transition: background var(--ease), transform var(--ease);
}

.gallery-dot.active { background: var(--royal); transform: scale(1.3); }


.section-intro { color: var(--mist); max-width: 640px; margin-bottom: 36px; }

.hobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 26px;
}

.hobby-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform var(--ease), border-color var(--ease);
}

.hobby-card:hover { transform: translateY(-5px); border-color: var(--royal); }

.hobby-icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
}

.hobby-icon-a { background: linear-gradient(135deg, #232f8f, #5b74f2); }
.hobby-icon-b { background: linear-gradient(135deg, #182270, #4661e0); }

.hobby-card h3 { font-family: var(--font-mono); font-size: 1.02rem; font-weight: 600; margin-bottom: 8px; }
.hobby-card p { color: var(--mist); font-size: 0.92rem; }


.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 26px;
}

.project-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--ease), border-color var(--ease);
}

.project-card:hover { transform: translateY(-5px); border-color: var(--royal); }

.project-thumb {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.05em;
}

.thumb-1 { background: linear-gradient(135deg, #232f8f, #5b74f2); }
.thumb-2 { background: linear-gradient(135deg, #182270, #4661e0); }
.thumb-3 { background: linear-gradient(135deg, #10173f, #5468e8); }
.thumb-4 { background: linear-gradient(135deg, #1c2470, #6c82f5); }

.project-body { padding: 20px; }
.project-body h3 { font-family: var(--font-mono); font-size: 1.02rem; font-weight: 600; margin-bottom: 8px; }
.project-body p { color: var(--mist); font-size: 0.9rem; margin-bottom: 14px; }

.project-tags { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }

.project-tags span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 3px 9px;
  background: var(--panel-2);
  border-radius: 5px;
  color: var(--mist);
}

.project-link { font-family: var(--font-mono); color: var(--royal); font-weight: 500; font-size: 0.85rem; }
.project-link:hover { text-decoration: underline; }


.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 54px;
}

.contact-info p { color: var(--mist); margin-bottom: 22px; }
.contact-list li { margin-bottom: 14px; }

.contact-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--royal);
  margin-bottom: 2px;
}

.social-links { display: flex; gap: 12px; margin-top: 22px; }

.social-links a {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  transition: border-color var(--ease), color var(--ease);
}

.social-links a:hover { border-color: var(--royal); color: var(--royal); }

.contact-form { display: flex; flex-direction: column; gap: 20px; }
.form-group { position: relative; }

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 13px 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 0.94rem;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.form-group textarea { resize: vertical; min-height: 110px; }

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--royal);
  box-shadow: 0 0 0 3px rgba(91, 116, 242, 0.25);
}

.form-group label {
  position: absolute;
  left: 15px; top: 13px;
  color: var(--mist);
  font-size: 0.94rem;
  pointer-events: none;
  transition: transform var(--ease), font-size var(--ease), color var(--ease);
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
  transform: translateY(-24px);
  font-size: 0.72rem;
  color: var(--royal);
}

.form-group.error input, .form-group.error textarea { border-color: #ff5c7a; }

.error-msg {
  display: block;
  min-height: 17px;
  color: #ff5c7a;
  font-size: 0.76rem;
  margin-top: 4px;
}

.form-success { display: none; color: #4fd394; font-size: 0.88rem; text-align: center; }
.form-success.visible { display: block; }


.footer {
  text-align: center;
  padding: 30px 24px;
  border-top: 1px solid var(--line);
  color: var(--mist);
  font-size: 0.82rem;
}

.footer .comment {
  display: block;
  font-family: var(--font-mono);
  color: var(--mist);
  opacity: 0.7;
  margin-bottom: 6px;
  font-size: 0.78rem;
}


.back-to-top {
  position: fixed;
  bottom: 26px; right: 26px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--royal-deep);
  color: #fff;
  font-family: var(--font-mono);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--ease), transform var(--ease), visibility var(--ease), background var(--ease);
  z-index: 900;
}

.back-to-top:hover { background: var(--royal); }
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }


@keyframes blink { 50% { opacity: 0; } }

@keyframes scrollCue {
  0% { opacity: 0; top: 6px; }
  30% { opacity: 1; }
  100% { opacity: 0; top: 20px; }
}


@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: 0; right: -100%;
    height: 100vh;
    width: min(78%, 300px);
    background: var(--panel-2);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    transition: right var(--ease);
    border-left: 1px solid var(--line);
    z-index: 999;
  }
  .nav-links.open { right: 0; }
  .nav-toggle { display: flex; }
  .terminal-body { font-size: 0.88rem; padding: 22px 18px 26px; }
  .stats { gap: 26px; }
}

@media (max-width: 480px) {
  .section { padding: 84px 20px; }
  .terminal-actions { flex-direction: column; align-items: stretch; }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
