/* Tech-savvy dark theme */
:root {
  --bg-dark: #0a0e17;
  --bg-card: #111827;
  --bg-elevated: #1a2332;
  --accent: #00d4aa;
  --accent-dim: #00d4aa33;
  --accent-hover: #00f5c4;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #2d3a4f;
  --glow: 0 0 20px rgba(0, 212, 170, 0.15);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  margin: 0;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;
  background: var(--bg-dark);
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-dim), transparent),
    linear-gradient(180deg, var(--bg-dark) 0%, #0d1321 100%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes glowPulse {
  0%, 100% { box-shadow: var(--glow); }
  50% { box-shadow: 0 0 30px rgba(0, 212, 170, 0.25); }
}

@keyframes slideInNav {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Navigation Bar */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(10, 14, 23, 0.85);
  border-bottom: 1px solid var(--border);
  animation: slideInNav 0.5s ease-out;
}

#home {
  padding: 16px 8vw;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.topmenu {
  color: var(--text-muted);
  margin: 4px 6px;
  padding: 8px 14px;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.25s ease;
  position: relative;
}

.topmenu::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.25s ease;
  border-radius: 1px;
}

.topmenu:hover {
  color: var(--accent-hover);
}

.topmenu:hover::after {
  transform: scaleX(1);
}

.topdiv {
  display: flex;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-left: auto;
  overflow-x: auto;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  padding: 8px;
  margin: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.profile_name {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  gap: 6px;
}

.logo_text {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
  text-decoration: none;
}

.profile_name .contact_info {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile_name .contact_info a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.profile_name .contact_info a:hover {
  color: var(--accent);
}

.contact_info img {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

.contact_info span {
  color: var(--text-muted);
}

/* Section base */
section {
  padding: 80px 8vw 60px;
  max-width: 1200px;
  margin: 0 auto;
  animation: fadeInUp 0.6s ease-out;
}

section:nth-child(n) {
  animation-delay: 0.1s;
}

/* Titles */
h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 32px;
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
}

.introduction {
  font-size: 24px;
  text-align: center;
  margin: 24px 0;
  color: var(--text);
  white-space: nowrap;
}

/* Layout & About Me */
.container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  padding: 80px 8vw;
  max-width: 1200px;
  margin: 0 auto;
}

#about-me h1 {
  font-size: 42px;
  margin: 0 0 16px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.2;
}

#about-me h1 br + span,
#about-me h1 span {
  color: var(--accent);
}

#about-me p {
  font-size: 17px;
  color: var(--text-muted);
  margin: 0 0 12px;
  max-width: 540px;
}

.about-content {
  max-width: 560px;
}

.about-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.profile_image {
  box-shadow: var(--glow);
  border: 2px solid var(--border);
  border-radius: 16px;
  width: 260px;
  height: 260px;
  object-fit: cover;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile_image:hover {
  transform: scale(1.02);
  box-shadow: 0 0 30px rgba(0, 212, 170, 0.2);
}

/* Skills */
#skills,
#experience,
#projects,
#education,
#recommendations,
#contact {
  padding-top: 80px;
}

.all_skills {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 0;
}

.skill {
  flex: 1 1 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  font-size: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  animation: fadeInUp 0.5s ease-out backwards;
}

.skill:nth-child(1) { animation-delay: 0.1s; }
.skill:nth-child(2) { animation-delay: 0.2s; }
.skill:nth-child(3) { animation-delay: 0.3s; }

.skill:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--glow);
}

.skill h6 {
  font-size: 16px;
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--accent);
}

.skill p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.skill p a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.skill p a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

.skill-proof {
  margin-top: 12px !important;
  font-size: 12px !important;
  font-style: normal !important;
}

.skill-proof a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.skill-proof a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.flex_center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Projects, Experience, Education */
.projects-container {
  margin-top: 0;
}

.projects-container hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 32px 0;
}

