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

:root {
  --bg-primary: #06181c;
  --bg-secondary: #0c2229;
  --bg-tertiary: #0e2a33;
  --white: #cfcbcb;
  --white-strong: #f0eeee;
  --accent: #a08cf4;
  --accent-light: #b5a5ff;
  --text-muted: #9aa8aa;
  --border: rgba(255, 255, 255, 0.09);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  --radius: 20px;
  --transition: 180ms ease;
}

html {
  scroll-behavior: smooth;
}
body {
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
  color: var(--white);
  background:
    radial-gradient(
      circle at top right,
      rgba(160, 140, 244, 0.08),
      transparent 30%
    ),
    var(--bg-primary);
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
}

.site-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.sidebar,
.main-content {
  background: rgba(12, 34, 41, 0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 32px;
  overflow: hidden;
}

.sidebar-top {
  padding: 30px 24px 24px;
}
.avatar {
  width: 86px;
  height: 86px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  border: 1px solid rgba(160, 140, 244, 0.35);
  background: linear-gradient(145deg, var(--bg-tertiary), #172f38);
  color: var(--accent-light);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 2px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}
.sidebar-info {
  text-align: center;
}
.sidebar-info h1 {
  color: var(--white-strong);
  font-size: 21px;
  line-height: 1.25;
}
.sidebar-info p {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.sidebar-toggle {
  display: none;
  width: 100%;
  margin-top: 20px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--accent-light);
  background: var(--bg-tertiary);
  cursor: pointer;
  justify-content: space-between;
  align-items: center;
}
.sidebar-info-more {
  padding: 0 24px 24px;
}
.divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0 20px;
}
.contact-list {
  display: grid;
  gap: 16px;
}
.contact-item {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  min-width: 0;
}
.contact-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--bg-tertiary);
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 700;
}
.contact-item small {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.contact-item strong {
  display: block;
  margin-top: 2px;
  color: var(--white);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.social-list {
  display: flex;
  gap: 10px;
  list-style: none;
  flex-wrap: wrap;
}
.social-list a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--bg-tertiary);
  transition: var(--transition);
}
.social-list a:hover {
  color: var(--accent-light);
  transform: translateY(-2px);
}

.main-content {
  min-width: 0;
  position: relative;
  overflow: hidden;
}
.navbar {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 34, 41, 0.92);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(12px);
}
.nav-link {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 9px;
  font-weight: 700;
  transition: var(--transition);
}
.nav-link:hover,
.nav-link.active {
  color: var(--accent-light);
  background: rgba(160, 140, 244, 0.07);
}

.page {
  display: none;
  padding: 42px;
  animation: fade-in 220ms ease;
}
.page.active {
  display: block;
}
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-heading {
  max-width: 760px;
  margin-bottom: 30px;
}
.eyebrow {
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 8px;
}
.section-heading h2 {
  color: var(--white-strong);
  font-size: clamp(27px, 4vw, 38px);
  line-height: 1.15;
}
.compact-heading {
  margin-top: 46px;
  margin-bottom: 20px;
}
.section-note {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 13px;
}
.about-copy {
  display: grid;
  gap: 16px;
  max-width: 820px;
  color: var(--text-muted);
  font-size: 15px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.service-card,
.project-card,
.blog-card,
.contact-panel,
.stack-box {
  background: rgba(14, 42, 51, 0.76);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.service-card {
  padding: 22px;
}
.service-number {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}
.service-card h3 {
  margin-top: 12px;
  color: var(--white-strong);
  font-size: 17px;
}
.service-card p {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.resume-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 36px;
}
.resume-title {
  color: var(--white-strong);
  font-size: 19px;
  margin-bottom: 18px;
}
.timeline {
  border-left: 1px solid rgba(160, 140, 244, 0.28);
  margin-left: 7px;
}
.timeline-item {
  position: relative;
  padding: 0 0 26px 24px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  left: -5px;
  top: 7px;
  box-shadow: 0 0 0 4px rgba(160, 140, 244, 0.1);
}
.timeline-label {
  color: var(--accent-light);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}
.timeline-item h4 {
  color: var(--white-strong);
  margin-top: 4px;
  font-size: 16px;
}
.timeline-item p:last-child {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 5px;
}
.skills-section {
  margin-top: 48px;
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 28px;
}
.skill-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--white);
  font-size: 12px;
  margin-bottom: 8px;
}
.skill-head span:last-child {
  color: var(--text-muted);
}
.skill-bar {
  height: 7px;
  border-radius: 999px;
  background: #071a20;
  overflow: hidden;
}
.skill-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
}
.stack-box {
  margin-top: 30px;
  padding: 20px;
}
.stack-box h3 {
  color: var(--white-strong);
  font-size: 16px;
}
.stack-box p {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.8;
}

.portfolio-controls {
  margin-bottom: 24px;
}
.filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-button {
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 9px 13px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 12px;
  transition: var(--transition);
}
.filter-button:hover,
.filter-button.active {
  color: var(--accent-light);
  border-color: rgba(160, 140, 244, 0.3);
}
.mobile-filter {
  display: none;
}
.mobile-filter span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  margin-bottom: 7px;
}
.mobile-filter select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px;
  background: var(--bg-tertiary);
  color: var(--white);
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.project-card {
  padding: 18px;
  display: flex;
  gap: 16px;
  transition: var(--transition);
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: rgba(160, 140, 244, 0.25);
}
.project-card.hidden {
  display: none;
}
.project-mark {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--bg-primary);
  color: var(--accent-light);
  border: 1px solid rgba(160, 140, 244, 0.18);
  font-size: 12px;
  font-weight: 800;
}
.project-content > span,
.blog-card > span {
  color: var(--accent-light);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}
