/* ==========================================================================
   Design System & Variables
   ========================================================================== */

:root {
  --font-main: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --color-bg: #F8F9FA;
  --color-header: rgba(255, 255, 255, 0.9);
  --color-surface: #FFFFFF;
  --color-surface-hover: #F8FAFC;
  --color-text-primary: #0F172A;
  --color-text-secondary: #475569;
  --color-text-muted: #64748B;
  --color-accent: #B89A58;
  --color-accent-hover: #9E8142;
  --color-accent-subtle: rgba(184, 154, 88, 0.08);
  --color-accent-border: rgba(184, 154, 88, 0.22);
  --color-border: #E2E8F0;
  --color-border-subtle: #F1F5F9;
  --color-primary-btn: #0F172A;
  --color-primary-btn-hover: #1E293B;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 4px 16px -2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.02);
  --shadow-hover: 0 12px 28px -4px rgba(15, 23, 42, 0.08), 0 4px 10px rgba(15, 23, 42, 0.02);
  --shadow-photo: 0 20px 40px -15px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.05);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   CSS Reset & Base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.no-scroll {
  overflow: hidden;
}

main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

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

.container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 0 32px;
}

/* ==========================================================================
   Buttons & Links
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
  min-height: 44px; /* Touch friendly standard */
}

/* Primary dark obsidian action */
.btn-primary {
  background-color: var(--color-primary-btn);
  color: #FFFFFF;
  border-color: var(--color-primary-btn);
}

