/* =========================================================
   BRAHIM EL MOKHTARI — ACADEMIC PORTFOLIO
   Scientific / Academic Theme
   ========================================================= */

/* =========================================================
   01. RESET
   ========================================================= */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background: #f7f9fb;
  color: #17212b;
  line-height: 1.6;
  overflow-x: hidden;
}

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

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


/* =========================================================
   02. VARIABLES
   ========================================================= */

:root {
  --bg: #f7f9fb;
  --white: #ffffff;
  --dark: #101820;
  --dark-2: #17232d;

  --text: #17212b;
  --muted: #64717d;

  --line: #dce4e9;

  --cyan: #16b8c9;
  --cyan-dark: #078c9c;
  --blue: #1769aa;

  --accent: #16b8c9;

  --radius: 14px;

  --max-width: 1250px;
}


/* =========================================================
   03. GLOBAL
   ========================================================= */

::selection {
  background: var(--cyan);
  color: white;
}

.container {
  width: min(var(--max-width), 90%);
  margin: auto;
}

.section {
  width: min(var(--max-width), 90%);
  margin: auto;
  padding: 120px 0;
}

.section.dark {
  width: 100%;
  padding-left: 5%;
  padding-right: 5%;

  background:
    radial-gradient(
      circle at 80% 20%,
      rgba(22,184,201,0.08),
      transparent 30%
    ),
    var(--dark);

  color: white;
}

h1,
h2,
h3 {
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

h2 {
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -2px;
}

.eyebrow {
  margin-bottom: 20px;

  color: var(--cyan);

  font-size: 11px;
  font-weight: 800;

  letter-spacing: .18em;
  text-transform: uppercase;
}


/* =========================================================
   04. NAVIGATION
   ========================================================= */

.nav {
  position: fixed;
  top: 0;
  left: 0;

  z-index: 1000;

  width: 100%;
  height: 76px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 5%;

  background: rgba(247,249,251,0.88);

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  border-bottom: 1px solid rgba(220,228,233,0.8);
}

.logo {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -1px;
}

.logo span {
  color: var(--cyan);
}

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

.nav nav a {
  position: relative;

  font-size: 13px;
  font-weight: 500;

  color: #475560;

  transition: color .25s ease;
}

.nav nav a::after {
  content: "";

  position: absolute;

  left: 0;
  bottom: -7px;

  width: 0;
  height: 2px;

  background: var(--cyan);

  transition: width .25s ease;
}

.nav nav a:hover {
  color: var(--cyan-dark);
}

.nav nav a:hover::after {
  width: 100%;
}

.cv-btn {
  padding: 11px 18px;

  border: 1px solid var(--cyan);

  border-radius: 7px;

  color: var(--cyan-dark);

  font-size: 12px;
  font-weight: 700;

  transition:
    background .25s ease,
    color .25s ease,
    transform .25s ease;
}

.cv-btn:hover {
  background: var(--cyan);
  color: white;

  transform: translateY(-2px);
}


/* =========================================================
   05. HERO / OPENING PAGE
   ========================================================= */

.hero {
  position: relative;

  min-height: 100vh;

  width: 100%;

  display: grid;
  grid-template-columns: 1.05fr .95fr;

  align-items: center;

  gap: 70px;

  padding: 130px 7% 80px;

  overflow: hidden;

  background:
    radial-gradient(
      circle at 80% 45%,
      rgba(22,184,201,0.12),
      transparent 30%
    ),
    linear-gradient(
      135deg,
      #f8fafc 0%,
      #eef4f7 100%
    );
}


/* subtle scientific grid */

.hero::before {
  content: "";

  position: absolute;
  inset: 0;

  opacity: .35;

  background-image:
    linear-gradient(
      rgba(23,105,170,0.045) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(23,105,170,0.045) 1px,
      transparent 1px
    );

  background-size: 45px 45px;

  pointer-events: none;
}


/* Hero text */

.hero-text {
  position: relative;
  z-index: 2;
}

.hero h1 {
  margin-bottom: 25px;

  font-size: clamp(65px, 8vw, 110px);

  line-height: .88;

  letter-spacing: -6px;

  font-weight: 800;
}

.hero h1 span {
  color: var(--cyan-dark);
}

.lead {
  max-width: 680px;

  margin-bottom: 35px;

  color: var(--muted);

  font-size: 18px;
  line-height: 1.75;
}


/* Buttons */

.actions {
  display: flex;
  align-items: center;

  gap: 15px;

  flex-wrap: wrap;
}

.primary,
.secondary {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  padding: 14px 22px;

  border-radius: 7px;

  font-size: 13px;
  font-weight: 700;

  transition:
    transform .25s ease,
    background .25s ease,
    border .25s ease;
}

.primary {
  background: var(--dark);
  color: white;
}

.primary:hover {
  background: var(--cyan-dark);
  transform: translateY(-3px);
}

.secondary {
  border: 1px solid var(--line);
  background: white;
}

.secondary:hover {
  border-color: var(--cyan);
  color: var(--cyan-dark);
  transform: translateY(-3px);
}


/* =========================================================
   06. HERO SCIENTIFIC ART
   ========================================================= */

.hero-art {
  position: relative;

  min-height: 480px;

  display: flex;
  align-items: center;
  justify-content: center;
}


/* Orb */

.orb {
  position: absolute;

  width: 340px;
  height: 340px;

  border-radius: 50%;

  background:
    radial-gradient(
      circle at 35% 30%,
      rgba(255,255,255,.9),
      rgba(22,184,201,.18) 35%,
      rgba(23,105,170,.18) 60%,
      transparent 72%
    );

  border: 1px solid rgba(22,184,201,.25);

  box-shadow:
    0 0 80px rgba(22,184,201,.12),
    inset 0 0 50px rgba(23,105,170,.08);

  animation: floatOrb 7s ease-in-out infinite;
}


/* scientific rings */

.orb::before,
.orb::after {
  content: "";

  position: absolute;

  inset: -35px;

  border: 1px solid rgba(22,184,201,.16);

  border-radius: 50%;

  transform: rotate(25deg);
}

.orb::after {
  inset: -70px;

  transform: rotate(-35deg);

  border-color: rgba(23,105,170,.12);
}


@keyframes floatOrb {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-15px) scale(1.02);
  }
}


