/* ==========================================================================
   Minimalist Portfolio Stylesheet — Anis Moulla
   ========================================================================== */

:root {
  --bg: #dddddd;
  --text-primary: #111111;
  --text-secondary: #555555;
  --text-muted: #666666;
  --pill-bg: #cecece;
  --pill-hover: #bdbdbd;
  --surface-light: #f9f9f8;
  --surface-muted: #f1f1ef;
  --surface-dark: #161618;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Oxygen, Ubuntu, Cantarell, sans-serif;
  --radius-pill: 9999px;
  --radius-card: 12px;
  --shadow-mockup: 0 14px 30px rgba(0, 0, 0, 0.11), 0 3px 8px rgba(0, 0, 0, 0.06);
  --shadow-mockup-front: 0 18px 36px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.08);
}

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

html {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text-primary);
  overflow-x: clip;
}

button,
input {
  font-family: inherit;
}

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

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

h1,
h2,
h3,
p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Layout Wrapper */
.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 24px;
}

/* ==========================================================================
   1. Hero / Introduction Section
   ========================================================================== */

.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  display: block;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  background-color: var(--pill-bg);
}

.bio {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bio p {
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.bio-underline {
  text-decoration: underline;
  text-decoration-color: rgba(17, 17, 17, 0.35);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.18s ease;
}

.bio-underline:hover {
  text-decoration-color: var(--text-primary);
}

/* ==========================================================================
   2. Navigation Menu (Interactive Tabs)
   ========================================================================== */

.nav-tabs {
  margin-top: 32px;
  margin-bottom: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

.nav-tab {
  appearance: none;
  background: transparent;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: -0.01em;
  position: relative;
  transition: color 0.18s ease;
}

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

.nav-tab.is-active {
  color: var(--text-primary);
  font-weight: 600;
}

/* Tab Content Switching & Smooth Fade Animation */
.tab-content-area {
  min-height: 240px;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
  animation: tabFadeIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Shared Buttons & Badges
   ========================================================================== */

.pill-button,
.pill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background-color: var(--pill-bg);
  color: var(--text-primary);
  border: none;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  padding: 7px 13px;
  white-space: nowrap;
  transition: background-color 0.18s ease, transform 0.16s ease;
}

.pill-button {
  cursor: pointer;
}

.pill-button:hover,
.pill-badge:hover {
  background-color: var(--pill-hover);
}

.pill-button:active {
  transform: scale(0.98);
}

.pill-badge {
  font-size: 13px;
  padding: 7px 14px;
  cursor: default;
}

/* ==========================================================================
   3. Projects Showcase (Home & Projects Tabs)
   ========================================================================== */

.projects-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.filter-pill {
  appearance: none;
  border: none;
  border-radius: var(--radius-pill);
  background-color: var(--pill-bg);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 13px;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.filter-pill:hover {
  background-color: var(--pill-hover);
  color: var(--text-primary);
}

.filter-pill.is-active {
  background-color: var(--text-primary);
  color: #f3f3f3;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 36px;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  padding: 0;
  min-width: 0;
}

.project-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.project-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 9px;
  display: block;
}

.project-logo--circle {
  border-radius: 50%;
}

.project-meta {
  flex: 1;
  min-width: 0;
}

.project-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.28;
  letter-spacing: -0.015em;
}

.project-timeline {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.3;
}

.project-website-btn {
  flex-shrink: 0;
}

.project-description {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* Overlapping Angled Visual Mockup Preview */
.mockup-stage {
  position: relative;
  margin-top: 18px;
  height: 192px;
  width: 100%;
  cursor: pointer;
  user-select: none;
}

.mockup-layer {
  position: absolute;
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.mockup-back {
  width: 78%;
  height: 148px;
  left: 2%;
  top: 6px;
  background-color: var(--surface-light);
  border: 1px solid rgba(17, 17, 17, 0.08);
  box-shadow: var(--shadow-mockup);
  transform: rotate(-2.5deg);
  z-index: 1;
}

.mockup-front {
  width: 60%;
  height: 146px;
  right: 2%;
  bottom: 4px;
  background-color: #ffffff;
  border: 1px solid rgba(17, 17, 17, 0.1);
  box-shadow: var(--shadow-mockup-front);
  transform: rotate(2.6deg);
  z-index: 2;
}

.mockup-stage:hover .mockup-back {
  transform: rotate(-3.4deg) translate(-2px, -2px);
}

.mockup-stage:hover .mockup-front {
  transform: rotate(3.4deg) translate(2px, -3px);
}

/* Miniature UI Mockup Chrome & Details */
.ui-frame {
  width: 100%;
  height: 100%;
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 9px;
  line-height: 1.25;
  color: #18181b;
}

.ui-frame--dark {
  background-color: #161618;
  color: #f4f4f5;
  border-color: rgba(255, 255, 255, 0.08);
}

.ui-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.ui-frame--dark .ui-topbar {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.ui-dots {
  display: flex;
  gap: 3px;
}

.ui-dots span {
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  background-color: #d4d4d8;
}

.ui-frame--dark .ui-dots span {
  background-color: #3f3f46;
}

.ui-brand {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ui-chip {
  font-size: 7.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 9999px;
  background-color: #e4e4e7;
  color: #18181b;
}

.ui-chip--green {
  background-color: #dcfce7;
  color: #166534;
}

.ui-chip--indigo {
  background-color: #e0e7ff;
  color: #312e81;
}

.ui-chip--amber {
  background-color: #fef3c7;
  color: #92400e;
}

.ui-chip--dark {
  background-color: #27272a;
  color: #e4e4e7;
}

.ui-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4.5px 6px;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.035);
}

.ui-frame--dark .ui-row {
  background-color: rgba(255, 255, 255, 0.06);
}

.ui-muted {
  color: #71717a;
  font-size: 8px;
}

.ui-frame--dark .ui-muted {
  color: #a1a1aa;
}

.ui-strong {
  font-weight: 600;
}

.ui-progress-track {
  height: 5px;
  width: 100%;
  border-radius: 9999px;
  background-color: #e4e4e7;
  overflow: hidden;
}

.ui-progress-fill {
  height: 100%;
  border-radius: 9999px;
  background-color: #18181b;
}

.ui-btn-mini {
  margin-top: auto;
  width: 100%;
  padding: 5px 8px;
  border-radius: 6px;
  background-color: #18181b;
  color: #ffffff;
  font-size: 8px;
  font-weight: 600;
  text-align: center;
}

.ui-btn-mini--indigo {
  background-color: #312e81;
}

.ui-btn-mini--green {
  background-color: #14532d;
}

.ui-btn-mini--sky {
  background-color: #0f172a;
}

.ui-input-box {
  padding: 4px 6px;
  border-radius: 5px;
  border: 1px solid #e4e4e7;
  background-color: #fafafa;
  font-size: 8px;
  color: #52525b;
  display: flex;
  justify-content: space-between;
}

.ui-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.ui-mini-tile {
  padding: 5px 6px;
  border-radius: 6px;
  background-color: #f4f4f5;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ui-map-stage {
  position: relative;
  flex: 1;
  border-radius: 7px;
  background-color: #eef2ee;
  border: 1px solid rgba(20, 83, 45, 0.12);
  overflow: hidden;
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ui-map-grid {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: linear-gradient(to right, #cbd5c0 1px, transparent 1px),
    linear-gradient(to bottom, #cbd5c0 1px, transparent 1px);
  background-size: 16px 16px;
}

/* ==========================================================================
   4. About Me & Contact Tab Views
   ========================================================================== */

.section-heading {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  margin-bottom: 14px;
}

.sub-heading {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.about-section {
  max-width: 620px;
}

.about-narrative {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.about-narrative p {
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text-primary);
}

.skills-block {
  margin-top: 32px;
}

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

/* Contact Tab */
.contact-section {
  max-width: 580px;
}

.contact-intro {
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
}

.contact-actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.copy-email-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.copy-email-btn {
  padding: 8px 16px;
  font-size: 13.5px;
}

.copy-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background-color: var(--text-primary);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.copy-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px;
  border-style: solid;
  border-color: var(--text-primary) transparent transparent transparent;
}

.copy-tooltip.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.contact-email-display {
  font-size: 14px;
  color: var(--text-secondary);
}

.contact-links {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  padding: 4px 0;
  border-bottom: 1px solid rgba(17, 17, 17, 0.22);
  transition: border-color 0.18s ease, color 0.18s ease;
}

.contact-link:hover {
  border-bottom-color: var(--text-primary);
}

.contact-link .arrow {
  font-size: 13px;
  color: var(--text-secondary);
  transition: transform 0.18s ease, color 0.18s ease;
}

.contact-link:hover .arrow {
  transform: translate(2px, -2px);
  color: var(--text-primary);
}

/* ==========================================================================
   Project Preview Modal
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(17, 17, 17, 0.32);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
  animation: modalFadeIn 0.2s ease both;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  background-color: #e6e6e6;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
  animation: modalSlideIn 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.modal-description {
  margin-top: 14px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.modal-preview-stage {
  margin-top: 18px;
}

.modal-preview-stage .mockup-stage {
  margin-top: 0;
  height: 210px;
  cursor: default;
}

.modal-meta {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-note {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 640px) {
  .container {
    padding: 52px 20px 64px;
  }

  .nav-tabs {
    gap: 18px;
    margin-top: 28px;
    margin-bottom: 32px;
  }

  .projects-grid {
    gap: 40px;
  }

  .mockup-stage {
    height: 184px;
  }
}

@media (max-width: 380px) {
  .mockup-back {
    width: 82%;
  }

  .mockup-front {
    width: 64%;
  }

  .modal-card {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tab-panel.is-active,
  .modal-backdrop,
  .modal-card {
    animation: none;
  }

  .mockup-layer,
  .nav-tab,
  .pill-button,
  .copy-tooltip,
  .contact-link .arrow {
    transition: none;
  }
}
