/* ==========================================================================
   Guessoum Moussaoui Azzedine — Personal Portfolio Design System
   Aesthetic: Tactile Minimalist Monochrome / Framed Studio Architecture
   Directly matching the reference design layout and typography
   ========================================================================== */

/* ---------- CSS RESET & TOKENS ---------- */
:root {
  /* Surface colors */
  --bg-page: #ECEEF0;
  --bg-card: #FFFFFF;
  --bg-island: #F4F5F7;
  --bg-island-border: rgba(0, 0, 0, 0.035);
  
  /* Text colors */
  --text-primary: #121417;
  --text-secondary: #5E6573;
  --text-muted: #8E95A2;
  --text-inverse: #FFFFFF;

  /* Borders & Badges */
  --border-light: rgba(0, 0, 0, 0.05);
  --border-medium: rgba(0, 0, 0, 0.12);
  --border-badge: rgba(0, 0, 0, 0.07);

  /* Shadows */
  --shadow-frame: 0 30px 80px -20px rgba(18, 20, 23, 0.07), 0 2px 6px rgba(18, 20, 23, 0.02);
  --shadow-badge: 0 4px 14px rgba(0, 0, 0, 0.06);
  --shadow-btn: 0 2px 5px rgba(0, 0, 0, 0.1);
  --shadow-modal: 0 32px 80px -15px rgba(0, 0, 0, 0.22);

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Border Radii */
  --radius-frame: 44px;
  --radius-island: 36px;
  --radius-pill: 9999px;
  --radius-card: 20px;

  /* Transitions */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 160ms;
  --duration-normal: 240ms;
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-primary);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  scrollbar-width: thin;
  scrollbar-color: rgba(18, 20, 23, 0.22) transparent;
}

/* Global minimalist scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(18, 20, 23, 0.16);
  border-radius: 9999px;
  transition: background-color var(--duration-fast) ease;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(18, 20, 23, 0.35);
}

::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 24px;
  line-height: 1.5;
  background-color: var(--bg-page);
}

/* Subtle physical paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 0);
  background-size: 20px 20px;
  pointer-events: none;
  z-index: 0;
}

/* ---------- OUTER CONTAINER / FRAMED CANVAS ---------- */
.page-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.card-frame {
  background: var(--bg-card);
  border-radius: var(--radius-frame);
  box-shadow: var(--shadow-frame);
  border: 1px solid var(--border-light);
  overflow: hidden;
  padding: 20px 20px 36px 20px;
  display: flex;
  flex-direction: column;
  gap: 72px;
}

/* ---------- 1. HERO ISLAND (TOP CAPSULE) ---------- */
.hero-island {
  background-color: var(--bg-island);
  border-radius: var(--radius-island);
  padding: 28px 36px 36px 36px;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid var(--bg-island-border);
}

/* Top Navigation */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 52px;
}

.nav-contact-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  padding: 4px 6px 4px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-badge);
}

.email-address {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.nav-socials {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--duration-fast) ease;
}

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

.nav-badge-link {
  color: var(--text-primary);
  font-weight: 600;
  cursor: default;
  background: rgba(0, 0, 0, 0.04);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  letter-spacing: -0.01em;
}

.sep {
  color: var(--border-medium);
  user-select: none;
  font-size: 0.75rem;
}

/* Pill Buttons */
.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 500;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration-normal) var(--ease-spring);
  padding: 4px 12px;
  border: 1px solid transparent;
}

.pill-btn-ghost {
  background: #FFFFFF;
  color: var(--text-primary);
  border: 1px solid var(--border-badge);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.pill-btn-ghost:hover {
  background: #F8F9FA;
  border-color: var(--border-medium);
}

.copy-btn {
  position: relative;
  overflow: hidden;
}

.copy-btn .check-icon {
  display: none;
  stroke: #16A34A;
}

.copy-btn.copied {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #065F46;
}

.copy-btn.copied .btn-text {
  display: none;
}

.copy-btn.copied .check-icon {
  display: inline-block;
}

.pill-btn-dark {
  background: var(--text-primary);
  color: var(--text-inverse);
  padding: 10px 22px;
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: var(--shadow-btn);
}

.pill-btn-dark:hover {
  background: #000000;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16);
}

.pill-btn-light {
  background: #FFFFFF;
  color: var(--text-primary);
  padding: 10px 22px;
  font-size: 0.84rem;
  font-weight: 500;
  border: 1px solid var(--border-medium);
}

.pill-btn-light:hover {
  background: #F8F9FA;
  border-color: var(--text-primary);
  transform: translateY(-1px);
}

/* Hero Centerpiece */
.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 16px 42px 16px;
}