/* Grid */

.grid {
  position: absolute;

  width: 390px;
  height: 390px;

  border-radius: 50%;

  background-image:
    linear-gradient(
      rgba(22,184,201,.12) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(22,184,201,.12) 1px,
      transparent 1px
    );

  background-size: 28px 28px;

  mask-image: radial-gradient(
    circle,
    black 20%,
    transparent 72%
  );

  -webkit-mask-image: radial-gradient(
    circle,
    black 20%,
    transparent 72%
  );

  animation: rotateGrid 25s linear infinite;
}


@keyframes rotateGrid {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}


/* Equations */

.formula {
  position: relative;

  z-index: 5;

  padding: 30px 35px;

  border-radius: 12px;

  background: rgba(255,255,255,.78);

  border: 1px solid rgba(22,184,201,.2);

  box-shadow:
    0 20px 60px rgba(22,50,70,.12);

  color: #285261;

  font-family: "Courier New", monospace;

  font-size: 18px;

  line-height: 2;

  backdrop-filter: blur(8px);
}


/* =========================================================
   07. HERO NEWS
   ========================================================= */

.hero-news {
  position: absolute;

  z-index: 10;

  right: 5%;
  bottom: 45px;

  width: 350px;

  padding: 22px;

  border-radius: 12px;

  background: rgba(16,24,32,.96);

  color: white;

  box-shadow:
    0 20px 60px rgba(0,0,0,.18);

  border: 1px solid rgba(22,184,201,.25);
}

.news-header {
  display: flex;
  align-items: center;

  gap: 9px;

  margin-bottom: 17px;

  font-size: 10px;
  font-weight: 800;

  letter-spacing: .16em;

  color: var(--cyan);
}

.news-dot {
  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: var(--cyan);

  box-shadow:
    0 0 12px rgba(22,184,201,.9);

  animation: pulse 2s infinite;
}

