:root {
  --bg: #0f1220;
  --panel: #14182a;
  --muted: #9aa3b2;
  --text: #e6e9ef;
  --brand: #BB86FC;
  --brand-2: #03DAC6;
  --line: #242a41;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans;
  background: var(--bg);
  color: var(--text);
}

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

a:hover {
  color: var(--brand-2);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(8px);
  background: rgba(15, 18, 32, .7);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

#langToggle{
    padding: 5px 10px;
    cursor: pointer;
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-weight: 800;
  letter-spacing: .5px;
}

.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(65deg, var(--brand), var(--brand-2));
}

.navlinks {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.navlinks a {
  font-weight: 600;
  font-size: .95rem;
  color: var(--text);
  margin-left: 30px;
}

.navlinks a:hover{
  color: var(--brand-2);
}

.social {
  display: flex;
  gap: .5rem;
}

.social img {
  width: 28px;
  height: 28px;
  transition: all 0.3s ease;
}

.social a:hover img {
  transform: scale(1.1);
  filter: drop-shadow(0 0 8px var(--brand-2)) drop-shadow(0 0 12px var(--brand-2));
}

.toggle-btn {
  cursor: pointer;
  padding: .4rem .6rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: .85rem;
  margin-left: 1rem;
}

.hero {
  position: relative;
  padding: 96px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 40px;
  align-items: center;
}

.hero-grid img {
  width: 70%;
  height: auto;
  border-radius: 12px;
  margin-left: auto;
  display: block;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: var(--muted);
  background: #0c0f1a;
  border: 1px solid var(--line);
  padding: .35rem .6rem;
  border-radius: 999px;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  margin: .5rem 0 1rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
}

.cta {
  display: flex;
  gap: .75rem;
  margin-top: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  border: 1px solid var(--brand);
  background: linear-gradient(135deg, var(--brand) 0%, #a280f0 100%);
  color: #0b0b0b;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.btn:hover, .btn:focus {
  transform: translateY(-2px) scale(1.04);
  background: var(--brand-2, #0077cc);
  color: #fff;
}

.video {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  aspect-ratio: 16/9;
  background: #000;
}

.video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

section {
  padding: 56px 0;
  border-top: 1px solid var(--line);
}

section h2 {
  font-size: 1.75rem;
  margin: 0 0 1rem;
}

.kicker {
  color: var(--muted);
  font-size: .95rem;
  margin-bottom: 1.25rem;
}

.about {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.about p {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
}

.timeline {
  /* Use a responsive card grid for experience so it isn't overly vertical on wide screens */
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  align-items: start;
}

.job {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: .35rem;
}

.job .row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.job h3 {
  margin: .25rem 0;
  font-size: 1.15rem;
}

.job .meta {
  color: var(--muted);
  font-size: .9rem;
}

.job ul {
  margin: .25rem 0 0 1rem;
  color: var(--text);
}

/* About Section */
#about {
  padding: 80px 0;
  background: var(--panel);
}

/* Projects Section */
#projects {
  padding: 80px 0;
  background: var(--panel);
}

.cards {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.card {
  grid-column: span 6;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s cubic-bezier(.4,2,.6,1), box-shadow 0.2s;
}

/* Ensure cards stretch to the same height and push the CTA to the bottom */
.cards {
  align-items: stretch;
}

.card {
  height: 100%;
}

.card:hover, .card:focus-within {
  transform: translateY(-8px) scale(1.025);
  box-shadow: 0 8px 32px #0004;
  z-index: 2;
}

.card .content {
  padding: 14px;
}

/* Make main content grow to fill card so CTA sits at bottom */
.card .content {
  flex: 1 1 auto;
}

.card h3 {
  margin: .25rem 0 .35rem;
  font-size: 1.1rem;
}

.card p {
  margin: 0;
  color: var(--text);
}

.card a.block {
  margin: 12px 14px 14px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .55rem .8rem;
  font-weight: 700;
  /* visually separate CTA and ensure consistent placement */
  align-self: stretch;
}

/* Skills Section */
#skills {
  padding: 80px 0;
}

.skills-wrap {
  display: grid;
  gap: 18px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.skill {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.skill:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--brand);
}

.skill:hover img {
  transform: scale(1.1);
}

.skill img {
  width: 36px;
  height: 36px;
  filter: hue-rotate(315deg) saturate(1) brightness(1);
  transition: transform 0.3s ease;
}

.skill span {
  font-size: .95rem;
}

.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

label {
  display: block;
  font-weight: 700;
  margin: 10px 0 6px;
}

input, textarea, button {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0c0f1a;
  color: var(--text);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

button {
  cursor: pointer;
  font-weight: 800;
  border-color: var(--brand);
  background: linear-gradient(135deg, var(--brand), #8d63f2);
  color: #0c0c0c;
}

button:hover {
  filter: brightness(1.03);
}

.contact-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.contact-card p {
  margin: .35rem 0;
  color: var(--text);
}

footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  color: var(--muted);
}

.featured-skills {
  margin-bottom: 2rem;
}
.featured-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}
.featured-skill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 140px;
  max-width: 180px;
  background: #181a1b;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 2px 8px #0002;
  transition: all 0.3s ease;
  cursor: pointer;
}

.featured-skill:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  background: #1f2122;
}