.avatar-wrapper {
  position: relative;
  margin-bottom: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.avatar-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  padding: 3px;
  background: #FFFFFF;
  box-shadow: var(--shadow-badge);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  filter: grayscale(100%) contrast(106%);
  display: block;
}

/* Floating badge placed to the right of the avatar matching the reference */
.floating-badge {
  position: absolute;
  top: 14px;
  left: calc(100% - 10px);
  background: #FFFFFF;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-badge);
  border: 1px solid var(--border-badge);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  white-space: nowrap;
  animation: floatSubtle 4s ease-in-out infinite alternate;
}

@keyframes floatSubtle {
  0% { transform: translateY(0); }
  100% { transform: translateY(-3px); }
}

.badge-avatar-dot {
  width: 6px;
  height: 6px;
  background: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.badge-name {
  font-weight: 600;
  color: var(--text-primary);
}

.badge-status-icon {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.hero-headline {
  font-size: clamp(2.3rem, 4.3vw, 3.3rem);
  font-weight: 650;
  line-height: 1.14;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin-bottom: 24px;
}

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

.hero-cta {
  gap: 7px;
  padding: 10px 22px;
}

.arrow-up-right {
  transition: transform var(--duration-fast) ease;
}

.hero-cta:hover .arrow-up-right {
  transform: translate(2px, -2px);
}

/* Partners & Brand Logos Strip */
.partners-strip {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 26px;
  margin-top: 12px;
}

.partners-grid {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px 36px;
}

.partner-logo-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
}

.partner-logo-img {
  height: 28px;
  max-height: 32px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  filter: grayscale(100%) opacity(0.55);
  transition: all var(--duration-fast) ease;
}

.partner-logo-item:hover .partner-logo-img {
  filter: grayscale(0%) opacity(1);
  transform: translateY(-2px);
}

/* ---------- 2. MID SECTION: SERVICES / WHAT I DO ---------- */
.services-section {
  text-align: center;
  padding: 0 16px;
}

.services-headline {
  font-size: clamp(1.75rem, 3.1vw, 2.3rem);
  font-weight: 650;
  line-height: 1.22;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 24px;
}

/* Tilted Pill Badge matching reference */
.section-badge-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}

.tilted-badge {
  display: inline-block;
  background: #FFFFFF;
  color: var(--text-secondary);
  border: 1px solid var(--border-badge);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  transform: rotate(-3deg);
  transition: transform var(--duration-fast) ease;
}

.tilted-badge:hover {
  transform: rotate(0deg) scale(1.04);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 24px;
  text-align: left;
}

.service-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.service-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-island);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  margin-bottom: 6px;
  transition: all var(--duration-normal) ease;
  border: 1px solid var(--border-light);
}

.service-card:hover .service-icon-box {
  background: var(--text-primary);
  color: var(--text-inverse);
  transform: translateY(-2px);
}

.service-title {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.service-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  font-weight: 400;
}

/* ---------- 3. BOTTOM CTA ISLAND ---------- */
.cta-island {
  background-color: var(--bg-island);
  border-radius: var(--radius-island);
  padding: 52px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--bg-island-border);
}

.handshake-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  box-shadow: var(--shadow-badge);
  border: 1px solid var(--border-badge);
  margin-bottom: 22px;
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.handshake-icon-wrap:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.handshake-icon-wrap svg {
  display: block;
  flex-shrink: 0;
}

.cta-headline {
  font-size: clamp(2rem, 3.7vw, 2.8rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin-bottom: 28px;
}

.cta-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.cta-main-btn {
  padding: 11px 24px;
}

.cta-sub-btn {
  padding: 11px 24px;
}

/* ---------- 4. FOOTER ---------- */
.page-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 0 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

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

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast);
}

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

/* ---------- MODALS (PROJECTS & CV) ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 20, 23, 0.45);
  backdrop-filter: blur(10px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) ease;
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: #FFFFFF;
  width: 100%;
  max-width: 600px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 28px;
  box-shadow: var(--shadow-modal);
  padding: 32px;
  position: relative;
  border: 1px solid var(--border-light);
  transform: translateY(16px) scale(0.98);
  transition: transform var(--duration-normal) var(--ease-spring);

  /* Modern standard scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(18, 20, 23, 0.22) transparent;
}

/* Elegant pill scrollbar matching site design */
.modal-dialog::-webkit-scrollbar {
  width: 6px;
}

