/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* Layout */
  --nav-height: 50px;
  --max-width: 1140px;
  --section-padding: 60px 24px;

  /* Light palette */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-nav: rgba(26, 26, 26, 0.75);
  --bg-footer: #1a1a1a;
  --text-primary: #222;
  --text-body: #333;
  --text-muted: #555;
  --text-subtle: #777;
  --text-faint: #999;
  --text-nav: #ccc;
  --text-nav-hover: #fff;
  --border-light: #e4e4e4;
  --modal-overlay: rgba(0, 0, 0, 0.72);
  --modal-bg: #ffffff;
  --hero-overlay: rgba(0, 0, 0, 0.45);

  /* Typography */
  --font-serif: 'EB Garamond', serif;
  --font-sans: 'Quattrocento Sans', sans-serif;

  /* iOS vh fix (set by JS) */
  --vh: 1vh;
}

/* ============================================================
   DARK MODE
   ============================================================ */
[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-secondary: #242424;
  --bg-nav: rgba(10, 10, 10, 0.85);
  --bg-footer: #111;
  --text-primary: #e8e8e8;
  --text-body: #d4d4d4;
  --text-muted: #aaa;
  --text-subtle: #888;
  --text-faint: #666;
  --border-light: #3a3a3a;
  --modal-bg: #2a2a2a;
  --hero-overlay: rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .worklogo,
[data-theme="dark"] .timeline-logo {
  background-color: #2a2a2a;
}

[data-theme="dark"] .cta-btn {
  background-color: transparent;
  color: #fff !important;
  border-color: #fff;
}

[data-theme="dark"] .cta-btn:hover {
  background-color: #fff;
  color: #111 !important;
}

[data-theme="dark"] img:not(.hero-video) {
  filter: brightness(0.92);
}

.icon-wrap img.icon-dark {
  display: none;
}

[data-theme="dark"] .icon-wrap img.icon-light {
  display: none;
}

[data-theme="dark"] .icon-wrap img.icon-dark {
  display: block;
}

img.icon-dark {
  display: none;
}

[data-theme="dark"] img.icon-light {
  display: none;
}

[data-theme="dark"] img.icon-dark {
  display: block;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--text-body);
  background-color: #000;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  line-height: 1.3;
}

p {
  margin: 0;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

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

:target {
  scroll-margin-top: calc(var(--nav-height) + 16px);
}

/* ============================================================
   NAVBAR
   ============================================================ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--bg-nav);
  border: none;
  outline: none;
  box-shadow: none;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  min-height: var(--nav-height);
  padding: 0 16px;
  position: relative;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  padding: 6px;
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  line-height: 1;
  transition: transform 0.3s;
}

.theme-toggle:hover {
  transform: translateY(-50%) rotate(20deg);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.nav-toggle .icon-bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #fff;
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-links a {
  color: var(--text-nav);
  padding: 14px 16px;
  display: block;
  font-family: var(--font-sans);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-nav-hover);
}

/* ============================================================
   HERO BACKGROUND DIV (mobile fallback)
   ============================================================ */
.hero-bg {
  display: none;
}

/* ============================================================
   HERO VIDEO BACKGROUND
   ============================================================ */
.hero-video {
  position: fixed;
  top: -1px;
  left: -1px;
  width: calc(100vw + 2px);
  height: calc(100vh + 2px);
  height: calc(100dvh + 2px);
  object-fit: cover;
  z-index: -2;
}

/* ============================================================
   HERO / INTRO
   ============================================================ */
.intro {
  position: relative;
  background: transparent;
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
}

.intro::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--hero-overlay);
  z-index: 0;
}

.introBlock {
  position: relative;
  z-index: 1;
  padding: 40px 24px;
}

