/* ============================================
   TAHER ALMLHEM — PORTFOLIO
   ============================================ */

:root {
  --bg: #0a0a0a;
  --bg-card: #111;
  --bg-card-hover: #161616;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);

  --text: #ededed;
  --text-secondary: #888;
  --text-muted: #555;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  --max-width: 720px;
  --nav-height: 60px;
  --radius: 8px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: #333;
  color: #fff;
}

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

ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.nav.scrolled {
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  width: 100%;
  max-width: var(--max-width);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav__logo span {
  color: var(--text-muted);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav__link {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.nav__link:hover {
  color: var(--text);
}

.nav__menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav__menu-btn span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.nav__menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav__menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.nav__menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.section__title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 32px;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero__content {
  max-width: 560px;
}

.hero__greeting {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.hero__name {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.hero__name-accent {
  color: var(--text);
}

.hero__title {
  font-size: 18px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.hero__description {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
}

.hero__links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.hero__link:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.hero__link svg {
  width: 18px;
  height: 18px;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  transition: opacity 0.2s ease;
}

.hero__cta:hover {
  opacity: 0.85;
}

.hero__cta svg {
  width: 14px;
  height: 14px;
}

/* ---------- About ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.about__text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
}

.about__text p + p {
  margin-top: 16px;
}

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

.about__detail-card {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.about__detail-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.about__detail-value {
  font-size: 14px;
  color: var(--text);
}

.about__languages {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.about__language-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.about__language-badge span {
  font-size: 11px;
  color: var(--text-muted);
}

/* ---------- Tech Stack ---------- */
.tech__categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tech__category {
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.tech__category-name {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

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

.tech__item {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.tech__item-dot {
  display: none;
}

/* ---------- Experience ---------- */
.experience__card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.experience__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.experience__role {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.experience__company {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.experience__date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

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

.experience__point {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: 16px;
  position: relative;
}

.experience__point::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* ---------- Projects ---------- */
.projects__grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease;
}

.project-card:hover {
  border-color: var(--border-hover);
}

.project-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.project-card__title-group {
  flex: 1;
}

.project-card__title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.project-card__subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.project-card__links {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.project-card__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  transition: opacity 0.2s ease;
}

.project-card__link--primary {
  background: var(--text);
  color: var(--bg);
}

.project-card__link--primary:hover {
  opacity: 0.85;
}

.project-card__link--secondary {
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.project-card__link--secondary:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.project-card__link svg {
  width: 12px;
  height: 12px;
}

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

.project-card__highlights {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.project-card__highlight {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: 16px;
  position: relative;
}

.project-card__highlight::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.project-card__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.project-card__tech-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
}

/* ---------- Education ---------- */
.education__card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.education__degree {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

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

.education__year {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ---------- Contact ---------- */
.contact {
  padding: 80px 0 48px;
  text-align: center;
}

.contact__heading {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.contact__subtext {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.contact__links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.contact__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-secondary);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.contact__link:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.contact__link svg {
  width: 16px;
  height: 16px;
}

/* ---------- Footer ---------- */
.footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer__text {
  font-size: 13px;
  color: var(--text-muted);
}

.footer__text span {
  color: var(--text-muted);
}

/* ---------- Reveal Animation ---------- */
.reveal {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.reveal.visible {
  opacity: 1;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav__links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 20px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
  }

  .nav__links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav__menu-btn {
    display: flex;
  }

  .hero__name {
    font-size: 32px;
  }

  .about__grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

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

  .experience__header {
    flex-direction: column;
    gap: 4px;
  }

  .project-card__header {
    flex-direction: column;
  }

  .education__card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .contact__links {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 480px) {
  .hero__name {
    font-size: 28px;
  }

  .section__title {
    font-size: 20px;
  }

  .container {
    padding: 0 16px;
  }

  .project-card,
  .experience__card {
    padding: 20px;
  }
}