.project-content h3,
.blog-card h3 {
  margin-top: 6px;
  color: var(--white-strong);
  font-size: 16px;
}
.project-content p,
.blog-card p {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 12px;
}
.project-content a,
.blog-card a {
  display: inline-block;
  margin-top: 13px;
  color: var(--accent-light);
  font-size: 12px;
  text-decoration: none;
}
.project-content a:hover,
.blog-card a:hover {
  text-decoration: underline;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.blog-card {
  padding: 22px;
}

.contact-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 18px;
  align-items: start;
}
.contact-panel {
  padding: 24px;
}
.contact-panel h3 {
  color: var(--white-strong);
  font-size: 21px;
}
.contact-panel p {
  margin-top: 9px;
  color: var(--text-muted);
  font-size: 13px;
}
.email-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--accent-light);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.contact-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.contact-links a {
  color: var(--text-muted);
  text-decoration: none;
  background: var(--bg-tertiary);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
}
.contact-links a:hover {
  color: var(--accent-light);
}
.contact-form {
  display: grid;
  gap: 8px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(14, 42, 51, 0.76);
}
.contact-form label {
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  margin-top: 5px;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  color: var(--white);
  background: var(--bg-primary);
  padding: 12px 13px;
  resize: vertical;
  transition: var(--transition);
}
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: rgba(160, 140, 244, 0.55);
  box-shadow: 0 0 0 3px rgba(160, 140, 244, 0.08);
}
.contact-form button {
  margin-top: 8px;
  border: 0;
  border-radius: 10px;
  padding: 12px;
  background: var(--accent);
  color: #15101e;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}
.contact-form button:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}
.form-note {
  min-height: 20px;
  color: var(--text-muted);
  font-size: 11px;
}

@media (max-width: 900px) {
  .site-shell {
    grid-template-columns: 250px minmax(0, 1fr);
    width: min(100% - 24px, 1180px);
    gap: 14px;
    margin-top: 20px;
  }
  .page {
    padding: 30px;
  }
  .service-grid,
  .project-grid,
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .resume-grid,
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  body {
    padding-bottom: 76px;
  }
  .site-shell {
    display: block;
    width: min(100% - 20px, 620px);
    margin: 10px auto;
  }
  .sidebar {
    position: relative;
    top: 0;
    margin-bottom: 12px;
  }
  .sidebar-top {
    padding: 20px;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
  }
  .avatar {
    width: 62px;
    height: 62px;
    margin: 0;
    border-radius: 16px;
    font-size: 17px;
  }
  .sidebar-info {
    text-align: left;
  }
  .sidebar-info h1 {
    font-size: 16px;
  }
  .sidebar-info p {
    font-size: 11px;
  }
  .sidebar-toggle {
    display: flex;
    grid-column: 1 / -1;
  }
  .sidebar-info-more {
    display: none;
    padding: 0 20px 20px;
  }
  .sidebar[data-expanded="true"] .sidebar-info-more {
    display: block;
  }
  .sidebar[data-expanded="true"] .sidebar-toggle span:last-child {
    transform: rotate(180deg);
  }
  .main-content {
    border-radius: 16px;
    overflow: visible;
  }
  .navbar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    top: auto;
    padding: 8px;
    justify-content: space-around;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
  }
  .nav-link {
    padding: 9px 8px;
    font-size: 11px;
  }
  .page {
    padding: 26px 20px;
  }
  .section-heading h2 {
    font-size: 27px;
  }
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .sidebar-top {
    grid-template-columns: 52px minmax(0, 1fr);
  }
  .avatar {
    width: 52px;
    height: 52px;
    font-size: 14px;
  }
  .sidebar-info h1 {
    font-size: 14px;
  }
  .sidebar-info p {
    font-size: 10px;
  }
  .sidebar-toggle {
    grid-column: 1 / -1;
  }
  .filter-list {
    display: none;
  }
  .mobile-filter {
    display: block;
  }
  .project-card {
    flex-direction: column;
  }
  .project-mark {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
  }
  .nav-link {
    font-size: 10px;
    padding-inline: 5px;
  }
}

.resume-download-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 22px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(14, 42, 51, 0.76);
}

.resume-download-panel h3 {
  color: var(--white-strong);
  font-size: 17px;
}

.resume-download-panel p {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 12px;
}

.resume-download-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.resume-download-button {
  display: inline-block;
  padding: 11px 15px;
  border-radius: 9px;
  background: var(--accent);
  color: #15101e;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: var(--transition);
}

.resume-download-button:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

.resume-source-link,
.form-email-fallback {
  color: var(--accent-light);
  font-size: 12px;
  text-decoration: none;
}

.resume-source-link:hover,
.form-email-fallback:hover {
  text-decoration: underline;
}

.contact-form button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.form-email-fallback {
  display: inline-block;
}
.form-email-fallback[hidden] {
  display: none;
}

@media (max-width: 700px) {
  .resume-download-panel {
    align-items: flex-start;
    flex-direction: column;
  }
  .resume-download-actions {
    justify-content: flex-start;
  }
}