.introBlock h1 {
  font-family: var(--font-serif);
  font-size: 64px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.introBlock p {
  font-size: 20px;
  color: #f0f0f0;
  margin-bottom: 8px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

/* ============================================================
   CTA BUTTON
   ============================================================ */
.cta-btn {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 36px;
  background-color: #fff;
  color: #111 !important;
  border: 2px solid #fff;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.cta-btn:hover {
  background-color: transparent;
  color: #fff !important;
  border-color: #fff;
}

.cta-btn--outline {
  background-color: #fff;
  color: #111 !important;
  border-color: #fff;
  margin-left: 12px;
}

.cta-btn--outline:hover {
  background-color: transparent;
  color: #fff !important;
  border-color: #fff;
}

/* ============================================================
   CONTENT WRAP — solid background to block fixed video
   ============================================================ */
.content-wrap {
  position: relative;
  z-index: 1;
  background-color: var(--bg-primary);
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding: var(--section-padding);
  background-color: var(--bg-primary);
  position: relative;
  z-index: 1;
}

.section--alt {
  background-color: var(--bg-secondary);
}

/* ============================================================
   SECTION HEADINGS
   ============================================================ */
.section-heading {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 3.4rem;
  font-weight: 700;
  margin-bottom: 30px;
  color: var(--text-primary);
}

/* ============================================================
   RESPONSIVE TEXT VARIANTS
   ============================================================ */
.mobile-only {
  display: none;
}

.desktop-only {
  display: inline;
}

/* ============================================================
   BY THE NUMBERS / STATS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 24px;
}

.stat-card {
  text-align: center;
  padding: 24px 16px;
}

.stat-number {
  display: block;
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-label {
  display: block;
  font-size: 17px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

.stat-context {
  display: block;
  font-size: 15px;
  color: var(--text-faint);
  margin-top: 4px;
  font-style: italic;
}

/* ============================================================
   CAREER TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 0 20px 48px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--border-light);
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -36px;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--text-primary);
  border: 3px solid var(--bg-secondary);
}

/* Education section uses --bg-primary background */
.section:not(.section--alt) .timeline-dot {
  border-color: var(--bg-primary);
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.timeline-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 14px;
  flex-shrink: 0;
}

.timeline-meta {
  display: flex;
  flex-direction: column;
}

.companyname {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.companyname a {
  color: inherit;
  text-decoration: none;
}

.companyname a:hover {
  text-decoration: underline;
}

.timeline-role {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-body);
  margin-top: 2px;
}

.timeline-date {
  font-size: 15px;
  color: var(--text-faint);
  margin-top: 2px;
}

.timeline-details {
  margin-top: 12px;
}

.timeline-expand {
  cursor: pointer;
  font-size: 15px;
  color: var(--text-subtle);
  font-family: var(--font-sans);
  list-style: none;
  user-select: none;
}

.timeline-expand::-webkit-details-marker {
  display: none;
}

.timeline-expand::before {
  content: '+ ';
  font-weight: 700;
}

.timeline-details[open] .timeline-expand::before {
  content: '− ';
}

.work-p {
  color: var(--text-muted);
  line-height: 1.75;
  margin-top: 8px;
  font-size: 17px;
}

/* ============================================================
   SKILLS / DEVELOPMENT CAPABILITIES
   ============================================================ */
.skills-container {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.skill-group {
  text-align: center;
}

.skill-category {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.skill-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.pill {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 999px;
  border: 1.5px solid var(--border-light);
  background-color: var(--bg-primary);
  color: var(--text-body);
  font-size: 14px;
  font-family: var(--font-sans);
  transition: transform 0.2s, border-color 0.2s, background-color 0.2s;
  cursor: default;
}

.pill:hover {
  transform: translateY(-2px);
  border-color: var(--text-subtle);
}

[data-theme="dark"] .pill {
  background-color: var(--bg-secondary);
}

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  background-color: var(--bg-primary);
  border: 1.5px solid var(--border-light);
  border-radius: 12px;
  padding: 28px 32px;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .project-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.project-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.project-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  max-width: 28px;
  object-fit: contain;
  flex-shrink: 0;
  margin-left: auto;
}

.project-desc {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}

.project-features {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}

.project-features li {
  font-size: 15px;
  color: var(--text-body);
  line-height: 1.7;
  padding-left: 20px;
  position: relative;
}

.project-features li::before {
  content: '\2022';
  position: absolute;
  left: 4px;
  color: var(--text-faint);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  margin-bottom: 0;
}

.project-links {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border-light);
}

.project-link {
  display: inline-block;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-body);
  border: 1.5px solid var(--border-light);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, transform 0.1s;
}

.project-link:hover {
  border-color: var(--text-subtle);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* ============================================================
   VOLUNTEER
   ============================================================ */
.volunteer-section {
  text-align: center;
}

.volunteerWork {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 28px;
  padding: 20px 0;
}

.vicon {
  width: 100px;
  height: 100px;
  object-fit: contain;
  cursor: pointer;
  border-radius: 24px;
  transition: transform 0.2s;
}

.vicon:hover {
  transform: scale(1.1);
}

/* ============================================================
   MODALS
   ============================================================ */
.custom-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background-color: var(--modal-overlay);
}

.custom-modal.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: var(--modal-bg);
  padding: 30px 28px;
  width: 92%;
  max-width: 780px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 10px;
  position: relative;
  color: var(--text-body);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: var(--text-subtle);
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.volunteer-img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 16px;
}