@keyframes pulse {

  0% {
    box-shadow: 0 0 0 0 rgba(22,184,201,.5);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(22,184,201,0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(22,184,201,0);
  }
}

.hero-news-item {
  padding: 12px 0;

  border-bottom: 1px solid rgba(255,255,255,.09);
}

.hero-news-item:last-child {
  border-bottom: none;
}

.hero-news-date {
  font-size: 9px;

  font-weight: 700;

  letter-spacing: .13em;

  color: #8ea0aa;
}

.hero-news-item h3 {
  margin: 5px 0 5px;

  font-size: 15px;

  line-height: 1.3;
}

.hero-news-item p {
  margin: 0;

  color: #aebbc3;

  font-size: 11px;

  line-height: 1.55;
}

.hero-news-item a {
  display: inline-block;

  margin-top: 7px;

  color: var(--cyan);

  font-size: 11px;
}


/* =========================================================
   08. ABOUT
   ========================================================= */

.split {
  display: grid;

  grid-template-columns: .8fr 1.2fr;

  gap: 100px;

  align-items: start;
}

.split h2 {
  color: var(--dark);
}

.copy {
  max-width: 750px;
}

.copy p {
  margin-bottom: 22px;

  color: var(--muted);

  font-size: 16px;

  line-height: 1.8;
}


/* Facts */

.facts {
  display: grid;

  grid-template-columns:
    repeat(3, 1fr);

  gap: 1px;

  margin-top: 45px;

  background: var(--line);

  border: 1px solid var(--line);
}

.facts > div {
  padding: 25px;

  background: white;
}

.facts b {
  display: block;

  margin-bottom: 7px;

  color: var(--cyan-dark);

  font-size: 27px;
}

.facts span {
  display: block;

  color: var(--muted);

  font-size: 12px;

  line-height: 1.5;
}


/* =========================================================
   09. RESEARCH
   ========================================================= */

.section.dark h2 {
  margin-bottom: 45px;
}


/* Horizontal scroll */

.research-scroll {
  display: flex;

  flex-wrap: nowrap;

  gap: 18px;

  width: 100%;
  max-width: 100%;

  overflow-x: auto;
  overflow-y: hidden;

  padding:
    10px 5px 25px;

  scroll-behavior: smooth;

  -webkit-overflow-scrolling: touch;
}

.research-scroll article {
  flex: 0 0 310px;

  min-width: 310px;

  min-height: 270px;

  padding: 30px;

  border: 1px solid rgba(255,255,255,.10);

  border-radius: 12px;

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,.055),
      rgba(255,255,255,.015)
    );

  transition:
    transform .3s ease,
    border-color .3s ease,
    background .3s ease;
}

.research-scroll article:hover {
  transform: translateY(-7px);

  border-color: rgba(22,184,201,.65);

  background:
    linear-gradient(
      145deg,
      rgba(22,184,201,.09),
      rgba(255,255,255,.02)
    );
}

.research-scroll article span {
  display: block;

  margin-bottom: 55px;

  color: var(--cyan);

  font-size: 11px;

  font-weight: 800;

  letter-spacing: .14em;
}

.research-scroll article h3 {
  margin-bottom: 15px;

  font-size: 22px;

  line-height: 1.2;
}

.research-scroll article p {
  color: #aebac1;

  font-size: 13px;

  line-height: 1.7;
}


/* scrollbar */

.research-scroll::-webkit-scrollbar {
  height: 6px;
}

.research-scroll::-webkit-scrollbar-track {
  background: rgba(255,255,255,.06);

  border-radius: 10px;
}

.research-scroll::-webkit-scrollbar-thumb {
  background: var(--cyan);

  border-radius: 10px;
}

.research-scroll::-webkit-scrollbar-thumb:hover {
  background: #5bd7e2;
}


/* Firefox */

.research-scroll {
  scrollbar-width: thin;

  scrollbar-color:
    var(--cyan)
    rgba(255,255,255,.06);
}


/* =========================================================
   10. PUBLICATIONS
   ========================================================= */

#publications h2 {
  margin-bottom: 50px;
}

.pubs {
  display: grid;

  grid-template-columns:
    repeat(2, 1fr);

  gap: 18px;
}

.pubs article {
  position: relative;

  padding: 32px;

  min-height: 260px;

  background: white;

  border: 1px solid var(--line);

  border-radius: 12px;

  transition:
    transform .3s ease,
    border-color .3s ease,
    box-shadow .3s ease;
}

.pubs article:hover {
  transform: translateY(-5px);

  border-color: rgba(22,184,201,.5);

  box-shadow:
    0 15px 40px rgba(25,60,80,.08);
}

.pubs article span {
  display: block;

  margin-bottom: 25px;

  color: var(--cyan-dark);

  font-size: 10px;

  font-weight: 800;

  letter-spacing: .12em;
}

.pubs article h3 {
  margin-bottom: 15px;

  font-size: 20px;

  line-height: 1.3;
}

.pubs article p {
  color: var(--muted);

  font-size: 13px;
}

.pubs article a {
  position: absolute;

  bottom: 28px;

  left: 32px;

  color: var(--cyan-dark);

  font-size: 12px;

  font-weight: 700;
}

.pubs article a:hover {
  text-decoration: underline;
}


/* =========================================================
   11. EXPERIENCE / TIMELINE
   ========================================================= */

.timeline-section {
  background: #eef3f5;

  width: 100%;

  padding-left: 5%;
  padding-right: 5%;
}