.project-card {
  display: block;
  margin-bottom: 0;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s ease;
  animation: fadeInUp 0.5s ease-out backwards;
  text-decoration: none;
  cursor: pointer;
  color: inherit;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(3) { animation-delay: 0.2s; }
.project-card:nth-child(5) { animation-delay: 0.3s; }
.project-card:nth-child(7) { animation-delay: 0.4s; }

.project-card:hover {
  border-color: var(--accent);
  box-shadow: var(--glow);
  transform: translateY(-4px);
}

.project-card h3 {
  font-size: 20px;
  margin: 0 0 12px;
  color: var(--accent);
}

.project-card li {
  font-size: 15px;
  margin: 0 0 8px 18px;
  color: var(--text-muted);
}

.project-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  transition: color 0.2s ease, gap 0.2s ease;
}

.project-card:hover .project-cta {
  color: var(--accent-hover);
  gap: 10px;
}

.experience-list,
.education-list {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 0;
}

.experience-card,
.education-card {
  flex: 1 1 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  animation: fadeInUp 0.5s ease-out backwards;
}

.experience-card:nth-child(1) { animation-delay: 0.1s; }
.experience-card:nth-child(2) { animation-delay: 0.2s; }
.experience-card:nth-child(3) { animation-delay: 0.3s; }
.education-card:nth-child(1) { animation-delay: 0.1s; }
.education-card:nth-child(2) { animation-delay: 0.2s; }
.education-card:nth-child(3) { animation-delay: 0.3s; }

.experience-card:hover,
.education-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--glow);
}

.experience-card h3,
.education-card h3 {
  font-size: 18px;
  margin: 0 0 8px;
  color: var(--text);
}

.experience-meta,
.education-meta {
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 12px;
}

.experience-card ul {
  margin: 0;
  padding-left: 18px;
}

.experience-card li {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* Recommendations */
.all_recommendations {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 0;
}

.recommendation {
  flex: 1 1 220px;
  font-style: italic;
  text-align: left;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  animation: fadeInUp 0.5s ease-out backwards;
}

.recommendation:nth-child(1) { animation-delay: 0.1s; }
.recommendation:nth-child(2) { animation-delay: 0.2s; }
.recommendation:nth-child(3) { animation-delay: 0.3s; }
.recommendation:nth-child(4) { animation-delay: 0.4s; }

.recommendation:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--glow);
}

.recommendation-body {
  margin-bottom: 12px;
}

.recommendation-text {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: -webkit-line-clamp 0.3s ease;
}

.recommendation.expanded .recommendation-text {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.rec-quote {
  color: var(--accent);
  font-size: 20px;
  font-family: Georgia, serif;
}

.recommendation-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.recommendation-author {
  font-style: normal;
  font-size: 13px;
}

.recommendation-author a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.recommendation-author a:hover {
  color: var(--accent-hover);
}

.read-more-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  margin: 0;
  transition: all 0.2s ease;
}

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

/* Scroll to Top */
.iconbutton {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  right: 24px;
  bottom: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 50;
}

.iconbutton a {
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.iconbutton:hover {
  border-color: var(--accent);
  box-shadow: var(--glow);
}

/* Form Pop-up */
.popup {
  width: min(380px, calc(100vw - 32px));
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  position: fixed;
  visibility: hidden;
  z-index: 200;
  padding: 24px;
  animation: fadeIn 0.3s ease;
}

.popup img {
  padding-top: 16px;
}

.popup-emoji {
  font-size: 42px;
  line-height: 1;
  margin-top: 6px;
}

.popup h3 {
  color: var(--text);
  margin: 16px 0;
}

.popup button {
  background: var(--accent);
  border: none;
  color: var(--bg-dark);
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.popup button:hover {
  background: var(--accent-hover);
}

/* Recommendation Form */
#contact fieldset {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  background: var(--bg-card);
  max-width: 400px;
}

.contact-actions {
  margin: 4px 0 12px;
}

.recommendation-direct-btn {
  width: auto;
  text-align: center;
  box-sizing: border-box;
}

#recommendation-cta {
  padding-top: 28px;
  padding-bottom: 16px;
}