.modal-p {
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 12px;
  font-size: 15px;
}

.modal-img {
  display: block;
  margin-bottom: 4px;
}

.modal-link {
  color: var(--text-subtle);
  text-decoration: underline;
  transition: color 0.2s;
}

.modal-link:hover {
  color: var(--text-primary);
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 40px;
  padding: 10px 0 0;
}

.contact .img {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-body);
}

.icon-wrap {
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color 0.25s;
}

.contact .img:hover .icon-wrap {
  border-color: var(--text-body);
}

.icon-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  padding: 4px;
  transition: opacity 0.25s;
}

.contact .img:hover .icon-wrap img {
  opacity: 0;
}

.contact-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-body);
  font-family: var(--font-sans);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.contact .img:hover .contact-label {
  opacity: 1;
}

/* ============================================================
   CONTACT FORM
   ============================================================ */
.contact-form-wrap {
  max-width: 600px;
  margin: 40px auto 0;
}

.contact-form-heading {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: flex;
  gap: 14px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-light);
  border-radius: 8px;
  background-color: var(--bg-primary);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 15px;
  transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--text-subtle);
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

.form-submit {
  align-self: center;
  padding: 12px 40px;
  background-color: var(--text-primary);
  color: var(--bg-primary);
  border: 2px solid var(--text-primary);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

.form-submit:hover {
  background-color: transparent;
  color: var(--text-primary);
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background-color: var(--bg-footer);
  color: #aaa;
  text-align: center;
  padding: 10px 20px;
  font-size: 14px;
  font-family: var(--font-sans);
  position: relative;
  z-index: 1;
}

/* ============================================================
   SCROLL FADE-IN ANIMATION
   ============================================================ */
.fade-in-section {
  opacity: 0;
  transition: opacity 0.6s ease-out;
}

.fade-in-section.is-visible {
  opacity: 1;
}

/* ============================================================
   MOBILE / RESPONSIVE  (≤ 768 px)
   ============================================================ */
@media (max-width: 768px) {

  .nav-inner {
    flex-wrap: wrap;
  }

  .site-nav {
    background-color: rgba(50, 50, 50, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  [data-theme="dark"] .site-nav {
    background-color: rgba(20, 20, 20, 0.92);
  }

  .nav-toggle .icon-bar {
    margin: 3px 0;
  }

  .theme-toggle {
    top: 0;
    transform: none;
    height: var(--nav-height);
    display: flex;
    align-items: center;
  }

  .theme-toggle:hover {
    transform: rotate(20deg);
  }

  .nav-toggle {
    top: 0;
    transform: none;
    height: var(--nav-height);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    display: none;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
    padding: 4px 0;
    order: 1;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links li {
    flex: 0 0 33.333%;
    text-align: center;
  }

  .nav-links a {
    padding: 8px 4px;
    font-size: 13px;
    width: 100%;
    text-align: center;
  }

  /* Keep video playing on mobile */
  .hero-video {
    width: 100vw;
    height: 100lvh;
  }

  .intro {
    background-image: none;
    background-color: transparent;
    background-attachment: scroll;
    z-index: 1;
  }

  .introBlock h1 {
    font-size: 40px;
  }

  .introBlock p {
    font-size: 16px;
  }

  .cta-btn--outline {
    margin-left: 0;
    margin-top: 10px;
  }

  .section-heading {
    font-size: 2.4rem;
  }

  .mobile-only {
    display: inline;
  }

  .desktop-only {
    display: none;
  }

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

  /* Timeline mobile */
  .timeline {
    padding-left: 36px;
  }

  .timeline::before {
    left: 12px;
  }

  .timeline-dot {
    left: -30px;
    width: 12px;
    height: 12px;
  }

  .timeline-logo {
    width: 48px;
    height: 48px;
  }

  .companyname {
    font-size: 17px;
  }

  .timeline-role {
    font-size: 13px;
  }

  .timeline-date {
    font-size: 12px;
  }

  /* Volunteer 2x2 grid */
  .volunteerWork {
    display: grid;
    grid-template-columns: repeat(2, auto);
    justify-content: center;
    gap: 20px;
  }

  .vicon {
    width: 104px;
    height: 104px;
    border-radius: 22px;
  }

  .contact {
    gap: 24px;
  }

  /* Stats mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 10px 8px;
  }

  .stat-number {
    font-size: 2.4rem;
  }

  .form-row {
    flex-direction: column;
  }
}