.modal-dialog::-webkit-scrollbar-track {
  background: transparent;
  margin: 24px 0; /* Keeps the thumb cleanly inside the card's 28px radius */
}

.modal-dialog::-webkit-scrollbar-thumb {
  background-color: rgba(18, 20, 23, 0.18);
  border-radius: 9999px;
  transition: background-color var(--duration-fast) ease;
}

.modal-dialog::-webkit-scrollbar-thumb:hover {
  background-color: rgba(18, 20, 23, 0.42);
}

.modal-dialog::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.modal-dialog::-webkit-scrollbar-corner {
  background: transparent;
}

.modal-backdrop.is-open .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 18px;
}

.modal-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
}

.modal-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.modal-close-btn {
  background: var(--bg-island);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all var(--duration-fast);
}

.modal-close-btn:hover {
  background: var(--text-primary);
  color: #FFFFFF;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Project Cards in Modal */
.project-modal-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-pill-card {
  background: var(--bg-island);
  border-radius: var(--radius-card);
  padding: 20px;
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--duration-normal) ease;
}

.project-pill-card:hover {
  background: #FFFFFF;
  border-color: var(--border-medium);
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.08);
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
}

.project-tag {
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-year {
  background: rgba(0,0,0,0.05);
  padding: 2px 8px;
  border-radius: 99px;
  color: var(--text-primary);
}

.project-name {
  font-size: 0.98rem;
  font-weight: 650;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.project-summary {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 10px;
  font-size: 0.74rem;
}

.project-role {
  color: var(--text-secondary);
  font-weight: 500;
}

.project-link {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--duration-fast) ease, opacity var(--duration-fast) ease;
}

.project-link:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.project-stat {
  color: #10B981;
  font-weight: 600;
}

/* CV Styles */
.cv-bio {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
}

.cv-bio strong {
  color: var(--text-primary);
  font-weight: 600;
}

.cv-section h4 {
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.pill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill-tag {
  background: var(--bg-island);
  color: var(--text-primary);
  font-size: 0.74rem;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
}

.timeline-item {
  margin-bottom: 14px;
  border-left: 2px solid var(--border-medium);
  padding-left: 12px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 3px;
  flex-wrap: wrap;
}

.timeline-period {
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.timeline-item p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.timeline-company {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 1px;
  margin-bottom: 4px;
  font-weight: 500;
}

.education-item {
  margin-bottom: 10px;
  border-left: 2px solid var(--border-medium);
  padding-left: 12px;
}

.education-degree {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.education-school {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.cv-note {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.cv-contact-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Toast */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: var(--text-primary);
  color: #FFFFFF;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: all var(--duration-normal) var(--ease-spring);
  z-index: 1000;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ---------- RESPONSIVE BREAKPOINTS ---------- */
@media (max-width: 860px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 20px;
  }

  .card-frame {
    padding: 16px 16px 32px 16px;
    gap: 52px;
    border-radius: 32px;
  }

  .hero-island {
    padding: 24px 20px 32px 20px;
    border-radius: 26px;
  }

  .floating-badge {
    left: auto;
    right: -20px;
  }

  .hidden-mobile {
    display: none;
  }
}

@media (max-width: 600px) {
  body {
    padding: 12px;
  }

  .top-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 36px;
  }

  .nav-contact-group {
    justify-content: space-between;
  }

  .nav-socials {
    justify-content: center;
  }

  .avatar-wrapper {
    flex-direction: column;
    gap: 10px;
  }

  .floating-badge {
    position: static;
    transform: none !important;
    animation: none;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .partners-grid {
    gap: 18px 24px;
  }

  .partner-logo-img {
    height: 24px;
    max-width: 105px;
  }

  .cta-island {
    padding: 38px 16px;
    border-radius: 24px;
  }

  .cta-actions {
    flex-direction: column;
    width: 100%;
  }

  .cta-main-btn, .cta-sub-btn {
    width: 100%;
  }

  .page-footer {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .modal-dialog {
    padding: 24px 18px 24px 20px;
    border-radius: 24px;
    max-height: 92vh;
  }

  .modal-dialog::-webkit-scrollbar-track {
    margin: 18px 0;
  }
}