.recommendation-cta-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.recommendation-cta-text {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 15px;
}

#contact {
  padding-top: 20px;
}

.contact-label {
  display: block;
  color: var(--text);
  font-size: 13px;
  margin: 8px 0 4px;
}

.required-mark {
  color: var(--accent-hover);
  font-size: 10px;
  opacity: 0.6;
  vertical-align: super;
}

.contact-feedback {
  min-height: 18px;
  margin: 4px 0 0;
  font-size: 12px;
  color: #ff9f9f;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.contact-feedback.show {
  opacity: 1;
}

input, textarea {
  font-family: inherit;
  margin: 10px 0;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* Buttons */
button {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  margin: 20px auto 0;
}

button:hover {
  background: var(--accent);
  color: var(--bg-dark);
  box-shadow: var(--glow);
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn.primary {
  background: var(--accent);
  color: var(--bg-dark);
  border: none;
}

.btn.primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}

.btn.outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn.outline:hover {
  background: var(--accent-dim);
  border-color: var(--accent-hover);
  color: var(--accent-hover);
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 1280px) {
  #home {
    padding: 14px 5vw;
    gap: 20px;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .topdiv {
    width: 100%;
    margin-left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px;
    background: rgba(17, 24, 39, 0.85);
    overflow-x: visible;
  }

  .topdiv.open {
    display: flex;
  }

  .topmenu {
    width: 100%;
  }

  section,
  .container {
    padding-left: 5vw;
    padding-right: 5vw;
  }

  #about-me h1 {
    font-size: 36px;
  }

  .about-content,
  #about-me p {
    max-width: 100%;
  }

  .experience-card,
  .education-card,
  .skill,
  .recommendation {
    flex-basis: 260px;
  }
}

@media (max-width: 768px) {
  #home {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 4vw;
  }

  .topmenu {
    white-space: normal;
    padding: 8px 12px;
    font-size: 13px;
  }

  .profile_name {
    gap: 4px;
  }

  .logo_text {
    font-size: 18px;
  }

  .profile_name .contact_info {
    font-size: 12px;
  }

  .contact_info img {
    width: 16px;
    height: 16px;
  }

  .container {
    padding: 44px 4vw;
    gap: 24px;
    justify-content: center;
  }

  #about-me h1 {
    font-size: 30px;
  }

  section {
    padding: 52px 4vw 36px;
  }

  h2 {
    font-size: 25px;
    margin-bottom: 24px;
  }

  .profile_image {
    width: 220px;
    height: 220px;
  }

  .project-card,
  .experience-card,
  .education-card,
  .recommendation,
  .skill {
    padding: 18px;
  }

  .projects-container hr {
    margin: 24px 0;
  }

  .project-card h3 {
    font-size: 18px;
  }

  .project-card li,
  .experience-card li,
  .skill p,
  .recommendation {
    font-size: 14px;
  }

  #contact fieldset {
    width: 100%;
    max-width: 100%;
    padding: 22px;
  }

  .introduction {
    white-space: normal;
    font-size: 22px;
  }

  button,
  .btn {
    font-size: 14px;
    padding: 10px 18px;
  }
}

@media (max-width: 480px) {
  html {
    scroll-padding-top: 88px;
  }

  section {
    padding-top: 44px;
    padding-bottom: 30px;
  }

  #about-me h1 {
    font-size: 26px;
  }

  #about-me p {
    font-size: 15px;
  }

  .profile_image {
    width: 180px;
    height: 180px;
  }

  .about-actions {
    gap: 8px;
  }

  .topmenu {
    padding: 7px 10px;
    font-size: 12px;
  }

  .nav-toggle {
    width: 36px;
    height: 36px;
  }

  .recommendation-footer {
    align-items: flex-start;
  }

  .popup {
    padding: 18px;
  }

  .popup h3 {
    margin: 12px 0;
    font-size: 17px;
  }

  .iconbutton {
    width: 42px;
    height: 42px;
    right: 14px;
    bottom: 14px;
  }
}
