:root {
  --max-width: 1200px;
  --gap: 1.5rem;
  --color-bg: #f7fafc; /* named */
  --color-card: #ffffff;
  --color-primary: #6c5ce7; /* hex */
  --color-accent: rgb(0, 191, 166); /* rgb */
  --text: #0f172a;
  --muted: #6b7280;
  --radius: 12px;
  --shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  --fw-regular: 400;
  --fw-semibold: 600;
}

/* Reset / base */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial;
  color: var(--text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem;
}

.site-header {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.6),
    rgba(255, 255, 255, 0.45)
  );
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}
.site-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-weight: var(--fw-semibold);
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}
.logo-accent {
  color: var(--color-primary);
}

.main-nav a {
  margin-left: 1rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
.main-nav a:hover,
.main-nav a:focus {
  color: var(--text);
}

.hero {
  padding: 3rem 0;
}
.hero-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
}
.hero-copy {
  flex: 1;
  min-width: 280px;
}

.hero-figure {
  flex: 0 0 auto;
  width: clamp(150px, 40%, 300px);
  margin: 0 auto;
}

.hero-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  max-width: 100%;
}
.hero h1 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
}
.lead {
  color: var(--muted);
  margin: 0 0 1rem;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}
.btn.primary {
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  color: white;
  box-shadow: var(--shadow);
}
.btn.ghost {
  background: transparent;
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--text);
}
.btn:hover {
  transform: translateY(-2px);
}

.hero-illustration {
  width: 420px;
  flex: 0 0 420px;
}
.hero-illustration svg {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

.section {
  padding: 2rem 0;
}
.section h2 {
  margin-top: 0;
}

.features .feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}
.feature {
  background: var(--color-card);
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.about .two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--gap);
  align-items: start;
}

.contact-info {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

footer {
  padding: 1.25rem 0;
  border-top: 1px solid rgba(15, 23, 42, 0.04);
  background: gray;
  color: white;
}

.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

@media (max-width: 1024px) {
  :root {
    --max-width: 960px;
  }
  .hero-inner {
    flex-direction: column-reverse;
  }
  .hero-illustration {
    width: 100%;
    flex: 0 0 auto;
  }
  .features .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .about .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  :root {
    --max-width: 720px;
  }
  .main-nav {
    display: none;
  }
  .hero h1 {
    font-size: 1.5rem;
  }
  .features .feature-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    padding: 2rem 0;
  }
}

@media print {
  .hero-illustration,
  .site-footer,
  .main-nav {
    display: none;
  }
}

.feature h3 {
  margin-top: 0;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

/* Scroll progress bar  */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* Sticky header with scroll shadow  */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 250, 252, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  transition:
    box-shadow 0.3s ease,
    transform 0.35s ease;
}
.header.scrolled {
  box-shadow: 0 2px 20px rgba(15, 23, 42, 0.1);
}
.header.header-hidden {
  transform: translateY(-110%);
}

/* Active nav link  */
.main-nav a.active {
  color: var(--color-primary);
  font-weight: var(--fw-semibold);
}

/* Header action buttons (theme toggle + hamburger)  */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.icon-btn {
  background: transparent;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.4rem 0.65rem;
  color: inherit;
  transition:
    background 0.2s,
    transform 0.2s;
}
.icon-btn:hover {
  background: rgba(108, 92, 231, 0.08);
  transform: scale(1.1);
}
.hamburger-btn {
  display: none;
}

/* Scroll-reveal animations  */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
[data-reveal].visible {
  opacity: 1;
  transform: translateY(0);
}

/* Skill tags  */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 1rem;
}
.skill-category h3 {
  margin-top: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.skill-tag {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--color-card);
  border: 1.5px solid rgba(108, 92, 231, 0.25);
  color: var(--color-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.15s,
    box-shadow 0.2s;
}
.skill-tag:hover {
  background: rgba(108, 92, 231, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(108, 92, 231, 0.15);
}
.skill-tag.highlighted {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.35);
}

/* Contact form  */
.contact-form {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 520px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}
.form-group input,
.form-group textarea {
  padding: 0.65rem 1rem;
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--color-card);
  color: var(--text);
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}
.form-group textarea {
  resize: vertical;
  min-height: 110px;
}

/* Mobile: show hamburger, make nav a dropdown  */
@media (max-width: 767px) {
  .hamburger-btn {
    display: inline-flex;
  }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-card);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    flex-direction: column;
    padding: 1rem;
    gap: 0.75rem;
    box-shadow: var(--shadow);
  }
  .main-nav.open {
    display: flex;
  }
  .main-nav a {
    margin-left: 0;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  }
}

/* Dark mode  */
body.dark-mode {
  --color-bg: #0f172a;
  --color-card: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
body.dark-mode .header {
  background: rgba(15, 23, 42, 0.92);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
body.dark-mode .icon-btn {
  border-color: rgba(255, 255, 255, 0.12);
}
body.dark-mode .main-nav.open {
  background: var(--color-card);
}
body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
  border-color: rgba(255, 255, 255, 0.1);
}
body.dark-mode footer {
  background: #060d1a;
}

/* Column grid (projects & experiences)  */
.col-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Certificates grid  */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 350px));
  gap: 0.75rem;
  justify-content: center;
}

.cert-article {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
}

.cert-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.cert-img:hover {
  opacity: 0.8;
}

/* Uploaded certificate file cards */
.cert-file-card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 0;
}

.cert-file-card img.cert-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  display: block;
}

.cert-file-card > div {
  padding: 0.6rem 0.75rem;
}

.cert-file-card > div p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cert-pdf-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
}

.cert-pdf-icon-bio {
  font-size: 3rem;
}

/* Certificate lightbox  */
#cert-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
}

#cert-lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}