.featured-skill:hover img {
  transform: scale(1.1);
}
.featured-skill img {
  width: 32px;
  height: 32px;
  margin-bottom: 0.5rem;
  filter: hue-rotate(130deg) saturate(1) brightness(1.1);
  transition: transform 0.3s ease;
}
.featured-skill span {
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.featured-skill .badge {
  background: #0077cc;
  color: #fff;
  border-radius: 12px;
  font-size: 0.8em;
  padding: 2px 10px;
  margin-bottom: 0.5rem;
}
.featured-skill .bar {
  width: 100%;
  height: 8px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
}
.featured-skill .fill {
  height: 100%;
  background: linear-gradient(90deg, #0077cc, #00c6ff);
  border-radius: 4px;
  transition: width 0.7s;
}

.live-preview {
  margin: 1rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #222;
  background: #111;
  height: 350px;
  position: relative;
}
.live-preview iframe {
  width: 1000px;
  height: 900px;
  border: none;
  background: #fff;
  transform: scale(0.5);
  transform-origin: top left;
  display: block;
}

/* Blog Section */
#blog {
  padding: 80px 0;
  background: var(--panel);
}

/* Blog Styles */
.blog-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0 0;
}
.blog-list li {
  margin-bottom: 1.2rem;
  font-size: 1.08em;
}
.blog-list a {
  color: var(--brand);
  text-decoration: none;
}
.blog-list a:hover {
  text-decoration: underline;
  color: var(--brand-2);
}
.blog-list span {
  color: var(--muted);
  margin-left: 0.5em;
  font-size: 0.95em;
}

/* Responsive */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid img {
    margin: 0 auto;
    width: 60%;
  }

  .contact {
    grid-template-columns: 1fr;
  }

  .cards .card {
    grid-column: span 12;
  }

  .skills-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .navlinks {
    display: none;
  }
}

@media (max-width: 640px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .social img {
    width: 26px;
    height: 26px;
  }

  .hero {
    padding-top: 84px;
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }

  html,
  body {
    scroll-behavior: auto;
  }
}

.form-feedback {
  margin-top: 1rem;
  font-weight: 600;
  color: var(--brand-2);
  min-height: 1.5em;
  transition: color 0.2s;
  text-align: center;
}

/* Education Section */
#education {
  padding: 80px 0;
}

.education-grid {
  display: grid;
  gap: 2rem;
  margin-top: 3rem;
}

.education-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.education-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.education-header h3 {
  color: var(--brand);
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
}

.institution {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.date {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.education-details p {
  margin-bottom: 1.5rem;
  color: var(--muted);
}

.coursework h4 {
  color: var(--text);
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
}

.coursework ul {
  margin: 0;
  padding-left: 1.5rem;
}

.coursework li {
  color: var(--muted);
  margin-bottom: 0.5rem;
}

/* Certifications Section */
#certifications {
  padding: 80px 0;
  background: var(--panel);
}

.certifications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.cert-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cert-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.cert-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.cert-card h3 {
  color: var(--brand);
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
}

.cert-issuer {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.cert-date {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Testimonials Section */
#testimonials {
  padding: 80px 0;
  background: var(--panel);
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.testimonial-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2rem;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.quote {
  color: var(--brand);
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  position: absolute;
  top: 1rem;
  left: 1.5rem;
  opacity: 0.3;
}

.testimonial-card p {
  margin: 2rem 0 1.5rem 0;
  color: var(--muted);
  font-style: italic;
  position: relative;
  z-index: 1;
}

.testimonial-author {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.testimonial-author strong {
  color: var(--text);
}

.testimonial-author span {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Experience Section */
#experience {
  padding: 80px 0;
}

/* Enhanced Timeline / Card visualization
   - On wide screens we display experience as padded cards in a responsive grid
   - On small screens we preserve the vertical timeline line and markers for visual context
*/
.timeline {
  position: relative;
  margin-top: 1.5rem;
  grid-auto-rows: auto;
  /* ensure grid items stretch to equal heights within the same row */
  align-items: stretch;
}

/* Hide the vertical timeline decoration by default (desktop uses card grid) */
.timeline::before {
  display: none;
}

/* Job as a card */
.job {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  margin: 0;
  /* make each job card a column flex container and fill its grid cell height */
  display: flex;
  flex-direction: column;
  height: 100%;
}

.job:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.45);
}

.job .row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.job h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--brand);
}

