/* ==========================================================
   Salim Maalouf — portfolio
   Palette:
     --bg      #0D1420  deep blue-black
     --surface #141E2E  raised panels
     --line    #243044  borders
     --text    #E8EDF4  primary text
     --muted   #93A1B5  secondary text
     --accent  #F05138  Swift orange
     --blue    #7FA7D9  code / quiet links
   Type: Apple system stack (SF Pro on Apple devices), SF Mono for code.
   ========================================================== */

:root {
  --bg: #0d1420;
  --surface: #141e2e;
  --line: #243044;
  --text: #e8edf4;
  --muted: #93a1b5;
  --accent: #f05138;
  --blue: #7fa7d9;
  --content: 46rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 1.25rem;
}

a {
  color: var(--blue);
  text-decoration: none;
}
a:hover,
a:focus-visible {
  color: var(--accent);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-name {
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.nav-links {
  display: flex;
  gap: 1.35rem;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
}
.nav-links a.active {
  color: var(--text);
}
.nav-links a:hover {
  color: var(--accent);
}

/* ---------- hero ---------- */
.hero {
  padding: 5.5rem 0 4rem;
}
.hero-id {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin: 0 0 1.75rem;
}
.avatar {
  flex: none;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
  box-shadow:
    0 0 0 4px var(--bg),
    0 0 0 6px var(--accent),
    0 18px 40px -16px rgba(240, 81, 56, 0.55);
}
.hero-kicker {
  margin: 0 0 0.4rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 1rem;
}
.hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.hero-facts {
  margin: 0 0 1.75rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow:
    0 28px 60px -32px rgba(240, 81, 56, 0.35),
    0 14px 32px -20px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}
.hero-facts div {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--line);
}
.hero-facts div:nth-child(odd) {
  border-right: 1px solid var(--line);
}
.hero-facts div.facts-status {
  grid-column: 1 / -1;
  border-right: 0;
  border-bottom: 0;
}
.hero-facts dt {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero-facts dd {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}
.hero-facts dd span {
  display: block;
}
.hero-facts dd .status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 0.6rem;
  vertical-align: 0.1em;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.18);
}
.hero-line {
  margin: 0;
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.15rem;
}

/* ---------- sections ---------- */
section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--line);
}
h2 {
  margin: 0 0 1.5rem;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

/* ---------- chips: skills + apps ---------- */
.skills,
.apps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.skills {
  margin-top: 1.75rem;
}
.skills li,
.apps li {
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.skills li {
  color: var(--muted);
  font-size: 0.9rem;
}
.apps li {
  color: var(--text);
  font-size: 0.95rem;
}

/* ---------- experience stats ---------- */
.stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
}
.stats li {
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}
.stats strong {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--accent);
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* ---------- education + certifications timeline ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.5rem;
  border-left: 2px solid var(--line);
}
.timeline li {
  position: relative;
  padding: 0 0 2.25rem 1.25rem;
}
.timeline li:last-child {
  padding-bottom: 0.25rem;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: calc(-1.5rem - 6px);
  top: 0.55rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.tl-years {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}
.timeline h3 {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.timeline p {
  margin: 0;
  color: var(--muted);
}

/* ---------- projects ---------- */
.app-group + .app-group {
  margin-top: 2rem;
}
.app-group h3 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
.app-group h3 span {
  margin-left: 0.3rem;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.95rem;
}
.load-error {
  margin: 0;
  color: var(--muted);
}

/* ---------- contact ---------- */
.contact-list {
  margin: 1.25rem 0 0;
  display: grid;
  gap: 0.6rem;
}
.contact-list div {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1rem;
  align-items: baseline;
}
.contact-list dt {
  color: var(--muted);
  font-size: 0.9rem;
}
.contact-list dd {
  margin: 0;
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

/* ---------- footer ---------- */
footer {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- motion: one moment, on load ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero > * {
    opacity: 0;
    transform: translateY(8px);
    animation: rise 0.55s ease-out forwards;
  }
  .hero > *:nth-child(2) {
    animation-delay: 0.08s;
  }
  .hero > *:nth-child(3) {
    animation-delay: 0.16s;
  }
  .hero > *:nth-child(4) {
    animation-delay: 0.24s;
  }
  @keyframes rise {
    to {
      opacity: 1;
      transform: none;
    }
  }
  .status-dot {
    animation: pulse 2.4s ease-in-out infinite;
  }
  .avatar {
    animation: spin 2s ease-in-out infinite;
  }
  @keyframes spin {
    0%,
    50% {
      transform: perspective(600px) rotateY(0deg);
    }
    100% {
      transform: perspective(600px) rotateY(360deg);
    }
  }
  @keyframes pulse {
    50% {
      box-shadow: 0 0 0 7px rgba(52, 199, 89, 0.05);
    }
  }
}

/* ---------- small screens ---------- */
@media (max-width: 540px) {
  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
  .nav-links {
    gap: 0.2rem 0.9rem;
  }
  .nav-links a {
    font-size: 0.9rem;
  }
  .hero {
    padding-top: 3.5rem;
  }
  .hero-id {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
  .avatar {
    width: 6.5rem;
    height: 6.5rem;
  }
  .hero-facts {
    grid-template-columns: 1fr;
  }
  .hero-facts div {
    padding: 0.9rem 1.1rem;
  }
  .hero-facts div:nth-child(odd) {
    border-right: 0;
  }
}