.timeline-section > * {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.timeline-section h2 {
  margin-bottom: 60px;
}

.timeline {
  border-top: 1px solid #ccd7dc;
}

.timeline > div {
  display: grid;

  grid-template-columns: 150px 1fr;

  gap: 40px;

  padding: 30px 0;

  border-bottom: 1px solid #ccd7dc;
}

.timeline > div > b {
  color: var(--cyan-dark);

  font-size: 13px;

  letter-spacing: .08em;
}

.timeline h3 {
  margin-bottom: 7px;

  font-size: 19px;
}

.timeline p {
  color: var(--muted);

  font-size: 13px;
}

.timeline .muted {
  margin-top: 8px;

  color: #7c8992;

  font-style: italic;
}


/* =========================================================
   12. SKILLS
   ========================================================= */

.skill-grid {
  display: grid;

  grid-template-columns:
    repeat(2, 1fr);

  gap: 1px;

  background: rgba(255,255,255,.10);

  margin-top: 50px;
}

.skill-grid > div {
  padding: 35px;

  background: var(--dark);
}

.skill-grid h3 {
  margin-bottom: 15px;

  color: var(--cyan);

  font-size: 18px;
}

.skill-grid p {
  color: #aab6bd;

  font-size: 13px;

  line-height: 1.7;
}


/* =========================================================
   13. CONTACT
   ========================================================= */

.contact {
  text-align: center;

  padding-top: 130px;
  padding-bottom: 130px;
}

.contact h2 {
  margin-bottom: 20px;
}

.contact > p {
  max-width: 600px;

  margin: 0 auto 35px;

  color: var(--muted);
}

.contact-links {
  display: flex;

  justify-content: center;

  align-items: center;

  flex-wrap: wrap;

  gap: 12px;
}

.contact-links a {
  padding: 11px 17px;

  border: 1px solid var(--line);

  border-radius: 7px;

  background: white;

  color: #40505a;

  font-size: 12px;

  transition:
    color .25s ease,
    border-color .25s ease,
    transform .25s ease;
}

.contact-links a:hover {
  color: var(--cyan-dark);

  border-color: var(--cyan);

  transform: translateY(-3px);
}


/* =========================================================
   14. FOOTER
   ========================================================= */

footer {
  display: flex;

  justify-content: space-between;

  gap: 20px;

  padding: 25px 5%;

  background: #0b1116;

  color: #83919a;

  font-size: 11px;
}


/* =========================================================
   15. SCROLL REVEAL
   ========================================================= */

.section,
.hero-text,
.hero-news {
  animation: fadeUp .8s ease both;
}

@keyframes fadeUp {

  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* =========================================================
   16. TABLET
   ========================================================= */

@media (max-width: 1050px) {

  .nav nav {
    gap: 17px;
  }

  .nav nav a {
    font-size: 12px;
  }

  .hero {
    grid-template-columns: 1fr;

    min-height: auto;

    padding-top: 140px;
  }

  .hero-art {
    min-height: 400px;
  }

  .hero-news {
    position: relative;

    right: auto;
    bottom: auto;

    width: min(500px, 100%);

    margin: 0 auto;
  }

  .split {
    grid-template-columns: 1fr;

    gap: 45px;
  }

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

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


/* =========================================================
   17. MOBILE
   ========================================================= */

@media (max-width: 750px) {

  .nav {
    height: 68px;

    padding: 0 5%;
  }

  .nav nav {
    display: none;
  }

  .cv-btn {
    padding: 9px 13px;

    font-size: 10px;
  }


  .hero {
    padding:
      120px 7% 60px;

    gap: 40px;
  }

  .hero h1 {
    font-size: 60px;

    letter-spacing: -4px;
  }

  .lead {
    font-size: 15px;
  }

  .hero-art {
    min-height: 340px;
  }

  .orb {
    width: 250px;
    height: 250px;
  }

  .grid {
    width: 290px;
    height: 290px;
  }

  .formula {
    padding: 20px 24px;

    font-size: 14px;
  }

  .hero-news {
    width: 100%;

    margin-top: -20px;
  }


  .section {
    width: 90%;

    padding: 80px 0;
  }

  .section.dark {
    padding-left: 5%;
    padding-right: 5%;
  }


  h2 {
    font-size: 42px;

    letter-spacing: -1.5px;
  }


  .research-scroll article {
    flex-basis: 285px;

    min-width: 285px;
  }


  .timeline > div {
    grid-template-columns: 1fr;

    gap: 8px;
  }


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


  footer {
    flex-direction: column;

    text-align: center;

    align-items: center;
  }
}


/* =========================================================
   18. SMALL PHONES
   ========================================================= */

@media (max-width: 430px) {

  .hero h1 {
    font-size: 50px;
  }

  .actions {
    flex-direction: column;

    align-items: stretch;
  }

  .primary,
  .secondary {
    width: 100%;
  }

  .hero-news {
    padding: 18px;
  }

  .facts > div {
    padding: 20px;
  }

  .pubs article {
    padding: 25px;
  }

  .pubs article a {
    left: 25px;
  }
}