.job .meta {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.job ul {
  margin: 0.25rem 0 0 1.25rem;
  padding: 0;
  background: none;
  border: none;
}

.job li {
  color: var(--muted);
  margin-bottom: 0.55rem;
}

/* Small screens: switch back to vertical timeline with markers */
@media (max-width: 899px) {
  .timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--brand), var(--brand-2));
  }

  .job {
    position: relative;
    margin-bottom: 3rem;
    padding-left: 60px;
  }

  .job::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brand);
    border: 3px solid var(--bg);
    z-index: 1;
  }

  .job:hover::before {
    background: var(--brand-2);
    transform: scale(1.2);
    transition: all 0.3s ease;
  }

  .job .row {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1rem;
  }

  .job ul {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    margin: 0;
  }
}

/* Other Websites Section */
#other-websites {
  padding: 80px 0;
  background: var(--panel);
}

.websites-container {
  margin-top: 3rem;
  overflow: visible;
  border-radius: 12px;
  position: relative;
  padding: 0 60px;
}

.website-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.website-nav-btn:hover {
  background: var(--brand);
  color: var(--bg);
  transform: translateY(-50%) scale(1.1);
}

.website-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--line);
}

.website-nav-btn:disabled:hover {
  transform: translateY(-50%);
  background: var(--line);
  color: var(--muted);
}

.website-nav-prev {
  left: 10px;
}

.website-nav-next {
  right: 10px;
}

.websites-scroll {
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 1rem 0;
  margin: 0 -60px;
  padding-left: 60px;
  padding-right: 60px;
  scrollbar-width: thin;
  scrollbar-color: var(--brand) var(--line);
}

.websites-scroll::-webkit-scrollbar {
  height: 8px;
}

.websites-scroll::-webkit-scrollbar-track {
  background: var(--line);
  border-radius: 4px;
}

.websites-scroll::-webkit-scrollbar-thumb {
  background: var(--brand);
  border-radius: 4px;
}

.websites-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--brand-2);
}

.website-card {
  flex: 0 0 calc(75vw - 2rem);
  max-width: 800px;
  min-width: 300px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 400px;
}

.website-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: var(--brand);
}

.website-card:last-child {
  margin-right: 2rem;
}

.website-image {
  height: 200px;
  overflow: hidden;
  position: relative;
}

.website-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.website-card:hover .website-image img {
  transform: scale(1.05);
}

.website-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.website-content h3 {
  color: var(--brand);
  margin: 0 0 0.75rem 0;
  font-size: 1.3rem;
}

.website-content p {
  color: var(--muted);
  margin: 0 0 1rem 0;
  line-height: 1.5;
  flex: 1;
}

.website-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.website-tech span {
  background: var(--line);
  color: var(--text);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.website-card:hover .website-tech span {
  background: var(--brand);
  color: var(--bg);
}

/* Responsive Design for New Sections */
@media (max-width: 768px) {
  .certifications-grid {
    grid-template-columns: 1fr;
  }
  
  .testimonials-grid {
    grid-template-columns: 1fr;
  }
  
  .timeline::before {
    left: 15px;
  }
  
  .job {
    padding-left: 45px;
  }
  
  .job::before {
    left: 6px;
    width: 16px;
    height: 16px;
  }
  
  .quote {
    font-size: 3rem;
    top: 0.5rem;
    left: 1rem;
  }
  
  .website-card {
    flex: 0 0 calc(90vw - 2rem);
    height: 350px;
  }
  
  .website-image {
    height: 150px;
  }
  
  .website-content {
    padding: 1rem;
  }
  
  .websites-container {
    padding: 0 50px;
  }
  
  .website-nav-btn {
    width: 40px;
    height: 40px;
  }
  
  .website-nav-prev {
    left: 5px;
  }
  
  .website-nav-next {
    right: 5px;
  }
  
  .websites-scroll {
    margin: 0 -50px;
    padding-left: 50px;
    padding-right: 50px;
  }
}