.btn-primary:hover {
  background-color: var(--color-primary-btn-hover);
  border-color: var(--color-primary-btn-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
}

.btn-primary .btn-icon {
  color: #FFFFFF;
}

/* Aesthetic secondary & channel actions */
.btn-secondary,
.btn-outline,
.btn-phone,
.btn-whatsapp {
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  border-color: var(--color-border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover,
.btn-outline:hover,
.btn-phone:hover,
.btn-whatsapp:hover {
  background-color: var(--color-surface-hover);
  border-color: #CBD5E1;
  color: var(--color-text-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

/* Subtle, refined brand accenting strictly on the icons */
.btn-secondary .btn-icon {
  color: #0A66C2;
}

.btn-whatsapp .btn-icon {
  color: #16A34A;
}

.btn-phone .btn-icon,
.btn-outline .btn-icon {
  color: var(--color-text-secondary);
}

.btn-project {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-accent);
  padding: 0;
  margin-top: 16px;
  min-height: auto;
}

.btn-project:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

.btn-large {
  padding: 15px 28px;
  font-size: 15px;
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: currentColor;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.header {
  background-color: var(--color-header);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 92px;
}

.logo-link {
  display: flex;
  align-items: center;
}

.logo {
  height: 68px;
  width: auto;
  object-fit: contain;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.logo:hover {
  opacity: 0.9;
  transform: scale(1.03);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

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


/* Mobile Hamburger Toggle */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  border-radius: var(--radius-sm);
  flex-direction: column;
  justify-content: space-around;
  width: 44px;
  height: 44px;
  z-index: 1100;
  -webkit-tap-highlight-color: transparent;
}

.hamburger-line {
  width: 24px;
  height: 2px;
  background-color: var(--color-text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   Hero / About Section
   ========================================================================== */

.hero-section {
  padding: 70px 0 60px;
}

.hero-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.hero-content {
  flex: 1;
  max-width: 660px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

.hero-title {
  font-size: clamp(32px, 5vw, 50px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  color: var(--color-text-primary);
}

.highlight-name {
  color: var(--color-accent);
}

.hero-role {
  font-size: clamp(16px, 3vw, 20px);
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  line-height: 1.4;
}

.hero-bio {
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 28px;
}

.tripoli-link {
  color: var(--color-accent);
  font-weight: 600;
  border-bottom: 1px dotted var(--color-accent);
}

.tripoli-link:hover {
  color: var(--color-accent-hover);
  border-bottom-style: solid;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 0;
}

/* Hero photo card */
.hero-visual {
  flex-shrink: 0;
  position: relative;
}

.image-card {
  position: relative;
  border-radius: var(--radius-lg);
}

.hero-photo {
  width: 400px;
  height: 400px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-photo);
  background-color: #E2E8F0;
}

.floating-badge {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-hover);
  white-space: nowrap;
}

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

.badge-text {
  display: flex;
  flex-direction: column;
}

.badge-text strong {
  font-size: 12px;
  color: var(--color-text-primary);
}

.badge-text span {
  font-size: 11px;
  color: var(--color-accent);
  font-weight: 600;
}

/* ==========================================================================
   Section Layouts & Headers
   ========================================================================== */

section {
  padding: 80px 0;
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 48px;
}

.section-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent-hover);
  background-color: var(--color-accent-subtle);
  border: 1px solid var(--color-accent-border);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 15px;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Skills Section
   ========================================================================== */

.section-skills {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

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

.skill-card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #D1D5DB;
}

.skill-icon-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.skill-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.skill-category-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.skill-description {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  flex: 1;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  transition: var(--transition);
}

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

/* ==========================================================================
   Projects Section
   ========================================================================== */

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

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.project-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

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

.project-card.featured-project {
  border-color: rgba(184, 154, 88, 0.3);
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFAF9 100%);
  box-shadow: 0 4px 20px -2px rgba(184, 154, 88, 0.08);
}

.project-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.project-badge {
  align-self: flex-start;
  background-color: var(--color-accent-subtle);
  color: var(--color-accent-hover);
  border: 1px solid var(--color-accent-border);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
}

.project-badge.badge-alt {
  background-color: #F1F5F9;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.project-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.project-title a:hover {
  color: var(--color-accent);
}

.project-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
}

/* ==========================================================================
   Experience & Affiliations
   ========================================================================== */

.section-affiliations {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.affiliations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.affiliation-card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: var(--transition);
}

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

.affiliation-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.affiliation-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.affiliation-role {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 10px;
}

.affiliation-text {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   Contact / Connect Section
   ========================================================================== */

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

.contact-box {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 56px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  box-shadow: var(--shadow-card);
}

.contact-info {
  flex: 1;
  max-width: 580px;
}

.contact-title {
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 8px 0 14px;
  line-height: 1.3;
}

.contact-text {
  font-size: 15px;
  color: var(--color-text-muted);
  margin-bottom: 22px;
  line-height: 1.6;
}

.contact-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.meta-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ==========================================================================
   Outline SVG Icons
   ========================================================================== */

.outline-icon {
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  flex-shrink: 0;
}

.badge-outline-icon {
  width: 18px;
  height: 18px;
  stroke: var(--color-accent);
}

.star-icon {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  margin-right: 4px;
  display: inline-block;
  vertical-align: -1px;
}

.skill-svg {
  width: 24px;
  height: 24px;
  stroke: var(--color-text-primary);
}

.affiliation-svg {
  width: 24px;
  height: 24px;
  stroke: var(--color-accent);
}

.meta-svg {
  width: 18px;
  height: 18px;
  stroke: var(--color-accent);
}

.meta-link {
  color: var(--color-text-primary);
  font-weight: 500;
}

.meta-link.bold-link {
  color: var(--color-text-primary);
  font-weight: 600;
  font-size: 15px;
}

.meta-link:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.contact-cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  min-width: 260px;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background-color: var(--color-header);
  border-top: 1px solid var(--color-border);
  padding: 28px 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.footer-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

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

/* ==========================================================================
   Responsive Breakpoints & Smartphone Optimizations
   ========================================================================== */

/* Tablet (<= 992px) */
@media (max-width: 992px) {
  .hero-container {
    flex-direction: column-reverse;
    text-align: center;
    gap: 40px;
  }

  .hero-content {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-actions {
    justify-content: center;
  }


  .skills-grid, .affiliations-grid {
    grid-template-columns: 1fr;
  }

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

  .contact-box {
    flex-direction: column;
    text-align: center;
    padding: 40px 28px;
  }

  .contact-meta {
    align-items: center;
  }

  .contact-cta {
    width: 100%;
  }

  .contact-cta .btn {
    width: 100%;
  }
}

/* Smartphone & Small Tablet (<= 860px) */
@media (max-width: 860px) {
  .header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background-color: #FFFFFF;
  }

  .header-container {
    height: 78px;
  }

  .logo {
    height: 54px;
  }

  .mobile-menu-btn {
    display: flex;
  }

  /* Full-width Mobile Drawer Navigation */
  .nav-links {
    position: fixed;
    top: 78px;
    left: 0;
    right: 0;
    width: 100%;
    height: calc(100vh - 78px);
    height: calc(100dvh - 78px);
    background-color: #FFFFFF;
    flex-direction: column;
    align-items: stretch;
    padding: 24px 28px calc(40px + env(safe-area-inset-bottom, 0px));
    gap: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, visibility 0.25s;
    border-top: 1px solid var(--color-border);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
    z-index: 999;
  }

  .nav-links.nav-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-link {
    font-size: 18px;
    font-weight: 500;
    padding: 18px 4px;
    border-bottom: 1px solid var(--color-border-subtle);
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color 0.15s ease, padding-left 0.15s ease;
  }

  .nav-link:hover,
  .nav-link:active {
    color: var(--color-accent);
    padding-left: 8px;
  }


  .hero-section {
    padding: 40px 0 50px;
  }

  .hero-photo {
    width: 280px;
    height: 280px;
  }

  .floating-badge {
    padding: 8px 16px;
    bottom: -14px;
  }

  .footer-container {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
  }
}

/* Standard & Small Smartphones (<= 540px) */
@media (max-width: 540px) {
  .header-container {
    height: 72px;
  }

  .logo {
    height: 48px;
  }

  .nav-links {
    top: 72px;
    height: calc(100vh - 72px);
    height: calc(100dvh - 72px);
    padding: 20px 20px calc(36px + env(safe-area-inset-bottom, 0px));
  }

  .container {
    padding: 0 18px;
  }

  .hero-title {
    font-size: 30px;
  }

  .hero-photo {
    width: 230px;
    height: 230px;
    border-radius: 18px;
  }

  .hero-actions {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }

  .hero-actions .btn {
    width: 100%;
    padding: 13px 18px;
    font-size: 14px;
  }


  .floating-badge {
    padding: 6px 12px;
    gap: 8px;
    bottom: -12px;
  }

  .badge-icon {
    font-size: 16px;
  }

  .badge-text strong {
    font-size: 11px;
  }

  .badge-text span {
    font-size: 10px;
  }

  .skill-card, .project-card, .affiliation-card {
    padding: 24px 18px;
  }

  .contact-box {
    padding: 32px 18px;
  }

  .contact-title {
    font-size: 22px;
  }
}